WO2017063299A1 - 一种对比度调整方法及装置 - Google Patents

一种对比度调整方法及装置 Download PDF

Info

Publication number
WO2017063299A1
WO2017063299A1 PCT/CN2015/100215 CN2015100215W WO2017063299A1 WO 2017063299 A1 WO2017063299 A1 WO 2017063299A1 CN 2015100215 W CN2015100215 W CN 2015100215W WO 2017063299 A1 WO2017063299 A1 WO 2017063299A1
Authority
WO
WIPO (PCT)
Prior art keywords
contrast
value
region
segmentation
jnd
Prior art date
Application number
PCT/CN2015/100215
Other languages
English (en)
French (fr)
Inventor
金羽锋
Original Assignee
深圳市华星光电技术有限公司
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 深圳市华星光电技术有限公司 filed Critical 深圳市华星光电技术有限公司
Priority to US14/908,150 priority Critical patent/US10210604B2/en
Publication of WO2017063299A1 publication Critical patent/WO2017063299A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to a contrast adjustment method and apparatus.
  • Contrast refers to the measurement of different brightness levels between the brightest white and the darkest black in the image, reflecting the magnitude of the grayscale contrast of an image. The larger the difference range, the greater the contrast.
  • Adjusting the image contrast is an important means of enhancing the image display.
  • the method of adjusting image contrast is generally to convert an image to an HSV (hue-saturation-value) color space or LAB (L is an abbreviation for luminosity, indicating brightness; AB means color channel, A represents the range from magenta to green, B represents the color space from yellow to blue, and then adjusts the brightness curve of the luminance component (V or L) to change the brightness correspondence of the pixels before and after the adjustment, thereby achieving the adjustment image.
  • HSV high-saturation-value
  • LAB an abbreviation for luminosity, indicating brightness
  • AB means color channel
  • A represents the range from magenta to green
  • B represents the color space from yellow to blue
  • V or L luminance component
  • the Gamma parameter of the display can be used to adjust, for example, by changing the relationship between the gray signal and the brightness, but the single contrast setting is not applicable to all images.
  • Embodiments of the present invention provide a method and apparatus for adjusting image contrast, which are intended to improve the contrast of an image.
  • Embodiments of the present invention provide a contrast adjustment method, including:
  • the step S2 is specifically: dividing the gray-scale image by using a watershed algorithm to obtain a plurality of divided regions;
  • the step S4 specifically includes:
  • the step S42 specifically includes:
  • S421 classify the segmentation area based on the determination result
  • the step S43 specifically includes:
  • the step S421 is specifically:
  • the step S422 is specifically:
  • the C H is a region contrast of the segmentation region in the first type of segmentation region
  • the C L is a region contrast of the segmentation region in the second type of segmentation region
  • the I ave is the segmentation The average value of the brightness of the area, the I bg being the background brightness value of the current image.
  • the step S423 is specifically:
  • the C H-jnd is a contrast quantization value of the segmentation region in the first type of segmentation region, and the C jnd is the JND value, and represents a contrast difference value of each segmentation region.
  • the JND value is calculated as follows:
  • the S jnd is an area corresponding to the divided area.
  • the step S1 includes:
  • the embodiment of the invention further provides a contrast adjustment method, wherein the adjustment method comprises:
  • the step S4 specifically includes:
  • the step S42 specifically includes:
  • S421 classify the segmentation area based on the determination result
  • the step S43 specifically includes:
  • the step S421 is specifically:
  • the step S422 is specifically:
  • the C H is a region contrast of the segmentation region in the first type of segmentation region
  • the C L is a region contrast of the segmentation region in the second type of segmentation region
  • the I ave is the segmentation The average value of the brightness of the area, the I bg being the background brightness value of the current image.
  • the step S423 is specifically:
  • the C H-jnd is a contrast quantization value of the segmentation region in the first type of segmentation region, and the C jnd is the JND value, and represents a contrast difference value of each segmentation region.
  • the step S2 is specifically: dividing the grayscale image by using a watershed algorithm to obtain a plurality of divided regions.
  • the JND value is calculated by the following formula, the formula is:
  • the S jnd is an area corresponding to the divided area.
  • the step S1 includes:
  • the embodiment of the invention further provides a contrast adjusting device, comprising:
  • a grayscale image acquisition module configured to acquire a grayscale image corresponding to the current image
  • a region segmentation module configured to segment the grayscale image to obtain a plurality of segmentation regions
  • a first calculating module configured to calculate a JND value corresponding to the divided area based on an area of each of the divided areas
  • a second calculating module configured to calculate a target contrast based on a JND value of each of the divided regions and a background luminance value of the current image
  • the adjustment module adjusts the contrast of the current image based on the target contrast and the preset condition.
  • the grayscale image is first segmented to obtain a plurality of segmentation regions, and each segment is segmented.
  • the average brightness value of the area is compared with the background brightness value, and a plurality of divided areas are classified.
  • the contrast quantization value is calculated for the corresponding divided area, and the contrast average value of each type of divided area is obtained.
  • the contrast of the entire image is obtained. Since the contrast adjustment of the image sub-region is performed by using the JND value in the present invention, the adjustment can be correspondingly based on the area of each divided region, and the pair of images that can be perceived by the human eye are considered in the contrast adjustment process.
  • the effect of brightness makes the image contrast closer to the needs of the human eye, and the contrast adjustment is more scientific.
  • FIG. 1 is a flow chart of a first preferred embodiment of an image contrast adjustment method of the present invention
  • step S42 is a specific flowchart of step S42 of the embodiment corresponding to FIG. 3;
  • FIG. 5 is a specific flowchart of step S43 of the embodiment corresponding to FIG. 3;
  • Figure 6 is a block diagram showing the structure of a first preferred embodiment of an image contrast adjusting device of the present invention.
  • FIG. 7 is a specific structural diagram of an acquisition module 1 of a first preferred embodiment of an image contrast adjustment apparatus
  • FIG. 8 is a specific structural diagram of a second calculation module 4 of a first preferred embodiment of an image contrast adjustment apparatus according to the present invention.
  • FIG. 9 is a specific structural diagram of a second calculating unit 42 corresponding to the embodiment of FIG. 8;
  • FIG. 10 is a specific structural diagram of a third calculating unit 43 corresponding to the embodiment of FIG. 8;
  • FIG. 11 is a schematic flow chart of a specific embodiment of an image contrast adjustment method according to the present invention.
  • FIG. 12 is a schematic diagram of an image of the present invention after feature segmentation.
  • the image contrast adjustment method specifically includes:
  • Step S1 obtaining a grayscale image corresponding to the current image
  • Step S2 dividing the grayscale image to obtain a plurality of divided regions
  • the grayscale image is first divided into regions, and more than one segmentation region is obtained, and the grayscale image is segmented.
  • the feature segmentation is mainly performed, and the feature may include the grayscale of the image. Texture, contour, grayscale, etc., and the segmentation method may include a threshold segmentation algorithm, a region segmentation algorithm, and an edge segmentation algorithm.
  • the present embodiment uses a watershed algorithm to segment the grayscale image, mainly considering the image as a geomorphological topography, and the gray value of each pixel in the image represents the altitude of the point, each The local minimum value and its affected area are collecting basins, and the boundary of the collecting basin forms a watershed.
  • the water-dividing collar algorithm mainly comprises two steps: one is to process the image, and the case of the gray value of the processed image pixel is sorted in ascending order; the second is to scan the sorted order to construct the catchment basin Then, a waterproof dam is constructed at the edge of the differently-marked catchment basin to initialize the image area.
  • the specific implementation process may include: obtaining a gradient magnitude image by using a sobel operator; foreground marking object and calculation; calculating a background mark; calculating a watershed transformation of the segmentation function, etc., since the above processes are all prior art, and are not described herein again.
  • Step S3 calculating a JND value corresponding to the divided area based on an area of each of the divided areas;
  • the JND (Just noticeable difference) value is the minimum sensible difference, and is a quantity unit for measuring the degree of difference between the two sensory psychology. Since the sensitivity of the human eye to the brightness of different images is different, the JND value may be Quantitatively measure the effect of the human eye on the brightness of the image. In a preferred embodiment of the embodiment, the following formula calculates the JND value:
  • the C jnd is the JND value, and represents a contrast difference value corresponding to each divided area
  • the S jnd is an area corresponding to the divided area.
  • Step S4 calculating a target contrast based on a JND value of each of the divided regions and a background luminance value of the current image
  • the target contrast is calculated by calculating an average brightness value, a JND value, and a background brightness value of the current image of each of the divided regions, wherein the average brightness value of the divided region and the background brightness value of the current image may be Obtaining at the same time as the step S3 may be performed after the step S3, before the step S4, where no limitation is imposed here.
  • Step S5 Adjust a contrast of the current image based on the target contrast and a preset condition.
  • the preset condition may include a display parameter of the display screen, a contrast of the current image, and the like, and is not limited herein.
  • the grayscale image is first divided, a plurality of divided regions are obtained, and the average luminance value of each divided region is compared with the background luminance value, and the plurality of divided regions are classified according to the judgment result, based on each divided region.
  • the JND value is respectively calculated for the contrast quantization value of the corresponding divided region, and the contrast average value of each type of divided region is obtained, and finally the target contrast is obtained. Since the JND value is used to adjust the contrast of the image sub-region, the The area of a divided area is adjusted accordingly. In the contrast adjustment process, the influence of the human eye on the brightness of the image is considered, so that the image contrast is closer to the human eye and the contrast adjustment is more scientific.
  • step S1 of the first preferred embodiment of the image alignment degree adjustment method of the present invention, wherein the step S1 may include
  • Step S11 acquiring an RGB color image of the current image
  • Step S12 converting the RGB color image into a grayscale image based on the SRGB standard
  • Step S13 Perform a brightness value on the grayscale image based on the grayscale distribution mode of the grayscale image to obtain a background luminance value corresponding to the current image.
  • the acquisition of the background brightness value is not limited to the step S2, and may be after the step S2, before the step S4, where no limitation is made.
  • step S4 of the first preferred embodiment of the image adjustment method of the present invention, wherein the step S4 specifically includes:
  • Step S40 calculating an average brightness value of each of the divided regions
  • the average luminance value of each divided region is calculated in various manners.
  • the luminance values of each pixel of one divided region may be summed and then averaged.
  • the value is used to obtain the average brightness value of the divided area, and the average brightness value may be calculated in other ways, which is not limited herein.
  • Step S41 Determine whether an average brightness value of each of the divided regions is greater than a current image. The background brightness value is obtained, and the judgment result is obtained;
  • the average brightness value of each of the divided regions is compared with the background brightness value of the current image, and when the average brightness value is greater than the background brightness value, the first determination result is when the average brightness is When the value is smaller than the background brightness value, it is the second judgment result.
  • Step S42 Calculate a region contrast quantization value corresponding to the segmentation region based on an average luminance value of each of the segmentation regions, a JND value of each of the segmentation and a background luminance value of the current image, and a determination result;
  • different judgment results use different methods to calculate the contrast quantization value, that is, the segment contrast region corresponding to the first determination result and the region contrast quantization value of the segment region corresponding to the second determination result are calculated by using different paths.
  • the corresponding JND value is obtained based on the area of each divided area, and the contrast ratio is adjusted based on the JND value to obtain the contrast quantization value. Since each divided area can be separately adjusted, the image is closer to the image. The actual demand, the adjustment is more scientific.
  • Step S43 calculating the target contrast according to the contrast quantization value.
  • the calculated contrast quantization values are summed to be the target contrast.
  • step of calculating the average brightness value of each of the divided areas may be performed simultaneously with the step S3, or before the step S3, where no limitation is imposed thereon;
  • step S42 specifically includes:
  • Step S421 classify the segmentation area based on the determination result
  • the partitioning area is divided into a first type of divided area and a second type of divided area according to the determination result; wherein the divided area corresponding to the first determination result is divided into
  • the divided regions corresponding to the second determination result are classified into the second category.
  • the divided regions are divided into two categories according to the background luminance value, and the contrast values of the corresponding regions are respectively calculated. , you can adjust the contrast of the image more effectively.
  • Step S422 Calculate the area contrast of each type of divided area based on the classification result, the average brightness value of each of the divided areas, and the background brightness value of the current image.
  • the area contrast of each divided area corresponding to the first type of divided area may be obtained by using the first formula
  • the area contrast of the corresponding divided area corresponding to the second type of divided area is obtained by using the second formula.
  • Step S423 Calculate the contrast quantization value of each of the segmentation regions based on the region contrast and the corresponding JND value of each of the segmentation regions.
  • the contrast quantization value may be calculated by using the following formula.
  • step S43 specifically includes:
  • Step S431 Calculate a contrast average value of each type of segmentation region based on the contrast quantization value of each of the segmentation regions, and specifically, obtain a contrast average value of the segmentation region of each class for each type of segmentation region, The sum of the contrast quantized values of the divided regions is the average of the contrasts.
  • the average of the contrasts of the first and second types of divided regions is obtained.
  • Step S432 calculating the target contrast based on the average value of the contrast of each type of divided area, wherein the contrast average of the first type and the second type of divided area is the target contrast.
  • the present invention also provides an image contrast adjusting device, as shown in FIG. 6 , which is a structural block diagram of a first preferred embodiment of an image contrast adjusting device of the present invention, including:
  • the acquiring module 1 is configured to acquire a grayscale image corresponding to the current image
  • a segmentation module 2 configured to segment the grayscale image to obtain a plurality of segmentation regions
  • the first calculation module 3 is configured to calculate a JND value corresponding to the divided region based on the area of each of the divided regions.
  • the JND (Just noticeable difference) value is a minimum sensible difference, and is a measurement of two
  • the quantity unit of the degree of sensory psychological difference, because the human eye is not sensitive to the brightness of different images, the JND value can quantitatively measure the influence of the human eye on the brightness of the image.
  • the following formula calculates the JND value:
  • the C jnd is the JND value, and represents a contrast difference value corresponding to each divided area
  • the S jnd is an area corresponding to the divided area.
  • a second calculating module 4 configured to calculate a target contrast based on a JND value of each of the divided regions and a background brightness value of the current image
  • the adjusting module 5 adjusts the contrast of the current image based on the target contrast and the preset condition
  • the acquiring module 1 acquires a grayscale image
  • the segmentation module 2 divides the grayscale image to obtain a plurality of divided regions
  • the first computing module 3 calculates
  • the second calculation module 4 calculates the target contrast based on the JND value of each divided area and the background brightness value of the current image
  • the adjustment module 5 adjusts the current image based on the calculated target contrast and the preset condition. Contrast.
  • the specific working principle of the image contrast adjusting device of this embodiment is the same as or similar to the description of the image adjusting method of the embodiment corresponding to FIG. 1. For details, refer to the description of the study embodiment, and details are not described herein again.
  • FIG. 7 a specific structural diagram of the acquisition module 1 of the first preferred embodiment of the image contrast adjustment apparatus, wherein the acquisition module 1 specifically includes:
  • the obtaining unit 11 is configured to acquire an RGB color image corresponding to the current image
  • the converting unit 12 is configured to convert the RGB color image into a grayscale image based on the SRGB standard
  • the extracting unit 13 is configured to perform brightness value on the grayscale image based on the grayscale distribution mode of the grayscale image to obtain a background luminance value of the current image.
  • the obtaining unit 11 acquires an RGB color image of the current image
  • the converting unit 12 converts the RGB color image into a grayscale image based on the SRGB standard
  • the extracting unit 13 performs the grayscale distribution mode based on the grayscale image.
  • the brightness is taken to obtain a background brightness value of the current image.
  • a specific structural diagram of the second computing module 4 of the first preferred embodiment of the image contrast adjusting device of the present invention includes:
  • the first calculating unit 40 is configured to calculate an average brightness value of each of the divided regions, wherein first, an average brightness value of each divided region needs to be calculated, and a method for calculating an average brightness value of each divided region is various, preferably The first calculating unit 40 may obtain the average brightness value of the divided area by summing the brightness values of each pixel of one divided area, and may calculate the average brightness value by other methods, where This is not a limitation.
  • the determining unit 41 is configured to determine whether the average brightness value of each of the divided areas is greater than the background brightness value of the current image, and obtain a determination result. In this embodiment, the determining unit 41 averages the brightness of each of the divided areas. The value is compared with the background brightness value of the current image. When the average brightness value is greater than the background brightness value, it is the first determination result, and when the average brightness value is less than the background brightness value, it is the second determination result.
  • the second calculating unit 42 is configured to calculate a region contrast quantized value of the divided region corresponding to the determination result based on the average luminance value, the JND value, and the background luminance value of the current image. Specifically, different judgment results use different methods to calculate the contrast quantization value, that is, the segment contrast region corresponding to the first determination result and the region contrast quantization value of the segment region corresponding to the second determination result are calculated by using different paths.
  • the third calculating unit 43 is configured to calculate a target contrast according to the contrast quantization value.
  • the calculated contrast quantization values are summed to be the target contrast.
  • FIG. 9 is a specific structural diagram of the second calculating unit 42 of the corresponding embodiment of FIG. 8; wherein the second calculating unit 42 specifically includes:
  • the classification unit 421 is configured to classify each of the divided regions based on the determination result, where the classification unit 421 is specifically configured to divide the divided region into a first type of divided regions based on the determination result and a second type of segmentation region, further, dividing the segmentation region corresponding to the first determination result into a first class, and dividing the segmentation region corresponding to the second determination result into a second class.
  • the background area is divided into two categories, and the contrast value of the corresponding area is calculated separately, which can adjust the contrast of the image more effectively.
  • the area contrast calculation unit 422 is configured to calculate an area contrast of each type of divided area based on the classification result, the average brightness value of each of the divided areas, and the background brightness value of the current image;
  • the area contrast of each divided area corresponding to the first type of divided area may be obtained by using the first formula
  • the area contrast of the corresponding divided area corresponding to the second type of divided area is obtained by using the second formula.
  • the contrast quantized value calculation unit 423 is configured to calculate the contrast quantization value of each of the divided regions based on the region contrast and the corresponding JND value of each of the divided regions.
  • FIG. 10 it is a specific structural diagram of the third calculating unit 43 corresponding to the embodiment of FIG. 8; wherein the third calculating unit 43 includes:
  • the average value calculating unit 431 is configured to calculate a contrast average value of each type of divided region based on the contrast quantized value of each of the divided regions, and specifically, obtain a divided region of each type for each type of divided region
  • the average value of the contrast is obtained by summing the contrast quantized values of the divided regions of the class, and then taking the average value to obtain the corresponding contrast average value.
  • the contrast average values of the first type and the second type of divided regions are respectively obtained. .
  • the target contrast calculation unit 432 calculates the target contrast based on the average value of the contrast of each of the divided regions, wherein the contrast average of the first and second types of divided regions is the target contrast.
  • FIG. 11 is a schematic flowchart diagram of a specific embodiment of an image contrast adjustment method according to the present invention
  • FIG. 12 is a corresponding image subjected to segmentation processing.
  • Step S111 Obtain a grayscale image corresponding to the current image
  • Step S112 dividing the grayscale image to obtain a plurality of divided regions.
  • the shapes of the different divided regions are inconsistent, including a star, a square, and a circle (see FIG. 12).
  • the detected Background color the background brightness value I bg is obtained .
  • Step S113 calculating a JND value and an average brightness value of each of the divided regions, that is, calculating JND values of the direction, the star, and the circular divided region respectively; and calculating the direction, the star, and the circular segment respectively.
  • the average brightness value of the area it should be noted that the calculation of the average brightness value can be performed before or after calculating the JND value, which is not limited herein.
  • Step S114 determining whether the average brightness value of each of the divided regions is greater than the background brightness value, obtaining first and second determination results, obtaining a first determination result when the determination is yes, and obtaining a second determination result when the determination is negative. And dividing the divided area corresponding to the first determination result into the first type of divided area (go to step S1151), and dividing the divided area corresponding to the second determination result into the second type of divided area (turning Go to step S1161), in this embodiment, since the average luminance value of the star-divided region is smaller than the background luminance value, it is classified into the second-type divided region, and the average luminance values of the square and circular divided regions are greater than the background luminance value. It is classified as the first segmentation area.
  • Step S1151 Calculate the region contrast of the corresponding segmentation region by using the first formula. Specifically, calculate the region contrast of the corresponding segment region by using the first formula for the first type of segmentation region. In this embodiment, respectively, based on the first formula.
  • C H I ave /I bg calculates the regional contrast of the square and circular segmentation regions;
  • Step S1153 Calculating a contrast of the first type of divided region based on the contrast quantized value, wherein the contrast quantized value of the square divided region and the contrast quantized value of the circular divided region are summed and averaged to obtain a first type of divided region.
  • the average value of the contrast is passed to step S117.
  • Step S1161 Calculate the region contrast of the corresponding divided region by using the second formula.
  • the calculation is performed separately. The area contrast of the divided area of each divided area;
  • Step S1163 Calculating a contrast of the second type of segmentation region based on the contrast quantization value, wherein, since there is only a star segmentation region, the contrast value of the second type segmentation region is a contrast quantization value of the star segmentation region.
  • the contrast quantization values of the two segmentation regions are summed and averaged to obtain a corresponding contrast, and then the process proceeds to the step. S117.
  • Step S117 calculating a contrast based on the first type of divided area and the second type of divided area Target contrast
  • the contrast between the contrast of the first type of divided regions calculated in steps S1153 and S1163 and the contrast of the second type of divided regions is the target contrast.
  • Step S118 adjusting a contrast of the current image based on the target contrast and a preset condition, where the preset condition may include a resolution requirement of the display screen, a contrast of the current image, and the like, and may also be Including other parameters, there is no limit here.
  • the grayscale image is first segmented, a plurality of segmentation regions are obtained, and the average luminance value of each segmentation region is compared with the background luminance value, and a plurality of segmentation regions are classified according to the determination result, based on each segmentation region.
  • the JND value is used to calculate the contrast quantization value of the corresponding segmentation region, and the contrast average value of each type of segmentation region is obtained, and finally the contrast of the entire image is obtained.
  • the contrast adjustment of the image subregion is performed by using the JND value. Corresponding adjustment is made based on the area of each divided area. In the contrast adjustment process, the influence of the human eye on the brightness of the image is considered, so that the image contrast is closer to the human eye and the contrast adjustment is more scientific.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

一种对比度调整方法及装置,所述方法包括:获得当前图像对应的灰阶图像(S1);对所述灰阶图像进行分割,获得若干分割区域(S2);基于每个所述分割区域的面积,计算对应所述分割区域的JND值(S3);以及基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度(S4);基于所述目标对比度及预设条件,调整所述当前图像的对比度(S5)。

Description

一种对比度调整方法及装置 技术领域
本发明涉及图像处理技术领域,特别是涉及一种对比度调整方法及装置。
背景技术
对比度指的是图像中最亮的白色与最暗的黑色之间的不同亮度层级的测量,反应了一幅图像灰度反差的大小,差异范围越大对比度越大。
调整图像对比度是增强图像显示效果的重要手段。现有技术中,调整图像对比度的方法一般是将图像转换到HSV(hue-saturation-value,色相-饱和度-亮度)颜色空间或LAB(L是luminosity的缩写,表示亮度;AB表示颜色通道,A表示从洋红色至绿色的范围,B表示从黄色至蓝色的范围)颜色空间,再调整亮度分量(V或L)的亮度曲线来改变调整前后像素点的亮度对应关系,从而达到调整图像的整体对比度的目的,但用此方法获得的调整后的图像,不能充分表现图像的细节,而且可能破坏图像的亮暗区域分布,因此调整效果不佳。
此外,还可利用显示器的Gamma(灰度系数)参数来调整,例如,通过改变灰度信号与亮度的关系来调整图像对比度,但单一对比度设定并无法适用于所有图像。
发明内容
本发明实施例提供了一种调整图像对比度的方法及装置,旨在改善图像的对比度。
本发明实施例提供一种对比度调整方法,其包括:
S1、获得当前图像对应的灰阶图像;
S2、对所述灰阶图像进行分割,获得若干分割区域;
S3、基于每个所述分割区域的面积,计算对应所述分割区域的JND值;
S4、基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度;以及
S5、基于所述目标对比度及预设条件,调整所述当前图像的对比度;
其中所述步骤S2具体为:采用分水岭算法对所述灰阶图像进行分割,获得若干分割区域;
所述步骤S4具体包括:
S40、计算每个所述分割区域的平均亮度值;
S41、判断每个所述分割区域的亮度平均值是否大于背景亮度值,获得判断结果;
S42、基于每个所述分割区域的平均亮度值、每个所述分割区域的JND值、所述当前图像的背景亮度值以及所述判断结果,计算对应的所述分割区域的区域对比度量化值;
S43、根据所述对比度量化值,计算所述目标对比度。
在本发明所述的对比度调整方法中,所述步骤S42具体包括:
S421、基于所述判断结果,对所述分割区域进行分类;
S422、基于所述分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类所述分割区域的区域对比度;
S423、基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值。
在本发明所述的对比度调整方法中,所述步骤S43具体包括:
S431、基于每个所述分割区域的所述对比度量化值,计算每类的所有分割 区域的对比度平均值;
S432、基于每类分割区域的对比度平均值,计算所述目标对比度。
在本发明所述的对比度调整方法中,所述步骤S421具体为:
基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域;
所述步骤S422具体为:
使用第一公式计算第一类分割区域的每一个分割区域的区域对比度;及
使用第二公式计算第二类分割区域的每一个分割区域的区域对比度;
其中,所述第一公式为:CH=Iave/Ibg
所述第二公式为:CL=Ibg/Iave
其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
在本发明所述的对比度调整方法中,所述步骤S423具体为:
采用公式CH-jnd=CH/Cjnd计算第一类分割区域中的所述分割区域的对比度量化值;及
采用公式CL-jnd=CL/Cjnd计算第二类分割区域中的所述对比度量化值;
其中,所述CH-jnd为第一类分割区域中的所述分割区域的对比度量化值,所述Cjnd即为所述JND值,表示每一个分割区域的对比度差异值。
在本发明所述的对比度调整方法中,所述步骤S3中,采用如下计算JND值,所述公式为:
Figure PCTCN2015100215-appb-000001
其中,所述Sjnd为对应分割区域的面积。
在本发明所述的对比度调整方法中,所述步骤S1包括:
S11、获取所述当前图像的RGB彩色图像;
S12、基于SRGB标准将所述RGB彩色图像转为灰阶图像;以及
S13、基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行取值,获得所述当前图像的背景亮度值。
本发明实施例还提供一种对比度调整方法,其中,所述调整方法包括:
S1、获得当前图像对应的灰阶图像;
S2、对所述灰阶图像进行分割,获得若干分割区域;
S3、基于每个所述分割区域的面积,计算对应所述分割区域的JND值;
S4、基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度;以及
S5、基于所述目标对比度及预设条件,调整所述当前图像的对比度。
在本发明所述的对比度调整方法中,所述步骤S4具体包括:
S40、计算每个所述分割区域的平均亮度值;
S41、判断每个所述分割区域的亮度平均值是否大于背景亮度值,获得判断结果;
S42、基于每个所述分割区域的平均亮度值、每个所述分割区域的JND值、所述当前图像的背景亮度值以及所述判断结果,计算对应的所述分割区域的区域对比度量化值;
S43、根据所述对比度量化值,计算所述目标对比度。
在本发明所述的对比度调整方法中,所述步骤S42具体包括:
S421、基于所述判断结果,对所述分割区域进行分类;
S422、基于所述分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类所述分割区域的区域对比度;
S423、基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值。
在本发明所述的对比度调整方法中,所述步骤S43具体包括:
S431、基于每个所述分割区域的所述对比度量化值,计算每类的所有分割区域的对比度平均值;
S432、基于每类分割区域的对比度平均值,计算所述目标对比度。
在本发明所述的对比度调整方法中,所述步骤S421具体为:
基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域;
所述步骤S422具体为:
使用第一公式计算第一类分割区域的每一个分割区域的区域对比度;及
使用第二公式计算第二类分割区域的每一个分割区域的区域对比度;
其中,所述第一公式为:CH=Iave/Ibg
所述第二公式为:CL=Ibg/Iave
其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
在本发明所述的对比度调整方法中,所述步骤S423具体为:
采用公式CH-jnd=CH/Cjnd计算第一类分割区域中的所述分割区域的对比度量化值;及
采用公式CL-jnd=CL/Cjnd计算第二类分割区域中的所述对比度量化值;
其中,所述CH-jnd为第一类分割区域中的所述分割区域的对比度量化值,所述Cjnd即为所述JND值,表示每一个分割区域的对比度差异值。
在本发明所述的对比度调整方法中,所述步骤S2具体为:采用分水岭算法对所述灰阶图像进行分割,获得若干分割区域。
在本发明所述的对比度调整方法中,所述步骤S3中,采用如下公式计算JND值,所述公式为:
Figure PCTCN2015100215-appb-000002
其中,所述Sjnd为对应分割区域的面积。
在本发明所述的对比度调整方法中,所述步骤S1包括:
S11、获取所述当前图像的RGB彩色图像;
S12、基于SRGB标准将所述RGB彩色图像转为灰阶图像;以及
S13、基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行取值,获得所述当前图像的背景亮度值。
本发明实施例还提供一种对比度调整装置,包括:
灰阶图像获取模块,用于获取所述当前图像对应的灰阶图像;
区域分割模块,用于对所述灰阶图像进行分割,获得若干分割区域;
第一计算模块,用于基于每个所述分割区域的面积计算对应所述分割区域的JND值;
第二计算模块,用于基于每个所述分割区域的JND值及当前图像的背景亮度值计算目标对比度;以及
调整模块,基于所述目标对比度及预设条件,调整当前图像的对比度。
本发明中,首先对灰阶图像进行分割,获得若干分割区域,将每一个分割 区域的平均亮度值与背景亮度值进行比较,将若干分割区域进行分类,基于每一个分割区域的JND值分别对对应分割区域进行对比度量化值计算,求得每一类分割区域的对比度平均值,最终求得整个图像的对比度,由于本发明中,利用JND值对图像分区域进行对比度调整,可基于每一个分割区域的面积来对应调整,在对比度调整过程中考虑人眼所能察觉的对图像亮度的影响,使得图像对比度更贴近人眼需求,对比度调整更科学。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:
图1为本发明的一种图像对比度调整方法的第一优选实施例的流程图;
图2为本发明的一种图像对准度调整方法的第一优选实施例的步骤S1的具体流程图;
图3为本发明的一种图像调整方法的第一优选实施例的步骤S4的具体流程图;
图4为图3对应的实施例的步骤S42的具体流程图;
图5为图3对应的实施例的步骤S43的具体流程图;
图6为本发明的一种图像对比度调整装置的第一优选实施例的结构模块图;
图7为一种图像对比度调整装置的第一优选实施例的获取模块1的具体结构图;
图8为本发明的一种图像对比度调整装置的第一优选实施例的第二计算模块4的具体结构图;
图9为图8对应实施例的第二计算单元42的具体结构图;
图10为图8对应实施例的第三计算单元43的具体结构图;
图11为本发明的一种图像对比度调整方法的具体实施例的流程示意图;
图12为本发明的图像经过特征分割后的示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性的劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
参照图1,为本发明的图像对比度调整方法的第一优选实施例的流程图,所述图像对比度调整方法具体包括:
步骤S1、获得当前图像对应的灰阶图像;
步骤S2、对所述灰阶图像进行分割,获得若干分割区域;
在本实施例中,首先需要对灰阶图像进行区域分割,获得一个以上分割区域,对灰阶图像进行分割,本实施例中主要是进行特征分割,所述、特征可包括图像的灰度、纹理、轮廓、灰阶等,而分割方法可包括阈值分割算法、基于区域分割算法及基于边缘分割算法等。
优选地,本实施例采用分水岭算法对灰阶图像进行分割处理,主要是将图像看做是测地学上的拓扑地貌,将图像中的每一像素灰度值表示该点的海拔高度,每一个局部极小的值及其影响区域为集水盆,而集水盆的边界形成分水岭。 所述分水领算法主要包括两个步骤:一是将图像进行处理,在将处理的图像像素灰度值的大小案子升序排列处理;二是对排序出的顺序进行扫描,构造出集水盆地,然后在不同标记的集水盆地的边缘构造出防水堤坝,对图像区域的初始化划分处理。具体实现过程可包括:运用sobel算子获得梯度幅值图像;前景标记对象和计算;计算背景标记;计算分割函数的分水岭变换等,由于上述过程均为现有技术,此处不再赘述。
步骤S3、基于每个所述分割区域的面积,计算对应所述分割区域的JND值;
本实施例中,所述JND(Just noticeable difference)值即为最小可觉差,是测量两种感觉心理差别程度的数量单位,由于人眼对不同图像的亮度敏感程度不一样,该JND值可定量衡量人眼所能察觉的对图像亮度的影响。在本实施例的一个优选方案中,以下公式计算所述JND值:
Figure PCTCN2015100215-appb-000003
其中,所述Cjnd即为所述JND值,表示每一个分割区域对应的对比度差异值,所述Sjnd为对应分割区域的面积。
步骤S4、基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度;
具体地,通过计算每个所述分割区域的平均亮度值、JND值及所述当前图像的背景亮度值来计算目标对比度,其中,所述分割区域的平均亮度值及当前图像的背景亮度值可与所述步骤S3同时进行获得,也可在步骤S3之后,所述步骤S4之前,此处对此不作限制。
步骤S5、基于所述目标对比度及预设条件,调整所述当前图像的对比度。本实施例中,所述预设条件可包括显示屏的分辨率要求、所述当前图像的对比度等显示参数,此处对此不作限制。
本实施例中,首先对灰阶图像进行分割,获得若干分割区域,将每一个分割区域的平均亮度值与背景亮度值进行比较判断,按照判断结果将若干分割区域进行分类,基于每一个分割区域的JND值分别对对应分割区域进行对比度量化值计算,求得每一类分割区域的对比度平均值,最终获得目标对比度,由于本发明中,利用JND值对图像分区域进行对比度调整,可基于每一个分割区域的面积来对应调整,在对比度调整过程中考虑人眼所能察觉的对图像亮度的影响,使得图像对比度更贴近人眼需求,对比度调整更科学。
在本发明的一个优选方案中,如图2所示,为本发明的一种图像对准度调整方法的第一优选实施例的步骤S1的具体流程图,其中,所述步骤S1可包括
步骤S11、获取所述当前图像的RGB彩色图像;
步骤S12、基于SRGB标准将所述RGB彩色图像转为灰阶图像;
本实施例中,由于SRGB(standard Red Green Blue)标准为现有技术,转化过程也是现有技术,此处不再赘述。
步骤S13、基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行亮度取值,获得所述当前图像对应的背景亮度值。
需要说明的是,所述背景亮度值的获取不限定在所述步骤S2之前,也可在步骤S2之后,在所述步骤S4之前,此处对此不作限制。
进一步地,如图3所示,为本发明的一种图像调整方法的第一优选实施例的步骤S4的具体流程图,其中所述步骤S4具体包括:
步骤S40、计算每个所述分割区域的平均亮度值;
首先需要计算每个所述分割区域的平均亮度值,每个分割区域的平均亮度值的计算方法有多种,优选地,可将一个分割区域的每一个像素点的亮度值求和之后求平均值来求得该分割区域的平均亮度值,还可以采用其他方式计算平均亮度值,此处对此不作限制。
步骤S41、分别判断每个所述分割区域的平均亮度值是否大于当前图像的 背景亮度值,获得判断结果;
本实施例中,将每一个所述分割区域的平均亮度值与当前图像的背景亮度值进行比较判断,当所述平均亮度值大于背景亮度值时,为第一判断结果,当所述平均亮度值小于背景亮度值时为第二判断结果。
步骤S42、基于每个所述分割区域的平均亮度值、每个所述分割与的JND值、所述当前图像的背景亮度值及判断结果,计算对应所述分割区域的区域对比度量化值;
具体地,不同的判断结果则采用不同的方法计算对比度量化值,即第一判断结果对应的分割区域与第二判断结果对应的分割区域的区域对比度量化值采用不同的路径来计算。
本实施例中,基于每个分割区域的面积分别求得对应的JND值,基于该JND值对区域对比度进行调整获得对比度量化值,由于可单独对每个分割区域分别进行调整,因此更贴近图像的实际需求,调整更科学。
步骤S43、根据所述对比度量化值,计算所述目标对比度。
本实施例中,将所计算的对比度量化值求和后即为目标对比度。
需要说明的是,计算每一个分割区域的平均亮度值这一步骤还可与所述步骤S3同时进行,也可以在步骤S3之前,此处对此不作限制;
在本发明的一个优选方案中,如图4所示,为基于图3对应的实施例的步骤S42的具体流程图,其中,所述步骤S42具体包括:
步骤S421、基于所述判断结果对所述分割区域进行分类;
本实施例中,具体为:基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域;其中,将与所述第一判断结果对应的分割区域分为第一类,将与所述第二判断结果对应的分割区域分为第二类,本实施例中,以背景亮度值为界,将分割区域分为两大类,并分别计算对应区域的对比度值,可更有效地调整图像的对比度。
步骤S422、基于所述分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类分割区域的区域对比度。
本实施例中,具体地,可采用第一公式求得第一类分割区域对应的每一个分割区域的区域对比度,采用第二公式求得第二类分割区域对应的对应分割区域的区域对比度,所述第一公式为:CH=Iave/Ibg,第二公式为:CL=Ibg/Iave,其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
步骤S423、基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值,本实施例中,可采用如下公式计算所述对比度量化值,针对第一类分割区域,采用公式CH-jnd=CH/Cjnd来计算第一类分割区域的每个分割区域的对比度量化值,其中所述CH-jnd为第一类分割区域的每个分割区域的对比度量化值;针对第二类分割区域,采用公式CL-jnd=CL/Cjnd来计算第二类分割区域中的每一个分割区域的对比度量化值,其中,所述CL-jnd为第二类分割区域的每个分割区域的对比度量化值。
进一步地,如图5所示,为基于图3对应的实施例的步骤S43的具体流程图,所述步骤S43具体包括:
步骤S431、基于每个所述分割区域的所述对比度量化值,计算每类分割区域的对比度平均值,具体地,分别对每一类分割区域求得该类的分割区域的对比度平均值,可对该类的分割区域的对比度量化值求和后取平均值即为对应的对比度平均值,本实施例中,分别求得第一类及第二类分割区域的对比度平均值。
步骤S432、基于每类分割区域的对比度平均值,计算所述目标对比度,其中,将所述第一类及第二类分割区域的对比度平均值求和即为目标对比度。
本发明还提供一种图像对比度调整装置,如图6所示,为本发明的一种图像对比度调整装置的第一优选实施例的结构模块图,包括:
获取模块1,用于获取当前图像对应的灰阶图像;
分割模块2,用于对所述灰阶图像进行分割,获得若干分割区域;
第一计算模块3,用于基于每个所述分割区域的面积分别计算对应分割区域的JND值;本实施例中,所述JND(Just noticeable difference)值即为最小可觉差,是测量两种感觉心理差别程度的数量单位,由于人眼对不同图像的亮度敏感程度不一样,该JND值可定量衡量人眼所能察觉的对图像亮度的影响。在本实施例的一个优选方案中,以下公式计算所述JND值:
Figure PCTCN2015100215-appb-000004
其中,所述Cjnd即为所述JND值,表示每一个分割区域对应的对比度差异值,所述Sjnd为对应分割区域的面积。
第二计算模块4,用于基于每个所述分割区域的JND值及当前图像的背景亮度值,计算目标对比度;
调整模块5,基于所述目标对比度及预设条件,调整当前图像的对比度;
本实施例中,所述图像调整装置在使用过程中,所述获取模块1获取灰阶图像,分割模块2对所述灰阶图像进行分割,获得若干分割区域,所述第一计算模块3计算每一个分割区域的JND值,所述第二计算模块4基于每一个分割区域的JND值及当前图像的背景亮度值计算目标对比度,调整模块5基于所计算的目标对比度及预设条件调整当前图像的对比度。本实施例的图像对比度调整装置的具体工作原理与图1对应的实施例的图像调整方法的描述相同或者相似,具体可参考读研实施例的描述,此处不再赘述。
在本发明的一个优选方案中,如图7所示,为一种图像对比度调整装置的第一优选实施例的获取模块1的具体结构图,其中所述获取模块1具体包括:
获取单元11、用于获取所述当前图像对应的RGB彩色图像;
转化单元12、用于基于SRGB标准将所述RGB彩色图像转为灰阶图像;
提取单元13,用于基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行亮度取值,获得所述当前图像的背景亮度值。
本实施例中,获取单元11获取当前图像的RGB彩色图像,该转化单元12基于SRGB标准将所述RGB彩色图像转为灰阶图像,提取单元13基于该灰阶图像的灰阶分布众数进行亮度取值,获得所述当前图像的背景亮度值。
在本发明的又一个优选方案中,如图8所示,为本发明的一种图像对比度调整装置的第一优选实施例的第二计算模块4的具体结构示意图,包括:
第一计算单元40、用于计算每个所述分割区域的平均亮度值,其中,首先需要计算每一个分割区域的平均亮度值,每一个分割区域的平均亮度值的计算方法有多种,优选地,第一计算单元40可将一个分割区域的每一个像素点的亮度值求和之后求平均值来求得该分割区域的平均亮度值,还可以采用其他方式计算平均亮度值,此处对此不作限制。
判断单元41、用于判断每个所述分割区域的平均亮度值是否大于当前图像的背景亮度值,获得判断结果,本实施例中,所述判断单元41将每一个所述分割区域的平均亮度值与当前图像的背景亮度值进行比较判断,当所述平均亮度值大于背景亮度值时,为第一判断结果,当所述平均亮度值小于背景亮度值时为第二判断结果。
第二计算单元42、用于基于每个所述分割区域的平均亮度值、JND值及当前图像的背景亮度值,计算与判断结果对应的分割区域的区域对比度量化值。具体地,不同的判断结果则采用不同的方法计算对比度量化值,即第一判断结果对应的分割区域与第二判断结果对应的分割区域的区域对比度量化值采用不同的路径来计算。
第三计算单元43,用于根据所述的对比度量化值计算目标对比度。本实施例中,将所计算的对比度量化值求和后即为目标对比度。
本实施例的图像调整装置的具体工作原理与图3对应实施例的具体工作原理基本一致,此处不再赘述。
本发明的一个优选方案中,如图9所示,为图8对应实施例的第二计算单元42的具体结构图;其中,所述第二计算单元42具体包括:
分类单元421、用于基于所述判断结果对每个所述分割区域进行分类,其中,所述分类单元421具体用于基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域,进一步地,将与所述第一判断结果对应的分割区域分为第一类,将与所述第二判断结果对应的分割区域分为第二类,本实施例中,以背景亮度值为界,将分割区域分为两大类,并分别计算对应区域的对比度值,可更有效地调整图像的对比度。
区域对比度计算单元422、用于基于分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类分割区域的区域对比度;
本实施例中,具体地,可采用第一公式求得第一类分割区域对应的每一个分割区域的区域对比度,采用第二公式求得第二类分割区域对应的对应分割区域的区域对比度,所述第一公式为:CH=Iave/Ibg,第二公式为:CL=Ibg/Iave,其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
对比度量化值计算单元423、用于基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值,本实施例中,可采用如下公式计算所述对比度量化值,针对第一类分割区域,采用公式CH-jnd=CH/Cjnd来计算第一类分割区域的每一个分割区域的对比度量化值;针对第二类分割区域,采用公式CL-jnd=CL/Cjnd来计算第二类分割区域中的每一个分割区域的对比度量化值。
本实施例的具体工作原理与图4对应的实施例的工作原理基本一致,此处不再赘述。
进一步地,如图10所示,为图8对应实施例的第三计算单元43的具体结构图;其中,所述第三计算单元43包括:
平均值计算单元431、用于基于每个所述分割区域的所述对比度量化值,计算每类分割区域的对比度平均值,具体地,分别对每一类分割区域求得该类的分割区域的对比度平均值,可对该类的分割区域的对比度量化值求和后取平均值即为对应的对比度平均值,本实施例中,分别求得第一类及第二类分割区域的对比度平均值。
目标对比度计算单元432、用于基于每类分割区域的对比度平均值,计算所述目标对比度,其中,将所述第一类及第二类分割区域的对比度平均值求和即为目标对比度。
本实施例的具体工作原理与图5对应的实施例的工作原理基本一致,此处不再赘述。
为了便于理解技术方案,下面以简单图像的处理过程为例说明本发明的技术方案:
如图11所示,为本发明的一种图像对比度调整方法的具体实施例的流程示意图,图12为对应的经过分割处理的图像。
步骤S111、获取当前图像对应的灰阶图像;
步骤S112、对所述灰阶图像进行分割,获得若干分割区域,如图6所示,不同分割区域形状不一致,包括星形,方形及圆形(见图12),在此过程中,检测出背景色彩,获得背景亮度值Ibg
步骤S113、计算每个所述分割区域的JND值及平均亮度值,即分别计算所述方向、星形及圆形分割区域的JND值;并且分别计算出所述方向、星形及圆形分割区域的平均亮度值,需要说明的是,平均亮度值的计算可在计算JND值之前、与JND同时计算或之后进行,此处对此不作限制。
步骤S114、判断每个所述分割区域的平均亮度值是否大于背景亮度值,得到第一及第二判断结果,当判断为是时获得第一判断结果,当判断为否时获得第二判断结果,将与第一判断结果对应的分割区域归为第一类分割区域(转到步骤S1151),将与第二判断结果对应的分割区域归为第二类分割区域(转 到步骤S1161),本实施例中,由于星形分割区域的平均亮度值小于背景亮度值而被归类为第二类分割区域,而方形及圆形分割区域的平均亮度值均大于背景亮度值而归类为第一分割区域。
步骤S1151、采用第一公式计算对应的所述分割区域的区域对比度,具体地,对第一类分割区域采用第一公式计算对应的分割区域的区域对比度,本实施例中,分别基于第一公式CH=Iave/Ibg计算方形及圆形分割区域的区域对比度;
步骤S1152、基于所计算的区域对比度及JND值,计算对应的对比度量化值,其中,基于方形分割区域的JND值及区域对比度,采用公式CH-jnd=CH/Cjnd计算对比度量化值,同理计算圆形分割区域的对比度量化值。
步骤S1153、基于所述对比度量化值计算第一类分割区域的对比度,其中,将方形分割区域的对比度量化值与圆形分割区域的对比度量化值求和后取平均值得到第一类分割区域的对比度平均值,接着转到步骤S117。
步骤S1161、采用第二公式计算对应的所述分割区域的区域对比度,本实施例中,对第二类分割区域采用第二公式CL=Ibg/Iave计算对应的分割区域对比值,由于第二类分割区域只有星形分割区域,只需要计算星形分割区域的区域对比度即可,在本发明的其他实施例中,当第二类分割区域包括两个以上分割区域时,则分别计算每一个分割区域的分割区域的区域对比度;
步骤S1162、基于所计算的区域对比度及JND值,计算对应的对比度量化值,其中,基于星形分割区域的JND值及区域对比度,采用公式CL-jnd=CL/Cjnd计算对比度量化值。
步骤S1163、基于所述的对比度量化值,计算第二类分割区域的对比度,其中,由于只有星形分割区域,此时第二类分割区域的对比度值为所述星形分割区域的对比度量化值,在本发明的其他实施例中,当第二类分割区域包括两个以上分割区域时,则需要将两个分割区域的对比度量化值求和后取平均值得到对应的对比度,接着转到步骤S117。
步骤S117、基于所述的第一类分割区域及第二类分割区域的对比度计算 目标对比度;
本实施例中,将所述步骤S1153及步骤S1163计算所得的第一类分割区域的对比度及第二类分割区域的对比度求和即为目标对比度。
步骤S118、基于所述的目标对比度及预设条件,调整所述当前图像的对比度,其中,所述预设条件可包括显示屏的分辨率要求、所述当前图像的对比度等显示参数,还可包括其他参数,此处对此不作限制。
本发明中,首先对灰阶图像进行分割,获得若干分割区域,将每一个分割区域的平均亮度值与背景亮度值进行比较判断,按照判断结果将若干分割区域进行分类,基于每一个分割区域的JND值分别对对应分割区域进行对比度量化值计算,求得每一类分割区域的对比度平均值,最终求得整个图像的对比度,本发明中,由于利用JND值对图像分区域进行对比度调整,可基于每一个分割区域的面积来对应调整,在对比度调整过程中考虑人眼所能察觉的对图像亮度的影响,使得图像对比度更贴近人眼需求,对比度调整更科学。
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (17)

  1. 一种对比度调整方法,其包括:
    S1、获得当前图像对应的灰阶图像;
    S2、对所述灰阶图像进行分割,获得若干分割区域;
    S3、基于每个所述分割区域的面积,计算对应所述分割区域的JND值;
    S4、基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度;以及
    S5、基于所述目标对比度及预设条件,调整所述当前图像的对比度;
    其中所述步骤S2具体为:采用分水岭算法对所述灰阶图像进行分割,获得若干分割区域;
    所述步骤S4具体包括:
    S40、计算每个所述分割区域的平均亮度值;
    S41、判断每个所述分割区域的亮度平均值是否大于背景亮度值,获得判断结果;
    S42、基于每个所述分割区域的平均亮度值、每个所述分割区域的JND值、所述当前图像的背景亮度值以及所述判断结果,计算对应的所述分割区域的区域对比度量化值;
    S43、根据所述对比度量化值,计算所述目标对比度。
  2. 根据权利要求1所述的对比度调整方法,其中所述步骤S42具体包括:
    S421、基于所述判断结果,对所述分割区域进行分类;
    S422、基于所述分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类所述分割区域的区域对比度;
    S423、基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值。
  3. 根据权利要求2所述的对比度调整方法,其中所述步骤S43具体包括:
    S431、基于每个所述分割区域的所述对比度量化值,计算每类的所有分割区域的对比度平均值;
    S432、基于每类分割区域的对比度平均值,计算所述目标对比度。
  4. 根据权利要求2所述的对比度调整方法,其中所述步骤S421具体为:
    基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域;
    所述步骤S422具体为:
    使用第一公式计算第一类分割区域的每一个分割区域的区域对比度;及
    使用第二公式计算第二类分割区域的每一个分割区域的区域对比度;
    其中,所述第一公式为:CH=Iave/Ibg
    所述第二公式为:CL=Ibg/Iave
    其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
  5. 根据权利要求4所述的对比度调整方法,其中所述步骤S423具体为:
    采用公式CH-jnd=CH/Cjnd计算第一类分割区域中的所述分割区域的对比度量化值;及
    采用公式CL-jnd=CL/Cjnd计算第二类分割区域中的所述对比度量化值;
    其中,所述CH-jnd为第一类分割区域中的所述分割区域的对比度量化值,所述Cjnd即为所述JND值,表示每一个分割区域的对比度差异值。
  6. 根据权利要求1所述的对比度调整方法,其中所述步骤S3中,采用如下计算JND值,所述公式为:
    Figure PCTCN2015100215-appb-100001
    其中,所述Sjnd为对应分割区域的面积。
  7. 根据权利要求1所述的对比度调整方法,其中所述步骤S1包括:
    S11、获取所述当前图像的RGB彩色图像;
    S12、基于SRGB标准将所述RGB彩色图像转为灰阶图像;以及
    S13、基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行取值,获得所述当前图像的背景亮度值。
  8. 一种对比度调整方法,其包括:
    S1、获得当前图像对应的灰阶图像;
    S2、对所述灰阶图像进行分割,获得若干分割区域;
    S3、基于每个所述分割区域的面积,计算对应所述分割区域的JND值;
    S4、基于每个所述分割区域的JND值及所述当前图像的背景亮度值,计算目标对比度;以及
    S5、基于所述目标对比度及预设条件,调整所述当前图像的对比度。
  9. 根据权利要求8所述的对比度调整方法,其中所述步骤S4具体包括:
    S40、计算每个所述分割区域的平均亮度值;
    S41、判断每个所述分割区域的亮度平均值是否大于背景亮度值,获得判断结果;
    S42、基于每个所述分割区域的平均亮度值、每个所述分割区域的JND值、所述当前图像的背景亮度值以及所述判断结果,计算对应的所述分割区域的区 域对比度量化值;
    S43、根据所述对比度量化值,计算所述目标对比度。
  10. 根据权利要求9所述的对比度调整方法,其中所述步骤S42具体包括:
    S421、基于所述判断结果,对所述分割区域进行分类;
    S422、基于所述分类结果、每个所述分割区域的平均亮度值及所述当前图像的背景亮度值,计算每类所述分割区域的区域对比度;
    S423、基于每个所述分割区域的所述区域对比度及对应的JND值,计算每个所述分割区域的所述对比度量化值。
  11. 根据权利要求10所述的对比度调整方法,其中所述步骤S43具体包括:
    S431、基于每个所述分割区域的所述对比度量化值,计算每类的所有分割区域的对比度平均值;
    S432、基于每类分割区域的对比度平均值,计算所述目标对比度。
  12. 根据权利要求10所述的对比度调整方法,其中所述步骤S421具体为:
    基于所述判断结果,将所述分割区域分为第一类分割区域以及第二类分割区域;
    所述步骤S422具体为:
    使用第一公式计算第一类分割区域的每一个分割区域的区域对比度;及
    使用第二公式计算第二类分割区域的每一个分割区域的区域对比度;
    其中,所述第一公式为:CH=Iave/Ibg
    所述第二公式为:CL=Ibg/Iave
    其中,所述CH为第一类分割区域中的所述分割区域的区域对比度,所述CL为第二类分割区域中的所述分割区域的区域对比度,所述Iave为所述分割区 域的亮度平均值,所述Ibg为所述当前图像的背景亮度值。
  13. 根据权利要求12所述的对比度调整方法,其中所述步骤S423具体为:
    采用公式CH-jnd=CH/Cjnd计算第一类分割区域中的所述分割区域的对比度量化值;及
    采用公式CL-jnd=CL/Cjnd计算第二类分割区域中的所述对比度量化值;
    其中,所述CH-jnd为第一类分割区域中的所述分割区域的对比度量化值,所述Cjnd即为所述JND值,表示每一个分割区域的对比度差异值。
  14. 根据权利要求8所述的对比度调整方法,其中所述步骤S2具体为:采用分水岭算法对所述灰阶图像进行分割,获得若干分割区域。
  15. 根据权利要求14所述的对比度调整方法,其中所述步骤S3中,采用如下计算JND值,所述公式为:
    Figure PCTCN2015100215-appb-100002
    其中,所述Sjnd为对应分割区域的面积。
  16. 根据权利要求8所述的对比度调整方法,其中所述步骤S1包括:
    S11、获取所述当前图像的RGB彩色图像;
    S12、基于SRGB标准将所述RGB彩色图像转为灰阶图像;以及
    S13、基于所述灰阶图像的灰阶分布众数对所述灰阶图像进行取值,获得所述当前图像的背景亮度值。
  17. 一种对比度调整装置,其包括:
    灰阶图像获取模块,用于获取当前图像对应的灰阶图像;
    区域分割模块,用于对所述灰阶图像进行分割,获得若干分割区域;
    第一计算模块,用于基于每个所述分割区域的面积计算对应所述分割区域 的JND值;
    第二计算模块,用于基于每个所述分割区域的JND值及当前图像的背景亮度值计算目标对比度;以及
    调整模块,基于所述目标对比度及预设条件,调整当前图像的对比度。
PCT/CN2015/100215 2015-10-15 2015-12-31 一种对比度调整方法及装置 WO2017063299A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/908,150 US10210604B2 (en) 2015-10-15 2015-12-31 Method and device for adjusting contrast

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510666784.6A CN105303531B (zh) 2015-10-15 2015-10-15 一种对比度调整方法及装置
CN201510666784.6 2015-10-15

Publications (1)

Publication Number Publication Date
WO2017063299A1 true WO2017063299A1 (zh) 2017-04-20

Family

ID=55200755

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/100215 WO2017063299A1 (zh) 2015-10-15 2015-12-31 一种对比度调整方法及装置

Country Status (3)

Country Link
US (1) US10210604B2 (zh)
CN (1) CN105303531B (zh)
WO (1) WO2017063299A1 (zh)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105895054A (zh) * 2016-05-17 2016-08-24 深圳天珑无线科技有限公司 输出亮度的调节方法、Gamma曲线的调整方法及显示装置
CN107547895B (zh) * 2016-06-29 2020-02-18 腾讯科技(深圳)有限公司 一种图像处理方法及其装置
CN107689215B (zh) * 2016-08-05 2019-12-24 青岛海信电器股份有限公司 一种智能显示设备的背光调节方法和装置
CN107689214B (zh) * 2016-08-05 2020-03-24 青岛海信电器股份有限公司 一种智能显示设备的背光调节方法和装置
CN106328053B (zh) * 2016-10-19 2019-01-25 深圳市华星光电技术有限公司 一种OLED Mura补偿的最高亮度优化方法及装置
CN106570838B (zh) * 2016-10-28 2019-05-03 成都西纬科技有限公司 一种图像亮度优化方法及装置
JP7196915B2 (ja) * 2018-06-19 2022-12-27 株式会社ソシオネクスト 輝度決定方法、輝度決定装置、および、映像表示装置
CN109308687A (zh) * 2018-09-06 2019-02-05 百度在线网络技术(北京)有限公司 用于调节图像亮度的方法和装置
CN113470583B (zh) * 2020-03-30 2023-08-04 北京小米移动软件有限公司 显示画面的调整方法及装置、存储介质
CN112381662B (zh) * 2020-10-30 2024-04-26 中国农业大学 花粉可育率评估方法及装置
CN112767558A (zh) * 2021-01-29 2021-05-07 苏州唐古光电科技有限公司 图像处理方法、装置、系统、设备及介质
CN115667867A (zh) * 2021-03-15 2023-01-31 京东方科技集团股份有限公司 显示面板的漏光程度的确定方法、装置、系统及测试治具
CN113436263B (zh) * 2021-08-25 2021-12-21 深圳市大道智创科技有限公司 一种基于图像处理的特征点提取方法及系统
CN116244815A (zh) * 2021-12-06 2023-06-09 广州汽车集团股份有限公司 一种汽车参数化纹理生成方法与系统、存储介质
CN114494262B (zh) * 2022-04-19 2022-07-26 广东粤港澳大湾区硬科技创新研究院 一种图像对比度的评估方法和装置
CN114783387B (zh) * 2022-05-25 2023-08-25 福州大学 自适应环境光的彩色电润湿电子纸图像对比度增强方法
CN115187930B (zh) * 2022-09-13 2022-12-06 广州科弗联信息科技有限公司 一种水库安全监控方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529284A (zh) * 2003-09-29 2004-09-15 上海交通大学 基于分水岭算法的视频对象提取方法
CN101957985A (zh) * 2010-10-15 2011-01-26 重庆医科大学 人类视觉对比度分辨率的自动自适应最佳补偿方法
US20120128224A1 (en) * 2010-11-22 2012-05-24 Electronics And Telecommunications Research Institute Method of segmenting lesions in images
CN104966272A (zh) * 2015-05-29 2015-10-07 中国农业大学 一种水下海参图像处理方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI387952B (zh) * 2007-06-08 2013-03-01 Chunghwa Picture Tubes Ltd 檢測顯示器的燒付現象的方法
US8559511B2 (en) * 2010-03-30 2013-10-15 Hong Kong Applied Science and Technology Research Institute Company Limited Method and apparatus for video coding by ABT-based just noticeable difference model
CN103792699A (zh) * 2013-09-09 2014-05-14 中华人民共和国四川出入境检验检疫局 基于B样条曲面拟合的TFT-LCD Mura缺陷机器视觉检测方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529284A (zh) * 2003-09-29 2004-09-15 上海交通大学 基于分水岭算法的视频对象提取方法
CN101957985A (zh) * 2010-10-15 2011-01-26 重庆医科大学 人类视觉对比度分辨率的自动自适应最佳补偿方法
US20120128224A1 (en) * 2010-11-22 2012-05-24 Electronics And Telecommunications Research Institute Method of segmenting lesions in images
CN104966272A (zh) * 2015-05-29 2015-10-07 中国农业大学 一种水下海参图像处理方法及系统

Also Published As

Publication number Publication date
CN105303531B (zh) 2018-01-26
CN105303531A (zh) 2016-02-03
US10210604B2 (en) 2019-02-19
US20180211368A1 (en) 2018-07-26

Similar Documents

Publication Publication Date Title
WO2017063299A1 (zh) 一种对比度调整方法及装置
JP5781743B2 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
US9811746B2 (en) Method and system for detecting traffic lights
KR101451982B1 (ko) 디지털 영상 장치에서 화이트 밸런스 조정 장치 및 방법
WO2016065792A1 (zh) 显示装置的残像等级判定方法及检测装置
WO2017024615A1 (zh) 图像增强方法
KR101629825B1 (ko) Hdr 기능을 이용한 차량용 디스플레이 장치 및 방법
CN109471276B (zh) 一种液晶屏色偏缺陷检测方法及装置
CN104504722B (zh) 一种利用灰色点校正图像颜色的方法
US9064178B2 (en) Edge detection apparatus, program and method for edge detection
CN108293092A (zh) 基于强度变化的参数调整
RU2011111681A (ru) Способы и системы регулировки баланса белого светодиодной подсветки
TWI670977B (zh) 不良像素補償方法與裝置
CN102750713B (zh) 一种图像偏色检测方法
US10375383B2 (en) Method and apparatus for adjusting installation flatness of lens in real time
CN106951891A (zh) 光斑检测方法和装置
Ye et al. Removing shadows from high-resolution urban aerial images based on color constancy
CN109583330B (zh) 一种用于人脸照片的毛孔检测方法
CN109996061B (zh) Ir-cut的异常检测方法及装置
TW201721127A (zh) 檢測細胞受人類乳突病毒(hpv)感染的裝置及其檢測方法
JP2019178892A5 (zh)
CN101790101A (zh) 图像饱和度调整方法与图像饱和度调整装置
JP2015064753A (ja) 画像処理装置
TW201418671A (zh) 水位量測方法
JP2005326323A (ja) 画質検査装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 14908150

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15906181

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15906181

Country of ref document: EP

Kind code of ref document: A1