Image processing methods, apparatuses, electronic devices, storage media, and software products

By dividing the image into multiple image blocks and adjusting the pixel values ​​according to the complexity of each block, and adopting different levels of brightness mapping, the problem of insufficient flexibility in image brightness adjustment in existing technologies is solved, and the improvement of power consumption and display effect in SDR images is achieved.

CN122089617APending Publication Date: 2026-05-26BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies are not very flexible in adjusting image brightness, and it is difficult to balance power consumption and image display effect, especially when there are both bright and dark scenes in SDR images, the display effect is poor.

Method used

The image is segmented into multiple image blocks, and the pixel values ​​are adjusted according to the complexity of each image block. Different brightness mapping methods are used, including first-level, second-level, and third-level pixel transformation formulas, to adjust the pixel values ​​of simple, medium-information, and high-information regions respectively. The complexity of the image block is determined by a complexity prediction model.

Benefits of technology

It achieves improved image display quality while taking power consumption into account, especially in images containing multiple scenes, thus enhancing the overall visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089617A_ABST
    Figure CN122089617A_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of image processing technology, specifically providing an image processing method, apparatus, electronic device, storage medium, and program product. The method includes: segmenting an image to be processed to obtain multiple image blocks; determining the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block; adjusting the pixel values ​​of each pixel in each image block according to a pixel value adjustment method corresponding to the complexity of the image block; and obtaining a target image based on the adjusted image blocks. In this way, by adjusting the pixel values ​​of each image block according to the complexity of its content, the brightness of the image display can be adjusted, thus balancing power consumption and visual effect in image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, specifically to an image processing method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] In grayscale images, pixel values ​​directly determine the brightness of a pixel. In color images, pixel values ​​are composed of three components: red, green, and blue (RGB), but the value of each component is also related to brightness. Therefore, the brightness of an image can be effectively changed by adjusting the size of the pixel values.

[0003] Under relevant technologies, a fixed adjustment method is usually adopted to perform global pixel adjustments on any image, thereby achieving image brightness adjustment.

[0004] However, this approach results in poor flexibility in image processing, making it difficult to balance power consumption and image display quality. Summary of the Invention

[0005] To address the aforementioned problems, this disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product.

[0006] In one aspect, this disclosure provides an image processing method, including:

[0007] The image to be processed is segmented to obtain multiple image blocks;

[0008] The complexity of each image block is determined based on the distribution of pixel values ​​of each pixel in each image block;

[0009] For each image block, adjust the pixel values ​​of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block;

[0010] The target image is obtained based on the adjusted image blocks.

[0011] In one embodiment, the image to be processed is segmented to obtain multiple image blocks, including:

[0012] Obtain the image segmentation method; the image segmentation method is at least one;

[0013] For each image segmentation method, the image to be processed is segmented according to the image segmentation method to obtain an image block set containing multiple image blocks.

[0014] In one implementation, the complexity of each image block is determined based on the distribution of pixel values ​​of each pixel in each image block, including:

[0015] Each image patch is input into the complexity prediction model to obtain the complexity of each image patch.

[0016] The complexity prediction model is used to determine the complexity of an image patch based on the distribution of pixel values ​​of each pixel in the patch.

[0017] In one embodiment, the method further includes:

[0018] The complexity prediction model is trained using the following steps:

[0019] Each image sample is segmented to obtain the corresponding image block for each image sample;

[0020] Determine the complexity label for each image block of each image sample;

[0021] The classification model is trained based on each image patch of each image sample and its corresponding complexity label to obtain a trained complexity prediction model.

[0022] In one implementation, the complexity label of each image block in each image sample is determined, including:

[0023] For each image sample, the image sample is divided into regions according to the complexity of each content in the image sample to obtain at least one content region and its corresponding complexity. The complexity of the at least one content region is determined as the complexity of each pixel contained therein.

[0024] For each image patch in each image sample, perform the following steps:

[0025] Based on the complexity of each pixel in the image patch, determine the number of pixels corresponding to each complexity.

[0026] The percentage of each pixel is obtained by comparing the number of each pixel with the total number of pixels in the image block.

[0027] The complexity label of the image block is determined based on the proportion of each pixel.

[0028] In one implementation, the complexity label of an image patch is determined based on the proportion of each pixel, including:

[0029] Use any one of the following:

[0030] If the maximum value among the proportions of each pixel is higher than the first proportion threshold, then the complexity corresponding to the maximum value is determined as the complexity label of the image patch.

[0031] If the difference between the two highest target pixel percentages is lower than the second percentage threshold, and both target pixel percentages are higher than the third percentage threshold, then the complexity label is determined based on the two target pixel percentages.

[0032] If the difference between any two pixel proportions in each pixel proportion is lower than the fourth proportion threshold, then the complexity label is determined based on the median value of each complexity.

[0033] In one implementation, the complexity label is determined based on the proportion of two target pixels, including:

[0034] Determine the two target complexities corresponding to the proportions of the two target pixels;

[0035] If the difference between two target complexities is less than the complexity threshold, the maximum value of the two target complexities is determined as the complexity label; otherwise, the median value between the two target complexities is determined as the complexity label.

[0036] In one implementation, adjusting the pixel values ​​of each pixel in an image block according to a pixel value adjustment method corresponding to the complexity of the image block includes:

[0037] For each pixel in the image patch, input the initial pixel value into the pixel transformation formula corresponding to the complexity of the image patch to obtain the transformed pixel value.

[0038] In one implementation, the complexity includes a first level, a second level, and a third level;

[0039] The pixel conversion formula corresponding to the first level is used to reduce the pixel value located in the first pixel range;

[0040] The pixel conversion formula corresponding to the second level is used to increase the pixel value located in the second pixel range;

[0041] The pixel transformation formula corresponding to the third level is used to perform linear transformations on pixel values.

[0042] In one implementation, if the complexity of the image patch is level three, the pixel conversion formula corresponding to level three includes:

[0043] Linear_RGB={(\frac{RGB / 255+0.055}{1.055})}^{2.2};

[0044] Output_RGB = 3 * Linear_RGB, 0 <Linear_RGB≤112a*ln(12*Linear_RGB-b)+c,112<Linear_RGB<1;

[0045] Where RGB represents the initial pixel value, Linear_RGB represents the pixel value after linear processing, Output_RGB represents the converted pixel value, and a, b, and c are all weighting coefficients.

[0046] In one implementation, obtaining a target image based on the adjusted image blocks includes:

[0047] The adjusted image blocks are then stitched together to obtain a stitched image.

[0048] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0049] Based on the pixel values ​​and fusion weights of each pixel located at the stitching edge between image blocks in the stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted to obtain the target image.

[0050] In one implementation, obtaining a target image based on the adjusted image blocks includes:

[0051] If there are multiple image segmentation methods, then each image block in the image block set obtained by each image segmentation method is stitched together to obtain multiple stitched images;

[0052] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0053] For each stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted according to the pixel values ​​and fusion weights of each pixel at the stitching edge between each image block in the stitched image, so as to obtain the corresponding edge fusion image.

[0054] The target image is obtained by globally fusing the edges of each image.

[0055] In one embodiment, global image fusion is performed on the edge-blended images to obtain the target image, including:

[0056] For each pixel, perform the following steps:

[0057] The new pixel value of a pixel is obtained by averaging the pixel values ​​in the edge-blended image.

[0058] In one aspect, this disclosure provides an image processing apparatus, comprising:

[0059] The segmentation unit is used to segment the image to be processed into multiple image blocks;

[0060] The determination unit is used to determine the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block;

[0061] The adjustment unit is used to adjust the pixel values ​​of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block.

[0062] The acquisition unit is used to obtain the target image based on the adjusted image blocks.

[0063] In one implementation, the segmentation unit is used for:

[0064] Obtain the image segmentation method; the image segmentation method is at least one;

[0065] For each image segmentation method, the image to be processed is segmented according to the image segmentation method to obtain an image block set containing multiple image blocks.

[0066] In one implementation, the determining unit is used to:

[0067] Each image patch is input into the complexity prediction model to obtain the complexity of each image patch.

[0068] The complexity prediction model is used to determine the complexity of an image patch based on the distribution of pixel values ​​of each pixel in the patch.

[0069] In one embodiment, the determining unit is further configured to:

[0070] The complexity prediction model is trained using the following steps:

[0071] Each image sample is segmented to obtain the corresponding image block for each image sample;

[0072] Determine the complexity label for each image block of each image sample;

[0073] The classification model is trained based on each image patch of each image sample and its corresponding complexity label to obtain a trained complexity prediction model.

[0074] In one embodiment, the determining unit is further configured to:

[0075] For each image sample, the image sample is divided into regions according to the complexity of each content in the image sample to obtain at least one content region and its corresponding complexity. The complexity of the at least one content region is determined as the complexity of each pixel contained therein.

[0076] For each image patch in each image sample, perform the following steps:

[0077] Based on the complexity of each pixel in the image patch, determine the number of pixels corresponding to each complexity.

[0078] The percentage of each pixel is obtained by comparing the number of each pixel with the total number of pixels in the image block.

[0079] The complexity label of the image block is determined based on the proportion of each pixel.

[0080] In one embodiment, the determining unit is further configured to: employ any one of the following:

[0081] If the maximum value among the proportions of each pixel is higher than the first proportion threshold, then the complexity corresponding to the maximum value is determined as the complexity label of the image patch.

[0082] If the difference between the two highest target pixel percentages is lower than the second percentage threshold, and both target pixel percentages are higher than the third percentage threshold, then the complexity label is determined based on the two target pixel percentages.

[0083] If the difference between any two pixel proportions in each pixel proportion is lower than the fourth proportion threshold, then the complexity label is determined based on the median value of each complexity.

[0084] In one embodiment, the determining unit is further configured to:

[0085] Determine the two target complexities corresponding to the proportions of the two target pixels;

[0086] If the difference between two target complexities is less than the complexity threshold, the maximum value of the two target complexities is determined as the complexity label; otherwise, the median value between the two target complexities is determined as the complexity label.

[0087] In one embodiment, the adjustment unit is used for:

[0088] For each pixel in the image patch, input the initial pixel value into the pixel transformation formula corresponding to the complexity of the image patch to obtain the transformed pixel value.

[0089] In one implementation, the complexity includes a first level, a second level, and a third level;

[0090] The pixel conversion formula corresponding to the first level is used to reduce the pixel value located in the first pixel range;

[0091] The pixel conversion formula corresponding to the second level is used to increase the pixel value located in the second pixel range;

[0092] The pixel transformation formula corresponding to the third level is used to perform linear transformations on pixel values.

[0093] In one implementation, if the complexity of the image patch is level three, the pixel conversion formula corresponding to level three includes:

[0094] Linear_RGB={(\frac{RGB / 255+0.055}{1.055})}^{2.2};

[0095] Output_RGB = 3 * Linear_RGB, 0 <Linear_RGB≤112a*ln(12*Linear_RGB-b)+c,112<Linear_RGB<1;

[0096] Where RGB represents the initial pixel value, Linear_RGB represents the pixel value after linear processing, Output_RGB represents the converted pixel value, and a, b, and c are all weighting coefficients.

[0097] In one embodiment, the obtaining unit is used to:

[0098] The adjusted image blocks are then stitched together to obtain a stitched image.

[0099] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0100] Based on the pixel values ​​and fusion weights of each pixel located at the stitching edge between image blocks in the stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted to obtain the target image.

[0101] In one embodiment, the obtaining unit is used to:

[0102] If there are multiple image segmentation methods, then each image block in the image block set obtained by each image segmentation method is stitched together to obtain multiple stitched images;

[0103] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0104] For each stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted according to the pixel values ​​and fusion weights of each pixel at the stitching edge between each image block in the stitched image, so as to obtain the corresponding edge fusion image.

[0105] The target image is obtained by globally fusing the edges of each image.

[0106] In one embodiment, the obtaining unit is used to:

[0107] For each pixel, perform the following steps:

[0108] The new pixel value of a pixel is obtained by averaging the pixel values ​​in the edge-blended image.

[0109] In one aspect, this disclosure provides an electronic device, including:

[0110] Processor; and

[0111] The memory stores computer instructions that cause the processor to perform the steps of the methods provided in the various alternative implementations of any of the image processing described above.

[0112] In one aspect, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of the methods provided in various alternative implementations of any of the above-described image processing methods.

[0113] On one hand, this disclosure provides a computer program product including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the steps of the method provided in various alternative implementations of any of the above-described image processing methods.

[0114] The image processing method in this embodiment includes segmenting the image to be processed to obtain multiple image blocks; determining the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block; adjusting the pixel values ​​of each pixel in each image block according to the pixel value adjustment method corresponding to the complexity of the image block; and obtaining a target image based on the adjusted image blocks. In this way, by adjusting the pixel values ​​of each image block according to the complexity of its content, the image display brightness can be adjusted, thus balancing power consumption and visual effect in image processing. Attached Figure Description

[0115] Figure 1 This is a flowchart of an image processing method according to an embodiment of the present disclosure.

[0116] Figure 2 This is a schematic diagram of an image segmentation embodiment of the present disclosure.

[0117] Figure 3 This is a schematic diagram of a complexity label setting in an embodiment of this disclosure.

[0118] Figure 4 This is a schematic diagram of the structure of a complexity prediction model in an embodiment of this disclosure.

[0119] Figure 5 This is a schematic diagram comparing brightness mapping curves in an embodiment of this disclosure.

[0120] Figure 6 This is another schematic diagram comparing brightness mapping curves in an embodiment of this disclosure.

[0121] Figure 7 This is a schematic diagram of an image block pixel conversion according to an embodiment of the present disclosure.

[0122] Figure 8 This is a schematic diagram of a stitched image according to an embodiment of the present disclosure.

[0123] Figure 9 This is a schematic diagram of a global image fusion embodiment of the present disclosure.

[0124] Figure 10 This is a flowchart of a method for generating a target image according to an embodiment of this disclosure.

[0125] Figure 11 This is a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure.

[0126] Figure 12 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0127] The technical solutions of this disclosure will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. Furthermore, the technical features involved in the different embodiments of this disclosure described below can be combined with each other as long as they do not conflict with each other.

[0128] With the rapid development of image capturing and display equipment, and the exponential increase in network bandwidth, the image industry has flourished, making images an important information carrier today.

[0129] Since Standard Dynamic Range (SDR) playback devices still dominate the market, adjusting the display brightness of SDR images to improve the overall visual experience is a problem that needs to be solved.

[0130] In related technologies, gamma 2.2 is typically used to calibrate the brightness mapping curve, and the brightness of the SDR image is adjusted according to this brightness mapping curve. The gamma value is a parameter that measures the brightness response curve of a display, describing the non-linear relationship between the input signal (i.e., the pixel value of each pixel in the image) and the screen display brightness.

[0131] However, this approach suffers from poor image processing flexibility, making it difficult to balance power consumption and image display quality. For example, when an SDR image contains both bright and dark scenes, this method cannot adequately address the display quality of each scene, typically resulting in a poor overall image quality.

[0132] To address the deficiencies of the aforementioned related technologies, this disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product.

[0133] This disclosure provides an image processing method that can be applied to electronic devices. This disclosure does not limit the type of electronic device, which can be any suitable type of device, such as terminal devices and servers, etc. This disclosure will not elaborate further.

[0134] See Figure 1 The diagram shown is a flowchart of an image processing method according to an embodiment of this disclosure. The following is a description of the method in conjunction with... Figure 1 The method is described below, and the specific implementation process is as follows:

[0135] Step 101: Segment the image to be processed to obtain multiple image blocks.

[0136] In one implementation, the following steps may be performed:

[0137] S1011: Obtain the image segmentation method; the image segmentation method is at least one.

[0138] In one implementation, the image segmentation method can be set according to the number of image blocks to be divided, for example, image segmentation can be performed according to M*N. M and N are both positive integers, and different image segmentation methods can use different values ​​of M and / or N.

[0139] See Figure 2 The image shown is a schematic diagram of an image segmentation method. Figure 2 In the process, the first image segmentation method is used to divide the image into 1*2 image blocks to obtain the first image block set; the second image segmentation method is used to divide the image into 2*2 image blocks to obtain the second image block set; and the third image segmentation method is used to divide the image into 4*4 image blocks to obtain the third image block set.

[0140] S1012: For each image segmentation method, the image to be processed is segmented according to the image segmentation method to obtain an image block set containing multiple image blocks.

[0141] Optionally, the image to be processed can be an SDR image. If there are multiple image segmentation methods, each image segmentation method can be used to segment the same image to be processed, obtaining the image block set corresponding to each image segmentation method.

[0142] Step 102: Determine the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block.

[0143] In one implementation, each image patch is input into a complexity prediction model to obtain the complexity of each image patch.

[0144] The complexity prediction model is used to determine the complexity of an image patch based on the distribution of pixel values ​​of each pixel in the patch.

[0145] Furthermore, the following steps can be used to train and obtain a complexity prediction model:

[0146] S1021: Segment each image sample to obtain the image block corresponding to each image sample.

[0147] In one embodiment, multiple image samples are acquired, and each image sample is segmented using an image segmentation method to obtain multiple image blocks.

[0148] Optionally, image samples can be obtained from different sources. For example, different SDR video sources can be downloaded from various video websites, and the videos can be converted into images, such as saving an image every five frames as an image sample. To improve the performance of model prediction, SDR videos with different resolutions, display styles, and source types can be selected. Optionally, resolutions can include 540P, 720P, 2K, and 4K, etc. Display styles and source types can include animation scene videos and real-life scene videos, and can include scene sources from different time periods such as morning, noon, and evening.

[0149] In this way, we can obtain image samples with diversity.

[0150] S1022: Determine the complexity label for each image block of each image sample.

[0151] In one implementation, when executing S1022, the following steps may be used:

[0152] S1022-1: For each image sample, divide the image sample into regions according to the complexity of each content of the image sample to obtain at least one content region and its corresponding complexity, and determine the complexity of the at least one content region as the complexity of each pixel contained therein.

[0153] An image may contain both simple and complex content. Therefore, the image can be divided into multiple content regions based on the complexity of each content region, with each region corresponding to a complexity level. For ease of implementation, the complexity can be divided into multiple levels. In practice, the number of complexity levels can be set according to the specific application scenario. Optionally, the complexity of each content region in the image sample can be manually calibrated. Complexity levels can include a first level, a second level, and a third level, which can also be represented as: easy_cont, mid_cont, and comp_cont, respectively.

[0154] The first level indicates a portion of the image where the pixel values ​​are relatively uniform and contain relatively little information. The second level indicates a portion of the image where the pixel values ​​have a certain range. Complexity indicates a portion of the image where the pixel values ​​have a large range, containing a large amount of information, and is an area of ​​interest that the human eye is likely to focus on. For example, if an image includes a sky background and an exhibition of flowers in the foreground, then the complexity of the sky area in the image is determined to be at the first level, and the complexity of the flower area is determined to be at the third level.

[0155] S1022-2: For each image block in each image sample, perform the following steps:

[0156] S1022-21: Determine the number of pixels corresponding to each complexity based on the complexity of each pixel in the image block.

[0157] S1022-22: Obtain the percentage of each pixel based on the ratio of the number of each pixel to the total number of pixels in the image block.

[0158] For example, the following formula can be used to determine the proportion of each pixel:

[0159]

[0160] Where (sm, sn) represents the maximum row and column number of pixels in the image patch, where sm and sn are both positive integers. easy_ratio represents the proportion of the first level, mid_ratio represents the proportion of the second level, comp_ratio represents the proportion of the third level, si represents the pixel index, and sum represents the total number of pixels in the image patch. easy_cont_si is the first-level pixel filtering function; if pixel si is of the first level, it outputs 1, otherwise it outputs 0. Similarly, mid_ratio_si and comp_cont_si are the second-level pixel filtering functions used to filter second-level pixels and the third-level pixel filtering functions used to filter third-level pixels, respectively.

[0161] In this way, we can obtain the pixel percentage corresponding to different levels of complexity.

[0162] S1022-23: Determine the complexity label of the image block based on the proportion of each pixel.

[0163] In one implementation, any one of the following methods is used:

[0164] Method 1: If the maximum value among the proportions of each pixel is higher than the first proportion threshold, then the complexity corresponding to the maximum value is determined as the complexity label of the image block.

[0165] The following is combined Figure 3 This section provides an example illustrating how to set complexity labels. See also... Figure 3 The diagram illustrates a complexity label setting. Taking a complexity level comprising three levels, with a first percentage threshold of 0.5 as an example, if a pixel's percentage exceeds 0.5, the complexity corresponding to that percentage is set as the complexity label.

[0166] Method 2: If the difference between the two highest target pixel proportions is lower than the second proportion threshold, and both target pixel proportions are higher than the third proportion threshold, then the complexity label is determined based on the proportions of the two target pixels.

[0167] In one implementation method, when executing method two, the following steps can be taken:

[0168] S1022-231: Determine the two target complexities corresponding to the proportions of the two target pixels.

[0169] S1022-232: If the difference between two target complexities is lower than the complexity threshold, the maximum value of the two target complexities is determined as the complexity label; otherwise, the median value between the two target complexities is determined as the complexity label.

[0170] For example, assuming the complexity threshold is 2, Figure 3 In this context, if two target complexities are at level one and level two respectively, and the difference between the two target complexities is 1, which is lower than the complexity threshold, then level two is determined as the complexity label. Similarly, if two target complexities are at level three and level two respectively, then level three is determined as the complexity label. If two target complexities are at level one and level three respectively, and the difference between the two target complexities is 2, which is not lower than the complexity threshold, then level two is determined as the complexity label.

[0171] In this way, if the difference between the two target complexities is large, the middle value between them will be determined as the complexity label.

[0172] Method 3: If the difference between any two pixel proportions in each pixel proportion is lower than the fourth proportion threshold, then the complexity label is determined based on the median value of each complexity.

[0173] For example, Figure 3 If the three pixels have equal proportions, then the second level is determined as the complexity label.

[0174] In practical applications, the percentage thresholds and complexity thresholds can be set according to the actual application scenario, and no restrictions are imposed here.

[0175] S1023: Based on each image patch of each image sample and its corresponding complexity label, train the classification model to obtain a trained complexity prediction model.

[0176] In one implementation, the following steps are performed repeatedly until the training conditions are met:

[0177] The image patch is input into the classification model to obtain the prediction complexity. The model loss is determined based on the difference between the prediction complexity and its corresponding complexity label. The parameters of the classification model are then adjusted based on the model loss.

[0178] In practical applications, training conditions can be set according to the specific application scenario. For example, training conditions can be that the model loss is below a loss threshold, or that the model loss remains unchanged after multiple consecutive training iterations. The loss threshold can be set according to the specific application scenario and is not restricted here.

[0179] Optionally, the training conditions can be expressed as:

[0180] Model optimization = argmin || pre_label - real_label || 2 ;

[0181] Where pre_label represents the prediction complexity and real_label represents the complexity label.

[0182] Taking the complexity as including a first level, a second level, and a third level as an example, in this embodiment of the application, the complexity prediction problem is optimized into a three-class classification problem. A classification model for three-class classification is constructed, and the classification model is trained to obtain a complexity prediction model, so as to predict the complexity of image patches through the complexity prediction model.

[0183] The following is combined Figure 4 The structure of the complexity prediction model is explained. (See also...) Figure 4 The figure shown is a schematic diagram of a complexity prediction model. Figure 4In this model, the complexity prediction model includes convolutional layers, pooling layers, and fully connected layers. The convolutional layers are used for feature extraction, and the fully connected layers output the probability that the content distribution of the current image patch belongs to each complexity level. The complexity corresponding to the highest probability among these probabilities is then used as the predicted complexity.

[0184] Step 103: For each image block, adjust the pixel value of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block.

[0185] Among them, the corresponding brightness mapping method can be set in advance for each complexity, and different brightness mapping methods can be set for different complexities.

[0186] In one implementation, for each pixel in the image block, the initial pixel value of the pixel is input into a pixel transformation formula corresponding to the complexity of the image block to obtain the transformed pixel value.

[0187] In one implementation, the complexity includes a first level, a second level, and a third level; the pixel transformation formula corresponding to the first level is used to reduce the pixel value located in the first pixel interval; the pixel transformation formula corresponding to the second level is used to increase the pixel value located in the second pixel interval; and the pixel transformation formula corresponding to the third level is used to perform a linear transformation on the pixel value.

[0188] Optionally, the pixel transformation formula corresponding to the first level, i.e., the first pixel transformation formula, can be:

[0189]

[0190] Where K1 is the first conversion coefficient, which is a positive number less than 1, for example, K1 is 0.8, H1 is the first pixel threshold, and Output_RGB is the converted pixel value. The first pixel interval is (0, H1).

[0191] The following section compares and explains five different brightness mapping methods. (See attached document.) Figure 5 The image shown is a schematic diagram comparing brightness mapping curves. The explanation uses pixel values ​​as grayscale values ​​as an example. Figure 5 In the graph, the horizontal axis represents the initial grayscale value of the pixel (i.e., the grayscale value corresponding to the pixel value before conversion), and the vertical axis represents the brightness level. Optionally, the vertical axis can also represent brightness.

[0192] Figure 5The display shows a normal brightness mapping curve and a first brightness mapping curve. The normal brightness mapping curve represents the relationship between the initial pixel value and the brightness level of a pixel under the correlation method. The first brightness mapping curve represents the relationship between the initial pixel value and the brightness level of a pixel in this embodiment of the application, when the complexity is at level one. Since the initial pixel value of the pixel is reduced when the complexity is at level one, the first brightness mapping curve is located below the normal brightness mapping curve. That is, for the same pixel value, the brightness level mapped based on the first brightness mapping curve is lower, and the actual response brightness is also lower, which saves power consumption in video playback scenarios to a certain extent.

[0193] Since the first-level image blocks contain less information and have relatively concentrated pixel distribution, they are usually mostly non-main content in the image and not the content that the user is actually concerned with. Therefore, the pixel values ​​of some pixels can be appropriately reduced, thereby reducing the corresponding brightness level. This can reduce power consumption while ensuring display effect and alleviate the overheating problem of devices (such as mobile phones).

[0194] Optionally, the pixel transformation formula corresponding to the second level, i.e., the second pixel transformation formula, can be:

[0195]

[0196] Where K2 is the second conversion coefficient, a positive number greater than 1, for example, K1 is 1.2, and H2 is the second pixel threshold. The second pixel interval is (0, H2). In practical applications, the first pixel interval, the first pixel threshold, the second pixel interval, and the second pixel threshold can all be set according to the actual application scenario, and there are no restrictions here.

[0197] The following section compares and explains six different brightness mapping methods. (See attached document.) Figure 6 The image shown is a comparative diagram of another brightness mapping curve. The explanation uses pixel values ​​as grayscale values ​​as an example. Figure 6 In the graph, the horizontal axis represents the initial grayscale value of the pixel (i.e., the grayscale value before conversion), and the vertical axis represents the brightness level.

[0198] Figure 6 The image displays a standard luminance mapping curve and a second luminance mapping curve. The standard luminance mapping curve represents the relationship between the initial pixel value and the luminance level of a pixel under the correlation method, while the second luminance mapping curve represents the relationship between the initial pixel value and the luminance level of a pixel in this embodiment of the application, when the complexity is at level two.

[0199] Because the pixel value distribution of the second-level image blocks has a certain range, the amount of information is increased to a certain extent compared with the simple content image blocks (i.e., the first-level image blocks). Therefore, the brightness level of the image blocks is no longer compressed, and the original gamma2.2 normal mapping curve, i.e. the ordinary brightness mapping curve, is maintained. In order to improve the readability of dark areas, the mapping curve part corresponding to dark areas in the ordinary brightness mapping curve is raised to a certain extent to ensure the clarity of the entire image.

[0200] If the complexity of the image patch is level three, the pixel transformation formula corresponding to level three, i.e., the third pixel transformation formula, includes:

[0201]

[0202] Where Linear_RGB is the pixel value after linear processing, RGB is the initial pixel value, Output_RGB is the converted pixel value, and a, b, and c are all weight coefficients.

[0203] In this embodiment, only the pixel value is used as an example for explanation. If the pixel value is composed of RGB three-channel components, the above formula can be used to calculate each component separately, and there is no limitation here.

[0204] Because the pixel values ​​in third-level image blocks span a large range and contain a significant amount of information, they are typically areas of interest that users tend to focus on. Therefore, pixel value conversion allows for further refinement, especially for pixel values ​​in darker areas. Specifically, this can be achieved by referencing the Hybrid Log Gamma (HLG) curve strategy used in High Dynamic Range (HDR) video to further subdivide pixel values ​​and assign more zero-degree levels. This involves first converting the 0-255 RGB data from a non-linear electrical signal to a linear optical signal, and then remapping the optical signal according to the improved HLG curve. Furthermore, the weighting coefficients of a, b, and c can be adjusted to achieve the desired image display effect, thus enabling the allocation of more brightness levels to complex content.

[0205] Combination Figure 2 and Figure 7 This section provides an example illustrating pixel transformation of image patches. Assume there are multiple sets of image patches, namely a first set, a second set, and a third set, with complexity levels including first, second, and third levels. (See [reference needed]). Figure 7 The image shown is a schematic diagram of image block pixel conversion. Figure 7The system includes an image segmentation module, a first image block set, a second image block set, and a third image block set; a complexity prediction module; a first pixel transformation formula, a second pixel transformation formula, and a third pixel transformation formula; and an output module.

[0206] The image segmentation module uses various segmentation methods to segment the image, obtaining a 1x2 first image block set, a 2x2 second image block set, and a 4x4 third image block set. The complexity prediction module predicts the complexity of each image block in the first, second, and third image block sets, obtaining the corresponding complexity. Based on the complexity of the image block, the corresponding pixel transformation formula is determined, i.e., the first pixel transformation formula, the second pixel transformation formula, or the third pixel transformation formula. The output module outputs the pixel-adjusted image blocks.

[0207] Step 104: Obtain the target image based on the adjusted image blocks.

[0208] In one implementation, step 104 can be performed in any of the following ways:

[0209] Method 1: If there is only one set of image patches, then obtain the target image based on that set of image patches.

[0210] In one embodiment, the adjusted image blocks are stitched together to obtain a stitched image; the fusion weight corresponding to the complexity of each adjusted image block is obtained; and the pixel values ​​of each pixel located at the stitching edge between the image blocks in the stitched image are adjusted according to the pixel values ​​and fusion weights of each pixel located at the stitching edge to obtain the target image.

[0211] See Figure 8 The diagram illustrates an image stitching process. To restore each image block to its initial resolution (i.e., the resolution of the image to be processed), the image blocks are stitched together. Because each image block has different complexity and corresponding pixel transformation methods, the stitched edges may exhibit issues such as cuts and breaks. To address this, corresponding fusion weights can be set for different levels of complexity, and the pixels at the stitching edges can be fused according to these weights to eliminate cuts and breaks.

[0212] In this system, the sum of the fusion weights corresponding to each complexity level is 1. For example, the complexity levels include Level 1, Level 2, and Level 3, with complexities of 0.2, 0.4, and 0.4 respectively, and their sum is 1. In practical applications, the fusion weights corresponding to each complexity level can be set according to the actual application scenario, and no restrictions are imposed here.

[0213] Optionally, when adjusting the pixel values ​​of each pixel located at the stitching edge based on the pixel values ​​and fusion weights of each pixel at the stitching edge between image blocks in the stitched image, the following steps can be performed separately for each pixel combination at the stitching edge:

[0214] Based on the complexity of the first pixel in the pixel combination, its corresponding first pixel value and first fusion weight, and the complexity of the second pixel in the pixel combination, its corresponding second pixel value and second fusion weight, a weighted sum is performed to obtain the third pixel value, and the third pixel value is determined as the new first pixel value and the new second pixel value, respectively.

[0215] In this pixel combination, the first pixel and the second pixel are adjacent pixels located on both sides of the stitching edge, and the first pixel and the second pixel in this pixel combination are located in different image blocks.

[0216] Optionally, the following formula can be used to determine the RGB3 value of the third pixel:

[0217] RGB3 = w1*RGB1 + w2*RGB2;

[0218] Wherein, RGB1 is the first pixel value, w1 is the first fusion weight, RGB2 is the second pixel value, and w2 is the second fusion weight.

[0219] Method 2: If there are multiple image segmentation methods, the target image is obtained based on the set of each image block.

[0220] In one embodiment, if there are multiple image segmentation methods, the image blocks in the image block set obtained by each image segmentation method are stitched together to obtain multiple stitched images; the fusion weight corresponding to the complexity of each image block after adjustment is obtained; for each stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted according to the pixel values ​​and fusion weights of each pixel located at the stitching edge between each image block in the stitched image to obtain the corresponding edge fusion image; and the edge fusion images are subjected to global image fusion to obtain the target image.

[0221] During image fusion, the following steps can be performed for each pixel:

[0222] The new pixel value of a pixel is obtained by averaging the pixel values ​​in the edge-blended image.

[0223] Taking the first edge-blended image, the second edge-blended image, and the third edge-blended image as examples, the following formula can be used to determine the new pixel value for each pixel in the target image:

[0224]

[0225] Where (i, j) is the row and column number of the pixel in the target image, (m, n) is the maximum row and column number of each pixel in the target image, final_img_i_j is the pixel (i, j) in the target image, img1_i_j is the pixel (i, j) in the first edge-blended image, img2_i_j is the pixel (i, j) in the second edge-blended image, and img3_i_j is the pixel (i, j) in the third edge-blended image.

[0226] Furthermore, based on the pixel values ​​of each pixel in the target image and the correspondence between pixel values ​​and brightness, the brightness of each pixel in the target image can be obtained.

[0227] In this way, the brightness of an image can be adjusted by changing its pixel values.

[0228] See Figure 9 The image shown is a schematic diagram of global image fusion. Figure 9 In the image, each edge-blended image is a first edge-blended image, a second edge-blended image, and a third edge-blended image. Then, global image fusion is performed on each edge-blended image to obtain the target image.

[0229] The following is combined Figure 10 The method for generating the target image is described in further detail. (See also...) Figure 10 The diagram shows a flowchart of a method for generating a target image. The method includes the following steps:

[0230] Step 1001: Segment the image to be processed according to various image segmentation methods to obtain multiple image block sets.

[0231] Step 1002: Input each image patch into the complexity prediction model to obtain the complexity of each image patch.

[0232] Step 1003: Adjust the pixel values ​​of each image block according to the pixel conversion formula corresponding to each image block to obtain multiple adjusted image blocks.

[0233] Step 1004: For each set of image blocks, stitch together the adjusted image blocks in the set to obtain the corresponding stitched image.

[0234] Step 1005: Perform edge blending processing on the stitching edges of each stitched image to obtain an edge-blended image.

[0235] Step 1006: Perform global image fusion on each edge-blended image to obtain the target image.

[0236] When performing steps 1001-1006, the specific steps can be found in steps 101-104 above, and there are no restrictions here.

[0237] In this embodiment, the image to be processed is divided into multiple image blocks. Different pixel adjustment methods are pre-set for different levels of complexity. Based on the pixel adjustment method corresponding to the complexity of each image block, the pixel values ​​of each image block are converted. When the content of the image block is simple, the pixel values ​​can be reduced, thereby reducing the corresponding brightness level, which greatly reduces the amount of computation and reduces display power consumption while meeting display effect requirements. When the content of the image block is relatively complex, only the pixel values ​​of the dark areas are increased, thereby improving the brightness level of the dark areas to ensure the clarity of the entire image block. When the content of the image block is more complex, the pixel values ​​can be further refined, thereby allocating more refined brightness levels to ensure the discernibility and readability of the image and improve the display effect.

[0238] Furthermore, image samples can be acquired based on video sources, and each image sample can be segmented and labeled to obtain training data. A complexity prediction model can then be trained based on this training data to determine the complexity of image patches. This allows for complexity classification based on the amount of information contained within each image patch. Further, through edge fusion processing of stitched edges and global image fusion between different edge-fused images, multi-dimensional fusion is achieved, reducing the discontinuity and fragmentation issues at stitched edges.

[0239] Based on the same inventive concept, this disclosure also provides an image processing apparatus. Since the principle of the above-described apparatus and device in solving the problem is similar to that of an image processing method, the implementation of the above-described apparatus can refer to the implementation of the method, and repeated details will not be elaborated further. This apparatus can be applied to electronic devices. This disclosure does not limit the type of electronic device; it can be any suitable type of device, such as terminal devices and servers, etc., which will not be elaborated further in this disclosure. The apparatus embodiment can be implemented by software, or by hardware, or a combination of software and hardware. Taking software implementation as an example, as a logically defined apparatus, it is formed by the processor of the electronic device loading the corresponding computer program instructions from non-volatile memory into memory for execution.

[0240] See Figure 11 The diagram shown is a structural block diagram of an image processing apparatus according to an embodiment of this disclosure. In some embodiments, the image processing apparatus of this disclosure includes:

[0241] The segmentation unit 1101 is used to segment the image to be processed to obtain multiple image blocks;

[0242] The determining unit 1102 is used to determine the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block;

[0243] The adjustment unit 1103 is used to adjust the pixel value of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block for each image block.

[0244] The obtaining unit 1104 is used to obtain the target image based on the adjusted image blocks.

[0245] In one embodiment, the segmentation unit 1101 is used for:

[0246] Obtain the image segmentation method; the image segmentation method is at least one;

[0247] For each image segmentation method, the image to be processed is segmented according to the image segmentation method to obtain an image block set containing multiple image blocks.

[0248] In one embodiment, the determining unit 1102 is used to:

[0249] Each image patch is input into the complexity prediction model to obtain the complexity of each image patch.

[0250] The complexity prediction model is used to determine the complexity of an image patch based on the distribution of pixel values ​​of each pixel in the patch.

[0251] In one embodiment, the determining unit 1102 is further configured to:

[0252] The complexity prediction model is trained using the following steps:

[0253] Each image sample is segmented to obtain the corresponding image block for each image sample;

[0254] Determine the complexity label for each image block of each image sample;

[0255] The classification model is trained based on each image patch of each image sample and its corresponding complexity label to obtain a trained complexity prediction model.

[0256] In one embodiment, the determining unit 1102 is further configured to:

[0257] For each image sample, the image sample is divided into regions according to the complexity of each content in the image sample to obtain at least one content region and its corresponding complexity. The complexity of the at least one content region is determined as the complexity of each pixel contained therein.

[0258] For each image patch in each image sample, perform the following steps:

[0259] Based on the complexity of each pixel in the image patch, determine the number of pixels corresponding to each complexity.

[0260] The percentage of each pixel is obtained by comparing the number of each pixel with the total number of pixels in the image block.

[0261] The complexity label of the image block is determined based on the proportion of each pixel.

[0262] In one embodiment, the determining unit 1102 is further configured to: employ any one of the following:

[0263] If the maximum value among the proportions of each pixel is higher than the first proportion threshold, then the complexity corresponding to the maximum value is determined as the complexity label of the image patch.

[0264] If the difference between the two highest target pixel percentages is lower than the second percentage threshold, and both target pixel percentages are higher than the third percentage threshold, then the complexity label is determined based on the two target pixel percentages.

[0265] If the difference between any two pixel proportions in each pixel proportion is lower than the fourth proportion threshold, then the complexity label is determined based on the median value of each complexity.

[0266] In one embodiment, the determining unit 1102 is further configured to:

[0267] Determine the two target complexities corresponding to the proportions of the two target pixels;

[0268] If the difference between two target complexities is less than the complexity threshold, the maximum value of the two target complexities is determined as the complexity label; otherwise, the median value between the two target complexities is determined as the complexity label.

[0269] In one embodiment, the adjustment unit 1103 is used for:

[0270] For each pixel in the image patch, input the initial pixel value into the pixel transformation formula corresponding to the complexity of the image patch to obtain the transformed pixel value.

[0271] In one implementation, the complexity includes a first level, a second level, and a third level;

[0272] The pixel conversion formula corresponding to the first level is used to reduce the pixel value located in the first pixel range;

[0273] The pixel conversion formula corresponding to the second level is used to increase the pixel value located in the second pixel range;

[0274] The pixel transformation formula corresponding to the third level is used to perform linear transformations on pixel values.

[0275] In one implementation, if the complexity of the image patch is level three, the pixel conversion formula corresponding to level three includes:

[0276] Linear_RGB={(\frac{RGB / 255+0.055}{1.055})}^{2.2};

[0277] Output_RGB = 3 * Linear_RGB, 0 <Linear_RGB≤112a*ln(12*Linear_RGB-b)+c,112<Linear_RGB<1;

[0278] Where RGB represents the initial pixel value, Linear_RGB represents the pixel value after linear processing, Output_RGB represents the converted pixel value, and a, b, and c are all weighting coefficients.

[0279] In one embodiment, the obtaining unit 1104 is used for:

[0280] The adjusted image blocks are then stitched together to obtain a stitched image.

[0281] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0282] Based on the pixel values ​​and fusion weights of each pixel located at the stitching edge between image blocks in the stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted to obtain the target image.

[0283] In one embodiment, the obtaining unit 1104 is used for:

[0284] If there are multiple image segmentation methods, then each image block in the image block set obtained by each image segmentation method is stitched together to obtain multiple stitched images;

[0285] Obtain the fusion weights corresponding to the complexity of each image patch after adjustment;

[0286] For each stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted according to the pixel values ​​and fusion weights of each pixel at the stitching edge between each image block in the stitched image, so as to obtain the corresponding edge fusion image.

[0287] The target image is obtained by globally fusing the edges of each image.

[0288] In one embodiment, the obtaining unit 1104 is used for:

[0289] For each pixel, perform the following steps:

[0290] The new pixel value of a pixel is obtained by averaging the pixel values ​​in the edge-blended image.

[0291] The image processing method in this embodiment includes segmenting the image to be processed to obtain multiple image blocks; determining the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block; adjusting the pixel values ​​of each pixel in each image block according to the pixel value adjustment method corresponding to the complexity of the image block; and obtaining a target image based on the adjusted image blocks. In this way, by adjusting the pixel values ​​of each image block according to the complexity of its content, the image display brightness can be adjusted, thus balancing power consumption and visual effect in image processing.

[0292] In this embodiment of the disclosure, an electronic device is also provided, including:

[0293] Processor; and

[0294] The memory stores computer instructions that cause the processor to execute the methods of any of the above-described embodiments.

[0295] In this embodiment of the disclosure, a computer-readable storage medium is provided, storing computer instructions for causing a computer to perform the methods of any of the above embodiments.

[0296] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the method described in any of the above embodiments.

[0297] Figure 12 A schematic diagram of the structure of an electronic device 1200 is shown. (See attached diagram.) Figure 12 As shown, the electronic device 1200 includes a processor 1210 and a memory 1220, and optionally may also include a power supply 1230, a display unit 1240, and an input unit 1250.

[0298] The processor 1210 is the control center of the electronic device 1200. It connects various components through various interfaces and lines, and performs various functions of the electronic device 1200 by running or executing software programs and / or data stored in the memory 1220, thereby performing overall monitoring of the electronic device 1200.

[0299] In this embodiment of the present disclosure, the processor 1210 executes the steps in the above embodiments when it calls the computer program stored in the memory 1220.

[0300] Optionally, processor 1210 may include one or more processing units; preferably, processor 1210 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into processor 1210. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented separately on independent chips.

[0301] The memory 1220 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, various applications, etc.; the data storage area may store data created based on the use of the electronic device 1200, etc. In addition, the memory 1220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0302] Electronic device 1200 also includes a power supply 1230 (such as a battery) that supplies power to various components. The power supply can be logically connected to processor 1210 through a power management system, thereby enabling the management of charging, discharging, and power consumption.

[0303] The display unit 1240 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 1200. In this embodiment, it is mainly used to display the display interfaces of various applications in the electronic device 1200, and the text, pictures, and other objects displayed on the display interfaces. The display unit 1240 may include a display panel 1241. The display panel 1241 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0304] The input unit 1250 can be used to receive information such as numbers or characters input by the user. The input unit 1250 may include a touch panel 1251 and other input devices 1252. The touch panel 1251, also known as a touch screen, can collect touch operations on or near the touch panel 1251 by the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1251).

[0305] Specifically, the touch panel 1251 can detect user touch operations and the signals generated by these operations, convert them into touch point coordinates, send them to the processor 1210, and receive and execute commands from the processor 1210. Furthermore, the touch panel 1251 can be implemented using various types of touch technologies, including resistive, capacitive, infrared, and surface acoustic wave. Other input devices 1252 can include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0306] Of course, the touch panel 1251 can cover the display panel 1241. When the touch panel 1251 detects a touch operation on or near it, it transmits the information to the processor 1210 to determine the type of touch event. Subsequently, the processor 1210 provides corresponding visual output on the display panel 1241 according to the type of touch event. Although in Figure 12 In this embodiment, the touch panel 1251 and the display panel 1241 are two separate components to realize the input and output functions of the electronic device 1200. However, in some embodiments, the touch panel 1251 and the display panel 1241 can be integrated to realize the input and output functions of the electronic device 1200.

[0307] The electronic device 1200 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity sensor, etc. Of course, depending on the specific application, the electronic device 1200 may also include other components such as a camera. Since these components are not the focus of this disclosure, therefore... Figure 12 It is not shown in the text and will not be described in detail here.

[0308] Those skilled in the art will understand that Figure 12 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or a combination of certain components, or different components.

[0309] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this disclosure, the functions of each module (or unit) can be implemented in one or more software or hardware components.

Claims

1. An image processing method, characterized in that, The method includes: The image to be processed is segmented to obtain multiple image blocks; The complexity of each image block is determined based on the distribution of pixel values ​​of each pixel in each image block; For each image block, the pixel values ​​of each pixel in the image block are adjusted according to the pixel value adjustment method corresponding to the complexity of the image block; The target image is obtained based on the adjusted image blocks.

2. The method according to claim 1, characterized in that, The image to be processed is segmented to obtain multiple image patches, including: Obtain the image segmentation method; the image segmentation method is at least one; For each image segmentation method, the image to be processed is segmented according to the image segmentation method to obtain an image block set containing multiple image blocks.

3. The method according to claim 1, characterized in that, The step of determining the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block includes: Each image patch is input into the complexity prediction model to obtain the complexity of each image patch. The complexity prediction model is used to determine the complexity of an image block based on the pixel value distribution of each pixel in the image block.

4. The method according to claim 3, characterized in that, The method further includes: The complexity prediction model is trained using the following steps: Each image sample is segmented to obtain the corresponding image block for each image sample; Determine the complexity label for each image block of each image sample; The classification model is trained based on each image patch of each image sample and its corresponding complexity label to obtain the trained complexity prediction model.

5. The method according to claim 4, characterized in that, The step of determining the complexity label for each image block of each image sample includes: For each image sample, the image sample is divided into regions according to the complexity of each content in the image sample to obtain at least one content region and its corresponding complexity. The complexity of the at least one content region is determined as the complexity of each pixel contained therein. For each image patch in each image sample, perform the following steps: Based on the complexity of each pixel in the image block, determine the number of pixels corresponding to each complexity. The percentage of each pixel is obtained by comparing the number of each pixel with the total number of pixels in the image block. The complexity label of the image block is determined based on the proportion of each pixel.

6. The method according to claim 5, characterized in that, Determining the complexity label of the image block based on the proportion of each pixel includes: Use any one of the following: If the maximum value among the proportions of each pixel is higher than the first proportion threshold, then the complexity corresponding to the maximum value is determined as the complexity label of the image block. If the difference between the two highest target pixel percentages is lower than the second percentage threshold, and both target pixel percentages are higher than the third percentage threshold, then the complexity label is determined based on the two target pixel percentages. If the difference between any two pixel proportions in each pixel proportion is lower than the fourth proportion threshold, then the complexity label is determined based on the median value of each complexity.

7. The method according to claim 6, characterized in that, Determining the complexity label based on the ratio of the two target pixels includes: Determine the two target complexities corresponding to the respective proportions of the two target pixels; If the difference between the two target complexities is lower than the complexity threshold, the maximum value of the two target complexities is determined as the complexity label; otherwise, the median value between the two target complexities is determined as the complexity label.

8. The method according to any one of claims 1-7, characterized in that, The step of adjusting the pixel values ​​of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block includes: For each pixel in the image block, the initial pixel value of the pixel is input into the pixel transformation formula corresponding to the complexity of the image block to obtain the transformed pixel value.

9. The method according to claim 8, characterized in that, The complexity includes a first level, a second level, and a third level; The pixel conversion formula corresponding to the first level is used to reduce the pixel value located in the first pixel range; The pixel conversion formula corresponding to the second level is used to increase the pixel value located in the second pixel range; The pixel transformation formula corresponding to the third level is used to perform linear transformation on the pixel value.

10. The method according to claim 9, characterized in that, If the complexity of the image patch is level three, the pixel conversion formula corresponding to level three includes: Where RGB represents the initial pixel value, Linear_RGB represents the pixel value after linear processing, Output_RGB represents the converted pixel value, and a, b, and c are all weighting coefficients.

11. The method according to any one of claims 1-7, characterized in that, The step of obtaining the target image based on the adjusted image blocks includes: The adjusted image blocks are then stitched together to obtain a stitched image. Obtain the fusion weights corresponding to the complexity of each image patch after adjustment; Based on the pixel values ​​and fusion weights of each pixel located at the stitching edge between each image block in the stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted to obtain the target image.

12. The method according to any one of claims 1-7, characterized in that, The step of obtaining the target image based on the adjusted image blocks includes: If there are multiple image segmentation methods, then each image block in the image block set obtained by each image segmentation method is stitched together to obtain multiple stitched images; Obtain the fusion weights corresponding to the complexity of each image patch after adjustment; For each stitched image, the pixel values ​​of each pixel located at the stitching edge are adjusted according to the pixel values ​​and fusion weights of each pixel at the stitching edge between each image block in the stitched image, so as to obtain the corresponding edge fusion image. The target image is obtained by performing global image fusion on the edge-blended images.

13. The method according to claim 12, characterized in that, The step of performing global image fusion on each edge-blended image to obtain the target image includes: For each pixel, perform the following steps: A new pixel value is obtained based on the average pixel value of the pixel in each edge-blended image.

14. An image processing apparatus, characterized in that, The device includes: The segmentation unit is used to segment the image to be processed into multiple image blocks; The determination unit is used to determine the complexity of each image block based on the distribution of pixel values ​​of each pixel in each image block; The adjustment unit is used to adjust the pixel value of each pixel in the image block according to the pixel value adjustment method corresponding to the complexity of the image block for each image block; The acquisition unit is used to obtain the target image based on the adjusted image blocks.

15. An electronic device, characterized in that, include: processor; as well as A memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer contains computer instructions for causing the computer to perform the method according to any one of claims 1 to 13.

17. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device is the method according to any one of claims 1 to 13.