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

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

Info

Publication number
CN109191395B
CN109191395B CN201810952870.7A CN201810952870A CN109191395B CN 109191395 B CN109191395 B CN 109191395B CN 201810952870 A CN201810952870 A CN 201810952870A CN 109191395 B CN109191395 B CN 109191395B
Authority
CN
China
Prior art keywords
gray
image
scale
brightness
sub
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.)
Active
Application number
CN201810952870.7A
Other languages
Chinese (zh)
Other versions
CN109191395A (en
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.)
Shenzhen Skyworth RGB Electronics Co Ltd
Original Assignee
Shenzhen Skyworth RGB Electronics 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 Shenzhen Skyworth RGB Electronics Co Ltd filed Critical Shenzhen Skyworth RGB Electronics Co Ltd
Priority to CN201810952870.7A priority Critical patent/CN109191395B/en
Publication of CN109191395A publication Critical patent/CN109191395A/en
Priority to PCT/CN2019/094263 priority patent/WO2020038124A1/en
Application granted granted Critical
Publication of CN109191395B publication Critical patent/CN109191395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation

Landscapes

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

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for enhancing image contrast, wherein the method comprises the following steps: acquiring a gray scale image of a target image; carrying out global contrast enhancement on the gray level image to obtain a global gray level image; dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map; and determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image. The technical problem that the image contrast enhancement scheme in the prior art is poor in adaptability is solved, and the technical effect of improving the adaptability of image contrast enhancement to the image is achieved.

Description

Image contrast enhancement method, device, equipment and storage medium
Technical Field
Embodiments of the present invention relate to image processing, and in particular, to a method, an apparatus, a device, and a storage medium for enhancing image contrast.
Background
At present, the most common image contrast enhancement method is global contrast enhancement, and for global contrast enhancement, if the parameter setting is too strong, the contrast of the processed image is excessively enhanced and unnatural, and some details are reduced or even disappear; if the parameter setting is too weak, the ideal contrast enhancement effect cannot be achieved, so that the two global contrast enhancement methods have the problem of poor adaptability to the picture; after recognizing the limitation of global contrast, the local area contrast enhancement technology is considered to be added, but the effect of the existing local area contrast enhancement technology is also poor in adaptability to pictures.
In summary, the image contrast enhancement scheme in the prior art has a technical problem of poor adaptability.
Disclosure of Invention
Embodiments of the present invention provide an image contrast enhancement method, apparatus, device and storage medium, so as to solve the technical problem of poor adaptability of an image contrast enhancement scheme in the prior art.
In a first aspect, an embodiment of the present invention provides an image contrast enhancement method, including:
acquiring a gray scale image of a target image;
carrying out global contrast enhancement on the gray level image to obtain a global gray level image;
dividing the gray scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray scale value of the target sub-region according to the gray scale value of the adjacent sub-region of the target sub-region to generate a local gray scale map;
and determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image.
Further, the performing global contrast enhancement on the gray scale map to obtain a global gray scale map includes:
and carrying out global contrast enhancement on the gray-scale image based on a fitted curve method to obtain a global gray-scale image.
Further, the performing global contrast enhancement on the gray scale map based on the fitted curve method to obtain a global gray scale map includes:
determining a gray level histogram of the gray level map based on a preset gray level number, and dividing the gray level map into a corresponding number of brightness regions based on a preset brightness level number;
acquiring a nonlinear adjustment curve of each brightness area;
acquiring the global gain and brightness weight coefficient of each brightness area as the global gain and brightness weight coefficient corresponding to each gray scale of the brightness area;
taking the product of the nonlinear adjustment curve value, the global gain and the weight coefficient of each gray scale of each brightness area as a single brightness adjustment value, and taking the sum of the single brightness adjustment values of different brightness areas corresponding to each gray scale as the adjustment value of each gray scale;
and adjusting the gray level image according to the adjustment value of each gray level to obtain a global gray level image.
Further, obtaining a luminance weight coefficient of each luminance region includes:
setting a brightness weight curve corresponding to the gray level histogram for each brightness area, wherein the brightness weight curve is used for expressing the ratio of the brightness value of each gray level in the current brightness area to the brightness values of all the brightness areas;
and calculating the ratio of all the brightness weights corresponding to the brightness weight curve of each brightness area to the sum of all the brightness weights corresponding to the brightness weight curves of all the brightness areas to serve as the weight coefficient of each brightness area.
Further, the dividing the gray scale map into a plurality of sub-regions includes:
performing edge filtering on the gray level image to obtain an edge image;
dividing the gray scale map into a plurality of sub-regions based on edges of the edge image.
Further, the adjusting the gray value of the target sub-region according to the gray value of the adjacent sub-region of the target sub-region to generate a local gray map includes:
calculating the average gray value of each sub-area;
and adjusting the gray value of the target sub-area according to the average gray value of the adjacent sub-area of the target sub-area to generate a local gray image.
Further, the adjusting the gray value of the target sub-region according to the average gray value of the adjacent sub-regions of the target sub-region to generate a local gray map includes:
calculating the difference sum of the average gray values of the target sub-area and each adjacent sub-area of the target sub-area;
and adjusting the gray distribution of the target sub-area according to the difference value to generate a local gray map.
In a second aspect, an embodiment of the present invention further provides an image contrast enhancement apparatus, including:
the gray-scale image acquisition module is used for acquiring a gray-scale image of the target image;
the global gray-scale image module is used for carrying out global contrast enhancement on the gray-scale image so as to obtain a global gray-scale image;
the local gray-scale map module is used for dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map;
and the enhanced gray level image determining module is used for determining an enhanced gray level image after the contrast of the target image is enhanced according to the global gray level image and the local gray level image.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of image contrast enhancement as described in the first aspect.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions for performing the image contrast enhancement method according to the first aspect when executed by a computer processor.
The technical scheme of the image contrast enhancement method provided by the embodiment of the invention comprises the following steps: acquiring a gray scale image of a target image; carrying out global contrast enhancement on the gray level image to obtain a global gray level image; dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map; and determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image. The local gray-scale image of the current sub-area is determined by combining the average value of the gray-scale values of the adjacent sub-areas, so that the overall effect of the picture can be improved while the dynamic enhancement of the local contrast is realized; the enhanced gray level map determined by combining the global gray level map and the local gray level map can show more picture details to present a more real and natural picture.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of an image contrast enhancement method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a global contrast enhancement method based on a fitted curve method according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating a non-linear adjustment curve of a low bright area according to a second embodiment of the present invention;
FIG. 4 is a diagram illustrating a non-linear adjustment curve of a middle bright area according to a second embodiment of the present invention;
FIG. 5 is a diagram illustrating a non-linear adjustment curve of a bright area according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of a histogram and a weight curve according to a second embodiment of the present invention;
fig. 7 is a block diagram of an image contrast enhancement apparatus according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus provided in the fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through embodiments with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a flowchart of an image contrast enhancement method according to an embodiment of the present invention. The technical scheme of the embodiment is suitable for the situation of contrast enhancement of the image. The method can be executed by the image contrast enhancement device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware manner and is configured to be applied in a processor. The method specifically comprises the following steps:
and S101, acquiring a gray scale image of the target image.
The gray scale number of the target image to be processed is obtained, and the gray scale number of the gray scale image can be set according to the usage scenario, which is not limited herein, and the example of the gray scale number being 1024 levels is described.
And S102, carrying out global contrast enhancement on the gray-scale image to obtain a global gray-scale image.
In order to obtain a good contrast effect, in this embodiment, global contrast enhancement is performed on the grayscale image to obtain a global grayscale image, and the global contrast enhancement is preferably performed on the grayscale image by using a fitted curve method to obtain the global grayscale image.
S103, dividing the gray-scale image into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale image.
In order to improve the image contrast enhancement effect, in this embodiment, on the basis of global contrast enhancement, local contrast enhancement is further introduced, the grayscale image is divided into a plurality of sub-regions, each sub-region is taken as a target sub-region based on a preset sequence, and the gray value of the target sub-region is adjusted according to the gray value of the adjacent sub-region of the target sub-region, so as to generate a local grayscale image.
Further, in order to improve the flexibility of sub-region division, in this embodiment, the edge filtering is performed on the grayscale image to obtain an edge image, and then the grayscale image is divided into a plurality of sub-regions based on the edge of the edge image. Preferably, the edge filtering method adopts a Sobel operator, and the method for dividing the gray-scale image based on the edge image includes:
calculating the horizontal direction difference Gx and the vertical direction difference Gy by adopting an edge difference Sobel operator, wherein the calculation is as follows:
Figure BDA0001771953510000071
Figure BDA0001771953510000072
the gradient mode and direction are calculated based on the horizontal direction difference Gx and the vertical direction difference Gy as follows:
Figure BDA0001771953510000073
θ=atan2(Gy,Gx)
the gradient angle θ ranges from radian- π to π, approximating it to four directions, representing horizontal, vertical and two diagonal directions (0, 45, 90, 135), respectively. The segmentation may be performed at ± i pi/8 (i ═ 1, 3, 5, 7), giving a specific value to the gradient angle falling in each region, representing one of the four directions, and thus obtaining an edge image. Since the edge images and gradient results are different for different images, the shape and number of sub-regions are different for different images. Therefore, the number and the shape of the sub-regions of the embodiment are not fixed and can be different according to different target images, so that the flexibility of local gray-scale image processing and the adaptability to the target images are improved.
After the sub-regions are determined, the gray scale distribution of each sub-region generally needs to be adjusted, and in this embodiment, the gray scale value of the target sub-region is adjusted according to the gray scale value of the adjacent sub-region of the target sub-region, preferably the gray scale average value, to generate a local gray scale map, preferably: calculating the difference sum of the average gray values of the target sub-area and each adjacent sub-area of the target sub-area; and adjusting the gray distribution of the target sub-area according to the difference value to generate a local gray map. In order to increase the speed of image processing, in this embodiment, each difference value and the corresponding adjustment policy are summarized in a table, so that when each target sub-region is processed, only the corresponding adjustment policy is searched in the table according to the difference value, and the adjustment policy here is gray scale mapping, specifically, if the difference value is the difference value between the target sub-region and its adjacent region, when the sum of the difference values is greater than positive, it indicates that the overall gray scale value of the target sub-region is higher, the gray scale of the target sub-region is compressed through gray scale mapping; when the difference sum is negative, the overall gray value of the target sub-area is low, and the gray value of the target sub-area is raised through gray mapping. The gray distribution of the target sub-area is adjusted through the gray average value of the adjacent images, so that the adaptability of local contrast enhancement to different images is improved, and the contrast enhancement effect of the whole image is more natural.
For example, assuming that the average gray-scale value of the target sub-region is 100, and the average gray-scale values of the four adjacent sub-regions are 80, 90, 110 and 110, respectively, the sum of the differences between the average gray-scale values of the target sub-region and the adjacent sub-regions is-10, and then a table lookup is performed to search the sum of the differences for an adjustment strategy corresponding to-10, so as to adjust the gray-scale value of the target sub-region.
And S104, determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image.
After the global gray-scale image and the local partial layout are determined, the global gray-scale image and the local gray-scale image are superposed to generate an enhanced gray-scale image after the target image is enhanced.
The technical scheme of the image contrast enhancement method provided by the embodiment of the invention comprises the following steps: acquiring a gray scale image of a target image; carrying out global contrast enhancement on the gray level image to obtain a global gray level image; dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map; and determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image. The local gray-scale image of the current sub-area is determined by combining the average value of the gray-scale values of the adjacent sub-areas, so that the overall effect of the picture can be improved while the dynamic enhancement of the local contrast is realized; the enhanced gray level map determined by combining the global gray level map and the local gray level map can show more picture details to present a more real and natural picture.
Example two
Fig. 2 is a flowchart of an image contrast enhancement method according to a second embodiment of the present invention. The embodiment of the present invention further illustrates global contrast enhancement based on a fitted curve method on the basis of the above embodiment, including:
and S1021, determining a gray level histogram of the gray level map based on the preset gray level number, and dividing the gray level map into a corresponding number of brightness areas based on the preset brightness level number.
The preset gray scale number can be set according to an actual use scene, and the preset gray scale number of the embodiment is preferably 32 levels which can be distinguished by human eyes, namely, a 32-level gray scale histogram of a 1024-level target image gray scale map needs to be determined.
The preset brightness level number can be set according to an actual use scene, and this embodiment describes that the preset brightness level number is 3, that is, the gray scale map is divided into 3 brightness regions, which are a low brightness region, a medium brightness region, and a high brightness region.
And S1022, acquiring a nonlinear adjustment curve of each brightness area.
And setting a nonlinear adjustment curve for each brightness region according to the adjustment target of each brightness region. It is understood that the shape of the non-linear adjustment curve may be set according to the usage scenario, and the non-linear adjustment curve is used to substantially reflect the contrast distribution of the located brightness region. Alternatively, the non-linear adjustment curve of the present embodiment is as shown in fig. 3, 4 and 5, and the dotted line is a straight line forming 45 ° with the coordinate axis, which indicates that the contrast of the images before and after processing is the same. Generally, when the nonlinear curve value is greater than 1, highlight portions of the image are compressed and dark portions of the image are expanded, and when the nonlinear curve value is less than 1, highlight portions of the image are expanded and dark portions of the image are compressed.
The three non-linear adjusting curves correspond to three lookup tables, the adjusting curve lookup table of the low brightness region corresponding to the non-linear adjusting curve of the low brightness region is Lut _0[32], the adjusting curve lookup table of the middle brightness region corresponding to the non-linear adjusting curve of the middle brightness region is Lut _1[32], and the adjusting curve lookup table of the high brightness region corresponding to the non-linear adjusting curve of the high brightness region is Lut _2[32 ].
S1023, obtaining the global gain and brightness weight coefficient of each brightness area as the global gain and brightness weight coefficient corresponding to each gray scale of the brightness area.
And acquiring the global gain of each brightness area as the global gain corresponding to each gray scale of the brightness area, wherein the global gain is an empirical value.
Acquiring a brightness weight coefficient of each brightness area as a brightness weight coefficient corresponding to each gray scale number of the brightness area, wherein the brightness weight coefficient is acquired by the following method: as shown in fig. 6, a luminance weight curve corresponding to the gray level histogram is set for each luminance area, wherein the luminance weight curve is used to represent the ratio of the luminance value of each gray level in the current luminance area to the luminance values of all luminance areas. The three brightness weight curves respectively correspond to three lookup tables, the weight lookup table of the low brightness area corresponding to the weight curve of the low brightness area is BinWeighting _ low _ LUT [32], the weight lookup table of the middle brightness area corresponding to the weight curve of the middle brightness area is BinWeighting _ mid _ LUT [32], and the weight lookup table of the high brightness area corresponding to the weight curve of the high brightness area is BinWeighting _ high _ LUT [32 ].
After the weight curve is determined, the product of the brightness weight curve of each brightness area and all corresponding gray scales is calculated as the weight of the brightness area, wherein the weight of the low brightness area is represented as Metric [0], the weight of the middle brightness area is represented as Metric [1], and the weight of the high brightness area is represented as Metric [2 ]. MetricSum ═ Metric [0] + Metric [1] + Metric [2], then corresponds to the sum of the weights of the three luminance zones, then the weighting coefficients of the three luminance zones are:
the weighting coefficients of the low bright areas are:
Figure BDA0001771953510000111
the weighting coefficients of the highlight areas are:
Figure BDA0001771953510000112
the weighting factor of the highlight is:
Figure BDA0001771953510000113
s1024, taking the product of the nonlinear adjustment curve value, the global gain and the weight coefficient of each gray scale of each brightness area as a single brightness adjustment value, and taking the sum of the single brightness adjustment values of different brightness areas corresponding to each gray scale as the adjustment value of each gray scale.
The product of the nonlinear adjustment curve value, the global gain and the weight coefficient of each gray scale of each brightness area is obtained to be used as a single brightness adjustment value of each gray scale, then the sum of the single brightness adjustment values of different brightness areas corresponding to each gray scale is obtained to be used as the adjustment value of each gray scale, and the comprehensive expression of the adjustment values is as follows:
LUT[i]=GlbGain0*W0*Lut_0[i]+GlbGain1*W1*Lut_1[i]+GlbGain2*W2*Lut_2[i]
the GlbGain0 is the global gain of the low bright area, the GlbGain1 is the global gain of the medium bright area, and the GlbGain2 is the global gain of the high bright area.
According to the formula, the adjustment value of each gray scale contains the information of each brightness area, which is beneficial to improving the adaptability of the global contrast enhancement to the image and the image contrast enhancement effect of the global gray scale image.
And S1025, adjusting the gray level image according to the adjustment value of each gray level to obtain a global gray level image.
Since the gray histogram and the non-linear adjustment curve graph are 32-order gray histograms, the adjustment value of the gray scale is also based on 32-order, and therefore after the adjustment value of each gray scale is determined, the adjustment value of each gray scale of the 1024-order gray histogram can be obtained through linear interpolation according to the adjustment value of each gray scale of the 32-order gray histogram, and then the global gray map can be obtained according to the adjustment value of each gray scale of the 1024-order gray histogram.
The embodiment of the invention can effectively balance the adjusting effect of each nonlinear adjusting curve through the weight coefficient, and further can quickly and accurately determine the global gray-scale image of the target image.
EXAMPLE III
Fig. 7 is a block diagram of an image contrast enhancement apparatus according to a third embodiment of the present invention. The apparatus is used for executing the image contrast enhancement method provided by any of the above embodiments, and the apparatus can be implemented by software or hardware. The device includes:
a grayscale image obtaining module 11, configured to obtain a grayscale image of the target image;
the global gray-scale image module 12 is configured to perform global contrast enhancement on the gray-scale image to obtain a global gray-scale image;
the local gray-scale map module 13 is configured to divide the gray-scale map into a plurality of sub-regions, use each sub-region as a target sub-region based on a preset sequence, and adjust a gray-scale value of the target sub-region according to a gray-scale value of an adjacent sub-region of the target sub-region to generate a local gray-scale map;
and an enhanced gray level image determining module 14, configured to determine an enhanced gray level image after contrast enhancement of the target image according to the global gray level image and the local gray level image.
The image contrast enhancement device provided by the embodiment of the invention comprises: the gray-scale image acquisition module is used for acquiring a gray-scale image of the target image; the global gray-scale image module is used for carrying out global contrast enhancement on the gray-scale image so as to obtain a global gray-scale image; the local gray-scale map module is used for dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map; and the enhanced gray level image determining module is used for determining an enhanced gray level image after the contrast of the target image is enhanced according to the global gray level image and the local gray level image. The local gray-scale image of the current sub-area is determined by combining the average value of the gray-scale values of the adjacent sub-areas, so that the overall effect of the picture can be improved while the dynamic enhancement of the local contrast is realized; the enhanced gray level map determined by combining the global gray level map and the local gray level map can show more picture details to present a more real and natural picture.
The image contrast enhancement device provided by the embodiment of the invention can execute the image contrast enhancement method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 8 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention, as shown in fig. 8, the apparatus includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of the processors 201 in the device may be one or more, and one processor 201 is taken as an example in fig. 8; the processor 201, the memory 202, the input device 203 and the output device 204 in the apparatus may be connected by a bus or other means, and fig. 8 illustrates the connection by a bus as an example.
The memory 202, as a computer-readable storage medium, can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the image contrast enhancement method in the embodiment of the present invention (e.g., the gray map acquisition module 11, the global gray map module 12, the local gray map module 13, and the enhanced gray map determination module 14). The processor 201 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the memory 202, i.e. implements the image contrast enhancement method described above.
The memory 202 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 202 may further include memory located remotely from the processor 201, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the apparatus.
The output device 204 may include a display device such as a display screen, for example, of a user terminal.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for image contrast enhancement, the method including:
acquiring a gray scale image of a target image;
carrying out global contrast enhancement on the gray level image to obtain a global gray level image;
dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map.
And determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the image contrast enhancement method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the image contrast enhancement method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the image contrast enhancement apparatus, the units and modules included in the embodiment are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. An image contrast enhancement method, comprising:
acquiring a gray scale image of a target image;
carrying out global contrast enhancement on the gray level image to obtain a global gray level image;
dividing the gray scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray scale value of the target sub-region according to the gray scale value of the adjacent sub-region of the target sub-region to generate a local gray scale map;
determining an enhanced gray scale image after the contrast of the target image is enhanced according to the global gray scale image and the local gray scale image;
wherein, the adjusting the gray value of the target sub-region according to the gray value of the adjacent sub-region of the target sub-region to generate a local gray map further comprises:
calculating the difference sum of the average gray values of the target sub-area and each adjacent sub-area of the target sub-area;
and adjusting the gray distribution of the target sub-area according to the difference value to generate a local gray map.
2. The method of claim 1, wherein the global contrast enhancement of the gray scale map to obtain a global gray scale map comprises:
and carrying out global contrast enhancement on the gray-scale image based on a fitted curve method to obtain a global gray-scale image.
3. The method of claim 2, wherein the fitting curve based approach to global contrast enhancement of the gray scale map to obtain a global gray scale map comprises:
determining a gray level histogram of the gray level map based on a preset gray level number, and dividing the gray level map into a corresponding number of brightness regions based on a preset brightness level number;
acquiring a nonlinear adjustment curve of each brightness area;
acquiring the global gain and brightness weight coefficient of each brightness area as the global gain and brightness weight coefficient corresponding to each gray scale of the brightness area;
taking the product of the nonlinear adjustment curve value, the global gain and the weight coefficient of each gray scale of each brightness area as a single brightness adjustment value, and taking the sum of the single brightness adjustment values of different brightness areas corresponding to each gray scale as the adjustment value of each gray scale;
and adjusting the gray level image according to the adjustment value of each gray level to obtain a global gray level image.
4. The method of claim 3, wherein obtaining the luminance weight coefficient for each luminance region comprises:
setting a brightness weight curve corresponding to the gray level histogram for each brightness area, wherein the brightness weight curve is used for expressing the ratio of the brightness value of each gray level in the current brightness area to the brightness values of all the brightness areas;
and calculating the ratio of all the brightness weights corresponding to the brightness weight curve of each brightness area to the sum of all the brightness weights corresponding to the brightness weight curves of all the brightness areas to serve as the weight coefficient of each brightness area.
5. The method of claim 1, wherein the dividing the grayscale map into a plurality of sub-regions comprises:
performing edge filtering on the gray level image to obtain an edge image;
dividing the gray scale map into a plurality of sub-regions based on edges of the edge image.
6. The method according to claim 5, wherein the adjusting the gray value of the target sub-region according to the gray values of the adjacent sub-regions of the target sub-region to generate the local gray map comprises:
calculating the average gray value of each sub-area;
and adjusting the gray value of the target sub-area according to the average gray value of the adjacent sub-area of the target sub-area to generate a local gray image.
7. An image contrast enhancement device, comprising:
the gray-scale image acquisition module is used for acquiring a gray-scale image of the target image;
the global gray-scale image module is used for carrying out global contrast enhancement on the gray-scale image so as to obtain a global gray-scale image;
the local gray-scale map module is used for dividing the gray-scale map into a plurality of sub-regions, taking each sub-region as a target sub-region based on a preset sequence, and adjusting the gray-scale value of the target sub-region according to the gray-scale value of the adjacent sub-region of the target sub-region to generate a local gray-scale map;
the enhanced gray level image determining module is used for determining an enhanced gray level image after the contrast of the target image is enhanced according to the global gray level image and the local gray level image;
wherein, the adjusting the gray value of the target sub-region according to the gray value of the adjacent sub-region of the target sub-region to generate a local gray map further comprises:
calculating the difference sum of the average gray values of the target sub-area and each adjacent sub-area of the target sub-area;
and adjusting the gray distribution of the target sub-area according to the difference value to generate a local gray map.
8. An apparatus, characterized in that the apparatus comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the image contrast enhancement method of any of claims 1-6.
9. A storage medium containing computer-executable instructions for performing the image contrast enhancement method of any one of claims 1-6 when executed by a computer processor.
CN201810952870.7A 2018-08-21 2018-08-21 Image contrast enhancement method, device, equipment and storage medium Active CN109191395B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810952870.7A CN109191395B (en) 2018-08-21 2018-08-21 Image contrast enhancement method, device, equipment and storage medium
PCT/CN2019/094263 WO2020038124A1 (en) 2018-08-21 2019-07-01 Image contrast enhancement method and apparatus, and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810952870.7A CN109191395B (en) 2018-08-21 2018-08-21 Image contrast enhancement method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109191395A CN109191395A (en) 2019-01-11
CN109191395B true CN109191395B (en) 2021-03-09

Family

ID=64918789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810952870.7A Active CN109191395B (en) 2018-08-21 2018-08-21 Image contrast enhancement method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109191395B (en)
WO (1) WO2020038124A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109191395B (en) * 2018-08-21 2021-03-09 深圳创维-Rgb电子有限公司 Image contrast enhancement method, device, equipment and storage medium
CN109903294B (en) * 2019-01-25 2020-05-29 北京三快在线科技有限公司 Image processing method and device, electronic equipment and readable storage medium
CN110033474B (en) * 2019-01-30 2021-09-03 西安天伟电子系统工程有限公司 Target detection method, target detection device, computer equipment and storage medium
CN110099222B (en) * 2019-05-17 2021-05-07 睿魔智能科技(深圳)有限公司 Exposure adjusting method and device for shooting equipment, storage medium and equipment
CN113015006B (en) * 2020-06-04 2022-10-14 海信视像科技股份有限公司 Display apparatus and display method
CN111683192B (en) * 2020-06-11 2023-03-21 展讯通信(上海)有限公司 Image processing method and related product
CN111738944B (en) * 2020-06-12 2024-04-05 深圳康佳电子科技有限公司 Image contrast enhancement method and device, storage medium and intelligent television
CN112419217B (en) * 2020-11-19 2024-03-26 腾讯科技(深圳)有限公司 Image processing method, device, computer equipment and medium
CN112950515A (en) * 2021-01-29 2021-06-11 Oppo广东移动通信有限公司 Image processing method and device, computer readable storage medium and electronic device
CN112950516B (en) * 2021-01-29 2024-05-28 Oppo广东移动通信有限公司 Method and device for enhancing local contrast of image, storage medium and electronic equipment
TWI786719B (en) * 2021-07-13 2022-12-11 義隆電子股份有限公司 Method for improving halo effect of display
CN113436263B (en) * 2021-08-25 2021-12-21 深圳市大道智创科技有限公司 Feature point extraction method and system based on image processing
CN113947553B (en) * 2021-12-20 2022-03-18 山东信通电子股份有限公司 Image brightness enhancement method and device
CN116894795B (en) * 2023-09-11 2023-12-26 归芯科技(深圳)有限公司 Image processing method and device
CN117218029B (en) * 2023-09-25 2024-03-01 南京邮电大学 Night dim light image intelligent processing method based on neural network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853497A (en) * 2010-02-25 2010-10-06 杭州海康威视软件有限公司 Image enhancement method and device
CN103279930A (en) * 2013-05-27 2013-09-04 辽宁工程技术大学 Synchronous image denoising and enhancing method
CN104994376A (en) * 2015-07-10 2015-10-21 深圳华侨城文化旅游科技股份有限公司 Method and system for automatically simulating projection colors of projector
CN105654438A (en) * 2015-12-27 2016-06-08 西南技术物理研究所 Gray scale image fitting enhancement method based on local histogram equalization
CN107767349A (en) * 2017-10-12 2018-03-06 深圳市华星光电半导体显示技术有限公司 A kind of method of Image Warping enhancing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7406716B2 (en) * 2003-06-10 2008-07-29 Kabushiki Kaisha Toshiba Software IP providing system and method, software IP obtaining method, and IP core designing and manufacturing method
US20100278423A1 (en) * 2009-04-30 2010-11-04 Yuji Itoh Methods and systems for contrast enhancement
CN105608676B (en) * 2015-12-23 2018-06-05 浙江宇视科技有限公司 The Enhancement Method and device of a kind of video image
CN109191395B (en) * 2018-08-21 2021-03-09 深圳创维-Rgb电子有限公司 Image contrast enhancement method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853497A (en) * 2010-02-25 2010-10-06 杭州海康威视软件有限公司 Image enhancement method and device
CN103279930A (en) * 2013-05-27 2013-09-04 辽宁工程技术大学 Synchronous image denoising and enhancing method
CN104994376A (en) * 2015-07-10 2015-10-21 深圳华侨城文化旅游科技股份有限公司 Method and system for automatically simulating projection colors of projector
CN105654438A (en) * 2015-12-27 2016-06-08 西南技术物理研究所 Gray scale image fitting enhancement method based on local histogram equalization
CN107767349A (en) * 2017-10-12 2018-03-06 深圳市华星光电半导体显示技术有限公司 A kind of method of Image Warping enhancing

Also Published As

Publication number Publication date
WO2020038124A1 (en) 2020-02-27
CN109191395A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
CN109191395B (en) Image contrast enhancement method, device, equipment and storage medium
US11113795B2 (en) Image edge processing method, electronic device, and computer readable storage medium
CN109817170B (en) Pixel compensation method and device and terminal equipment
CN105243371A (en) Human face beauty degree detection method and system and shooting terminal
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
CN111127476A (en) Image processing method, device, equipment and storage medium
EP3503019A1 (en) Improved inverse tone mapping method and corresponding device
CN111489322A (en) Method and device for adding sky filter to static picture
CN111369471A (en) Image processing method, device, equipment and storage medium
CN115578284A (en) Multi-scene image enhancement method and system
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
US9940543B2 (en) Control of computer vision pre-processing based on image matching using structural similarity
CN107564085B (en) Image warping processing method and device, computing equipment and computer storage medium
CN109982012B (en) Image processing method and device, storage medium and terminal
CN113793257A (en) Image processing method and device, electronic equipment and computer readable storage medium
WO2013109192A1 (en) Method and device for image processing
CN108734712B (en) Background segmentation method and device and computer storage medium
CN113052923A (en) Tone mapping method, tone mapping apparatus, electronic device, and storage medium
JP2012194603A (en) Image processing device, image processing program, and image processing method
CN113256484B (en) Method and device for performing stylization processing on image
CN115471413A (en) Image processing method and device, computer readable storage medium and electronic device
CN110035267B (en) Image enhancement circuit and method
CN109242750B (en) Picture signature method, picture matching method, device, equipment and storage medium
CN112200730B (en) Image filtering processing method, device, equipment and storage medium
CN111383183B (en) Image edge enhancement method and device and computer storage medium

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
GR01 Patent grant
GR01 Patent grant