Method, device, electronic equipment, storage medium and program product for image processing
By performing region segmentation and local adjustments on the image, the problem of loss of dark details caused by global image enhancement was solved, achieving local image quality improvement and overall effect compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2024-11-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies, through global adjustments during image enhancement, may result in the loss of details in dark areas, affecting image display quality.
By segmenting the image into regions, multiple image blocks are obtained. Each image block is then individually adjusted based on grayscale levels and local adjustment parameters, including sharpening, regional contrast enhancement, and dark detail enhancement. Finally, the images are stitched together and edges are softened.
It improves the local image quality, especially the details in dark areas, while maintaining the consistency and harmony of the overall display effect.
Smart Images

Figure CN122115274A_ABST
Abstract
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 image display scenarios, as users' demands for image quality (such as game image quality) continue to increase, image quality enhancement algorithms are usually used to enhance the image quality in order to improve the image quality.
[0003] In related technologies, image quality enhancement algorithms are typically used to make global adjustments to the image quality, such as increasing the overall brightness and contrast of the image content.
[0004] However, this approach may reduce the image display quality. For example, if there are dark patterns in the image, improving the overall image quality may result in the loss of details in the dark areas, thus affecting the final 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] Obtain the grayscale conditions and local adjustment parameter information of the image to be processed;
[0008] The image to be processed is divided into multiple image blocks;
[0009] Determine the gray level of each image patch;
[0010] For each image block, if the grayscale level of the image block meets the grayscale condition, then according to the local adjustment parameter information, the corresponding image quality adjustment operation is performed on the image block to obtain the adjusted image block;
[0011] Based on the adjusted image patch and other image patches, obtain the adjusted target image.
[0012] In one embodiment, before obtaining the grayscale conditions and local adjustment parameter information corresponding to the image to be processed, the method further includes:
[0013] Identify the currently running applications in the foreground to obtain the target application;
[0014] The currently displayed application interface of the target application is identified as the image to be processed.
[0015] In one embodiment, obtaining the grayscale conditions and local adjustment parameter information corresponding to the image to be processed includes:
[0016] From the global configuration information corresponding to the target application, obtain the grayscale conditions and local adjustment parameters corresponding to the target application, and determine the grayscale conditions and local adjustment parameters corresponding to the target application as the grayscale conditions and local adjustment parameters corresponding to the image to be processed.
[0017] Obtain the grayscale conditions and local adjustment parameters configured for the image to be processed from the page configuration information corresponding to the image to be processed.
[0018] In one embodiment, the image to be processed is divided into multiple image blocks, including:
[0019] The image to be processed is divided equally according to the set number of divisions to obtain multiple image blocks.
[0020] In one embodiment, the image to be processed is divided into multiple image blocks, including:
[0021] Obtain the grayscale level of each pixel in the image to be processed;
[0022] The image complexity of the image to be processed is determined based on the gray level of each pixel in the image to be processed.
[0023] The image to be processed is divided according to the number of divisions corresponding to the image complexity.
[0024] In one implementation, the grayscale condition is that the grayscale level of the image block is lower than the grayscale threshold; or, the grayscale condition is that the grayscale level of the image block is located within a specified grayscale range.
[0025] In one embodiment, the local adjustment parameter information includes at least one local adjustment parameter and its corresponding parameter value;
[0026] Local adjustment parameters include at least one of the following parameters: sharpening intensity parameter, area contrast intensity parameter, and shadow detail enhancement parameter;
[0027] Among them, the sharpening intensity parameter is used to adjust the sharpness of image edges; the regional contrast intensity parameter is used to adjust the sensitivity of contrast in different regions of the image; and the shadow detail enhancement parameter is used to enhance the shadow details in the image.
[0028] In one embodiment, before performing corresponding image quality adjustment operations on the image patch based on local adjustment parameter information to obtain the adjusted image patch, the method further includes:
[0029] Perform object detection on the image to be processed and obtain the object detection results;
[0030] Based on the object detection results, identify image patches containing target objects of a specified type;
[0031] Based on the local adjustment parameter information, the corresponding image quality adjustment operation is performed on the image patch to obtain the adjusted image patch, including:
[0032] If the image patch does not contain the target object, then the global image quality is adjusted based on the local adjustment parameter information.
[0033] If the image patch contains a target object, then the image quality is adjusted separately for the target object region and the non-target object region in the image patch based on the local adjustment parameter information.
[0034] In one implementation, image quality adjustments are performed on the target object region and non-target object regions in an image patch based on local adjustment parameter information, including:
[0035] Based on the parameter values corresponding to the local adjustment parameters, perform the image quality adjustment operation corresponding to the local adjustment parameters for non-target object areas in the image patch;
[0036] If the adjustment object of the local adjustment parameter includes the target object, then the gray level corresponding to the target object is determined, and the parameter value corresponding to the local adjustment parameter is adjusted according to the gray level corresponding to the target object. Then, according to the adjusted parameter value, the image quality adjustment operation corresponding to the local adjustment parameter is performed on the target object area in the image block.
[0037] In one implementation, determining the gray class corresponding to the target object includes:
[0038] If the image to be processed contains only one target object, the gray level corresponding to the target object is determined according to the gray level of each pixel in the target object region in at least one image block.
[0039] If the image to be processed contains multiple target objects, the gray level corresponding to the target object is determined based on the gray level of each pixel in the target object region corresponding to the multiple target objects in at least one image block.
[0040] In one implementation, the parameter values corresponding to the local adjustment parameters are adjusted according to the gray level corresponding to the target object, including:
[0041] Get the color range corresponding to the gray level of the target object;
[0042] Adjust the parameter values corresponding to the local adjustment parameters based on the adjustment coefficients corresponding to the color range.
[0043] In one embodiment, obtaining an adjusted target image based on the adjusted image patch and other image patches includes:
[0044] The adjusted image blocks, along with other image blocks, are stitched together to obtain a stitched image.
[0045] Edge softening processing is applied to the stitching edges of each image block in the stitched image to obtain the target image; edge softening processing is used to blur or smooth the stitching edges.
[0046] In one embodiment, after obtaining the adjusted target image based on the adjusted image patch and other image patches, the method further includes:
[0047] Obtain the global adjustment parameter information corresponding to the image to be processed;
[0048] Based on the global adjustment parameter information, perform at least one of the following operations on the target image:
[0049] Global color style adjustment, super-resolution enhancement, and inverse tone mapping processing.
[0050] In one aspect, this disclosure provides an image processing apparatus, comprising:
[0051] The acquisition unit is used to acquire the grayscale conditions and local adjustment parameter information of the image to be processed.
[0052] A partitioning unit is used to divide the image to be processed into multiple image blocks;
[0053] The determination unit is used to determine the grayscale level of each image block.
[0054] The adjustment unit is used to perform corresponding image quality adjustment operations on each image block according to the local adjustment parameter information if the gray level of the image block meets the gray level conditions, so as to obtain the adjusted image block.
[0055] The obtaining unit is used to obtain the adjusted target image based on the adjusted image patch and other image patches.
[0056] In one embodiment, the acquisition unit is further configured to:
[0057] Identify the currently running applications in the foreground to obtain the target application;
[0058] The currently displayed application interface of the target application is identified as the image to be processed.
[0059] In one embodiment, the acquisition unit is used for:
[0060] From the global configuration information corresponding to the target application, obtain the grayscale conditions and local adjustment parameters corresponding to the target application, and determine the grayscale conditions and local adjustment parameters corresponding to the target application as the grayscale conditions and local adjustment parameters corresponding to the image to be processed.
[0061] Obtain the grayscale conditions and local adjustment parameters configured for the image to be processed from the page configuration information corresponding to the image to be processed.
[0062] In one implementation, the partitioning unit is used for:
[0063] Obtain the grayscale level of each pixel in the image to be processed;
[0064] The image complexity of the image to be processed is determined based on the gray level of each pixel in the image to be processed.
[0065] The image to be processed is divided according to the number of divisions corresponding to the image complexity.
[0066] In one implementation, the partitioning unit is used for:
[0067] The image to be processed is divided equally according to the set number of divisions to obtain multiple image blocks.
[0068] In one implementation, the grayscale condition is that the grayscale level of the image block is lower than the grayscale threshold; or, the grayscale condition is that the grayscale level of the image block is located within a specified grayscale range.
[0069] In one embodiment, the local adjustment parameter information includes at least one local adjustment parameter and its corresponding parameter value;
[0070] Local adjustment parameters include at least one of the following parameters: sharpening intensity parameter, area contrast intensity parameter, and shadow detail enhancement parameter;
[0071] Among them, the sharpening intensity parameter is used to adjust the sharpness of image edges; the regional contrast intensity parameter is used to adjust the sensitivity of contrast in different regions of the image; and the shadow detail enhancement parameter is used to enhance the shadow details in the image.
[0072] In one embodiment, the adjustment unit is further configured to:
[0073] Perform object detection on the image to be processed and obtain the object detection results;
[0074] Based on the object detection results, identify image patches containing target objects of a specified type;
[0075] The adjustment unit is used for:
[0076] If the image patch does not contain the target object, then the global image quality is adjusted based on the local adjustment parameter information.
[0077] If the image patch contains a target object, then the image quality is adjusted separately for the target object region and the non-target object region in the image patch based on the local adjustment parameter information.
[0078] In one embodiment, the adjustment unit is used for:
[0079] Based on the parameter values corresponding to the local adjustment parameters, perform the image quality adjustment operation corresponding to the local adjustment parameters for non-target object areas in the image patch;
[0080] If the adjustment object of the local adjustment parameter includes the target object, then the gray level corresponding to the target object is determined, and the parameter value corresponding to the local adjustment parameter is adjusted according to the gray level corresponding to the target object. Then, according to the adjusted parameter value, the image quality adjustment operation corresponding to the local adjustment parameter is performed on the target object area in the image block.
[0081] In one embodiment, the adjustment unit is used for:
[0082] If the image to be processed contains only one target object, the gray level corresponding to the target object is determined according to the gray level of each pixel in the target object region in at least one image block.
[0083] If the image to be processed contains multiple target objects, the gray level corresponding to the target object is determined based on the gray level of each pixel in the target object region corresponding to the multiple target objects in at least one image block.
[0084] In one embodiment, the adjustment unit is used for:
[0085] Get the color range corresponding to the gray level of the target object;
[0086] Adjust the parameter values corresponding to the local adjustment parameters based on the adjustment coefficients corresponding to the color range.
[0087] In one embodiment, the obtaining unit is used to:
[0088] The adjusted image blocks, along with other image blocks, are stitched together to obtain a stitched image.
[0089] Edge softening processing is applied to the stitching edges of each image block in the stitched image to obtain the target image; edge softening processing is used to blur or smooth the stitching edges.
[0090] In one embodiment, the obtaining unit is further configured to:
[0091] Obtain the global adjustment parameter information corresponding to the image to be processed;
[0092] Based on the global adjustment parameter information, perform at least one of the following operations on the target image:
[0093] Global color style adjustment, super-resolution enhancement, and inverse tone mapping processing.
[0094] In one aspect, this disclosure provides an electronic device, including:
[0095] Processor; and
[0096] 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.
[0097] 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.
[0098] 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.
[0099] The image processing method in this embodiment includes obtaining grayscale conditions and local adjustment parameter information corresponding to the image to be processed; dividing the image to be processed into multiple image blocks; determining the grayscale level of each image block; for each image block, if the grayscale level of the image block meets the grayscale conditions, then performing a corresponding image quality adjustment operation on the image block according to the local adjustment parameter information to obtain an adjusted image block; and obtaining an adjusted target image based on the adjusted image block and other image blocks. In this way, performing local image quality adjustment after region segmentation of the image can improve image quality while maintaining image display quality. Attached Figure Description
[0100] Figure 1 This is a flowchart of an image processing method according to an embodiment of the present disclosure.
[0101] Figure 2 This is an example table of image adjustment parameters in an embodiment of this disclosure.
[0102] Figure 3 This is an architectural diagram of an image processing system according to an embodiment of the present disclosure.
[0103] Figure 4This is a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure.
[0104] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0105] 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.
[0106] In image display scenarios, image enhancement algorithms are typically used to globally adjust the image quality. However, this approach may degrade the image display quality.
[0107] For example, when there are dark patterns in a game scene, adjusting the overall content of the image can lead to the loss of details in the shadows and overexposure, thus affecting the final display effect. Therefore, how to improve the details in the shadows of a game scene without compromising the overall display effect remains a significant challenge.
[0108] Based on the deficiencies of the aforementioned related technologies, this disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product, aiming to improve image quality while maintaining image display effects.
[0109] 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.
[0110] 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:
[0111] Step 101: Obtain the grayscale conditions and local adjustment parameter information corresponding to the image to be processed.
[0112] In one implementation, the application currently running in the foreground is identified to obtain the target application; the application interface currently displayed by the target application is determined as the image to be processed.
[0113] For example, the target application could be a game application currently running in the foreground (such as Honor of Kings).
[0114] In practical applications, the image to be processed can be the currently displayed application interface of the target application, or any image that needs image processing. It does not have to be the application interface of the target application. The target application can be the application currently running in the foreground, or any application that has image quality optimization needs, and is not limited to the application currently running in the foreground.
[0115] In one implementation, step 101 can be performed in any of the following ways:
[0116] Method 1: Obtain the grayscale conditions and local adjustment parameters of the target application from the global configuration information of the target application, and determine the grayscale conditions and local adjustment parameters of the target application as the grayscale conditions and local adjustment parameters of the image to be processed.
[0117] As an example, a foreground / background recognition function is added to the game toolbox. Using this function, the target application currently running in the foreground is identified, and the currently displayed application interface of the target application is taken as the image to be processed. The grayscale conditions and local adjustment parameters of the target application are also obtained and determined as the grayscale conditions and local adjustment parameters of the image to be processed.
[0118] Method 2: Obtain the grayscale conditions and local adjustment parameters configured for the image to be processed from the page configuration information corresponding to the image to be processed.
[0119] This allows for personalized settings of grayscale conditions and local adjustment parameters for each image to be processed, or for global settings of grayscale conditions and local adjustment parameters for the target application. Furthermore, different grayscale conditions and local adjustment parameters can be personalized for different target applications. Moreover, for different images to be processed, corresponding grayscale conditions and local adjustment parameters can be set separately according to the type or label of each image (e.g., multiple images of the same scene, or multiple images that are all landscape scenes), without any limitations.
[0120] Optionally, the grayscale condition can be that the grayscale level of the image patch is lower than the grayscale threshold; the grayscale condition can also be that the grayscale level of the image patch is located within a specified grayscale range. One or more specified grayscale ranges can be specified.
[0121] In practical applications, grayscale conditions, grayscale thresholds, and specified grayscale ranges can all be set according to the actual application scenario, and there are no restrictions here.
[0122] In this way, image blocks can be filtered by using grayscale thresholds to identify those with dark areas. Furthermore, image blocks can be filtered more precisely by specifying grayscale ranges, allowing for more refined area adjustments later.
[0123] The local adjustment parameter information is used to adjust the image quality of specific areas, specifically to enhance local image quality, improve the visual effect and detail of the image, such as increasing image sharpness, the sensitivity of contrast between different areas of the image, and preserving shadow details. The local adjustment parameter information includes at least one local adjustment parameter and its corresponding parameter value; the local adjustment parameter includes at least one of the following parameters: sharpening intensity parameter, area contrast intensity parameter, and shadow detail enhancement parameter.
[0124] The sharpening intensity parameter adjusts the sharpness of image edges, making the image appear clearer by enhancing the edges and areas of abrupt grayscale changes. Sharpening does not directly alter the overall brightness of the image; instead, it enhances visual sharpness by increasing edge contrast.
[0125] The regional contrast intensity parameter is used to adjust the sensitivity of contrast between different regions in an image; it focuses on the brightness differences in local areas, rather than increasing the overall brightness. Increasing regional contrast can make specific parts of an image stand out more, but it will not significantly increase the overall brightness.
[0126] The Shadow Detail Enhancement parameter is used to enhance shadow detail in an image. Shadow detail refers to the detailed information retained in darker areas. Enhancing shadow detail usually means improving the visibility and gradation of shadows without sacrificing the overall image quality. This requires fine-tuning brightness and contrast to avoid overexposure or loss of detail in other areas.
[0127] Step 102: Divide the image to be processed into multiple image blocks.
[0128] In one implementation, step 102 can be performed in any of the following ways:
[0129] Method 1: Divide the image to be processed into multiple image blocks according to the set number of divisions.
[0130] The number of divisions is set to a positive integer, which can be set according to the actual application scenario. For example, it can be 9, and there is no restriction here.
[0131] By dividing the image into equal parts and obtaining multiple image blocks of the same size, the processing time for each image block can be kept consistent.
[0132] Method 2: Divide the image to be processed into multiple image blocks according to the specified image block size, so that the size of the divided image blocks is the specified image block size or smaller than the specified image block size.
[0133] The specified image block size can be set according to the actual application scenario, and there is no restriction here.
[0134] Method 3: Divide the image into blocks based on the gray levels of each pixel in the image to be processed.
[0135] In one implementation, the grayscale level of each pixel in the image to be processed is obtained; the image complexity of the image to be processed is determined based on the grayscale level of each pixel; and the image to be processed is divided according to the number of divisions corresponding to the image complexity. The higher the image complexity, the more divisions are required.
[0136] For example, a grayscale histogram can be generated based on the grayscale levels of each pixel in the image to be processed, and the image complexity can be determined based on the distribution in the grayscale histogram. The denser the distribution in the grayscale histogram, the higher the image complexity; conversely, the less dense the distribution, the lower the image complexity.
[0137] Furthermore, the partitioning size of different regions can be determined based on the image complexity of each region in the image to be processed, and image blocks can be divided according to the partitioning size of each region. The higher the image complexity, the smaller the partitioning size, and vice versa.
[0138] In this way, effective region segmentation of the image can be achieved.
[0139] Step 103: Determine the gray level of each image block.
[0140] In one implementation, the following steps are performed for each image block:
[0141] Based on the grayscale level of each pixel in the image block, determine the average or median value of the image block, and use it as the grayscale level of the image block.
[0142] As an example, a grayscale histogram of an image block can be output based on the grayscale level of each pixel in the image block. The average or median value of the image block can then be determined from the grayscale histogram and used as the grayscale level of the image block.
[0143] Furthermore, before performing step 103, the following steps can also be performed: convert the red, green, and blue (RGB) values of each pixel in the image to be processed into grayscale levels.
[0144] In this way, the gray level of each image block can be determined, thereby determining the brightness of the image block.
[0145] Step 104: For each image block, if the grayscale level of the image block meets the grayscale condition, then perform the corresponding image quality adjustment operation on the image block according to the local adjustment parameter information to obtain the adjusted image block.
[0146] Before performing step 104, object detection can also be performed on the image to be processed.
[0147] In one implementation, object detection can be performed on the image to be processed to obtain object detection results; based on the object detection results, an image block containing a target object of a specified type can be determined.
[0148] The target object of the specified type can be set according to the actual application scenario. For example, it can include, but is not limited to, at least one of the following: people, buildings, grass, ground, sky, and background.
[0149] Optionally, different object detection algorithms can be used for different specified types. For example, a face detection model can be used to detect people in an image. There are no restrictions on this.
[0150] Furthermore, object detection can be performed on each image block separately to obtain the object detection results for each image block, i.e., whether each image block contains a target object of a specified type.
[0151] In step 104, a dark detail enhancement algorithm can be used to adjust the image quality based on local adjustment parameter information, such as improving the sharpness of the target object, regional contrast, and dark details.
[0152] Some common algorithms for enhancing shadow detail include histogram equalization, gamma correction, and deep learning methods.
[0153] Histogram equalization, a classic image enhancement method, improves contrast by redistributing pixel values, thereby enhancing details in dark areas. Gamma correction alters an image's brightness and contrast by adjusting its gamma value. When the gamma value is less than 1, the image becomes brighter overall, suitable for low-light enhancement; when the gamma value is greater than 1, the image becomes darker overall, suitable for highlight suppression. Deep learning methods can automatically learn image features and complete the enhancement and restoration of low-light images in a single stage.
[0154] In one implementation, step 104 can be performed in the following manner:
[0155] Method 1: If the image patch does not contain the target object, then the global image quality is adjusted based on the local adjustment parameter information.
[0156] In one implementation, for each local adjustment parameter, the following steps are performed: according to the parameter value corresponding to the local adjustment parameter, the image quality adjustment operation corresponding to the local adjustment parameter is performed on the image block.
[0157] For example, according to the sharpening intensity value corresponding to the sharpening intensity parameter, sharpening processing is performed on image blocks. Specifically, this can be done by enhancing the adjustment of the image edges and grayscale transitions, increasing edge contrast, and making the image look clearer.
[0158] In this way, if the image block does not contain target objects such as people or the sky, the image block can be processed directly.
[0159] Method 2: If the image patch contains the target object, then adjust the image quality of the target object area and the non-target object area in the image patch separately according to the local adjustment parameter information.
[0160] In one implementation method, when executing method two, the following steps can be taken:
[0161] S1041: Based on the parameter values corresponding to the local adjustment parameters, perform the image quality adjustment operation corresponding to the local adjustment parameters for non-target object areas in the image block.
[0162] S1042: If the adjustment object of the local adjustment parameter includes the target object, then determine the gray level corresponding to the target object, adjust the parameter value corresponding to the local adjustment parameter according to the gray level corresponding to the target object, and perform the image quality adjustment operation corresponding to the local adjustment parameter for the target object area in the image block according to the adjusted parameter value.
[0163] In one implementation, the gray class corresponding to the target object can be determined using any of the following methods:
[0164] Method 1: If the image to be processed contains only one target object, then the gray level corresponding to the target object is determined according to the gray level of each pixel in the target object region in at least one image block.
[0165] Method 2: If the image to be processed contains multiple target objects, the gray level corresponding to the target object is determined based on the gray level of each pixel in the target object region corresponding to the multiple target objects in at least one image block.
[0166] In one implementation, the gray level of the target object is obtained based on the average gray level of the target object in multiple image blocks.
[0167] This is because the same target object (e.g., the sky) may be located in one or more image blocks, and the image to be processed may contain multiple identical target objects (e.g., multiple identical buildings). Therefore, by assigning the same target object, or multiple identical target objects, to the same gray level, the same parameter values are used to adjust the image quality of the same target object or multiple identical target objects in different subsequent image blocks. This ensures that the display effect of the same target object or multiple identical target objects in different image blocks does not change significantly, thus ensuring the consistency of the image.
[0168] In one implementation, the color range corresponding to the gray level of the target object is obtained; according to the adjustment coefficient (e.g., 0.8) corresponding to the color range, the parameter value corresponding to the local adjustment parameter is adjusted, and the adjustment coefficient is used to adjust the parameter value, thereby adjusting the image quality enhancement of the image block.
[0169] Furthermore, if corresponding local adjustment parameter information is configured for different images to be processed, the local adjustment parameter information of the current image to be processed is set according to the local adjustment parameter information of the previous image to be processed, so that the local adjustment parameter information of adjacent images is similar, thereby achieving smooth transition of the screen and consistency of changes before and after the screen, such as the consistency of adjacent interfaces of the same application or the consecutive frames of the same video.
[0170] Multiple color ranges can be pre-set according to actual application needs, and corresponding adjustment coefficients can be set for each color range.
[0171] As an example, if the gray level is in the first color range, the parameter value is increased by adjusting the coefficient; if the level is in the second color range, the parameter value is decreased by adjusting the coefficient.
[0172] For example, if the target area is a person's skin and the color is dark, the brightness adjustment range can be increased to make the skin brighter and whiter. On the other hand, if the target area is the background, the brightness adjustment range can be decreased to make the background more realistic.
[0173] This allows for the protection of target objects such as people and ensures the consistency of the target object across different image blocks.
[0174] Specifically, from each specified type of target object, a corresponding adjustment object (i.e., a target object whose image quality can be adjusted) is pre-set for each local adjustment parameter. If the adjustment object of a local adjustment parameter does not include the target object, then no image adjustment is performed on the target object region. The target object region in an image block is the region of the target object within that image block.
[0175] If the same image patch contains multiple target objects, then perform the following steps for each target object:
[0176] If the target object is included in the adjustment object of the local adjustment parameter, the parameter value of the local adjustment parameter is adjusted according to the gray level of the target object contained in the image patch; otherwise, no image adjustment is performed on the target object.
[0177] In this way, only the target object included in the local parameter adjustment will have its corresponding target object area adjusted in terms of image quality.
[0178] In this way, the image to be processed can be divided into regions without making a global adjustment to the entire image.
[0179] Step 105: Obtain the adjusted target image based on the adjusted image patch and other image patches.
[0180] In one implementation, when performing step 105, the following steps may be adopted:
[0181] S1051: The adjusted image blocks, along with other image blocks, are stitched together to obtain a stitched image.
[0182] S1052: Perform edge softening processing on the stitching edges of each image block in the stitched image to obtain the target image; the edge softening processing is used to blur or smooth the stitching edges.
[0183] Among them, the edge softening algorithm reduces sharpness by blurring or smoothing the edges of the image, making the image look softer and more natural. By softening the texture of each stitching edge, it can avoid the inconsistency of image segmentation caused by image quality adjustment operations such as enhancing dark details.
[0184] The core of edge smoothing algorithms lies in the processing of pixels at the image edges. Typically, such algorithms consider the value of each pixel and its surrounding pixels, updating the current pixel's value by calculating a weighted average of these pixel values. The goal is to reduce the contrast of sharp edges in the image, making them appear smoother and more natural.
[0185] Furthermore, the target image can be further adjusted globally to improve its display effect.
[0186] In one embodiment, global adjustment parameter information corresponding to the image to be processed is obtained; based on the global adjustment parameter information, at least one of the following operations is performed on the target image: global color style adjustment, super-resolution enhancement, and inverse tone mapping processing. The global adjustment parameters include at least one of the following: global color style adjustment, super-resolution enhancement, and inverse tone mapping processing.
[0187] Global color style adjustment is used to create an overall visual style in a design through unified color matching, hue, saturation, and brightness. It requires maintaining color consistency and harmony throughout the design.
[0188] Super-resolution enhancement refers to the process of converting low-resolution images into high-resolution images using algorithms and techniques. It can restore or supplement missing high-frequency details (i.e., lost information) in an image, thereby improving its clarity and quality. Some methods of super-resolution enhancement include interpolation-based methods and reconstruction-based methods. Interpolation-based methods include nearest-neighbor interpolation, linear interpolation, and bicubic interpolation. Reconstruction-based methods include frequency domain methods and spatial domain methods.
[0189] The Standard Dynamic Range to High Dynamic Range (SDR2HDR) algorithm is a technique that converts Standard Dynamic Range (SDR) video into High Dynamic Range (HDR) video. The core goal of SDR2HDR is to improve the dynamic range, color gamut, and bit depth of the video to achieve higher quality content. By restoring details in overexposed or underexposed areas and enhancing color performance, the final HDR video more closely resembles the human eye's perception of natural scenes in terms of brightness and color.
[0190] The following is combined with Figure 2 Examples are provided illustrating the adjustment objects for multiple image adjustment parameters used in image processing. See also... Figure 2 The table shown is an example of image adjustment parameters. Image adjustment parameters include local adjustment parameters and global adjustment parameters.
[0191] Where 0 indicates that the image adjustment parameters will not be used, 1 indicates local use, and 2 indicates global use. It can be seen that... Figure 2 In this process, the local adjustment parameter that can be applied to the image to be processed is the shadow detail enhancement parameter, which can adjust the image quality of each target object. Global color style adjustment, super-resolution enhancement, and inverse tone mapping can all be used to perform global image quality adjustments on the image to be processed.
[0192] The following is combined with Figure 3 This section provides examples of image processing systems used to illustrate image processing methods. (See also...) Figure 3 The diagram shown is an architecture diagram of an image processing system. Figure 3The system includes an image information acquisition module, a configuration information acquisition module, an external data processor unit, and a panel. The panel is used to output the target image.
[0193] The image information acquisition module includes an image acquisition module, a color conversion module, and a histogram module.
[0194] The image acquisition module is used to acquire the image to be processed. The color conversion module is used to convert the RGB values of each pixel in the image to grayscale levels. The histogram module is used to generate a grayscale histogram of the image to be processed based on the grayscale levels of each pixel.
[0195] Configuration information acquisition module: This module identifies the target application currently running in the foreground and reads its grayscale conditions and image adjustment parameters. For example, the target application could be Honor of Kings, Genshin Impact, Star Railway, or PUBG Mobile. The grayscale conditions and image adjustment parameters for different target applications can be customized according to actual application needs.
[0196] The external data processing unit (DPU) calls both the local adjustment module and the global adjustment module to perform image adjustments. The local adjustment module includes: a target recognition module, a region segmentation module, and an image patch adjustment module. The global adjustment module includes: an image stitching module, an edge softening module, and an effect enhancement module.
[0197] The system comprises the following modules: Target Recognition Module (RDM) for identifying target objects in the image; Region Segmentation Module for segmenting the image into multiple image patches; Image Patch Adjustment Module for adjusting local image patches that meet grayscale criteria, such as enhancing dark detail; Image Stitching Module for stitching the image patches together; Edge Softening Module for softening the stitching edges between image patches in the stitched image; and Effect Enhancement Module for global image effect processing of the target image through global parameter adjustments.
[0198] in, Figure 3 When each module of the image processing system is executed, the specific operations can be found in steps 101-105 above, and no restrictions are imposed here.
[0199] In this embodiment, the image is segmented into regions, and local image adjustments are made only to image blocks that meet grayscale conditions (e.g., darker grayscale). This improves local image quality (e.g., enhances texture details in dark areas) without affecting the display effect of other areas. Furthermore, if the image block contains a target object, the target object area and non-target object areas in the image block can be adjusted separately using different methods. This protects the target object and ensures the consistency of the same target object in each image block. Moreover, by softening the stitching edges in the stitched image, inconsistencies such as image segmentation caused by image quality adjustments such as enhancing dark details can be avoided. Furthermore, by globally adjusting the target image, the image display effect of the target image can be improved, thus balancing image quality with display effect.
[0200] 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.
[0201] See Figure 4 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:
[0202] The acquisition unit 401 is used to acquire the grayscale conditions and local adjustment parameter information corresponding to the image to be processed;
[0203] The partitioning unit 402 is used to partition the image to be processed into multiple image blocks;
[0204] Determining unit 403 is used to determine the gray level of each image block;
[0205] The adjustment unit 404 is used to perform corresponding image quality adjustment operations on each image block according to the local adjustment parameter information if the gray level of the image block meets the gray level conditions, so as to obtain the adjusted image block.
[0206] The obtaining unit 405 is used to obtain the adjusted target image based on the adjusted image block and other image blocks.
[0207] In one embodiment, the acquisition unit 401 is further configured to:
[0208] Identify the currently running applications in the foreground to obtain the target application;
[0209] The currently displayed application interface of the target application is identified as the image to be processed.
[0210] In one embodiment, the acquisition unit 401 is used for:
[0211] From the global configuration information corresponding to the target application, obtain the grayscale conditions and local adjustment parameters corresponding to the target application, and determine the grayscale conditions and local adjustment parameters corresponding to the target application as the grayscale conditions and local adjustment parameters corresponding to the image to be processed.
[0212] Obtain the grayscale conditions and local adjustment parameters configured for the image to be processed from the page configuration information corresponding to the image to be processed.
[0213] In one embodiment, the partitioning unit 402 is used for:
[0214] Obtain the grayscale level of each pixel in the image to be processed;
[0215] The image complexity of the image to be processed is determined based on the gray level of each pixel in the image to be processed.
[0216] The image to be processed is divided according to the number of divisions corresponding to the image complexity.
[0217] In one embodiment, the partitioning unit 402 is used for:
[0218] The image to be processed is divided equally according to the set number of divisions to obtain multiple image blocks.
[0219] In one implementation, the grayscale condition is that the grayscale level of the image block is lower than the grayscale threshold; or, the grayscale condition is that the grayscale level of the image block is located within a specified grayscale range.
[0220] In one embodiment, the local adjustment parameter information includes at least one local adjustment parameter and its corresponding parameter value;
[0221] Local adjustment parameters include at least one of the following parameters: sharpening intensity parameter, area contrast intensity parameter, and shadow detail enhancement parameter;
[0222] Among them, the sharpening intensity parameter is used to adjust the sharpness of image edges; the regional contrast intensity parameter is used to adjust the sensitivity of contrast in different regions of the image; and the shadow detail enhancement parameter is used to enhance the shadow details in the image.
[0223] In one embodiment, the adjustment unit 404 is further configured to:
[0224] Perform object detection on the image to be processed and obtain the object detection results;
[0225] Based on the object detection results, identify image patches containing target objects of a specified type;
[0226] Adjustment unit 404 is used for:
[0227] If the image patch does not contain the target object, then the global image quality is adjusted based on the local adjustment parameter information.
[0228] If the image patch contains a target object, then the image quality is adjusted separately for the target object region and the non-target object region in the image patch based on the local adjustment parameter information.
[0229] In one embodiment, the adjustment unit 404 is used to:
[0230] Based on the parameter values corresponding to the local adjustment parameters, perform the image quality adjustment operation corresponding to the local adjustment parameters for non-target object areas in the image patch;
[0231] If the adjustment object of the local adjustment parameter includes the target object, then the gray level corresponding to the target object is determined, and the parameter value corresponding to the local adjustment parameter is adjusted according to the gray level corresponding to the target object. Then, according to the adjusted parameter value, the image quality adjustment operation corresponding to the local adjustment parameter is performed on the target object area in the image block.
[0232] In one embodiment, the adjustment unit 404 is used to:
[0233] If the image to be processed contains only one target object, the gray level corresponding to the target object is determined according to the gray level of each pixel in the target object region in at least one image block.
[0234] If the image to be processed contains multiple target objects, the gray level corresponding to the target object is determined based on the gray level of each pixel in the target object region corresponding to the multiple target objects in at least one image block.
[0235] In one embodiment, the adjustment unit 404 is used to:
[0236] Get the color range corresponding to the gray level of the target object;
[0237] Adjust the parameter values corresponding to the local adjustment parameters based on the adjustment coefficients corresponding to the color range.
[0238] In one embodiment, the obtaining unit 405 is used to:
[0239] The adjusted image blocks, along with other image blocks, are stitched together to obtain a stitched image.
[0240] Edge softening processing is applied to the stitching edges of each image block in the stitched image to obtain the target image; edge softening processing is used to blur or smooth the stitching edges.
[0241] In one embodiment, the obtaining unit 405 is further configured to:
[0242] Obtain the global adjustment parameter information corresponding to the image to be processed;
[0243] Based on the global adjustment parameter information, perform at least one of the following operations on the target image:
[0244] Global color style adjustment, super-resolution enhancement, and inverse tone mapping processing.
[0245] The image processing method in this embodiment includes obtaining grayscale conditions and local adjustment parameter information corresponding to the image to be processed; dividing the image to be processed into multiple image blocks; determining the grayscale level of each image block; for each image block, if the grayscale level of the image block meets the grayscale conditions, then performing a corresponding image quality adjustment operation on the image block according to the local adjustment parameter information to obtain an adjusted image block; and obtaining an adjusted target image based on the adjusted image block and other image blocks. In this way, performing local image quality adjustment after region segmentation of the image can improve image quality while maintaining image display quality.
[0246] In this embodiment of the disclosure, an electronic device is also provided, including:
[0247] Processor; and
[0248] The memory stores computer instructions that cause the processor to execute the methods of any of the above-described embodiments.
[0249] 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.
[0250] 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.
[0251] Figure 5 A schematic diagram of the structure of an electronic device 5000 is shown. (See also...) Figure 5As shown, the electronic device 5000 includes a processor 5010 and a memory 5020, and optionally may also include a power supply 5030, a display unit 5040, and an input unit 5050.
[0252] The processor 5010 is the control center of the electronic device 5000. It connects various components through various interfaces and lines, and performs various functions of the electronic device 5000 by running or executing software programs and / or data stored in the memory 5020, thereby performing overall monitoring of the electronic device 5000.
[0253] In this embodiment of the present disclosure, the processor 5010 executes the steps in the above embodiments when it calls the computer program stored in the memory 5020.
[0254] Optionally, processor 5010 may include one or more processing units; preferably, processor 5010 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 5010. 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.
[0255] The memory 5020 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 5000, etc. In addition, the memory 5020 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, etc.
[0256] Electronic device 5000 also includes a power supply 5030 (such as a battery) that supplies power to various components. The power supply can be logically connected to processor 5010 through a power management system, thereby enabling the management of charging, discharging, and power consumption.
[0257] The display unit 5040 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 5000. In this embodiment, it is mainly used to display the display interfaces of various applications in the electronic device 5000, as well as text, images, and other objects displayed on the display interfaces. The display unit 5040 may include a display panel 5041. The display panel 5041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0258] The input unit 5050 can be used to receive information such as numbers or characters input by the user. The input unit 5050 may include a touch panel 5051 and other input devices 5052. The touch panel 5051, also known as a touch screen, can collect touch operations on or near 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 5051).
[0259] Specifically, the touch panel 5051 can detect user touch operations and the signals generated by these operations, convert them into touch point coordinates, send them to the processor 5010, and receive and execute commands from the processor 5010. Furthermore, the touch panel 5051 can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave sensors. Other input devices 5052 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.
[0260] Of course, the touch panel 5051 can cover the display panel 5041. When the touch panel 5051 detects a touch operation on or near it, it transmits the information to the processor 5010 to determine the type of touch event. Subsequently, the processor 5010 provides corresponding visual output on the display panel 5041 according to the type of touch event. Although in Figure 5 In this embodiment, the touch panel 5051 and the display panel 5041 are two separate components to realize the input and output functions of the electronic device 5000. However, in some embodiments, the touch panel 5051 and the display panel 5041 can be integrated to realize the input and output functions of the electronic device 5000.
[0261] The electronic device 5000 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 5000 may also include other components such as a camera. Since these components are not the focus of this disclosure, they will not be discussed further. Figure 5 It is not shown in the text and will not be described in detail here.
[0262] Those skilled in the art will understand that Figure 5 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.
[0263] 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: Obtain the grayscale conditions and local adjustment parameter information of the image to be processed; The image to be processed is divided into multiple image blocks; Determine the gray level of each image patch; For each image block, if the grayscale level of the image block meets the grayscale condition, then according to the local adjustment parameter information, the corresponding image quality adjustment operation is performed on the image block to obtain the adjusted image block; Based on the adjusted image blocks and other image blocks, the adjusted target image is obtained.
2. The method according to claim 1, characterized in that, Before obtaining the grayscale conditions and local adjustment parameter information corresponding to the image to be processed, the method further includes: Identify the currently running applications in the foreground to obtain the target application; The currently displayed application interface of the target application is identified as the image to be processed.
3. The method according to claim 2, characterized in that, The process of obtaining the grayscale conditions and local adjustment parameter information corresponding to the image to be processed includes: From the global configuration information corresponding to the target application, obtain the grayscale conditions and local adjustment parameters corresponding to the target application, and determine the grayscale conditions and local adjustment parameters corresponding to the target application as the grayscale conditions and local adjustment parameters corresponding to the image to be processed; or... Obtain the grayscale conditions and local adjustment parameters configured for the image to be processed from the page configuration information corresponding to the image to be processed.
4. The method according to claim 1, characterized in that, The process of dividing the image to be processed into multiple image blocks includes: Obtain the grayscale level of each pixel in the image to be processed; The image complexity of the image to be processed is determined based on the gray level of each pixel in the image to be processed. The image to be processed is divided according to the number of divisions corresponding to the image complexity.
5. The method according to claim 1, characterized in that, The process of dividing the image to be processed into multiple image blocks includes: The image to be processed is divided equally according to the set number of divisions to obtain multiple image blocks.
6. The method according to claim 1, characterized in that, The grayscale condition is that the grayscale level of the image patch is lower than the grayscale threshold; or... The grayscale condition is that the grayscale level of the image block is located within a specified grayscale range.
7. The method according to claim 1, characterized in that, The local adjustment parameter information includes at least one local adjustment parameter and its corresponding parameter value; The local adjustment parameters include at least one of the following parameters: sharpening intensity parameter, area contrast intensity parameter, and shadow detail enhancement parameter; The sharpening intensity parameter is used to adjust the sharpness of image edges; the regional contrast intensity parameter is used to adjust the sensitivity of contrast in different regions of the image; and the dark detail enhancement parameter is used to enhance the dark details in the image.
8. The method according to any one of claims 1-7, characterized in that, Before performing corresponding image quality adjustment operations on the image patch based on the local adjustment parameter information to obtain the adjusted image patch, the method further includes: Perform object detection on the image to be processed to obtain object detection results; Based on the object detection results, an image patch containing a target object of a specified type is determined; The step of performing a corresponding image quality adjustment operation on the image block according to the local adjustment parameter information to obtain the adjusted image block includes: If the image patch does not contain the target object, then the global image quality is adjusted based on the local adjustment parameter information. If the image block contains the target object, then the image quality is adjusted for the target object region and the non-target object region in the image block respectively according to the local adjustment parameter information.
9. The method according to claim 8, characterized in that, The step of adjusting the image quality of the target object region and non-target object region in the image patch according to the local adjustment parameter information includes: Based on the parameter values corresponding to the local adjustment parameters, perform the image quality adjustment operation corresponding to the local adjustment parameters for the non-target object regions in the image block; If the adjustment object of the local adjustment parameter includes the target object, then the gray level corresponding to the target object is determined, and the parameter value corresponding to the local adjustment parameter is adjusted according to the gray level corresponding to the target object. Then, according to the adjusted parameter value, the image quality adjustment operation corresponding to the local adjustment parameter is performed on the target object area in the image block.
10. The method according to claim 9, characterized in that, Determining the gray class corresponding to the target object includes: If the image to be processed contains only one target object, then the gray level corresponding to the target object is determined according to the gray level of each pixel in the target object region corresponding to the target object in at least one image block; If the image to be processed contains multiple target objects, the gray level corresponding to the target object is determined based on the gray level of each pixel in the target object region corresponding to the multiple target objects in at least one image block.
11. The method according to claim 9, characterized in that, The step of adjusting the parameter value corresponding to the local adjustment parameter according to the gray level corresponding to the target object includes: Obtain the color range corresponding to the gray level of the target object; The parameter values corresponding to the local adjustment parameters are adjusted according to the adjustment coefficients corresponding to the color range.
12. The method according to any one of claims 1-7, characterized in that, The step of obtaining the adjusted target image based on the adjusted image patch and other image patches includes: The adjusted image blocks, along with other image blocks, are stitched together to obtain a stitched image; The stitching edges of each image block in the stitched image are softened to obtain the target image; the edge softening process is used to blur or smooth the stitching edges.
13. The method according to any one of claims 1-7, characterized in that, After obtaining the adjusted target image based on the adjusted image patch and other image patches, the method further includes: Obtain the global adjustment parameter information corresponding to the image to be processed; Based on the global adjustment parameter information, perform at least one of the following operations on the target image: global color style adjustment, super-resolution enhancement, and inverse tone mapping processing.
14. An image processing apparatus, characterized in that, The device includes: The acquisition unit is used to acquire the grayscale conditions and local adjustment parameter information of the image to be processed. A segmentation unit is used to segment the image to be processed to obtain multiple image blocks; The determination unit is used to determine the grayscale level of each image block. The adjustment unit is used to perform a corresponding image quality adjustment operation on each image block according to the local adjustment parameter information if the gray level of the image block meets the gray level condition, so as to obtain the adjusted image block. The obtaining unit is used to obtain the adjusted target image based on the adjusted image block and other 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.