CN117952875A - Image contrast enhancement method and device, storage medium and electronic equipment - Google Patents

Image contrast enhancement method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117952875A
CN117952875A CN202410122739.3A CN202410122739A CN117952875A CN 117952875 A CN117952875 A CN 117952875A CN 202410122739 A CN202410122739 A CN 202410122739A CN 117952875 A CN117952875 A CN 117952875A
Authority
CN
China
Prior art keywords
image
brightness
brightness value
map
contrast enhancement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410122739.3A
Other languages
Chinese (zh)
Inventor
崔茗宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202410122739.3A priority Critical patent/CN117952875A/en
Publication of CN117952875A publication Critical patent/CN117952875A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The application discloses an image contrast enhancement method, an image contrast enhancement device, a storage medium, electronic equipment and a computer program product, wherein the image contrast enhancement method comprises the following steps: acquiring a brightness map of an image to be processed; determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map; determining a plurality of local brightness value distribution functions according to the overall brightness value distribution function and the brightness value intervals, wherein each brightness value interval corresponds to one local brightness value distribution function; according to the local brightness value distribution function and the brightness map, the contrast enhancement is carried out on the image to be processed, so that the phenomenon that the contrast enhancement of a local area fails or is excessive in the low-illumination image can be avoided, the method is suitable for the contrast enhancement of various low-illumination images, and the image enhancement effect is good.

Description

Image contrast enhancement method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image contrast enhancement method, an image contrast enhancement device, a storage medium, an electronic device, and a computer program product.
Background
The application range of the image acquisition equipment relates to important fields such as video monitoring, aerospace, disease diagnosis, film making and the like, and the rapid development of science and technology and the improvement of the quality of human life are ensured. However, in real life, factors of special natural environments such as insufficient light, night, heavy rain and the like often cause poor quality of an image obtained by hardware equipment for image acquisition, and serious problems such as blurred details, dark colors, noise and the like always occur in the image, so that the information recognition capability of human vision in the image is affected, and meanwhile, huge troubles are brought to subsequent processing of the image such as target recognition and the like.
The low-illumination image refers to an image with dark overall brightness of the acquired image and only part of detail visible, and the contrast of the image is required to be improved by a proper image processing method, so that the visibility of the image is enhanced. However, the existing image contrast enhancement method cannot be applied to extremely dark low-illumination images, and is easy to fail in contrast enhancement, and the contrast enhancement effect is poor.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides an image contrast enhancement method, an image contrast enhancement device, a storage medium, electronic equipment and a computer program product, which can enhance the contrast of various low-illumination images and have good contrast enhancement effect.
In a first aspect, the present application provides an image contrast enhancement method, comprising:
acquiring a brightness map of an image to be processed;
Determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map;
Determining a plurality of local brightness value distribution functions according to the integral brightness value distribution function and the brightness value interval, wherein each brightness value interval corresponds to one local brightness value distribution function;
and carrying out contrast enhancement on the image to be processed according to the local brightness value distribution function and the brightness map.
In some embodiments, the determining the overall luminance value distribution function and the plurality of luminance value intervals corresponding to the luminance values in the luminance map includes:
Generating a histogram according to the brightness value in the brightness map and the number of pixel points corresponding to the same brightness value;
determining a maximum numerical value interval in which a brightness value in the histogram is located, and dividing the maximum numerical value interval to obtain a plurality of brightness value intervals;
Determining the number of the pixel points corresponding to each brightness value in the histogram and the total number of the pixel points corresponding to all the brightness values; and calculating the ratio between each number and the total number to obtain an overall brightness value distribution function corresponding to the brightness map.
In some embodiments, the determining a plurality of local luminance value distribution functions from the overall luminance value distribution function and the luminance value interval includes:
determining correction parameters corresponding to each brightness value interval, wherein different brightness value intervals correspond to different correction parameters;
and correcting the integral brightness value distribution function by using the correction parameters to obtain a local brightness value distribution function corresponding to the corresponding brightness value interval.
In some embodiments, the performing contrast enhancement on the image to be processed according to the local luminance value distribution function and the luminance map includes:
accumulating the local brightness value distribution function corresponding to each pixel point in the brightness map to obtain an accumulation function;
Calculating the ratio between each local brightness value distribution function and the accumulation function to obtain an accumulation probability density function;
and carrying out contrast enhancement on the image to be processed according to the cumulative probability density function and the brightness map.
In some embodiments, the contrast enhancement of the image to be processed according to the cumulative probability density function and the luminance map includes:
Determining a maximum luminance value in the luminance map;
updating the brightness value in the brightness map according to the cumulative probability density function and the maximum brightness value to obtain an enhanced brightness map;
and generating a contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map so as to enhance the contrast of the image to be processed.
In some embodiments, when the image to be processed is a color image, the acquiring a luminance map of the image to be processed includes:
performing color space conversion on color values of pixel points in the color image to obtain target color values in a target color space; extracting a first component corresponding to a target coordinate axis in the target color value; generating a brightness map according to the first component corresponding to each pixel point;
the generating the contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map includes: extracting second components corresponding to other coordinate axes except the target coordinate axis in the target color value; and generating a contrast enhancement image corresponding to the image to be processed according to the second component and the brightness value in the enhancement brightness map.
In a second aspect, the present application provides an image contrast enhancement apparatus comprising:
The acquisition module is used for acquiring a brightness map of the image to be processed;
The first determining module is used for determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map;
the second determining module is used for determining a plurality of local brightness value distribution functions according to the integral brightness value distribution function and the brightness value intervals, and each brightness value interval corresponds to one local brightness value distribution function;
and the enhancement module is used for carrying out contrast enhancement on the image to be processed according to the local brightness value distribution function and the brightness map.
In some embodiments, the first determining module is specifically configured to:
Generating a histogram according to the brightness value in the brightness map and the number of pixel points corresponding to the same brightness value;
determining a maximum numerical value interval in which a brightness value in the histogram is located, and dividing the maximum numerical value interval to obtain a plurality of brightness value intervals;
Determining the number of the pixel points corresponding to each brightness value in the histogram and the total number of the pixel points corresponding to all the brightness values; and calculating the ratio between each number and the total number to obtain an overall brightness value distribution function corresponding to the brightness map.
In some embodiments, the second determining module is specifically configured to:
determining correction parameters corresponding to each brightness value interval, wherein different brightness value intervals correspond to different correction parameters;
and correcting the integral brightness value distribution function by using the correction parameters to obtain a local brightness value distribution function corresponding to the corresponding brightness value interval.
In some embodiments, the enhancement module specifically includes:
the accumulation sub-module is used for accumulating the local brightness value distribution function corresponding to each pixel point in the brightness map to obtain an accumulation function;
The calculating sub-module is used for calculating the ratio between each local brightness value distribution function and the accumulation function to obtain an accumulation probability density function;
And the enhancer module is used for enhancing the contrast of the image to be processed according to the cumulative probability density function and the brightness map.
In some embodiments, the enhancement submodule is specifically configured to:
Determining a maximum luminance value in the luminance map;
updating the brightness value in the brightness map according to the cumulative probability density function and the maximum brightness value to obtain an enhanced brightness map;
and generating a contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map so as to enhance the contrast of the image to be processed.
In some embodiments, when the image to be processed is a color image, the acquiring module is specifically configured to:
performing color space conversion on color values of pixel points in the color image to obtain target color values in a target color space; extracting a first component corresponding to a target coordinate axis in the target color value; generating a brightness map according to the first component corresponding to each pixel point;
The enhancement submodule is specifically used for: extracting second components corresponding to other coordinate axes except the target coordinate axis in the target color value; and generating a contrast enhancement image corresponding to the image to be processed according to the second component and the brightness value in the enhancement brightness map.
In a third aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the image contrast enhancement method of any of the above.
In a fourth aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any one of the above methods of image contrast enhancement when executing the program.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the image contrast enhancement method of any of the above.
The embodiment of the application provides an image contrast enhancement method, an image contrast enhancement device, a storage medium, electronic equipment and a computer program product, which are used for acquiring a brightness map of an image to be processed; determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map; determining a plurality of local brightness value distribution functions according to the overall brightness value distribution function and the brightness value intervals, wherein each brightness value interval corresponds to one local brightness value distribution function; according to the local brightness value distribution function and the brightness map, the contrast enhancement is carried out on the image to be processed, namely, the local enhancement mode is adopted, the contrast enhancement processing is carried out on the pixels with different brightness in the image to different degrees, instead of uniformly enhancing the whole image, the phenomenon that the contrast enhancement of the local area is invalid or excessive in the low-illumination image is avoided, and the method is suitable for the contrast enhancement of various low-illumination images and has good image enhancement effect.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of an image contrast enhancement method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an image contrast enhancement method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an image contrast enhancement device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another structure of an image contrast enhancement device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
The embodiment of the application provides an image contrast enhancement method, an image contrast enhancement device, a storage medium, electronic equipment and a computer program product.
Referring to fig. 1, fig. 1 is a flowchart of an image contrast enhancement method according to an embodiment of the application. The image contrast enhancement method is applied to an electronic device, which may be implemented as a user terminal or server, including VR device, notebook computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, personal digital assistant, dedicated messaging device, portable game device), etc. Specifically, the image contrast enhancement method may include the following steps 101-104, wherein:
101. And acquiring a brightness map of the image to be processed.
The brightness map is used for reflecting brightness degree of the image to be processed, has the same image size as the image to be processed, and corresponds to the pixel points in the image to be processed and the pixel points in the brightness map one by one. The image to be processed mainly refers to a low-illumination image, the low-illumination image refers to an image with dark overall brightness of the collected image and only part of detail visible, and the contrast of the image needs to be improved by a proper image processing method, so that the visibility of the image is enhanced.
The image to be processed can be shot by a built-in camera in the electronic equipment, and can also be transmitted to the electronic equipment by other external equipment. The user can select one or more images with dark visual effects from the images stored in the electronic equipment to carry out contrast enhancement, wherein the selected images are the images to be processed, and the electronic equipment can automatically detect whether the images are images with dark brightness after shooting to obtain new images or receiving the new images, and if so, the images are used as the images to be processed.
In some embodiments, the manner of obtaining the luminance map depends on the image type of the image to be processed, where the image type mainly includes a color image and a gray scale image, and the step 101 may specifically include:
When the image to be processed is a color image, performing color space conversion on color values of pixel points in the color image to obtain a target color value in a target color space; extracting a component corresponding to a target coordinate axis in the target color value; generating a brightness map according to the component extracted correspondingly from each pixel point;
when the image to be processed is a gray image, the gray image is taken as a brightness map.
The color image is an RGB (red, green and blue) three-channel image directly output from a camera, and each pixel has three color components (R component, G component and B component) to represent its color intensity, and for an 8-bit color depth image, each component is represented as an integer between 0 and 255. Gray scale images, also called gray scale images (single channel images), refer to each pixel having only one component (i.e., gray scale value) representing an intensity value, typically representing an integer between 0 and 255 for an 8bit color depth image, 0 representing all black and 255 representing all white.
When performing color space conversion on a pixel point in a color image, it is usually converted from an original RGB color space to a YUV color space (target color space), where U and V represent chromaticity and Y represents luminance, after performing color space conversion, a Y-axis (target coordinate axis) component representing luminance can be extracted, and the component is used as a value of the pixel point to generate a luminance map of the image to be processed.
The color space conversion formula may be as follows:
Y(s,y)=0.299R(x,y)+0.587G(x,y)+0.114B(x,y);
V(x,y)=0.713(R(x,y)-Y(x,y))+128;
U(x,y)=0.564(B(x,y)-Y(x,y))+128;
Wherein (x, Y) is a pixel point in the image, R (x, Y) is an R component of the pixel point (x, Y), G (x, Y) is a G component of the pixel point (x, Y), B (x, Y) is a B component of the pixel point (x, Y), Y (x, Y) is a Y component of the pixel point (x, Y), V (x, Y) is a V component of the pixel point (x, Y), and U (x, Y) is a U component of the pixel point (x, Y).
102. And determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map.
In some embodiments, referring to fig. 2, fig. 2 is another flowchart of an image contrast enhancement method according to an embodiment of the present application, the step 102 may specifically include the following steps 1021-1023, where:
1021. a histogram is generated from the luminance value in the luminance map and the number of pixels corresponding to the same luminance value.
In the luminance histogram, the horizontal axis represents the luminance value, the left to right represents the luminance from low to high, the vertical axis represents the number of pixels, and the bottom to top represents the number of pixels from small to large.
1022. And determining the maximum numerical value interval in which the brightness value in the brightness histogram is positioned, and dividing the maximum numerical value interval to obtain a plurality of brightness value intervals.
For an 8-bit color depth image, the brightness value in the brightness histogram is between 0 and 255, and the maximum value interval of the brightness value is between 0 and 255. The dividing standard of the brightness value interval can be flexibly set, for example, for images with different bit depths, several brightness value intervals with fixed values can be extracted and set, for example, if the maximum value interval of the brightness values is 0-255, 4 brightness value intervals can be set: [0,100], (100, 150], (150, 200] and (200,255 ], or the section length or the number of sections may be set in advance, and when the subsequent sections are divided, the section calculation is performed based on the maximum numerical section and the set section length or section data.
1023. Determining the number of the pixel points corresponding to each brightness value in the brightness histogram and the total number of the pixel points corresponding to all the brightness values; and calculating the ratio between each number and the total number to obtain the integral brightness value distribution function corresponding to the brightness map.
Wherein, the integral brightness value distribution function pdf () counts the proportion of the number of pixels of each brightness value in the brightness map to the total number of pixels of the whole image.
103. And determining a plurality of local brightness value distribution functions according to the whole brightness value distribution function and the brightness value interval, wherein each brightness value interval corresponds to one local brightness value distribution function.
Wherein the overall luminance value distribution function is a distribution function for all luminance values in the luminance map, and the local luminance value distribution function is a distribution function for luminance values within a single luminance value interval in the luminance map.
In some embodiments, referring to fig. 2, the step 103 may specifically include the following steps 1031 and 1032, where:
1031. determining correction parameters corresponding to each brightness value interval, wherein different brightness value intervals correspond to different correction parameters;
1032. And correcting the integral brightness value distribution function by using the correction parameter to obtain a local brightness value distribution function corresponding to the corresponding brightness value interval.
For example, if the luminance value interval is [0,100], (100, 150], (150, 200] and (200,255 ], the correction formula may be as follows:
Where i is a luminance value, w1, w2, w3, and w4 are correction parameters, pdf () is an overall luminance value distribution function, pdf w () is a local luminance value distribution function, and pdf w () is obtained by gamma correction of the overall luminance value distribution function pdf () with the correction parameters as an index.
Generally, as the value of the brightness value interval gradually decreases (the brightness of the image is darker), the value of the correction parameter can gradually increase, and then the brightness distribution of the image can be more uniform when the contrast is enhanced, so that the abrupt change phenomenon of the brightness of the image is avoided. The correction parameter may be a fixed value that is empirically set by the user, or may be a value that is calculated according to a set formula, for example, for simplicity of calculation, w1 may be set to a fixed value, and other correction parameters may be calculated based on w1, for example, w2=w1-0.2, w3=w1-0.4, w4=w1-0.6.
104. And carrying out contrast enhancement on the image to be processed according to the local brightness value distribution function and the brightness map.
In some embodiments, referring to fig. 2, the step 104 may specifically include the following steps 1041-1043, where:
1041. Accumulating the local brightness value distribution function corresponding to each pixel point in the brightness map to obtain an accumulation function;
1042. Calculating the ratio between each local brightness value distribution function and the accumulation function to obtain an accumulation probability density function;
1043. and carrying out contrast enhancement on the image to be processed according to the cumulative probability density function and the brightness map.
The calculation formula of the cumulative probability density function cdf w is as follows:
i is the luminance value in the luminance map, the luminance value of each pixel point in the luminance map corresponds to a local luminance value distribution function, and the summation function is sum (pdf w) obtained by summing the local luminance value distribution functions corresponding to the luminance values of all the pixel points in the luminance map.
In some embodiments, the step 1043 may specifically include:
updating the brightness value in the brightness map according to the cumulative probability density function to obtain an enhanced brightness map;
and generating a contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map so as to enhance the contrast of the image to be processed.
Specifically, the luminance values in the luminance map may be updated pixel by pixel through a new histogram distribution, and the new histogram distribution calculation formula is as follows:
Wherein, the input i and the output i (i) in the formula are the original luminance value and the updated luminance value of the same pixel point in the luminance map, i max is the maximum value of the original luminance value, and cdf w is the cumulative probability density function. For an 8bit depth image, i e 0,255, i max = 255.
It should be noted that, since cdf w is calculated based on the local luminance value distribution function, and the luminance value distribution function is corrected for the whole luminance value distribution function (local luminance value distribution function) by different correction parameters for the image areas of different luminance intervals in the luminance map, when the luminance map is updated (luminance enhanced) by the above formula, the image areas of different luminance intervals can achieve luminance enhancement of different degrees, so that the unnatural phenomenon that the local luminance of the image is too bright or too dark or the luminance mutation occurs can be avoided, and the luminance distribution of the image is more uniform. When the contrast enhancement is carried out on the basis of the brightness enhancement, the conditions of excessive contrast enhancement and unnatural enhancement effect of local areas can be avoided, the local details of the image can be protected, and the overall visual effect can be improved.
When the brightness value in the whole brightness map is updated through the formula, the obtained brightness map is the enhanced brightness map. Then, an image (i.e., the contrast enhancement image) with the same type as the image to be processed is obtained based on the enhancement brightness map, for example, when the image to be processed is a color image, the contrast enhancement image is also a color image, and when the image to be processed is a gray image, the contrast enhancement image is also a gray image.
Specifically, when the image to be processed is a color image, the step of generating the contrast enhancement image corresponding to the image to be processed according to the enhanced brightness map may specifically include:
extracting second components corresponding to other coordinate axes except the target coordinate axis in the target color value;
And generating a contrast enhancement image corresponding to the image to be processed according to the second component and the brightness value in the enhancement brightness map.
In step 101, the target color value is obtained by converting RGB values of pixels in the color image into YUV color space. The contrast enhanced image I OUT can be calculated by the following formula:
Rout(x,y)=Ilight_OUT(x,y)+1.403(V(x,y)-128)
Gout(x,y)=Ilight_OUT(x,y)-0.344(V(x,y)-128)-0.714(U(x,y)-128)
Bout(x,y)=Ilight_oUT(x,y)+1.773(U(x,y)-128)
where (x, y) is the pixel point in the contrast enhanced image, To enhance the luminance value in the luminance map, V is the V-axis component in the target color value, U is the U-axis component in the target color value, and R out,Gout,Bout is each component value of the pixel point in the contrast-enhanced image I oUT in the RGB color space, respectively.
In addition, when the image to be processed is a gray-scale image, the step of generating the contrast enhancement image corresponding to the image to be processed according to the enhanced brightness map may specifically include: the enhanced brightness image is used as a contrast enhanced image corresponding to the image to be processed, namely
As can be seen from the above, in the image contrast enhancement method provided by the embodiment of the present application, a luminance map of an image to be processed is obtained; determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map; determining a plurality of local brightness value distribution functions according to the overall brightness value distribution function and the brightness value interval, wherein each brightness value interval corresponds to one local brightness value distribution function; according to the local brightness value distribution function and the brightness map, the image to be processed is subjected to contrast enhancement, namely, a local enhancement mode is adopted, the pixels with different brightness in the image are subjected to contrast enhancement processing with different degrees, instead of uniformly enhancing the whole image, so that the phenomenon that the contrast enhancement of a local area fails or is excessive in the low-illumination image can be avoided, the method is suitable for the contrast enhancement of various low-illumination images, and the image enhancement effect is good.
According to the method described in the above embodiment, the embodiment of the present application further provides an image contrast enhancement device, which is configured to perform the steps in the image contrast enhancement method. Referring to fig. 3, fig. 3 is a schematic structural diagram of an image contrast enhancement device according to an embodiment of the application. The image contrast enhancement apparatus 200 is applied in an electronic device, which may be implemented as a user terminal or server, including VR device, notebook, tablet, desktop computer, set-top box, mobile device (e.g., mobile phone, personal digital assistant, dedicated messaging device, portable gaming device), etc.
Specifically, the image contrast enhancement device 200 includes an acquisition module 201, a first determination module 202, a second determination module 203, and an enhancement module 204, where:
An obtaining module 201, configured to obtain a luminance map of an image to be processed;
A first determining module 202, configured to determine an overall luminance value distribution function and a plurality of luminance value intervals corresponding to the luminance map;
A second determining module 203, configured to determine a plurality of local luminance value distribution functions according to the overall luminance value distribution function and the luminance value intervals, where each luminance value interval corresponds to one local luminance value distribution function;
And the enhancement module 204 is configured to enhance contrast of the image to be processed according to the local luminance value distribution function and the luminance map.
In some embodiments, the first determining module 202 is specifically configured to:
generating a histogram according to the brightness value in the brightness map and the number of the pixel points corresponding to the same brightness value;
Determining a maximum numerical value interval in which a brightness value in the histogram is located, and dividing the maximum numerical value interval to obtain a plurality of brightness value intervals;
Determining the number of the pixel points corresponding to each brightness value in the histogram and the total number of the pixel points corresponding to all the brightness values; and calculating the ratio between each number and the total number to obtain the integral brightness value distribution function corresponding to the brightness map.
In some embodiments, the second determining module 203 is specifically configured to:
Determining a correction parameter corresponding to each brightness value interval, wherein different brightness value intervals correspond to different correction parameters;
and correcting the integral brightness value distribution function by using the correction parameter to obtain a local brightness value distribution function corresponding to the corresponding brightness value interval.
In some embodiments, referring to fig. 4, fig. 4 is another schematic structural diagram of an image contrast enhancement device according to an embodiment of the present application, where the enhancement module 204 specifically includes:
An accumulating sub-module 2041, configured to accumulate the local luminance value distribution function corresponding to each pixel point in the luminance map to obtain an accumulating function;
a calculating submodule 2042 for calculating the ratio between each of the local luminance value distribution functions and the accumulation function to obtain an accumulated probability density function;
An enhancer module 2043 for contrast enhancement of the image to be processed according to the cumulative probability density function and the luminance map.
In some embodiments, the enhancer module 2043 is specifically for:
Determining a maximum luminance value in the luminance map;
updating the brightness value in the brightness map according to the cumulative probability density function and the maximum brightness value to obtain an enhanced brightness map;
and generating a contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map so as to enhance the contrast of the image to be processed.
In some embodiments, when the image to be processed is a color image, the acquiring module 201 is specifically configured to:
Performing color space conversion on color values of pixel points in the color image to obtain target color values in a target color space; extracting a first component corresponding to a target coordinate axis in the target color value; generating a brightness map according to the first component corresponding to each pixel point;
The enhancement submodule 2043 is specifically configured to: extracting second components corresponding to other coordinate axes except the target coordinate axis in the target color value; and generating a contrast enhancement image corresponding to the image to be processed according to the second component and the brightness value in the enhancement brightness map.
In some embodiments, when the image to be processed is a gray scale image, the obtaining module 201 is specifically configured to: the gray-scale image is used as a luminance map. The enhancement submodule 2043 is specifically configured to: and taking the enhanced brightness image as a contrast enhanced image corresponding to the image to be processed.
It should be noted that, the specific details of each module unit in the image contrast enhancement apparatus 200 are described in detail in the embodiment of the image contrast enhancement method, and are not described herein.
In some embodiments, the image contrast enhancement device in the embodiments of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal device. The electronic device may be a Mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile internet appliance (Mobile INTERNET DEVICE, MID), an augmented reality (augmented real ity, AR)/Virtual Reality (VR) device, a robot, a wearable device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), etc., and may also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a Television (TV), a teller machine, a self-service machine, etc., which are not particularly limited in the embodiments of the present application.
In some embodiments, as shown in fig. 5, an electronic device 300 is further provided in the embodiments of the present application, which includes a processor 301, a memory 302, and a computer program stored in the memory 302 and capable of running on the processor 301, where the program, when executed by the processor 301, implements the respective processes of the embodiments of the image contrast enhancement method described above, and the same technical effects are achieved, so that repetition is avoided and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
Those skilled in the art will appreciate that the electronic device 400 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 410 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
It should be appreciated that in embodiments of the present application, the input unit 404 may include a graphics processor (Graphics Processing Unit, GPU) 4041 and a microphone 4042, with the graphics processor 4041 processing image data of still pictures or video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 407 includes at least one of a touch panel 4071 and other input devices 4072. The touch panel 4071 is also referred to as a touch screen. The touch panel 4071 may include two parts, a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
Memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 409 may include volatile memory or nonvolatile memory, or the memory 409 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATE SDRAM, DDRSDRAM), enhanced Synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCH L INK DRAM, SLDRAM), and Direct random access memory (DRRAM). Memory 409 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 410 may include one or more processing units; the processor 410 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The embodiment of the application also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the image contrast enhancement method embodiment described above, and can achieve the same technical effects, and in order to avoid repetition, no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to realize the image contrast enhancement method.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
In the description of the present application, "plurality" means two or more.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A method of image contrast enhancement, comprising:
acquiring a brightness map of an image to be processed;
Determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map;
Determining a plurality of local brightness value distribution functions according to the integral brightness value distribution function and the brightness value interval, wherein each brightness value interval corresponds to one local brightness value distribution function;
and carrying out contrast enhancement on the image to be processed according to the local brightness value distribution function and the brightness map.
2. The method of claim 1, wherein determining the overall luminance value distribution function and the plurality of luminance value intervals corresponding to the luminance values in the luminance map comprises:
Generating a histogram according to the brightness value in the brightness map and the number of pixel points corresponding to the same brightness value;
determining a maximum numerical value interval in which a brightness value in the histogram is located, and dividing the maximum numerical value interval to obtain a plurality of brightness value intervals;
Determining the number of the pixel points corresponding to each brightness value in the histogram and the total number of the pixel points corresponding to all the brightness values; and calculating the ratio between each number and the total number to obtain an overall brightness value distribution function corresponding to the brightness map.
3. The image contrast enhancement method according to claim 1, wherein said determining a plurality of local luminance value distribution functions from said overall luminance value distribution function and said luminance value interval comprises:
determining correction parameters corresponding to each brightness value interval, wherein different brightness value intervals correspond to different correction parameters;
and correcting the integral brightness value distribution function by using the correction parameters to obtain a local brightness value distribution function corresponding to the corresponding brightness value interval.
4. A method of image contrast enhancement according to any of claims 1-3, wherein said contrast enhancement of said image to be processed according to said local luminance value distribution function and said luminance map comprises:
accumulating the local brightness value distribution function corresponding to each pixel point in the brightness map to obtain an accumulation function;
Calculating the ratio between each local brightness value distribution function and the accumulation function to obtain an accumulation probability density function;
and carrying out contrast enhancement on the image to be processed according to the cumulative probability density function and the brightness map.
5. The image contrast enhancement method according to claim 4, wherein said contrast enhancing said image to be processed according to said cumulative probability density function and said luminance map comprises:
Determining a maximum luminance value in the luminance map;
updating the brightness value in the brightness map according to the cumulative probability density function and the maximum brightness value to obtain an enhanced brightness map;
and generating a contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map so as to enhance the contrast of the image to be processed.
6. The image contrast enhancement method according to claim 5, wherein when the image to be processed is a color image, the acquiring a luminance map of the image to be processed includes:
performing color space conversion on color values of pixel points in the color image to obtain target color values in a target color space; extracting a first component corresponding to a target coordinate axis in the target color value; generating a brightness map according to the first component corresponding to each pixel point;
the generating the contrast enhancement image corresponding to the image to be processed according to the enhancement brightness map includes: extracting second components corresponding to other coordinate axes except the target coordinate axis in the target color value; and generating a contrast enhancement image corresponding to the image to be processed according to the second component and the brightness value in the enhancement brightness map.
7. An image contrast enhancement device, comprising:
The acquisition module is used for acquiring a brightness map of the image to be processed;
The first determining module is used for determining an integral brightness value distribution function and a plurality of brightness value intervals corresponding to the brightness map;
the second determining module is used for determining a plurality of local brightness value distribution functions according to the integral brightness value distribution function and the brightness value intervals, and each brightness value interval corresponds to one local brightness value distribution function;
and the enhancement module is used for carrying out contrast enhancement on the image to be processed according to the local brightness value distribution function and the brightness map.
8. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the image contrast enhancement method according to any of claims 1-6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the image contrast enhancement method of any of claims 1-6 when the program is executed by the processor.
10. A computer program product comprising a computer program which, when executed by a processor, implements the image contrast enhancement method according to any of claims 1-6.
CN202410122739.3A 2024-01-29 2024-01-29 Image contrast enhancement method and device, storage medium and electronic equipment Pending CN117952875A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410122739.3A CN117952875A (en) 2024-01-29 2024-01-29 Image contrast enhancement method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410122739.3A CN117952875A (en) 2024-01-29 2024-01-29 Image contrast enhancement method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117952875A true CN117952875A (en) 2024-04-30

Family

ID=90791955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410122739.3A Pending CN117952875A (en) 2024-01-29 2024-01-29 Image contrast enhancement method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117952875A (en)

Similar Documents

Publication Publication Date Title
JP5334402B2 (en) Display apparatus and method for improving flicker of video
US8577142B2 (en) Image processing device, image processing method and program with improved image contrast
CN113132696B (en) Image tone mapping method, image tone mapping device, electronic equipment and storage medium
CN113052923B (en) Tone mapping method, tone mapping apparatus, electronic device, and storage medium
CN112289278A (en) Screen brightness adjusting method, screen brightness adjusting device and electronic equipment
CN111901519B (en) Screen light supplement method and device and electronic equipment
CN112947824A (en) Display parameter adjusting method and device, electronic equipment and medium
CN110473156B (en) Image information processing method and device, storage medium and electronic equipment
CN113132639B (en) Image processing method and device, electronic equipment and storage medium
CN112508820B (en) Image processing method and device and electronic equipment
CN112511890A (en) Video image processing method and device and electronic equipment
CN112419218A (en) Image processing method and device and electronic equipment
EP4443286A1 (en) Image processing method and electronic device
CN116843566A (en) Tone mapping method, tone mapping device, display device and storage medium
CN116489377A (en) Image processing method and electronic device
CN113393391B (en) Image enhancement method, image enhancement device, electronic apparatus, and storage medium
CN117952875A (en) Image contrast enhancement method and device, storage medium and electronic equipment
CN111866476B (en) Image shooting method and device and electronic equipment
CN112419217B (en) Image processing method, device, computer equipment and medium
CN114782261B (en) Image processing method and device, electronic equipment and readable storage medium
CN114143448B (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114143447B (en) Image processing method and device and electronic equipment
CN114638951B (en) House model display method and device, electronic equipment and readable storage medium
CN114327715B (en) Interface display method, interface display device, electronic apparatus, and readable storage medium
CN118864335A (en) Image adjusting method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination