Image contrast enhancement method and device, computer device and chip

By identifying the semantic category of each pixel in the image and determining the target enhancement intensity, and combining the basic and additional enhancement intensities for contrast enhancement processing, the problems of noise amplification and noise stretching in local contrast enhancement methods are solved, thus improving image quality.

CN122115288APending Publication Date: 2026-05-29SPREADTRUM COMM (TIANJIN) INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SPREADTRUM COMM (TIANJIN) INC
Filing Date
2026-02-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing local contrast enhancement methods suffer from noise amplification and local noise stretching issues in image processing, resulting in unsatisfactory contrast enhancement effects.

Method used

By identifying the semantic category of each pixel in the image and determining the target enhancement intensity of each pixel based on the semantic category and brightness value, contrast enhancement processing is performed by combining the base enhancement intensity and the additional enhancement intensity to ensure that the enhancement intensity matches the scene content in the image patch.

Benefits of technology

It improves noise amplification and local noise stretching issues, enhances the image quality after contrast enhancement, and improves the processing effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115288A_ABST
    Figure CN122115288A_ABST
Patent Text Reader

Abstract

The application relates to an image contrast enhancement method and device, computer equipment and a chip. The method comprises the following steps: acquiring a to-be-processed image, and identifying a semantic category to which each pixel point in the to-be-processed image belongs; performing block processing on the to-be-processed image to obtain at least one image block; for each image block, determining a target enhancement intensity of each pixel point in the image block according to the semantic category to which each pixel point in the image block belongs; and performing contrast enhancement processing on the corresponding pixel point according to the target enhancement intensity of the pixel point. The application can improve the contrast enhancement processing effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image technology, and in particular to an image contrast enhancement method, apparatus, computer device, and chip. Background Technology

[0002] Image contrast enhancement is a technique widely used in many fields such as image processing and display technology. It aims to increase the brightness difference between different areas in an image, thereby making the picture look clearer and easier for the observer to distinguish details.

[0003] Currently, image contrast enhancement techniques are generally divided into global contrast enhancement and local contrast enhancement. Global contrast enhancement improves the overall contrast of an image without considering local regional differences; therefore, it may amplify noise and cause overly dark / overly bright areas. Local contrast enhancement divides the image into several blocks, enhancing the contrast of each block independently, making it suitable for images with varying brightness. It is evident that local contrast enhancement, compared to global contrast enhancement, considers local regional differences and can, to some extent, improve the problems of noise amplification and overly dark / overly bright areas.

[0004] However, after using local contrast enhancement to enhance the image contrast, there are still problems such as noise amplification and noise stretching in local areas of the image block. Therefore, the contrast enhancement effect is still not ideal. Summary of the Invention

[0005] Therefore, it is necessary to provide an image contrast enhancement method, apparatus, computer equipment, and chip that can improve the contrast enhancement processing effect in response to the above-mentioned technical problems.

[0006] In a first aspect, this application provides an image contrast enhancement method, comprising: acquiring an image to be processed and identifying the semantic category to which each pixel in the image to be processed belongs; dividing the image to be processed into blocks to obtain at least one image block; for each image block, determining the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs; and performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel.

[0007] In one embodiment, determining the target enhancement intensity of each pixel in an image block based on the semantic category to which each pixel belongs includes: determining the base enhancement intensity of each pixel in the image block based on the brightness value of each pixel in the image block; determining the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel belongs; and determining the target enhancement intensity of the corresponding pixel based on the base enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

[0008] In one embodiment, determining the additional enhancement intensity corresponding to an image block based on the semantic category to which each pixel in the image block belongs includes: determining the category features of the image block based on the semantic category to which each pixel in the image block belongs; determining the statistical features of the image block based on the pixel attribute statistics of the image block; and determining the additional enhancement intensity corresponding to the image block based on the category features and the statistical features.

[0009] In one embodiment, determining the category features of an image block based on the semantic category to which each pixel belongs includes: determining the percentage of pixels in the image block corresponding to each semantic category; and determining the category features of the image block based on the percentage of pixels in the image block corresponding to each semantic category.

[0010] In one embodiment, determining the category features of an image patch based on the proportion of pixels corresponding to each semantic category in the image patch includes: obtaining the category weights corresponding to different semantic categories; and determining the category features of the image patch based on the proportion of pixels corresponding to each semantic category in the image patch and the category weights corresponding to each semantic category.

[0011] In one embodiment, determining the statistical characteristics of an image block based on the pixel attribute statistics of the image block includes: performing statistics on the pixel attributes of the image block in different dimensions to obtain statistical results for the corresponding dimensions; and determining the statistical characteristics of the image block based on the statistical results of the image block in different dimensions.

[0012] In one embodiment, the target enhancement intensity includes a first target intensity corresponding to the pixel brightness and a second target intensity corresponding to the brightness of each color channel. Accordingly, based on the target enhancement intensity of the pixel, the corresponding pixel is subjected to contrast enhancement processing, including: determining the comprehensive enhancement intensity of the pixel in the corresponding color channel based on the first target intensity and the second target intensity of the pixel in each color channel; and performing contrast enhancement processing on the pixel in the corresponding color channel based on the comprehensive enhancement intensity of the pixel in each color channel.

[0013] Secondly, this application provides an image contrast enhancement device, comprising: an image acquisition module for acquiring an image to be processed and identifying the semantic category to which each pixel in the image to be processed belongs; a block processing module for performing block processing on the image to be processed to obtain at least one image block; an intensity enhancement module for determining the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs; and an enhancement processing module for performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel.

[0014] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect.

[0015] Fourthly, this application also provides a chip, including a processor and a communication interface, wherein the processor is configured to cause the chip to perform the steps of the method provided in the first aspect.

[0016] Fifthly, this application also provides a chip module, including a communication module, a power module, a storage module, and a chip, wherein: the power module is used to provide electrical energy to the chip module; the storage module is used to store data and instructions; the communication module is used for internal communication within the chip module, or for communication between the chip module and external devices; and the chip is used to perform the steps of the method provided in the first aspect above.

[0017] In a sixth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.

[0018] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect.

[0019] The aforementioned image contrast enhancement method, apparatus, computer equipment, and chip identify the semantic category of each pixel in the image to be processed, thereby determining the scene content corresponding to that pixel. Next, for each image block in the image to be processed, the target enhancement intensity of each pixel in the image block is determined based on the semantic category of each pixel in the image block. That is, the semantic category of each pixel in the image block is considered when determining the target enhancement intensity of a pixel, so that the target enhancement intensity of the pixel matches the scene content in the image block. Thus, after enhancing the contrast of the pixel using the target enhancement intensity, noise amplification and local noise stretching problems can be improved, thereby improving the image quality after contrast enhancement and enhancing the contrast enhancement processing effect. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating an image contrast enhancement method in one embodiment;

[0022] Figure 2 This is a flowchart illustrating the target enhancement intensity determination step in one embodiment;

[0023] Figure 3 This is a flowchart illustrating the additional reinforcement strength determination step in one embodiment;

[0024] Figure 4 This is a flowchart illustrating the category feature determination steps in one embodiment;

[0025] Figure 5 This is a flowchart illustrating the category feature determination steps in one embodiment;

[0026] Figure 6 This is a flowchart illustrating the statistical feature determination steps in one embodiment;

[0027] Figure 7 This is a flowchart illustrating the contrast enhancement processing steps in one embodiment;

[0028] Figure 8 This is a structural block diagram of an image contrast enhancement device in one embodiment;

[0029] Figure 9 This is an internal structural diagram of a computer device in one embodiment;

[0030] Figure 10 This is an internal structure diagram of a chip module in one embodiment. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0032] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0033] In one exemplary embodiment, an image contrast enhancement method is provided, see [link to example]. Figure 1 The image contrast enhancement method includes:

[0034] S110: Obtain the image to be processed and identify the semantic category of each pixel in the image to be processed.

[0035] The image to be processed is the image that needs to undergo contrast enhancement.

[0036] The semantic category can be understood as the category of scene content in the image to be processed. For example, if the image to be processed includes scene content such as blue sky, grass, people, and white clouds, then the semantic categories include blue sky category, grass category, people category, and white cloud category, etc. Of course, the semantic category can also be other categories, and there is no limit to the number of semantic categories.

[0037] In real-world scenarios, semantic segmentation techniques can be used to semantically segment an image, resulting in multiple semantic segmentation regions. Based on each semantic segmentation region, the semantic category of each pixel in the image can be determined. For example, if multiple semantic segmentation regions include a blue sky region, a grass region, a people region, and a white cloud region, then each pixel in the blue sky region belongs to the blue sky category, each pixel in the grass region belongs to the grass category, each pixel in the people region belongs to the people category, and each pixel in the white cloud region belongs to the white cloud category.

[0038] S120, the image to be processed is divided into blocks to obtain at least one image block.

[0039] The image to be processed can be uniformly divided into multiple rectangular blocks, each with a size of N×N, where N is a positive integer greater than or equal to 1.

[0040] For example, the image to be processed is divided into 16 image blocks, each of which is 3×3 in size, that is, each image block has 9 pixels.

[0041] Of course, it is also possible not to divide the image into uniform blocks, that is, each image block contains a different number of pixels. The specific block division method can be set as needed, and there is no limitation here.

[0042] S130, for each image block, determine the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel belongs.

[0043] The target enhancement intensity can be understood as the contrast enhancement intensity under the influence of semantic category.

[0044] For example, for a 3×3 image block, the semantic category to which the 9 pixels in the image block belong is used to determine the target enhancement intensity of each pixel in the image block.

[0045] S140 performs contrast enhancement processing on the corresponding pixels based on the target enhancement intensity of the pixels.

[0046] That is, for each pixel in the image block, contrast enhancement processing is performed on that pixel according to the target enhancement intensity. After the contrast enhancement processing of each pixel in the image to be processed is completed, the contrast-enhanced image corresponding to the image to be processed is obtained.

[0047] One method for enhancing the contrast of a pixel can be to multiply the initial brightness of the pixel by the target enhancement intensity to obtain the target brightness, and then use the target brightness instead of the initial brightness. Of course, other methods can be used to achieve contrast enhancement based on the target enhancement intensity, and these are not limited here.

[0048] The aforementioned image contrast enhancement method identifies the semantic category of each pixel in the image to be processed, thereby determining the scene content corresponding to that pixel. Next, for each image block in the image to be processed, the target enhancement intensity of each pixel in the image block is determined based on the semantic category of each pixel within that block. That is, the determination of the target enhancement intensity of a pixel takes into account the semantic category of each pixel in the image block, ensuring that the target enhancement intensity of the pixel matches the scene content of the image block. Thus, after enhancing the contrast of the pixels using the target enhancement intensity, the problems of noise amplification and local noise stretching can be improved, thereby enhancing the image quality after contrast enhancement and improving the contrast enhancement processing effect.

[0049] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the target enhancement intensity determination step in S130 is refined.

[0050] See Figure 2 The detailed steps for determining the target enhancement intensity include:

[0051] S210, determine the basic enhancement intensity of each pixel in the image block based on the brightness value of each pixel in the image block.

[0052] The base enhancement intensity can be understood as the contrast enhancement intensity determined without considering semantic categories.

[0053] Among them, adaptive histogram equalization algorithm, local Laplacian filtering algorithm or other local contrast enhancement methods can be used to determine the basic enhancement intensity of each pixel in the image block.

[0054] For example, for each image patch, an adaptive histogram equalization algorithm is used to determine the corresponding mapping data, which reflects the mapping relationship between different brightness values ​​and different base enhancement intensities. Then, based on the brightness value of each pixel in the image patch, the corresponding base enhancement intensity is found in the mapping data corresponding to the image patch.

[0055] Different image blocks correspond to different mapping data.

[0056] The mapping data can be a curve with luminance as the independent variable and base enhancement intensity as the dependent variable. Alternatively, the mapping data can be a mapping table storing the base enhancement intensity corresponding to different luminance values. Of course, the mapping data can also take other forms, which are not limited here.

[0057] In one optional implementation, the brightness value of each pixel may include the pixel's overall brightness (also known as the total brightness) and the brightness components of the pixel in each color channel. Thus, the base enhancement intensity of the pixel may include the first base enhancement intensity corresponding to the pixel's overall brightness in the mapping data, and the second base enhancement intensity corresponding to the pixel's brightness components in each color channel in the mapping data.

[0058] Specifically, the overall brightness can be represented by the Y (luminance component) of the pixel in the YCrCb channel. Here, Cr represents the red chromaticity and Cb represents the blue chromaticity.

[0059] The luminance components of each color channel can be understood as the luminance components of the pixel in RGB, corresponding to R (red color channel), G (green color channel) and B (blue color channel).

[0060] As can be seen, for each pixel, we can obtain a first basic enhancement intensity and three second basic enhancement intensities corresponding to the R, G, and B color channels.

[0061] S220, determine the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel in the image block belongs.

[0062] The additional enhancement intensity can be understood as the contrast enhancement intensity determined taking into account semantic categories.

[0063] The additional enhancement intensity corresponding to an image block can be determined in various ways based on the semantic category to which each pixel in the image block belongs, and no specific method is specified here.

[0064] S230, determine the target enhancement intensity of the corresponding pixel based on the basic enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

[0065] Specifically, the target enhancement intensity of a pixel can be obtained by weighted summing of the base enhancement intensity and the additional enhancement intensity corresponding to the image block.

[0066] For example, the target enhancement intensity corresponding to pixel a is calculated using the following formula:

[0067] F = B * PP + (1 - PP) * T

[0068] In the formula, F is the target enhancement intensity of pixel a, B is the basic enhancement intensity of pixel a, T is the additional enhancement intensity corresponding to the image block where pixel a is located, and PP is the preset weight.

[0069] Specifically, the first target intensity can be obtained by weighted summing the first base enhancement intensity of a pixel with the additional enhancement intensity of the image block containing that pixel; the second target intensity of the pixel in each color channel can be obtained by weighted summing the second base enhancement intensity of the pixel with the additional enhancement intensity of the image block containing that pixel. Therefore, the target enhancement intensity includes a first target intensity and the second target intensity corresponding to each color channel.

[0070] In this embodiment, during the process of determining the target enhancement strength, the basic enhancement strength is adjusted according to the additional enhancement strength determined based on the semantic category to obtain the target enhancement strength, thereby improving the rationality of the target enhancement strength and thus improving the effect of subsequent enhancement processing.

[0071] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the additional reinforcement strength in S220 is refined.

[0072] See Figure 3 The detailed steps for determining additional reinforcement strength include:

[0073] S310, determine the category features of the image block based on the semantic category to which each pixel in the image block belongs.

[0074] Among them, the category features of image patches can reflect the comprehensive semantic category of image patches.

[0075] In this context, each image patch corresponds to a category feature.

[0076] S320, determine the statistical characteristics of the image block based on the pixel attribute statistics of the image block.

[0077] Pixel attributes can include brightness, color, or other attributes.

[0078] Among them, statistical features can reflect the statistical situation of pixel attributes of each pixel in the image block.

[0079] In this context, each image patch corresponds to a statistical feature.

[0080] S330 determines the additional enhancement intensity corresponding to the image patch based on category features and statistical features.

[0081] For each image patch, the weighted sum of its categorical and statistical features yields the corresponding additional enhancement intensity. Specifically, the additional enhancement intensity is calculated using the following formula:

[0082] T = u × L + (1 - u) × Xp

[0083] In the formula, T represents the additional enhancement intensity, u represents the preset weight, L represents the categorical feature, and Xp represents the statistical feature.

[0084] Of course, other methods can be used to determine the additional enhancement intensity based on category and statistical characteristics, which are not limited here.

[0085] In this embodiment, the additional enhancement intensity is determined based on category features and statistical features. Category features reflect the comprehensive semantic category of the image patch, while statistical features reflect the statistical situation of the pixel attributes of each pixel in the image patch. It can be seen that determining the additional enhancement intensity from both semantic category and pixel attributes can improve the accuracy of the additional enhancement intensity.

[0086] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the category feature determination step in S310 is refined.

[0087] See Figure 4 The detailed steps for determining category features include:

[0088] S410, determine the percentage of pixels corresponding to each semantic category in the image block based on the semantic category to which each pixel belongs.

[0089] The percentage of pixels corresponding to each semantic category in an image block is the ratio between the number of pixels belonging to that semantic category in the image block and the total number of pixels in the image block.

[0090] S420, determine the category features of the image patch based on the proportion of pixels corresponding to each semantic category in the image patch.

[0091] For example, in an image patch, the percentage of pixels corresponding to the blue sky category is a1, the percentage of pixels corresponding to the white clouds category is a2, the percentage of pixels corresponding to the grass category is a3, and the percentage of pixels corresponding to the people category is a4. Based on a1, a2, a3, and a4, the category features of the image patch are determined.

[0092] In this embodiment, the proportion of pixels corresponding to each semantic category in the image block can reflect the size of the area occupied by different semantic categories. Therefore, the category features determined based on the proportion of pixels corresponding to each semantic category in the image block can accurately reflect the comprehensive semantic category of the image block.

[0093] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the category feature determination step in S420 is refined.

[0094] See Figure 5 The detailed steps for determining category features include:

[0095] S510, obtain the category weights corresponding to different semantic categories.

[0096] Among them, the category weight corresponding to the semantic category reflects the importance of the semantic category.

[0097] The category weights corresponding to semantic categories can be preset, and the corresponding category weights can be set according to the texture intensity of the scene content corresponding to the semantic category, that is, the importance of the semantic category is reflected by the texture intensity.

[0098] For example, the semantic categories can be sorted according to texture intensity, from low to high. The sorting result is: blue sky and white clouds (lowest texture intensity), grass (moderate texture intensity), and people (highest texture intensity). Therefore, the weight of the blue sky and white clouds categories is 0.3, the weight of the grass category is 0.5, and the weight of the people category is 0.7.

[0099] Understandably, higher category weights are assigned to semantic categories with higher texture intensity, while lower category weights are assigned to semantic categories with lower texture intensity. This way, based on the calculated category features, the noise stretching problem in local areas can be further improved, thereby further enhancing the contrast enhancement effect.

[0100] S520, determine the category features of the image patch based on the proportion of pixels corresponding to each semantic category and the category weight corresponding to each semantic category.

[0101] The process of determining the category features of an image patch may include: weighting and summing the percentage of pixels corresponding to each semantic category and the category weights corresponding to each semantic category in the image patch to obtain a first value; summing the category weights corresponding to each semantic category to obtain a second value; and using the ratio of the first value to the second value as the category feature of the image patch. That is, the category features of the image patch are calculated using the following formula:

[0102]

[0103] In the formula, L represents the category feature of the image patch. The category weight corresponding to the i-th semantic category is... This represents the percentage of pixels corresponding to the i-th semantic category.

[0104] For example, the calculation result of (a1×0.3+a2×0.3+a3×0.5+a4×0.7) / (0.3+0.3+0.5+0.7) is used as the category feature of the image patch.

[0105] In this embodiment, the category features of an image patch are determined based on the proportion of pixels corresponding to each semantic category and the category weight corresponding to each semantic category. Since the category weight corresponding to each semantic category is introduced, and this category weight reflects the importance of the semantic category, the calculated category features can emphasize important semantic categories while suppressing unimportant semantic categories, thereby improving the accuracy of the category features.

[0106] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the statistical feature determination step in S320 is refined.

[0107] See Figure 6 The detailed steps for determining statistical characteristics include:

[0108] S610 performs statistical analysis on the pixel attributes of the image block in different dimensions to obtain the statistical results for the corresponding dimensions.

[0109] The dimensions may include gradient, variance, mean, and at least two of other dimensions.

[0110] For example, the pixel attribute is brightness, and different dimensions include gradient and average. Regarding gradient: the horizontal and vertical brightness gradient values ​​of the image patch can be calculated separately, and then the horizontal and vertical brightness gradient values ​​are summed to obtain the overall brightness gradient value of the image patch. Regarding average: the average brightness value of each pixel in the image patch is calculated. This yields the statistical results corresponding to the two dimensions.

[0111] S620: Determine the statistical characteristics of the image patch based on the statistical results of the image patch in different dimensions.

[0112] For example, statistical results from different dimensions are fused according to a preset ratio to obtain the statistical features of the image patch. Of course, after fusion, the fusion result can also be input into a preset function to obtain the corresponding function value, thereby converting the fusion result into the corresponding function value, and using the function value as the statistical feature.

[0113] In this embodiment, the pixel attributes of the image block are statistically analyzed in different dimensions to obtain the statistical results corresponding to each dimension. Based on the statistical results of different dimensions, statistical features that can accurately reflect the pixel attribute statistics of the image block can be determined.

[0114] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this embodiment, the target enhancement intensity is refined into a first target intensity corresponding to the brightness of the pixel and a second target intensity corresponding to the brightness of each color channel, and the contrast enhancement processing step in S140 is refined.

[0115] See Figure 7 The refined contrast enhancement processing steps include:

[0116] S710 determines the overall enhancement intensity of a pixel in the corresponding color channel based on the first target intensity and the second target intensity of the pixel in each color channel.

[0117] For example, the first target intensity of a pixel and the second target intensity of the pixel in the R channel are weighted and summed to obtain the overall enhancement intensity in the R channel. The first target intensity of a pixel and the second target intensity of the pixel in the G channel are weighted and summed to obtain the overall enhancement intensity in the G channel. The first target intensity of a pixel and the second target intensity of the pixel in the B channel are weighted and summed to obtain the overall enhancement intensity in the B channel.

[0118] The first target intensity is applicable to all color channels, so the same stretching intensity, i.e. the same contrast enhancement intensity, can be achieved on all color channels based on the first target intensity.

[0119] Different color channels correspond to different second target intensities, thus enabling different tensile strengths across different color channels.

[0120] The S720 performs contrast enhancement processing on pixels in the corresponding color channels based on the overall enhancement intensity of each pixel in each color channel.

[0121] For example, the luminance component of the pixel in the R channel is multiplied by the overall enhancement intensity corresponding to the pixel in the R channel to obtain the target luminance component of the pixel in the R channel; the luminance component of the pixel in the G channel is multiplied by the overall enhancement intensity corresponding to the pixel in the G channel to obtain the target luminance component of the pixel in the G channel; the luminance component of the pixel in the B channel is multiplied by the overall enhancement intensity corresponding to the pixel in the B channel to obtain the target luminance component of the pixel in the B channel; thus, the target luminance of the pixel after contrast enhancement processing is obtained.

[0122] In this embodiment, for each color channel, the first target intensity and the second target intensity corresponding to the pixel in that color channel are fused to obtain the comprehensive enhancement intensity of the pixel in that color channel. Based on this comprehensive enhancement intensity, contrast enhancement processing is performed on the pixel in that color channel, thus achieving color channel-level contrast enhancement processing. Compared to pixel-level contrast enhancement processing, this achieves finer-grained enhancement, i.e., more precise enhancement. Furthermore, the comprehensive enhancement intensity fuses the same and different stretching intensities across all color channels, which can alleviate potential color cast issues after contrast enhancement processing, thereby improving the overall effect of contrast enhancement.

[0123] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0124] Based on the same inventive concept, this application also provides an image contrast enhancement apparatus for implementing the image contrast enhancement method described above. This apparatus can be applied to or integrated into a chip or chip module, for example. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more image contrast enhancement apparatus embodiments provided below can be found in the limitations of the image contrast enhancement method described above, and will not be repeated here.

[0125] In one exemplary embodiment, an image contrast enhancement device is provided. For example... Figure 8 As shown, the image contrast enhancement device includes an image acquisition module 810, a block processing module 820, an intensity enhancement module 830, and an enhancement processing module 840, wherein:

[0126] The image acquisition module 810 is used to acquire the image to be processed and identify the semantic category of each pixel in the image to be processed.

[0127] Block processing module 820 is used to perform block processing on the image to be processed to obtain at least one image block;

[0128] The intensity enhancement module 830 is used to determine the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs;

[0129] The enhancement processing module 840 is used to perform contrast enhancement processing on the corresponding pixels according to the target enhancement intensity of the pixels.

[0130] In one embodiment, the intensity enhancement module includes: a first determining submodule, configured to determine the basic enhancement intensity of each pixel in the image block based on the brightness value of each pixel in the image block; a second determining submodule, configured to determine the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel in the image block belongs; and a third determining submodule, configured to determine the target enhancement intensity of the corresponding pixel based on the basic enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

[0131] In one embodiment, the second determining submodule includes: a first determining unit, configured to determine the category features of the image block based on the semantic category to which each pixel in the image block belongs; a second determining unit, configured to determine the statistical features of the image block based on the pixel attribute statistics of the image block; and a third determining unit, configured to determine the additional enhancement intensity corresponding to the image block based on the category features and the statistical features.

[0132] In one embodiment, the first determining unit includes: a first determining subunit, used to determine the category features of the image block by classifying the semantic category to which each pixel in the image block belongs; a second determining subunit, used to determine the percentage of the number of pixels corresponding to each semantic category in the image block according to the semantic category to which each pixel in the image block belongs; and a third determining subunit, used to determine the category features of the image block according to the percentage of the number of pixels corresponding to each semantic category in the image block.

[0133] In one embodiment, the third determining subunit is specifically used to: obtain the category weights corresponding to different semantic categories; and determine the category features of the image patch based on the proportion of pixels corresponding to each semantic category and the category weights corresponding to each semantic category.

[0134] In one embodiment, the second determining unit is specifically used to: perform statistical analysis on the pixel attributes of the image block in different dimensions to obtain statistical results for the corresponding dimensions; and determine the statistical features of the image block based on the statistical results of the image block in different dimensions.

[0135] In one embodiment, the target enhancement intensity includes a first target intensity corresponding to the pixel brightness and a second target intensity corresponding to the brightness of each color channel; accordingly, the enhancement processing module is specifically used to: determine the comprehensive enhancement intensity of the pixel in the corresponding color channel based on the first target intensity and the second target intensity of the pixel in each color channel; and perform contrast enhancement processing on the pixel in the corresponding color channel based on the comprehensive enhancement intensity of the pixel in each color channel.

[0136] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0137] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements an image contrast enhancement method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0138] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0139] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring an image to be processed and identifying the semantic category to which each pixel in the image to be processed belongs; dividing the image to be processed into blocks to obtain at least one image block; for each image block, determining the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs; and performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel.

[0140] In one embodiment, the step of "determining the target enhancement intensity of each pixel in an image block according to the semantic category to which each pixel in the image block belongs" implemented by the processor when executing the computer program includes: determining the basic enhancement intensity of each pixel in the image block according to the brightness value of each pixel in the image block; determining the additional enhancement intensity corresponding to the image block according to the semantic category to which each pixel in the image block belongs; and determining the target enhancement intensity of the corresponding pixel according to the basic enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

[0141] In one embodiment, the step of "determining the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel in the image block belongs" implemented by the processor when executing the computer program includes: determining the category features of the image block based on the semantic category to which each pixel in the image block belongs; determining the statistical features of the image block based on the pixel attribute statistics of the image block; and determining the additional enhancement intensity corresponding to the image block based on the category features and the statistical features.

[0142] In one embodiment, the step of "determining the category features of an image block based on the semantic category to which each pixel in the image block belongs" implemented by the processor when executing the computer program includes: determining the percentage of the number of pixels corresponding to each semantic category in the image block based on the semantic category to which each pixel in the image block belongs; and determining the category features of the image block based on the percentage of the number of pixels corresponding to each semantic category in the image block.

[0143] In one embodiment, the step of "determining the category features of an image patch based on the proportion of pixels corresponding to each semantic category in the image patch" implemented by the processor when executing the computer program includes: obtaining the category weights corresponding to different semantic categories; and determining the category features of the image patch based on the proportion of pixels corresponding to each semantic category in the image patch and the category weights corresponding to each semantic category.

[0144] In one embodiment, the step of "determining the statistical characteristics of an image block based on the pixel attribute statistics of the image block" implemented by the processor when executing the computer program includes: performing statistics on the pixel attributes of the image block in different dimensions to obtain statistical results in the corresponding dimensions; and determining the statistical characteristics of the image block based on the statistical results of the image block in different dimensions.

[0145] In one embodiment, the target enhancement intensity includes a first target intensity corresponding to the pixel brightness and a second target intensity corresponding to the brightness of each color channel; the step of "performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel" implemented by the processor when executing the computer program includes: determining the comprehensive enhancement intensity of the pixel in the corresponding color channel according to the first target intensity and the second target intensity of the pixel in each color channel; and performing contrast enhancement processing on the pixel in the corresponding color channel according to the comprehensive enhancement intensity of the pixel in each color channel.

[0146] Based on the same inventive concept, embodiments of this application also provide a chip, including a processor and a communication interface; the communication interface is used to receive or send data; the processor is configured to cause the chip to perform the following steps: acquiring an image to be processed and identifying the semantic category to which each pixel in the image to be processed belongs; performing block processing on the image to be processed to obtain at least one image block; for each image block, determining the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs; and performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel.

[0147] In one embodiment, the processor is configured to cause the chip to perform the step of "determining the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs", including: determining the base enhancement intensity of each pixel in the image block according to the brightness value of each pixel in the image block; determining the additional enhancement intensity corresponding to the image block according to the semantic category to which each pixel in the image block belongs; and determining the target enhancement intensity of the corresponding pixel according to the base enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

[0148] In one embodiment, the processor is configured to cause the chip to perform the step of "determining the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel in the image block belongs", which includes: determining the category features of the image block based on the semantic category to which each pixel in the image block belongs; determining the statistical features of the image block based on the pixel attribute statistics of the image block; and determining the additional enhancement intensity corresponding to the image block based on the category features and the statistical features.

[0149] In one embodiment, the processor is configured to cause the chip to perform the step of "determining the category features of an image block based on the semantic category to which each pixel in the image block belongs", which includes: determining the percentage of the number of pixels corresponding to each semantic category in the image block based on the semantic category to which each pixel in the image block belongs; and determining the category features of the image block based on the percentage of the number of pixels corresponding to each semantic category in the image block.

[0150] In one embodiment, the processor is configured to cause the chip to perform the step of "determining the category features of an image block based on the percentage of pixels corresponding to each semantic category in the image block", which includes: obtaining the category weights corresponding to different semantic categories; and determining the category features of the image block based on the percentage of pixels corresponding to each semantic category and the category weights corresponding to each semantic category in the image block.

[0151] In one embodiment, the processor is configured to cause the chip to perform the step "determine the statistical characteristics of an image block based on the pixel attribute statistics of the image block", including: performing statistics on the pixel attributes of the image block in different dimensions to obtain statistical results in the corresponding dimensions; and determining the statistical characteristics of the image block based on the statistical results of the image block in different dimensions.

[0152] In one embodiment, the target enhancement intensity includes a first target intensity corresponding to the pixel brightness and a second target intensity corresponding to the brightness of each color channel; the processor is configured to cause the chip to perform the step of "performing contrast enhancement processing on the corresponding pixel according to the target enhancement intensity of the pixel", which includes: determining the comprehensive enhancement intensity of the pixel in the corresponding color channel according to the first target intensity and the second target intensity of the pixel in each color channel; and performing contrast enhancement processing on the pixel in the corresponding color channel according to the comprehensive enhancement intensity of the pixel in each color channel.

[0153] It is understood that the chip involved in the embodiments of this application may be a field-programmable gate array (FPGA), may be an application-specific integrated circuit (ASIC), may be a system on chip (SoC), may be a central processor unit (CPU), may be a network processor (NP), may be a digital signal processor (DSP), may be a microcontroller unit (MCU), may be a programmable logic device (PLD), or other integrated chips, etc.

[0154] Based on the same inventive concept, this application also provides a chip module, such as... Figure 10As shown, the chip module includes a communication module, a power module, a storage module, and a chip. Specifically: the power module provides power to the chip module; the storage module stores data and instructions; the communication module enables internal communication within the chip module or communication between the chip module and external devices; and the chip corresponds to the chip in the aforementioned chip embodiment. The implementation of this chip module can be found in the relevant content of the aforementioned chip embodiment, and will not be repeated here.

[0155] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the image contrast enhancement method.

[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in an image contrast enhancement method.

[0157] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0158] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0159] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An image contrast enhancement method, characterized in that, include: Acquire the image to be processed and identify the semantic category of each pixel in the image to be processed; The image to be processed is divided into blocks to obtain at least one image block; For each image block, the target enhancement intensity of each pixel in the image block is determined according to the semantic category to which each pixel in the image block belongs; Based on the target enhancement intensity of the pixel, the corresponding pixel is subjected to contrast enhancement processing.

2. The method according to claim 1, characterized in that, The step of determining the target enhancement intensity of each pixel in the image block based on the semantic category to which each pixel belongs includes: The base enhancement intensity of each pixel in the image block is determined based on the brightness value of each pixel in the image block; The additional enhancement intensity corresponding to the image block is determined based on the semantic category to which each pixel in the image block belongs; The target enhancement intensity of each pixel is determined based on the base enhancement intensity of each pixel in the image block and the additional enhancement intensity corresponding to the image block.

3. The method according to claim 2, characterized in that, The step of determining the additional enhancement intensity corresponding to the image block based on the semantic category to which each pixel in the image block belongs includes: The category features of the image block are determined based on the semantic category to which each pixel in the image block belongs; Based on the pixel attribute statistics of the image block, determine the statistical characteristics of the image block; The additional enhancement intensity corresponding to the image patch is determined based on the category features and the statistical features.

4. The method according to claim 3, characterized in that, The step of determining the category features of the image block based on the semantic category to which each pixel in the image block belongs includes: Based on the semantic category to which each pixel in the image block belongs, determine the percentage of pixels corresponding to each semantic category in the image block. The category features of the image block are determined based on the proportion of pixels corresponding to each semantic category in the image block.

5. The method according to claim 4, characterized in that, The step of determining the category features of the image patch based on the proportion of pixels corresponding to each semantic category in the image patch includes: Obtain the category weights corresponding to different semantic categories; The category features of the image block are determined based on the percentage of pixels corresponding to each semantic category and the category weight corresponding to each semantic category.

6. The method according to claim 3, characterized in that, The step of determining the statistical characteristics of the image patch based on the pixel attribute statistics of the image patch includes: The pixel attributes of the image block are statistically analyzed in different dimensions to obtain the statistical results for the corresponding dimensions; The statistical characteristics of the image patch are determined based on the statistical results of the image patch in different dimensions.

7. The method according to any one of claims 1 to 6, characterized in that, The target enhancement intensity includes a first target intensity corresponding to the pixel brightness and a second target intensity corresponding to the brightness of each color channel. Accordingly, the step of performing contrast enhancement processing on the corresponding pixel based on the target enhancement intensity of the pixel includes: Based on the first target intensity and the second target intensity of the pixel in each color channel, the overall enhancement intensity of the pixel in the corresponding color channel is determined; Based on the overall enhancement intensity of the pixel in each color channel, the pixel is subjected to contrast enhancement processing in the corresponding color channel.

8. An image contrast enhancement device, characterized in that, include: The image acquisition module is used to acquire the image to be processed and identify the semantic category to which each pixel in the image to be processed belongs; The block processing module is used to divide the image to be processed into blocks to obtain at least one image block; The intensity enhancement module is used to determine the target enhancement intensity of each pixel in the image block according to the semantic category to which each pixel in the image block belongs; An enhancement processing module is used to perform contrast enhancement processing on the corresponding pixels according to the target enhancement intensity of the pixels.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A chip, characterized in that, The device includes a processor and a communication interface, the processor being configured to cause the chip to perform the steps of the method described in any one of claims 1 to 7.