Image contrast enhancement method, device and display device
By calculating and equalizing the grayscale histogram of the display, the problem of local detail loss and hardware cost increase caused by contrast improvement in the existing technology is solved, and local contrast improvement and a better visual experience are achieved.
Patent Information
- Application Number
- CN201911205279.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-11-29
AI Technical Summary
When the existing technology enhances image contrast, it is easy to cause the loss of local picture details or increase hardware costs. It cannot effectively control the pixel grayscale of specific areas, affecting the visual experience.
By calculating the grayscale histogram based on the grayscale partition of the monitor and the number of pixels in the preset display area, and performing histogram equalization processing, the local contrast is improved without affecting the contrast of the global image and reducing the loss of details.
It achieves contrast improvement in local image areas, providing a better visual experience without adding additional hardware and reducing costs.
Smart Images

Figure CN112884659B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image contrast enhancement method, device, display equipment and computer storage medium. Background Art
[0002] Contrast is critical to visual effects. Generally speaking, the greater the contrast, the clearer and more eye-catching the image, and the brighter the color; while a small contrast will make the entire picture gray. High contrast is very helpful for image clarity, detail expression, and grayscale expression. Contrast is even more important for the display effect of dynamic images. Since the light and dark transitions in dynamic images are relatively fast, the higher the contrast, the easier it is for the human eye to distinguish such a transition process.
[0003] There are at least two methods for enhancing contrast in existing display devices. The first is the dynamic contrast method, which is to adjust different curves for different brightness images. When the dynamic image is played, an optimal curve is calculated according to the current image scene to achieve the effect of improving the contrast. However, this only performs contrast on all pixels of a frame. Although the effect is good, some details will still be lost for local image scenes, or bright field details will be lost in high-brightness images. The second is the regional dimming method, which increases the number of backlight strips on the display device, adds a hardware backlight control driver module, divides the area and controls the backlight according to the changes in the image scene to achieve the purpose of increasing the contrast, but it will increase the hardware cost and cannot control the grayscale of pixels in specific areas. Summary of the invention
[0004] In view of the above problems, the present invention provides an image contrast enhancement method, apparatus, display device and computer storage medium to enhance the contrast of a local preset display area of a played image without affecting the contrast of the global image, reducing the loss of picture details and providing users with a better visual experience.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A method for enhancing image contrast, comprising:
[0007] Calculate a grayscale histogram of the preset display area when the image is played according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area;
[0008] A histogram equalization process is performed on the grayscale histogram to improve the contrast of the preset display area.
[0009] Preferably, in the image contrast enhancement method, the step of "calculating a grayscale histogram of the preset display area when the image is played according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area" includes:
[0010] Calculating the number of pixels of each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels of the preset display area and the grayscale distribution function;
[0011] The grayscale histogram is obtained according to the number of pixels of each grayscale partition when the preset display area plays an image and the number of pixels of each grayscale partition of the preset display area obtained by calculation.
[0012] Preferably, in the image contrast enhancement method, the grayscale histogram calculation formula when the preset display area plays an image includes:
[0013] f(k)=T×Pr(r);
[0014] In the formula, k is the number of grayscale partitions, k max is the upper limit of the number of grayscale partitions, h is the length of the display, T is the number of grayscale levels in the preset display area; r is the normalized grayscale level of the pixel, ranging from 0 to 1, 0 represents black, 1 represents white, Pr(r) is the probability density distribution function of the pixel grayscale in the image, f(k) is the number of pixels in each grayscale partition of the preset display area; f(k)′ is the number of pixels in each grayscale partition when the preset display area plays an image, and P(k) is the grayscale histogram when the preset display area plays an image.
[0015] Preferably, in the image contrast enhancement method, the step of “performing histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area” includes:
[0016] Dividing the grayscale histogram into regions;
[0017] A histogram equalization process is performed on at least one divided area of the grayscale histogram.
[0018] Preferably, in the image contrast enhancement method, the preset display area is a preset display area of a display, and before calculating the grayscale histogram, the method further includes:
[0019] The number of pixels of each grayscale partition of a preset display area of the display when playing an image is obtained.
[0020] Preferably, in the image contrast enhancement method, the preset display area is a preset area for displaying a picture, and before calculating the grayscale histogram, the method further includes:
[0021] The number of pixels of each grayscale partition in a preset area of the displayed image is obtained.
[0022] The present invention also provides an image contrast enhancement device, comprising:
[0023] A histogram calculation module, used to calculate a grayscale histogram of the preset display area when the image is played according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area;
[0024] The histogram equalization module is used to perform histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area.
[0025] Preferably, in the image contrast enhancement device, the histogram calculation module comprises:
[0026] A partition pixel number calculation unit, used to calculate the number of pixels of each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels in the preset display area and the grayscale distribution function;
[0027] The histogram calculation unit is used to obtain the grayscale histogram according to the number of pixels of each grayscale partition when the preset display area plays an image and the calculated number of pixels of each grayscale partition of the preset display area.
[0028] The present invention also provides a display device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the display device to execute the image contrast enhancement method.
[0029] The present invention also provides a computer storage medium storing a computer program, wherein the computer program implements the image contrast enhancement method when executed by a processor.
[0030] The present invention provides an image contrast enhancement method, which comprises: calculating a grayscale histogram when the preset display area plays an image according to grayscale partitions of a display, the number of pixels of each grayscale partition when the preset display area plays an image, and the total number of pixels of the preset display area; performing histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area. The image contrast enhancement method of the present invention can adjust the grayscale of pixels of an image in the preset display area of the display, thereby enhancing the contrast of the preset display area, will not affect the contrast of the global image, reduce the loss of picture details, and provide users with a better visual experience, and does not need to add additional hardware, thereby reducing costs.
[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0033] Figure 1 is a flow chart of an image contrast enhancement method provided by Embodiment 1 of the present invention;
[0034] Figure 2 is a schematic diagram of a process for calculating a grayscale histogram of an image provided by Embodiment 1 of the present invention;
[0035] Figure 3 is a schematic diagram of a histogram equalization process provided by Embodiment 1 of the present invention;
[0036] Figure 4 is a flow chart of an image contrast enhancement method provided by Embodiment 2 of the present invention;
[0037] Figure 5 is a flow chart of another image contrast enhancement method provided by Embodiment 2 of the present invention;
[0038] Figure 6 is a structural schematic diagram of an image contrast enhancement device provided by Embodiment 3 of the present invention;
[0039] Figure 7 It is a structural schematic diagram of a histogram calculation module of an image contrast enhancement device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0041] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0042] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0043] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0044] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.
[0045] Example 1
[0046] Figure 1 : is a flow chart of an image contrast enhancement method provided by Embodiment 1 of the present invention, the method comprising the following steps:
[0047] Step S11: Calculate a grayscale histogram of the preset display area when playing an image according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays an image, and the total number of pixels of the preset display area.
[0048] In the embodiment of the present invention, the grayscale is the grayscale of the screen, which refers to the brightness value corresponding to each color and its own color light in the screen displayed by the display. The higher the grayscale of the display screen, the richer and more colorful its color is. For example, a display using an 8-bit processing system, that is, a display with 256 grayscale levels, has 256 brightness changes from black to white. Although the grayscale is a determining factor in determining color, it does not mean that the larger the better, because the resolution of the human eye is limited. In high-level grayscale, it is difficult for the human eye to distinguish between two adjacent grayscales. Therefore, before adjusting the grayscale of the pixel points of the display, the total grayscale can be partitioned. For example, the 256-level grayscale can be divided into 16 continuous grayscale areas. When the grayscale of the pixel points is adjusted later, the pixel points in the same grayscale area can be adjusted in the same way, so that the pixel points in different grayscale areas can obtain good contrast.
[0049] In an embodiment of the present invention, the preset display area may be an area pre-divided on the display screen. For example, in the Local dimming regional dimming technology, the display screen may be divided into areas, and the backlight brightness of each divided area may be dynamically controlled according to the real-time picture, so as to perform contrast enhancement control. In the display screen, multiple preset display areas may be pre-divided, and during real-time picture playback, multiple preset display areas that need to be contrast enhanced may be selected to perform grayscale histogram calculation, and the histogram may be equalized to enhance the contrast of the preset display areas. For example, the display screen may be pre-divided into 196 rectangular areas, and when playing pictures, the area selection part in the Local dimming regional dimming technology may be called to select the preset display area that needs to be contrast enhanced, and grayscale histogram equalization may be performed on the preset display area.
[0050] When the display is about to play an image in a preset display area, the number of pixels of each grayscale level of the image in the preset display area can be obtained. Specifically, an application program for obtaining the number of pixels based on grayscale partitioning can be set in the display device. After determining each pixel point of the displayed image, the application program will obtain the grayscale level of each pixel point of the image to be displayed in the preset display area, and then count the pixels according to the grayscale partitioning to obtain the number of pixels of each grayscale partitioning. Among them, the preset display area can be the entire display area of the display, or a part of the display area of the display, or an area in the picture to be displayed where the contrast is not obvious, resulting in the loss of picture details, so as to achieve the effect of adjusting the contrast of the local image. Among them, the area in the picture where the contrast is not obvious can be obtained by an image processing algorithm, which is not limited here.
[0051] In the embodiment of the present invention, while obtaining the number of pixels of each grayscale partition of the preset display area, the display device will also count the total number of pixels in the display screen. If the preset display area is a pre-defined area on the display, the pixel value of the defined area can be directly stored as the total number of pixels of the preset display area. If the preset display area is an area obtained by an algorithm on a picture, the algorithm or application is used to count the pixels of the picture display area to obtain the total number of pixels of the preset display area.
[0052] In an embodiment of the present invention, after obtaining the grayscale partition of the display, the number of pixels of each grayscale partition when the preset display area plays an image, and the total number of pixels of the preset display area, the display device will use a pre-stored histogram algorithm or a histogram application to calculate the grayscale histogram of the preset display area of the image to be displayed based on the above-mentioned obtained data. Among them, in the process of calculating the grayscale histogram, it is mainly divided into two steps: one is to use the total number of pixels in the preset display area, the grayscale partition of the display, and the probability density distribution function of the image grayscale to calculate the number of pixels of each grayscale partition of the preset display area; then, the number of pixels of each grayscale partition of the preset display area when playing the picture is divided by the calculated number of pixels of each grayscale partition, so as to obtain the distribution probability of the number of pixels of each grayscale partition of the preset display area, which is the grayscale histogram of the preset display area. In an embodiment of the present invention, the above-mentioned process of calculating the grayscale histogram can be implemented by an algorithm or an application, which is not limited here.
[0053] Step S12: performing histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area.
[0054] In an embodiment of the present invention, after obtaining a grayscale histogram, a histogram equalization process is performed on the grayscale histogram, so that the pixel points of each grayscale partition of the preset display area are adjusted according to the equalized histogram, that is, the number of pixel points of the preset display area under a certain grayscale partition is adjusted, so as to improve the contrast of the preset display area, and achieve the effect of adjusting the contrast of the local picture without affecting the global contrast of the picture. Among them, the histogram equalization process can effectively enhance the contrast of the preset display area, especially when the grayscale of the image pixel points in the preset display area is quite close, that is, when the contrast is quite close. Among them, the above-mentioned histogram equalization process can be implemented by using an application, for example, an application for histogram equalization is provided in the display device, and after obtaining the grayscale histogram, the grayscale histogram is equalized, and then the contrast of the preset display area is adjusted according to the grayscale histogram after the equalization process.
[0055] Figure 2 1 is a schematic diagram of a process for calculating a grayscale histogram of an image provided by Embodiment 1 of the present invention, comprising the following steps:
[0056] Step S21: Calculating the number of pixels in each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels in the preset display area and the grayscale distribution function.
[0057] Step S22: obtaining the grayscale histogram according to the number of pixels of each grayscale partition when the preset display area plays the image and the number of pixels of each grayscale partition of the preset display area obtained by calculation.
[0058] In the embodiment of the present invention, the grayscale histogram calculation formula of the preset display area when playing an image includes:
[0059] f(k)=T×Pr(r);
[0060] In the formula, k is the number of grayscale partitions, k max is the upper limit of the number of grayscale partitions, h is the length of the display, T is the number of grayscale levels in the preset display area; r is the normalized grayscale level of the pixel, ranging from 0 to 1, 0 represents black, 1 represents white, Pr(r) is the probability density distribution function of the pixel grayscale in the image, f(k) is the number of pixels in each grayscale partition of the preset display area; f(k)′ is the number of pixels in each grayscale partition when the preset display area plays an image, and P(k) is the grayscale histogram when the preset display area plays an image.
[0061] Figure 3 1 is a schematic diagram of a histogram equalization process provided by Embodiment 1 of the present invention, comprising the following steps:
[0062] Step S31: Divide the grayscale histogram into regions.
[0063] Step S32: performing histogram equalization processing on at least one divided area of the grayscale histogram.
[0064] In the embodiment of the present invention, the grayscale histogram can also be divided into regions, and the histogram equalization processing can be performed only on the divided regions. For example, in some preset display regions with brighter backgrounds, the main body is darker. In this case, the first half of the grayscale histogram can be used as the region that needs to be equalized, thereby avoiding equalization processing on the background part of the preset display region and avoiding increasing background noise. Alternatively, the grayscale levels of useful pixels can be screened out, and the grayscale histograms of these useful pixels are divided outside the region, thereby avoiding reducing the contrast of useful pixels during the equalization process.
[0065] Example 2
[0066] Figure 4 : is a flow chart of an image contrast enhancement method provided by Embodiment 2 of the present invention, the method comprising the following steps:
[0067] Step S41 obtains the number of pixels of each grayscale partition of the preset display area of the display when playing an image.
[0068] In an embodiment of the present invention, the preset display area is a preset display area of the display, that is, when the contrast is improved, only the contrast of the preset display area of the display can be improved, wherein the preset display area can be set before the display device leaves the factory, and is not limited here.
[0069] Step S42: Calculate a grayscale histogram of the preset display area of the display when playing an image according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area of the display plays an image, and the total number of pixels of the preset display area of the display.
[0070] The detailed description of this step is consistent with the above step S11 and will not be repeated here.
[0071] Step S43: performing histogram equalization processing on the grayscale histogram to improve the contrast of a preset display area of the display.
[0072] The detailed description of this step is consistent with the above step S12 and will not be repeated here.
[0073] Figure 5 : is a flow chart of another image contrast enhancement method provided by Embodiment 2 of the present invention, the method comprising the following steps:
[0074] Step S51: obtaining the number of pixels of each grayscale partition in a preset area of the displayed image.
[0075] In an embodiment of the present invention, the preset display area may also be a preset area for displaying a picture, wherein the preset area for displaying a picture may be obtained by an image processing algorithm in a display device. For example, an image processing algorithm for analyzing image contrast may be provided in the display device, and an area with low contrast in the displayed picture is obtained by the algorithm, and is set as a preset area for adjusting the contrast of the picture, so that a grayscale histogram may be uniformly processed when the preset area is subsequently displayed, thereby improving the contrast.
[0076] Step S52: Calculate the grayscale histogram of the preset area of the displayed image according to the grayscale partitions of the display, the number of pixels of each grayscale partition of the preset area of the displayed image, and the total number of pixels of the preset display area.
[0077] The detailed description of this step is consistent with the above step S11 and will not be repeated here.
[0078] Step S53: performing histogram equalization processing on the grayscale histogram to improve the contrast of a preset area of the image.
[0079] The detailed description of this step is consistent with the above step S12 and will not be repeated here.
[0080] Example 3
[0081] Figure 6 It is a structural schematic diagram of an image contrast enhancement device provided in Example 3 of the present invention.
[0082] The image contrast enhancement device 600 comprises:
[0083] The histogram calculation module 610 is used to calculate the grayscale histogram of the preset display area when the image is played according to the grayscale partition of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area;
[0084] The histogram equalization module 620 is used to perform histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area.
[0085] like Figure 7 As shown, the histogram calculation module 610 includes:
[0086] A partition pixel number calculation unit 611, configured to calculate the number of pixels of each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels of the preset display area and the grayscale distribution function;
[0087] The histogram calculation unit 612 is used to obtain the grayscale histogram according to the number of pixels of each grayscale partition when the preset display area plays an image and the calculated number of pixels of each grayscale partition of the preset display area.
[0088] In the embodiment of the present invention, for a more detailed functional description of the above modules and units, reference may be made to the corresponding contents in the aforementioned embodiment, which will not be repeated here.
[0089] In addition, the present invention also provides a display device, which may include a smart phone, a tablet computer, a car computer, a smart wearable device, etc. The display device includes a memory and a processor, the memory may be used to store a computer program, and the processor runs the computer program to enable the display device to perform the functions of each module in the above method or the above image contrast enhancement device.
[0090] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the display device (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0091] This embodiment also provides a computer storage medium for storing a computer program used in the above display device.
[0092] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0094] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0095] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for enhancing image contrast, characterized in that: include: Calculate a grayscale histogram of the preset display area when the image is played according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area; Performing histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area; The grayscale histogram calculation formula of the preset display area when playing an image includes: f(k)=T×Pr(r); In the formula, k is the number of grayscale partitions, k max is the upper limit of the number of grayscale partitions, h is the length of the display, T is the number of grayscale levels in the preset display area; r is the normalized grayscale level of the pixel, ranging from 0 to 1, 0 represents black, 1 represents white, Pr(r) is the probability density distribution function of the pixel grayscale in the image, f(k) is the number of pixels in each grayscale partition of the preset display area; f(k)′ is the number of pixels in each grayscale partition when the preset display area plays an image, and P(k) is the grayscale histogram when the preset display area plays an image.
2. The image contrast enhancement method according to claim 1, characterized in that: The step of calculating a grayscale histogram when the preset display area plays an image according to the grayscale partitions of the display, the number of pixels of each grayscale partition when the preset display area plays an image, and the total number of pixels of the preset display area comprises: Calculating the number of pixels of each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels of the preset display area and the grayscale distribution function; The grayscale histogram is obtained according to the number of pixels of each grayscale partition when the preset display area plays an image and the number of pixels of each grayscale partition of the preset display area obtained by calculation.
3. The image contrast enhancement method according to claim 1, characterized in that: The performing histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area includes: Dividing the grayscale histogram into regions; A histogram equalization process is performed on at least one divided area of the grayscale histogram.
4. The image contrast enhancement method according to any one of claims 1 to 3, characterized in that: The preset display area is a preset display area of the display, and before calculating the grayscale histogram, the method further includes: The number of pixels of each grayscale partition of a preset display area of the display when playing an image is obtained.
5. The image contrast enhancement method according to any one of claims 1 to 3, characterized in that: The preset display area is a preset area for displaying a picture, and before calculating the grayscale histogram, the method further includes: The number of pixels of each grayscale partition in a preset area of the displayed image is obtained.
6. An image contrast enhancement device, characterized in that: include: The histogram calculation module is used to calculate the grayscale histogram of the preset display area when the image is played according to the grayscale partition of the display, the number of pixels of each grayscale partition when the preset display area plays the image, and the total number of pixels of the preset display area; wherein the formula of the grayscale histogram when the preset display area plays the image includes: f(k)=T×Pr(r); In the formula, k is the number of grayscale partitions, k max is the upper limit of the number of grayscale partitions, h is the length of the display, T is the number of grayscales in the preset display area; r is the normalized grayscale of the pixel, ranging from 0 to 1, 0 represents black, 1 represents white, Pr(r) is the probability density distribution function of the grayscale of the pixel in the image, f(k) is the number of pixels in each grayscale partition of the preset display area; f(k)′ is the number of pixels in each grayscale partition when the preset display area plays an image, and P(k) is the grayscale histogram when the preset display area plays an image; The histogram equalization module is used to perform histogram equalization processing on the grayscale histogram to improve the contrast of the preset display area.
7. The image contrast enhancement device according to claim 6, characterized in that: The histogram calculation module comprises: A partition pixel number calculation unit, used to calculate the number of pixels of each grayscale partition of the preset display area according to the grayscale partition, the total number of pixels in the preset display area and the grayscale distribution function; The histogram calculation unit is used to obtain the grayscale histogram according to the number of pixels of each grayscale partition when the preset display area plays an image and the calculated number of pixels of each grayscale partition of the preset display area.
8. A display device, characterized in that: The device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the display device to perform the image contrast enhancement method according to any one of claims 1 to 5.
9. A computer storage medium, characterized in that The computer program is stored therein, and when the computer program is executed by a processor, the image contrast enhancement method according to any one of claims 1 to 5 is implemented.
