WO2020000546A1 - 图像色彩增强方法和装置 - Google Patents
图像色彩增强方法和装置 Download PDFInfo
- Publication number
- WO2020000546A1 WO2020000546A1 PCT/CN2018/096499 CN2018096499W WO2020000546A1 WO 2020000546 A1 WO2020000546 A1 WO 2020000546A1 CN 2018096499 W CN2018096499 W CN 2018096499W WO 2020000546 A1 WO2020000546 A1 WO 2020000546A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pixel point
- saturation
- pixel
- value
- local
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/94—Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/10—Texturing; Colouring; Generation of textures or colours
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Definitions
- the present invention relates to the field of image processing technology, and in particular, to a method and an apparatus for image color enhancement.
- the enhancement of color can make the image color more vivid and the visual effect more perfect.
- the traditional color enhancement method performs non-linear transformation processing on the saturation component, and enhances the color of the image by enhancing the saturation of the image.
- Figure 1 shows a graph of a non-linear saturation transformation function.
- Embodiments of the present invention provide an image color enhancement method and device, which can solve the problem of loss of details in the image color enhancement process and improve the sharpness of the image.
- an embodiment of the present invention provides an image color enhancement method, where the method includes:
- a second saturation transformation function is obtained according to the local detailed information of the pixel, where the local detailed information is determined by a difference in brightness between neighboring pixels of the pixel. Determined by the grayscale value;
- the present invention provides an image color enhancement device, where the device includes:
- An obtaining unit configured to obtain a first saturation of the pixel point for any pixel point in the image
- a processing unit configured to process a first saturation of the pixel according to a first saturation transformation function to obtain a slope corresponding to the first saturation of the pixel;
- the processing unit is further configured to obtain a second saturation transformation function according to the local detailed information of the pixel if the slope is less than a first preset threshold, wherein the local detailed information is determined by the pixel's Determined by the difference gray value of the brightness of adjacent pixels;
- the processing unit is further configured to process a first saturation of the pixel point according to the second saturation transformation function to obtain a second saturation degree of the pixel point;
- a calculation unit configured to calculate a target brightness value of the pixel point according to the second saturation
- An adjusting unit is configured to adjust an original brightness value of the pixel point to the target brightness value.
- the first saturation of the pixel is obtained for any pixel in the image; the first saturation of the pixel is processed according to the first saturation transformation function, and the first saturation corresponding to the pixel is obtained. If the slope is less than the first preset threshold, a second saturation transformation function is obtained according to the local detail information of the pixel, and the first saturation of the pixel is processed according to the adjusted saturation transformation function to obtain the pixel. Calculate a target brightness value of the pixel point according to the second saturation degree, and adjust the original brightness value of the pixel point to the target brightness value.
- a differential saturation enhancement method is adopted for pixels that are liable to cause loss of details in an image, so that the vividness of the image is enhanced, while the detailed information of the image is retained, and the sharpness of the image is improved.
- FIG. 1 is a graph of a saturation transformation function provided by the prior art
- FIG. 2 is a schematic flowchart of an image color enhancement method according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart of a method for calculating local detailed information according to an embodiment of the present invention
- FIG. 4 is a graph of a saturation transformation function according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a local area according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of an image color enhancement device according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
- the terminals involved in the embodiments of the present invention may include, but are not limited to, electronic devices such as a smart phone, a palmtop computer, a vehicle-mounted terminal, or a wearable device.
- the operating system of the terminal may include, but is not limited to, an Android operating system, an IOS operating system, a Symbian operating system, a Black Berry operating system, a Windows Phone 8 operating system, and the like, which are not limited in the embodiments of the present invention.
- the color image is displayed as digitized points.
- the terminal divides the color image into very small dots, called pixels. Pixels are the smallest light-emitting unit of the display screen of the terminal. And blue sub-pixels, by configuring different ratios of red, green, and blue sub-pixels, pixels can be rendered with different colors, saturation, brightness, and so on.
- the present invention proposes an image color enhancement method, which controls the slope of the saturation transformation function to adaptively adjust the enhancement of the saturation through the local color difference of the image and the local detail information to make the image colorful while saving the details of the image.
- the local color difference is mainly to calculate the color difference of the pixels in the local area.
- the local detailed information is calculated from the differential gray level value of the pixel brightness in the local area. It should be noted that the local area is composed of multiple pixels. Can be set by developers.
- the general principle of the image color enhancement method provided by the embodiment of the present invention may include: 1
- the terminal obtains the first saturation of the pixel for any pixel in the image.
- the first saturation may be Calculated according to the R (Red, Red), G (Green, Green), and B (Blue) values of the pixel.
- 2 The terminal calculates a corresponding slope of the first saturation of the pixel point in the first saturation transform function.
- the independent variable of the first saturation transformation function is the initial saturation and the dependent variable is the processed saturation.
- the specific first saturation transformation function can be set by the R & D personnel.
- the derivative of the first saturation transform function can be used to obtain the derivative function (ie, the slope function) of the first saturation transform function, and the first saturation can be obtained by bringing the first saturation into the slope function. Degree corresponding slope. 3
- the terminal determines whether the calculated slope is less than a first preset threshold, and if it is less than that, it is determined that the first saturation transformation function needs to be adjusted. In an implementation manner, after the terminal determines that the slope is smaller than the first preset threshold, the terminal directly adjusts the first saturation transformation function according to the local detail information of the pixel point to obtain a second saturation transformation function.
- the terminal determines that the slope corresponding to the first saturation of the pixel point is less than a first preset threshold, it further needs to determine whether the color difference value of the local color portion of the pixel point is less than a second preset value.
- the threshold if it is, adjust the first saturation transformation function according to the local detailed information of the pixel point to obtain a second saturation transformation function.
- the terminal processes the first saturation of the pixel according to the second saturation transformation function to obtain the second saturation of the pixel.
- the terminal calculates the target brightness value of the pixel according to the second saturation. Specifically, there is a one-to-one correspondence between the saturation value and the brightness value, and the terminal calculates the according to the correspondence between the saturation value and the brightness value.
- the pixel's target brightness value The terminal adjusts the original brightness value of the pixel point to the target brightness value.
- the original brightness value of the pixel is adjusted to the target brightness value and displayed.
- the image color enhancement scheme provided by the embodiments of the present invention can have at least the following advantages: (1) Determine whether a differentiated saturation adjustment method is required to be used by determining the slope value of the pixel in the saturation enhancement function. Adjusting the saturation of the pixels can make the adjustment of the pixels of different saturations different, and make the color difference in the image more obvious. (2) Differentiated saturation enhancement methods are used for pixels that are liable to cause loss of details in the image, so that the vividness of the image is enhanced, while the detailed information of the image is retained.
- FIG. 2 it is a schematic flowchart of an image color enhancement method according to an embodiment of the present invention. The method includes the following steps:
- this step may be performed by a terminal.
- the terminal may obtain the pixel saturation in the image by obtaining the R, G, and B values of the pixel of the image, and the terminal may obtain the pixel R, G, and B values. And B values determine the corresponding saturation value, and use this saturation value as the first saturation of the pixel.
- the terminal may convert an image from an RGB color gamut to an HSI color gamut, or an image from an RGB color gamut to an HSV color gamut. Among them, R is red, G is green, B is blue, H is hue, S is saturation, and I and V are lightness.
- the terminal After the terminal obtains the R, G, and B values of the image, the S (saturation of the image) is calculated. Degrees) value.
- the independent variable in the first saturation transformation function is the initial saturation
- the dependent variable is the processed saturation
- the first saturation transformation function may be:
- ⁇ is a segmented point
- ⁇ (i, j) is a corresponding preset parameter of the pixel point (i, j).
- S i (i, j) is the initial saturation
- S o (i, j) is the saturation after processing.
- ⁇ (i, j) in the first saturation transform function can also be set in advance to other values, such as 2/5, 1/2, 2 / 3 etc.
- this step may be specifically performed by a terminal.
- the terminal After the terminal obtains the first saturation transformation function, it needs to calculate the slope corresponding to the first saturation of the pixel, where the specific calculation method of the slope can be
- the terminal calculates a derivative function of a first saturation transformation function, and calculates a derivative value corresponding to the first saturation of the pixel according to the derivative function, and uses the derivative value as a corresponding value of the first saturation. Slope k.
- this step may be specifically performed by a terminal. After the terminal determines the slope corresponding to the first saturation of the pixel, it is necessary to determine whether the slope is smaller than a first preset threshold. If the slope is greater than or equal to the first preset threshold, If the threshold is set, the process ends.
- the terminal obtains a second saturation transformation function according to the local detail information of the pixel, where the first preset threshold can be 0.8, 1, 1.5, etc., which can be set in advance by the developer.
- the first preset threshold can be 0.8, 1, 1.5, etc., which can be set in advance by the developer.
- the embodiments of the present invention are not limited. It should be noted that the specific difference between the second saturation transform function and the first saturation transform function lies in the difference in ⁇ (i, j) values.
- the first saturation transformation function is:
- ⁇ 0.3
- ⁇ (i, j) 1/3
- the first preset threshold is 1
- the second saturation transformation function is:
- the terminal determines whether the local color difference value of the pixel is less than the second preset threshold ⁇ . If the terminal determines that the local color difference value of the pixel is greater than or equal to ⁇ , the process ends; if the terminal determines that the local color difference value of the pixel is less than ⁇ , it executes to obtain a second value according to the local detailed information of the pixel. Saturation transformation function. Wherein, the value of ⁇ can be set by the developer in advance. It should be noted that the local color difference value is determined by the brightness difference value of the adjacent pixel points of the pixel point, and the brightness value is determined by the R of the pixel point. , G, B values are determined by the difference.
- the terminal uses the following calculation formula to calculate the local color difference h ColorDiff (i, j) of the pixel (i, j):
- D R R (k, l) -R (i, j)
- D G G (k, l) -G (i, j)
- D B B (k, l) -B (i, j)
- R (i, j), G (i, j), B (i, j) are the R, G, and B values of pixel (i, j), R (k, l), G (k , l), B (k, l) are the R, G, and B values of the pixel (k, l), and the pixel (k, l) is a pixel in a local area, and the local area is a pixel ( i, j) is a square region with a center and a side length of w.
- the terminal defines each pixel in the local region as being adjacent to the pixel (i, j).
- the sizes of R (i, j), G (i, j), B (i, j), R (k, l), G (k, l), and B (k, l) can be directly obtained by the terminal.
- the terminal After the terminal obtains the local color difference value h ColorDiff (i, j), it can also perform normalization processing on the obtained local color difference value to obtain the normalized h ColorDiffN (i, j), where the normalization
- the specific process of processing is as follows:
- Max (h ColorDiff (i, j)) is the maximum local color difference value in each pixel.
- the terminal determines that the normalized local color difference value h ColorDiffN (i, j) is smaller than the second preset threshold, it executes to obtain a second saturation transformation function according to the local detailed information of the pixel point. It should be noted that, for a specific calculation method of obtaining the second saturation transformation function according to the local detailed information, refer to steps s31-s33.
- the local area includes the pixel point and at least one pixel point adjacent to the pixel point, which can be set in advance by a researcher.
- determining a brightness value of each pixel point adjacent to the target pixel point determining a first pixel point and a second pixel adjacent to the target pixel point Point, wherein the first pixel point and the second pixel point have the target pixel point as a symmetrical center point in the image; a third pixel point and a fourth pixel point adjacent to the target pixel point are determined, so The third pixel point and the fourth pixel point have the target pixel point as a symmetrical center point in the image;
- the target pixel point (i, j) has a brightness of I (i, j), and the first pixel point adjacent to the target pixel point is a pixel point (i + 1, j + 1). Point (i + 1, j) and pixel point (i + 1, j-1).
- the corresponding brightness values are I (i + 1, j + 1), I (i + 1, j), and I (i + 1, j-1).
- the second pixel points adjacent to the target pixel point are the pixel point (i-1, j + 1), the pixel point (i-1, j), and the pixel point (i-1, j-1).
- the corresponding brightness values are I (i-1, j + 1, Ii-1, j, and Ii-1, j-1.
- the third pixel point adjacent to the target pixel point is pixel point i + 1, j + 1, pixel point i, j + 1 and pixel point (i-1, j + 1).
- the corresponding brightness values are I (i + 1, j + 1), I (i, j + 1) And I (i-1, j + 1).
- the first pixel adjacent to the target pixel is pixel (i + 1, j-1), pixel (i, j-1), and pixel ( i-1, j-1).
- the corresponding brightness values are I (i + 1, j-1), I (i, j-1), and I (i-1, j-1), the pixel points (
- the calculation method for the brightness I (i, j) of i, j) can be:
- the sizes of R (i, j), G (i, j), and B (i, j) can be directly obtained by the terminal.
- a first difference value Detail H (i, j) between the first brightness of the first pixel and the second brightness of the second pixel is calculated.
- a second difference value Detail V (i, j) between the third brightness of the third pixel point and the fourth brightness of the fourth pixel point is calculated.
- a differential grayscale value Detail (i, j) of the target pixel point is obtained according to the first difference value and the second difference value.
- the terminal After the terminal calculates the differential grayscale value of each pixel in the local area (the area composed of w * w pixels), the terminal performs summing processing on the differential grayscale value of each pixel in the local area:
- the terminal After the terminal obtains the local detail information of the pixel, it can also perform normalization processing on the obtained local detail information value to obtain h DetailN (i, j).
- the specific process of the normalization processing is as follows:
- Max (h Detail (i, j)) is the maximum local detail information value in each pixel.
- the terminal recalculates the slope parameter ⁇ (i, j) of the saturation transformation function according to the normalized local detail information value. Specifically,
- ⁇ (i, j) ⁇ H + ( ⁇ L - ⁇ H ) * (tanh ( ⁇ * h DetailN (i, j)))
- ⁇ is the relationship parameter between the change trend of ⁇ and h DetailN
- ⁇ H and ⁇ L are constant values, which are preset by the R & D personnel according to different saturation transformation functions.
- ⁇ ⁇ H in the saturation transformation function
- ⁇ ⁇ L in the saturation transformation function
- ⁇ is a preset value, which is specifically set by the R & D personnel.
- this step may be specifically performed by a terminal.
- the terminal recalculates to obtain ⁇ (i, j)
- the value of ⁇ (i, j) in the first saturation function is replaced with the calculated target ⁇ (i, j).
- , j) value the target ⁇ (i, j) value is brought into the formula to obtain a second saturation transformation function, and the first saturation value of the pixel is brought into the second saturation transformation function Medium, you can get the second saturation.
- this step may be performed by a terminal. Specifically, after the terminal calculates the second saturation value, the brightness of the pixel may be calculated according to the correspondence between the saturation of the pixel and the brightness. Specifically, the terminal may convert the image from the HSI color gamut to the RGB color gamut, or the image from the HSV color gamut to the RGB color gamut, etc. For the specific correspondence between the saturation and the target brightness value, this embodiment of the present invention does not do limited.
- this step is performed by a terminal, and the terminal outputs pixels according to the calculated brightness.
- FIG. 2 is the saturation processing method of the terminal for a single pixel.
- the terminal can use the method described in steps S201-S206 to enhance the saturation of each pixel in the image to achieve the adjustment of the saturation.
- the saturation of the image is enhanced, and the color of the image is enhanced.
- the image color enhancement scheme determines whether the saturation transformation function needs to be adjusted by judging the slope value of the pixel in the saturation enhancement function and the local color difference of the pixel. If it is determined that the saturation of the image needs to be adjusted, The degree conversion function is adjusted, and the size to be adjusted is determined according to the local detailed information of the pixels, and then the saturation of the pixels is adjusted in a differentiated manner, so that the vividness of the image is enhanced, and the detailed information of the image is enhanced. Get reserved.
- the image color enhancement device provided by the embodiment of the present invention will be described in detail below with reference to FIG. 6. It should be noted that the image color enhancement device shown in FIG. 6 is configured to execute the method of the embodiments shown in FIG. 2 to FIG. 3 of the present invention. For ease of description, only parts related to the embodiment of the present invention are shown. The specific technical details have not been disclosed, with reference to the embodiments shown in FIGS. 2 to 3 of the present invention.
- the image color enhancement device 60 may include: an obtaining unit 601, a processing unit 602, a calculation unit 603, and an adjustment unit 604.
- An obtaining unit 601 configured to obtain, for any pixel in an image, a first saturation of the pixel
- a processing unit 602 configured to process a first saturation of the pixel according to a first saturation transformation function to obtain a slope corresponding to the first saturation of the pixel;
- the processing unit 602 is further configured to obtain a second saturation transformation function according to the local detailed information of the pixel if the slope is less than a first preset threshold, where the local detailed information is obtained by the pixel Determined by the difference gray value of the brightness of adjacent pixel points;
- the processing unit 602 is further configured to process the first saturation of the pixel according to the second saturation transformation function to obtain the second saturation of the pixel;
- a calculation unit 603, configured to calculate a target brightness value of the pixel point according to the second saturation
- An adjusting unit 604 is configured to adjust an original brightness value of the pixel point to the target brightness value.
- the calculation unit 603 is further configured to:
- a second saturation transformation function is obtained according to the local detail information of the pixel point.
- processing unit 602 is specifically configured to:
- the second saturation transformation function is obtained.
- processing unit 602 is specifically configured to:
- processing unit 602 is specifically configured to:
- processing unit 602 is specifically configured to:
- processing unit 602 is specifically configured to:
- the obtaining the differential gray value of each pixel in the local area according to the brightness value of each pixel adjacent to the target pixel includes:
- the obtaining unit 601 obtains the first saturation of the pixel; the processing unit 602 performs the first saturation of the pixel according to the first saturation transformation function. Processing to obtain a slope corresponding to the first saturation of the pixel; if the slope is less than a first preset threshold, the processing unit 602 obtains a second saturation transformation function according to the local detail information of the pixel, and the processing unit 602: Process the first saturation of the pixel point according to the second saturation transformation function to obtain the second saturation point of the pixel point; and the calculation unit 603 calculates the pixel point according to the second saturation degree.
- a target brightness value; the adjustment unit 604 adjusts the original brightness value of the pixel point to the target brightness value. It can make the pixels of different saturation have different adjustment ranges, make the color difference in the image obvious, and save the detailed information of the image.
- FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
- the terminal includes: at least one processor 701, input device 703, output device 704, memory 705, and at least one communication bus 702.
- the communication bus 702 is used to implement connection and communication between these components.
- the input device 703 may be a control panel or a microphone, and the output device 704 may be a display screen or the like.
- the memory 705 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), for example, at least one disk memory.
- the memory 705 may optionally be at least one storage device located far from the foregoing processor 701.
- the processor 701 may combine the apparatus described in FIG. 6 with a set of program code stored in the memory 705, and the processor 701, input device 703, and output device 704 call the program code stored in the memory 705 for performing the following operations:
- a processor 701 configured to obtain, for any pixel in the image, a first saturation of the pixel
- the processor 701 is further configured to process a first saturation of the pixel according to a first saturation transformation function to obtain a slope corresponding to the first saturation of the pixel;
- the processor 701 is further configured to obtain a second saturation transformation function according to local detail information of the pixel if the slope is less than a first preset threshold, where the local detail information is determined by a phase of the pixel Determined by the difference gray value of the brightness of adjacent pixels;
- the processor 701 is further configured to process the first saturation of the pixel according to the second saturation transformation function to obtain the second saturation of the pixel;
- the processor 701 is further configured to calculate a target brightness value of the pixel point according to the second saturation
- the processor 701 is further configured to adjust an original brightness value of the pixel point to the target brightness value.
- the processor 701 is further configured to:
- a second saturation transformation function is obtained according to the local detail information of the pixel point.
- processor 701 is specifically configured to:
- the second saturation transformation function is obtained.
- processor 701 is specifically configured to:
- processor 701 is specifically configured to:
- processor 701 is specifically configured to:
- processor 701 is specifically configured to:
- the obtaining the differential gray value of each pixel in the local area according to the brightness value of each pixel adjacent to the target pixel includes:
- the saturation enhancement function by determining the slope value of the pixel in the saturation enhancement function, it is determined whether the saturation of the pixel needs to be adjusted by using a different saturation adjustment method, so that the pixels of different saturation can be adjusted. Different adjustment amplitudes make the color difference in the image more obvious. Differentiated saturation enhancement methods are used for pixels that are likely to cause loss of details in the image, so that the vividness of the image is enhanced, while the detailed information of the image is retained.
- the units described in the embodiments of the present invention may be implemented by a general integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit, ASIC).
- a CPU Central Processing Unit
- ASIC Application Specific Integrated Circuit
- the processor 701 may be a central processing unit (CPU), and the processor may also be another general-purpose processor or a digital signal processor (DSP). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the bus 704 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc.
- ISA Industry Standard Architecture
- PCI Peripheral Component
- EISA Extended Industry Standard Architecture
- the bus 704 can be divided into The address bus, data bus, control bus, and the like are shown in FIG. 7 by only a thick line for convenience of representation, but it does not mean that there is only one bus or one type of bus.
- the program can be stored in a computer storage medium.
- the computer storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (Random Access Memory, RAM).
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
Abstract
本发明实施例公开了一种图像色彩增强方法和装置,所述方法包括:针对图像中任一像素点,获取像素点的第一饱和度;根据第一饱和度变换函数对像素点的第一饱和度进行处理,得到像素点的第一饱和度对应的斜率,若斜率小于第一预设阈值,则根据像素点的局部细节信息得到第二饱和度变换函数,根据调整后的饱和度变换函数对像素点的第一饱和度进行处理,得到像素点的第二饱和度,根据所述第二饱和度,计算像素点的目标亮度值,将像素点的原始亮度值调整为目标亮度值。通过上述方法,对于容易造成图像中细节丢失的像素点采用差异化的饱和度增强方式,使得图像的鲜艳程度得到增强的同时,图像的细节信息得到保留,提升图像的清晰度。
Description
本申请要求2018年6月25日提交中国专利局的,申请号为201810663995.8,发明名称为“图像色彩增强方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及图像处理技术领域,尤其涉及一种图像色彩增强方法和装置。
图像是人类视觉的基础,是自然景物的客观反映,是人类认识世界和人类本身的重要源泉。随着科技的发展,图像在互联网、安全监控、生物医疗等领域得到了广泛的应用,提高图像的视觉效果,以及图像的质量是现在图像处理的主要课题之一。
色彩的增强可以使图像色彩更加鲜艳,视觉效果更加完美。传统的色彩增强的方式对饱和度分量进行非线性变换处理,通过增强图像的饱和度,使得图像的色彩得到增强。图1示出了一种非线性饱和度变换函数的曲线图,如图1所示,当像素的饱和度s较小(s<s1)时,饱和度变换函数k=1,饱和度值将保持不变;像素饱和度位于中部区域(s1<s<s2)时,饱和度变换函数斜率k>1,饱和度的增强强度较大;像素饱和度位于较高区域(s>s2)时,为保证不超出,饱和度变化函数斜率k<1,此时可能会导致图像中饱和度较高的区域的细节丢失。目前的图像色彩增强方式存在以下问题为,当饱和度变化函数斜率k<1时,会导致图像的局部细节丢失。
发明内容
本发明实施例提供了一种图像色彩增强方法和装置,可以解决图像色彩增强过程中细节丢失的问题,提升图像的清晰度。
一方面,本发明实施例提供了一种图像色彩增强方法,所述方法包括:
针对图像中任一像素点,获取所述像素点的第一饱和度;
根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;
若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换 函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;
根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;
根据所述第二饱和度,计算所述像素点的目标亮度值;
将所述像素点的原始亮度值调整为所述目标亮度值。
第二方面,本发明提供了一种图像色彩增强装置,所述装置包括:
获取单元,用于针对图像中任一像素点,获取所述像素点的第一饱和度;
处理单元,用于根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;
所述处理单元,还用于若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;
所述处理单元,还用于根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;
计算单元,用于根据所述第二饱和度,计算所述像素点的目标亮度值;
调整单元,用于将所述像素点的原始亮度值调整为所述目标亮度值。
本发明实施例中,针对图像中任一像素点,获取像素点的第一饱和度;根据第一饱和度变换函数对像素点的第一饱和度进行处理,得到像素点的第一饱和度对应的斜率,若斜率小于第一预设阈值,则根据像素点的局部细节信息得到第二饱和度变换函数,根据调整后的饱和度变换函数对像素点的第一饱和度进行处理,得到像素点的第二饱和度,根据所述第二饱和度,计算像素点的目标亮度值,将像素点的原始亮度值调整为目标亮度值。通过上述方法,对于容易造成图像中细节丢失的像素点采用差异化的饱和度增强方式,使得图像的鲜艳程度得到增强的同时,图像的细节信息得到保留,提升图像的清晰度。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术提供的一种饱和度变换函数曲线图;
图2为本发明实施例提供的一种图像色彩增强方法的流程示意图;
图3为本发明实施例提供的一种局部细节信息计算方法的流程示意图;
图4为本发明实施例提供的一种饱和度变换函数的曲线图;
图5为本发明实施例提供的一种局部区域示意图;
图6为本发明实施例提供的一种图像色彩增强装置的结构示意图;
图7为本发明实施例提供的一种终端的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例涉及的终端可包括但不限于智能手机、掌上电脑、车载终端或者可穿戴设备等电子设备。该终端的操作系统可包括但不限于Android操作系统、IOS操作系统、Symbian(塞班)操作系统、Black Berry(黑莓)操作系统、Windows Phone8操作系统等等,本发明实施例不做限定。在终端中,彩色图像以数字化的点进行显示,终端将彩色图像分割成非常细小的点,称为像素点,像素点是终端的显示器显示画面的最小发光单位,由红色子像素、绿色子像素和蓝色子像素组成,通过配置不同的红、绿、蓝子像素的比例,即可使像素点呈现不同的颜色、饱和度、亮度等。
在终端显示的一些彩色图像中,由于采光缺陷、摄像头像素低等原因使得彩色图像中各个元素的层次不清晰,此时则可以通过色彩增强的方式增强图像细节,突出图像中重要信息,扩大图像中不同物体特征之间的差别,从而使得图像更加鲜艳,色彩,视觉效果更加完美。
基于此,本发明提出了一种图像色彩增强方法,通过图像的局部色彩差异与局部细节信息控制饱和度变换函数的斜率来自适应调整饱和度的增强,使图像色彩鲜艳的同时保存图像的细节。其中,局部色彩差异主要为计算局部区域内像素点的色彩差异,局部细节信息由局部区域内像素点亮度的差分灰阶值计算得到,需要说明的是,局部区域由多个像素点组成,具体可以由研发人员设置。
基于上述描述,本发明实施例提供的图像色彩增强方法的大致原理可以包括:①终端针对图像中任一像素点,获取所述像素点的第一饱和度,具体实现中,第一饱和度可以根据所述像素点的R(Red,红色)、G(Green,绿色)、B(Blue,蓝色)值计算得到。②终端计算所述像素点的第一饱和度在第一饱和度变换函数中对应的斜率。具体实现中,第一饱和度变换函数的自变量为初始饱和度,因变量为处理后的饱和度,具体的第一饱和度变换函数可以由研发人员设置。对第一饱和度变换函数进行求导,即可得到第一饱和度变换函数的导数函 数(即斜率函数),将第一饱和度带入该斜率函数即可得到所述像素点的第一饱和度对应的斜率。③终端判断计算得到的斜率是否小于第一预设阈值,若小于,则确定需要对第一饱和度变换函数进行调整。在一种实施方式中,终端确定斜率小于第一预设阈值之后,直接根据所述像素点的局部细节信息对第一饱和的变换函数进行调整,得到第二饱和度变换函数。在另一种实施方式中,终端确定所述像素点的第一饱和度对应的斜率小于第一预设阈值之后,还需要判断所述像素点的局部色彩部色彩差异值是否小于第二预设阈值,若是,则根据所述像素点的局部细节信息对第一饱和的变换函数进行调整,得到第二饱和度变换函数。④终端根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度。⑤终端根据所述第二饱和度,计算所述像素点的目标亮度值,具体的,饱和度值与亮度值存在一一对应关系,终端根据饱和度值与亮度值的对应关系计算出所述像素点的目标亮度值。⑥终端将所述像素点的原始亮度值调整为所述目标亮度值。具体实现中,终端计算出像素点的目标亮度值之后,将像素点的原始亮度值调整为该目标亮度值,并将其进行显示。
综上可知,本发明实施例提供的图像色彩增强方案可至少具备如下优点:(1)通过判断像素点的在饱和度增强函数中的斜率值来判定是否需要采用差异化的饱和度调整方式对像素点的饱和度进行调整,可以使得不同饱和度的像素点的调整幅度不同,使图像中的色彩差异更明显。(2)对于容易造成图像中细节丢失的像素点采用差异化的饱和度增强方式,使得图像的鲜艳程度得到增强的同时,图像的细节信息得到保留。
下面结合图2所述的实施例对上述方法进行具体的阐述,如图2所示,为本发明实施例提供的图像色彩增强方法流程示意图,该方法包括以下步骤:
S201、针对图像中任一像素点,获取所述像素点的第一饱和度。
本发明实施例中,该步骤可通过终端执行,具体地,终端获取图像中像素点的饱和度的方式可以为获取图像的像素点的R、G、B值,终端根据像素点的R、G、B值确定出其对应的饱和度值,并将该饱和度值作为像素点的第一饱和度。具体实现中,终端可以将图像由RGB色域转换为HSI色域,或者将图像由RGB色域转换为HSV色域等。其中,R表示红色,G表示绿色,B表示蓝色,H表示色调,S表示饱和度,I和V表示明度,终端获取到图像的R、G、B值之后,计算得到图像的S(饱和度)值。在一种可以选的实现方式中,终端获取像素点的R、G、B值,并确定R、G、B值中的最大值和最小值,计算所述最大值与最小值的差值,并将所述差值与最大值的比值作为像素点的第一饱和度。例如,像素点的R值最大,B值最小,则第一饱和度S=(R-B)/R。需要说明的是,终端也可以通过其他方式可获取到图像中像素点的第一饱和度,上述方式只是举例,在此不构成限定。
S202、根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点 的第一饱和度对应的斜率。
本发明实施例中,第一饱和度变换函数中自变量为初始饱和度,因变量为处理后的饱和度。
在一种实施方式中,第一饱和度变换函数可以为:
其中,θ为分段点,γ(i,j)为像素点(i,j)的对应的预设参数。S
i(i,j)为初始饱和度,S
o(i,j)为处理后的饱和度。
从上述公式中可以看出,当饱和度值小于或等于预设值θ时,S
i(i,j)=S
o(i,j),函数的斜率为k=1,处理后的饱和度等于初始饱和度。当像素点的饱和度值大于预设值θ时,对像素点(i,j)的饱和度S
i(i,j)进行处理,得到S
o(i,j),针对不同的γ(i,j)值,得到的函数图像如图4所示。从图4中可以看出,当像素点的饱和度值大于预设值θ时,采用该第一饱和度变换函数对像素点的第一饱度进行处理可以实现饱和度的增强,且γ(i,j)越小,对应的饱和度增强效果越好。
需要说明的是γ(i,j)的初始值可以由研发人员设定,如γ(i,j)=1/3,则第一饱和度变换函数为:
第一饱和度变换函数图像如图4所示,可选的,第一饱和度变换函数中的γ(i,j)也可以预先设置为其他值,如2/5、1/2、2/3等。
本发明实施例中,该步骤具体可通过终端执行,终端在获取到第一饱和度变换函数之后,则需要计算所述像素点的第一饱和度对应的斜率,其中,斜率的具体计算方式可以为:终端计算第一饱和度变换函数的导数函数,并根据所述导数函数计算所述像素点的第一饱和度对应的导数值,并将所述导数值作为所述第一饱和度对应的斜率k。
S203、若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数。
本发明实施例中,该步骤可具体通过终端执行,当终端确定像素点的第一饱和度对应的斜率之后,需要判断该斜率是否小于第一预设阈值,若该斜率大于或等于第一预设阈值,则结束本流程。
若该斜率小于第一预设阈值,则终端根据像素点的局部细节信息得到第二饱和度变换函数,其中,第一预设阈值可以为0.8、1、1.5等,具体可以由研发人员预先设置,本发明实 施例不做限定。需要说明的是,第二饱和度变换函数与第一饱和度变换函数的具体区别在于γ(i,j)值的不同。例如,第一饱和度变换函数为:
其中,θ为0.3,γ(i,j)=1/3,第一预设阈值为1,终端计算得到第一饱和度对应的斜率k=0.8,小于第一预设阈值,则终端根据像素点的局部细节信息计算得到新的γ(i,j)=1/2,则第二饱和度变换函数为:
需要说明的是,根据局部细节信息得到第二饱和度变换函数的具体计算方式可参见步骤s31-s33。
在另一种实现方式中,终端确定像素点的第一饱和度对应的斜率小于第一预设阈值之后,还需要判断所述像素点的局部色彩差异值是否小于第二预设阈值δ,若终端确定所述像素点的局部色彩差异值大于或等于δ,则结束本流程;若终端确定所述像素点的局部色彩差异值小于δ,则执行根据所述像素点的局部细节信息得到第二饱和度变换函数。其中,δ取值具体可以由研发人员预先设置,需要说明的是,所述局部色彩差异值由所述像素点的相邻像素点的亮度差值所决定,所述亮度值由像素点的R、G、B值的差值决定。
具体实现中,针对任意一个像素点(i,j),终端采用如下计算公式计算像素点(i,j)的局部色彩差异值h
ColorDiff(i,j):
其中,D
R=R(k,l)-R(i,j),D
G=G(k,l)-G(i,j),D
B=B(k,l)-B(i,j),R(i,j)、G(i,j)、B(i,j)分别为像素点(i,j)的R、G、B值,R(k,l)、G(k,l)、B(k,l)分别为像素点(k,l)的R、G、B值,像素点(k,l)为局部区域内的像素点,该局部区域为以像素点(i,j)为中心,边长为w的正方形区域,终端将该局部区域内的各个像素点定义为与像素点(i,j)相邻。R(i,j)、G(i,j)、B(i,j)、R(k,l)、G(k,l)、B(k,l)的大小可以由终端直接获取。w由研发人员预先设置,如5,7,9等。如图5所示,为w=5时的局部区域示意图。
终端获取到局部色彩差异值h
ColorDiff(i,j)之后,还可以对得到的局部色彩差异值进行归一化处理得到归一化处理后的h
ColorDiffN(i,j),其中,归一化处理的具体过程如下:
其中,Max(h
ColorDiff(i,j))为各个像素点中的最大局部色彩差异值。
当终端确定归一化处理后的局部色彩差异值h
ColorDiffN(i,j)小于第二预设阈值时,则执行根据所述像素点的局部细节信息得到第二饱和度变换函数。需要说明的是,根据局部细节信息得到第二饱和度变换函数的具体计算方式可参见步骤s31-s33。
s31、确定像素点所处的局部区域。
具体的,局部区域包括所述像素点以及与所述像素点相邻的至少一个像素点,其可以由研发人员预先设定。例如,如图5所示,局部区域可以为以像素点(i,j)为中心,边长为w的正方形区域,其中w=5。
s32、获取局部区域内各个像素点的差分灰阶值。
具体的,针对所述局部区域内任一目标像素点,确定与所述目标像素点相邻的各个像素点的亮度值;确定与所述目标像素点相邻的第一像素点和第二像素点,其中,第一像素点和第二像素点在所述图像中以所述目标像素点为对称中心点;确定与所述目标像素点相邻的第三像素点和第四像素点,所述第三像素点和所述第四像素点在所述图像中以所述目标像素点为对称中心点;
在一种实现方式中,目标像素点(i,j)亮度为I(i,j),与目标像素点相邻的第一像素点的为像素点(i+1,j+1),像素点(i+1,j)和像素点(i+1,j-1)。其对应的亮度值分别为I(i+1,j+1)、I(i+1,j)和I(i+1,j-1)。与目标像素点相邻的第二像素点的为像素点(i-1,j+1),像素点(i-1,j)和像素点(i-1,j-1)。其对应的亮度值分别为I(i-1,j+1、Ii-1,j和Ii-1,j-1。与目标像素点相邻的第三像素点的为像素点i+1,j+1,像素点i,j+1和像素点(i-1,j+1)。其对应的亮度值分别为I(i+1,j+1)、I(i,j+1)和I(i-1,j+1)。与目标像素点相邻的第一像素点的为像素点(i+1,j-1),像素点(i,j-1)和像素点(i-1,j-1)。其对应的亮度值分别为I(i+1,j-1)、I(i,j-1)和I(i-1,j-1),像素点(i,j)的亮度I(i,j)的计算方式可以为:
其中,R(i,j)、G(i,j)和B(i,j)的大小可以由终端直接获取。
当终端获取到局部区域内各个像素点的亮度之后,则根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰阶值,以像素点(i,j)为例,终端计算像素点的差分灰阶值Detail(i,j)的过程具体如下:
计算第一像素点的第一亮度与所述第二像素点的第二亮度之间的第一差值Detail
H(i,j)。
Detail
H(i,j)=[I(i+1,j+1)+2·I(i+1,j)+I(i+1,j-1)]
-[I(i-1,j+1)+2·I(i-1,j)+I(i-1,j-1)]
计算所述第三像素点的第三亮度与所述第四像素点的第四亮度之间的第二差值Detail
V(i,j)。
Detail
V(i,j)=[I(i+1,j+1)+2·I(i,j+1)+I(i-1,j+1)]
-[I(i+1,j-1)+2·I(i,j-1)+I(i-1,j-1)]
根据所述第一差值与所述第二差值得到所述目标像素点的差分灰阶值Detail(i,j)。
s33、将各个差分灰阶值进行相加,得到像素点的局部细节信息。
具体的,终端计算得到局部区域(w*w个像素点构成的区域)内的各个像素点的差分灰阶值之后,对该局部区域内的各个像素点的差分灰度值进行求和处理:
终端得到像素点的局部细节信息之后,还可以对得到的局部细节信息值进行归一化处理得到h
DetailN(i,j),其中,归一化处理的具体过程如下:
其中,Max(h
Detail(i,j))为各个像素点中的最大局部细节信息值。
终端根据归一化处理后的局部细节信息值重新计算饱和度变换函数的斜率参数γ(i,j),具体的,
γ(i,j)=γ
H+(γ
L-γ
H)*(tanh(δ*h
DetailN(i,j)))
其中,δ为γ的变化趋势与h
DetailN的关系参数,γ
H和γ
L为常数值,由研发人员根据不同的饱和度变换函数预先设置,当饱和度变换函数中γ=γ
H时,有较高的增强效果,当饱和度变换函数中γ=γ
L时,有较低的增强效果。δ为预设值,具体由研发人员设置。
S204、根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度。
本发明实施例中,该步骤可具体通过终端执行,终端重新计算得到γ(i,j)之后,将第一饱和度函数中的γ(i,j)值替换为计算得到的目标γ(i,j)值,将目标γ(i,j)值带入公式中,即可得到第二饱和度变换函数,将所述像素点的第一饱和度值带入所述第二饱和度变换函数中,即可得到第二饱和度。
S205、根据所述第二饱和度,计算所述像素点的目标亮度值。
本发明实施例中,该步骤可通过终端执行,具体地,终端计算得到第二饱和度值之后,可以根据像素点饱和度与亮度的对应关系,计算得到像素点的亮度。具体的,终端可以将图像从HSI色域转化为RGB色域,或者,将图像从HSV色域转化为RGB色域等,对于饱和度与目标亮度值的具体对应关系,本发明实施例不做限定。
S206、将所述像素点的原始亮度值调整为所述目标亮度值。
本发明实施例中,该步骤通过终端执行,终端按照计算得到的亮度对像素进行输出。
需要说明的是,图2所述实施例为终端针对单个像素点的饱和度处理方式,终端可以对图像中各个像素点采用步骤S201-S206所述的方法进行饱和度增强,即可实现对整张图像的饱和度增强,进而实现对图像的色彩增强。
本发明实施例提供的图像色彩增强方案通过判断像素点的在饱和度增强函数中的斜率值和像素点的局部色彩差异来判定是否需要对饱和度变换函数进行调整,若判定需要对图像的饱和度变换函数进行调整,则根据像素点的局部细节信息确定需要调整的大小,进而实现采用差异化的方式实现对像素点的饱和度调整,使得图像的鲜艳程度得到增强的同时,图像的细节信息得到保留。
下面将结合附图6对本发明实施例提供的图像色彩增强装置进行详细介绍。需要说明的是,附图6所示的图像色彩增强装置,用于执行本发明图2-图3所示实施例的方法,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,经参照本发明图2-图3所示的实施例。
请参见图6,为本发明提供的一种图像色彩增强装置的结构示意图;该图像色彩增强装置60可包括:获取单元601、处理单元602、计算单元603和调整单元604。
获取单元601,用于针对图像中任一像素点,获取所述像素点的第一饱和度;
处理单元602,用于根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;
所述处理单元602,还用于若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;
所述处理单元602,还用于根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;
计算单元603,用于根据所述第二饱和度,计算所述像素点的目标亮度值;
调整单元604,用于将所述像素点的原始亮度值调整为所述目标亮度值。
在一种实现方式中,所述计算单元603,还用于:
计算所述像素点的局部色彩差异值,所述局部色彩差异值由所述像素点的相邻像素点的亮度差值所决定;
若所述局部色彩差异值小于第二预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数。
再一种实现方式中,所述处理单元602,具体用于:
根据所述像素点的局部细节信息,计算得到所述像素点的第一斜率参数;
根据所述第一斜率参数,得到所述第二饱和度变换函数。
再一种实现方式中,所述处理单元602,具体用于:
计算所述第一饱和度变换函数的导数函数;
根据所述导数函数计算所述像素点的第一饱和度对应的导数值;
将所述导数值作为所述第一饱和度对应的斜率。
再一种实现方式中,所述处理单元602,具体用于:
确定所述像素点所处的局部区域,所述局部区域包括所述像素点以及与所述像素点相邻的至少一个像素点;
获取所述局部区域内各个像素点的差分灰度值;
将所述各个差分灰度值进行相加,得到所述像素点的局部细节信息。
再一种实现方式中,所述处理单元602,具体用于:
针对所述局部区域内任一目标像素点,确定与所述目标像素点相邻的各个像素点的亮度值;
根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值。
再一种实现方式中,所述处理单元602,具体用于:
确定与所述目标像素点相邻的第一像素点和第二像素点,所述第一像素点和所述第二像素点在所述图像中以所述目标像素点为对称中心点;
确定与所述目标像素点相邻的第三像素点和第四像素点,所述第三像素点和所述第四像素点在所述图像中以所述目标像素点为对称中心点;
所述根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值,包括:
计算所述第一像素点的第一亮度与所述第二像素点的第二亮度之间的第一差值;
计算所述第三像素点的第三亮度与所述第四像素点的第四亮度之间的第二差值;
根据所述第一差值与所述第二差值得到所述目标像素点的差分灰阶值。
本发明实施例中,针对图像中任一像素点,获取单元601获取所述像素点的第一饱和度;处理单元602,根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;若所述斜率小于第一预设阈值,则处理单元602根据所述像素点的局部细节信息得到第二饱和度变换函数,处理单元602根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;计算单元603根据所述第二饱和度,计算所述像素点的目标亮度值;调整单元604将所述像素点的原始亮度值调整为所述目标亮度值。可以使得不同饱和度的像素点的调整幅度不同,使图像中的色彩差异明显的同时保存图像的细节信息。
请参见图7,为本发明实施例提供了一种终端的结构示意图。如图7所示,该终端包括:至少一个处理器701,输入设备703,输出设备704,存储器705,至少一个通信总线702。其中,通信总线702用于实现这些组件之间的连接通信。其中,输入设备703可以是控制面板或者麦克风等,输出设备704可以是显示屏等。其中,存储器705可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器705可选的还可以是至少一个位于远离前述处理器701的存储装置。其中处理器701可以结合图6所描述的装置,存储器705中存储一组程序代码,且处理器701,输入设备703,输出设备704调用存储器705中存储的程序代码,用于执行以下操作:
处理器701,用于针对图像中任一像素点,获取所述像素点的第一饱和度;
处理器701,还用于根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;
处理器701,还用于若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;
处理器701,还用于根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;
处理器701,还用于根据所述第二饱和度,计算所述像素点的目标亮度值;
处理器701,还用于将所述像素点的原始亮度值调整为所述目标亮度值。
在一种实现方式中,处理器701,还用于:
计算所述像素点的局部色彩差异值,所述局部色彩差异值由所述像素点的相邻像素点的亮度差值所决定;
若所述局部色彩差异值小于第二预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数。
再一种实现方式中,处理器701,具体用于:
根据所述像素点的局部细节信息,计算得到所述像素点的第一斜率参数;
根据所述第一斜率参数,得到所述第二饱和度变换函数。
再一种实现方式中,处理器701,具体用于:
计算所述第一饱和度变换函数的导数函数;
根据所述导数函数计算所述像素点的第一饱和度对应的导数值;
将所述导数值作为所述第一饱和度对应的斜率。
再一种实现方式中,处理器701,具体用于:
确定所述像素点所处的局部区域,所述局部区域包括所述像素点以及与所述像素点相邻的至少一个像素点;
获取所述局部区域内各个像素点的差分灰度值;
将所述各个差分灰度值进行相加,得到所述像素点的局部细节信息。
再一种实现方式中,处理器701,具体用于:
针对所述局部区域内任一目标像素点,确定与所述目标像素点相邻的各个像素点的亮度值;
根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值。
再一种实现方式中,处理器701,具体用于:
确定与所述目标像素点相邻的第一像素点和第二像素点,所述第一像素点和所述第二像素点在所述图像中以所述目标像素点为对称中心点;
确定与所述目标像素点相邻的第三像素点和第四像素点,所述第三像素点和所述第四像素点在所述图像中以所述目标像素点为对称中心点;
所述根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值,包括:
计算所述第一像素点的第一亮度与所述第二像素点的第二亮度之间的第一差值;
计算所述第三像素点的第三亮度与所述第四像素点的第四亮度之间的第二差值;
根据所述第一差值与所述第二差值得到所述目标像素点的差分灰阶值。
本发明实施例中,通过判断像素点的在饱和度增强函数中的斜率值来判定是否需要采用差异化的饱和度调整方式对像素点的饱和度进行调整,可以使得不同饱和度的像素点的调整 幅度不同,使图像中的色彩差异更明显,对于容易造成图像中细节丢失的像素点采用差异化的饱和度增强方式,使得图像的鲜艳程度得到增强的同时,图像的细节信息得到保留。
本发明实施例中所述单元,可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。
应当理解,在本发明实施例中,所称处理器701可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
总线704可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互联(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等,该总线704可以分为地址总线、数据总线、控制总线等,为便于表示,图7仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的计算机存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。
Claims (15)
- 一种图像色彩增强方法,其中,包括:针对图像中任一像素点,获取所述像素点的第一饱和度;根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;根据所述第二饱和度,计算所述像素点的目标亮度值;将所述像素点的原始亮度值调整为所述目标亮度值。
- 根据权利要求1所述的方法,其中,所述根据所述像素点的局部细节信息得到第二饱和度变换函数之前,还包括:计算所述像素点的局部色彩差异值,所述局部色彩差异值由所述像素点的相邻像素点的亮度差值所决定;若所述局部色彩差异值小于第二预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数。
- 根据权利要求1所述的方法,其中,所述根据所述像素点的局部细节信息得到第二饱和度变换函数,包括:根据所述像素点的局部细节信息,计算得到所述像素点的第一斜率参数;根据所述第一斜率参数,得到所述第二饱和度变换函数。
- 根据权利要求1所述的方法,其中,所述根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率,包括:计算所述第一饱和度变换函数的导数函数;根据所述导数函数计算所述像素点的第一饱和度对应的导数值;将所述导数值作为所述第一饱和度对应的斜率。
- 根据权利要求1所述的方法,其中,所述根据所述像素点的局部细节信息得到第二饱和度变换函数之前,还包括:确定所述像素点所处的局部区域,所述局部区域包括所述像素点以及与所述像素点相邻的至少一个像素点;获取所述局部区域内各个像素点的差分灰度值;将所述各个差分灰度值进行相加,得到所述像素点的局部细节信息。
- 根据权利要求5所述的方法,其中,所述获取所述局部区域内各个像素点的差分灰度值,包括:针对所述局部区域内任一目标像素点,确定与所述目标像素点相邻的各个像素点的亮度值;根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值。
- 根据权利要求6所述的方法,其中,所述确定与所述目标像素点相邻的各个像素点的亮度值,包括:确定与所述目标像素点相邻的第一像素点和第二像素点,所述第一像素点和所述第二像素点在所述图像中以所述目标像素点为对称中心点;确定与所述目标像素点相邻的第三像素点和第四像素点,所述第三像素点和所述第四像素点在所述图像中以所述目标像素点为对称中心点;所述根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值,包括:计算所述第一像素点的第一亮度与所述第二像素点的第二亮度之间的第一差值;计算所述第三像素点的第三亮度与所述第四像素点的第四亮度之间的第二差值;根据所述第一差值与所述第二差值得到所述目标像素点的差分灰阶值。
- 一种图像色彩增强装置,其中,包括:获取单元,用于针对图像中任一像素点,获取所述像素点的第一饱和度;处理单元,用于根据第一饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第一饱和度对应的斜率;所述处理单元,还用于若所述斜率小于第一预设阈值,则根据所述像素点的局部细节信 息得到第二饱和度变换函数,其中,所述局部细节信息由所述像素点的相邻像素点的亮度的差分灰阶值所决定;所述处理单元,还用于根据所述第二饱和度变换函数对所述像素点的第一饱和度进行处理,得到所述像素点的第二饱和度;计算单元,用于根据所述第二饱和度,计算所述像素点的目标亮度值;调整单元,用于将所述像素点的原始亮度值调整为所述目标亮度值。
- 根据权利要求8所述的装置,其中,所述处理单元还用于:计算所述像素点的局部色彩差异值,所述局部色彩差异值由所述像素点的相邻像素点的亮度差值所决定;若所述局部色彩差异值小于第二预设阈值,则根据所述像素点的局部细节信息得到第二饱和度变换函数。
- 根据权利要求8所述的装置,其中,所述处理单元具体用于:根据所述像素点的局部细节信息,计算得到所述像素点的第一斜率参数;根据所述第一斜率参数,得到所述第二饱和度变换函数。
- 根据权利要求8所述的装置,其中,所述处理单元具体用于:计算所述第一饱和度变换函数的导数函数;根据所述导数函数计算所述像素点的第一饱和度对应的导数值;将所述导数值作为所述第一饱和度对应的斜率。
- 根据权利要求8所述的装置,其中,所述处理单元具体用于:确定所述像素点所处的局部区域,所述局部区域包括所述像素点以及与所述像素点相邻的至少一个像素点;获取所述局部区域内各个像素点的差分灰度值;将所述各个差分灰度值进行相加,得到所述像素点的局部细节信息。
- 根据权利要求12所述的装置,其中,所述处理单元具体用于:针对所述局部区域内任一目标像素点,确定与所述目标像素点相邻的各个像素点的亮度值;根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值。
- 根据权利要求13所述的装置,其中,所述处理单元具体用于:确定与所述目标像素点相邻的第一像素点和第二像素点,所述第一像素点和所述第二像素点在所述图像中以所述目标像素点为对称中心点;确定与所述目标像素点相邻的第三像素点和第四像素点,所述第三像素点和所述第四像素点在所述图像中以所述目标像素点为对称中心点;
- 根据权利要求14所述的装置,其中,所述根据所述与所述目标像素点相邻的各个像素点的亮度值,得到所述局部区域内各个像素点的差分灰度值,包括:计算所述第一像素点的第一亮度与所述第二像素点的第二亮度之间的第一差值;计算所述第三像素点的第三亮度与所述第四像素点的第四亮度之间的第二差值;根据所述第一差值与所述第二差值得到所述目标像素点的差分灰阶值。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/095,827 US10937130B1 (en) | 2018-06-25 | 2018-07-20 | Image color enhancement method and device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810663995.8A CN108876742B (zh) | 2018-06-25 | 2018-06-25 | 图像色彩增强方法和装置 |
| CN201810663995.8 | 2018-06-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020000546A1 true WO2020000546A1 (zh) | 2020-01-02 |
Family
ID=64295670
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/096499 Ceased WO2020000546A1 (zh) | 2018-06-25 | 2018-07-20 | 图像色彩增强方法和装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US10937130B1 (zh) |
| CN (1) | CN108876742B (zh) |
| WO (1) | WO2020000546A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112258413A (zh) * | 2020-10-23 | 2021-01-22 | 浙江大华技术股份有限公司 | 图像增强方法、电子设备及存储介质 |
| CN116137022A (zh) * | 2023-04-20 | 2023-05-19 | 山东省三河口矿业有限责任公司 | 一种用于地下采矿远程监控的数据增强方法 |
| CN118115398A (zh) * | 2024-04-23 | 2024-05-31 | 宝鸡拓普达钛业有限公司 | 一种加工刀具的图像特征增强方法及系统 |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110191252A (zh) * | 2019-04-03 | 2019-08-30 | 陈昊 | 一种人工关节外科手术图像传输系统及传输方法 |
| CN112541868B (zh) * | 2020-12-07 | 2024-05-14 | 影石创新科技股份有限公司 | 图像处理方法、装置、计算机设备和存储介质 |
| CN112907653B (zh) * | 2021-01-28 | 2024-04-19 | 浙江大华技术股份有限公司 | 一种图像处理方法、摄像装置及存储介质 |
| CN114878595B (zh) * | 2022-07-08 | 2022-09-20 | 山东蓝彩天下教育科技有限公司 | 一种书本印刷质量检测方法 |
| CN117058030B (zh) * | 2023-08-14 | 2025-11-28 | 腾讯科技(深圳)有限公司 | 图像处理方法、装置、设备、可读存储介质及程序产品 |
| CN117059047B (zh) * | 2023-10-12 | 2023-12-22 | 深圳市柯达科电子科技有限公司 | 一种用于lcd显示图像色彩智能调整方法 |
| CN117078676B (zh) * | 2023-10-16 | 2024-01-12 | 青岛盛鑫达机械有限公司 | 基于图像处理的破碎锤外壳视觉检测方法 |
| CN118334589B (zh) * | 2024-06-12 | 2024-08-30 | 金乡县林业保护和发展服务中心(金乡县湿地保护中心、金乡县野生动植物保护中心、金乡县国有白洼林场) | 基于计算机视觉的园林图像监控方法 |
| CN120472828B (zh) * | 2025-07-11 | 2025-11-18 | 广州市晶鑫光电科技有限公司 | 一种大功率led色彩输出控制系统及方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1017241A2 (en) * | 1998-12-31 | 2000-07-05 | Eastman Kodak Company | A method for compensating image color when adjusting the contrast of a digital color image |
| CN101325663A (zh) * | 2008-07-25 | 2008-12-17 | 北京中星微电子有限公司 | 一种提高图像质量的方法和装置 |
| US7734114B1 (en) * | 2005-12-07 | 2010-06-08 | Marvell International Ltd. | Intelligent saturation of video data |
| CN103065551A (zh) * | 2013-01-16 | 2013-04-24 | 深圳市华星光电技术有限公司 | 一种拼接显示屏 |
| CN107529050A (zh) * | 2017-09-28 | 2017-12-29 | 深圳市华星光电技术有限公司 | 一种图像色彩增强方法、显示设备及存储装置 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100621414B1 (ko) * | 2004-06-09 | 2006-09-08 | 삼성전자주식회사 | 채도 적응적인 영상 향상장치 및 그 방법 |
| JP5227502B2 (ja) * | 2006-09-15 | 2013-07-03 | 株式会社半導体エネルギー研究所 | 液晶表示装置の駆動方法、液晶表示装置及び電子機器 |
| JP6120687B2 (ja) * | 2012-06-14 | 2017-04-26 | アジア航測株式会社 | ラスター画像立体化処理装置及びラスター画像立体化方法並びにラスター画像立体化プログラム |
| TW201503051A (zh) * | 2013-07-02 | 2015-01-16 | Novatek Microelectronics Corp | 影像處理方法與使影像資料不飽和的方法與影像處理裝置 |
| CN105263009B (zh) * | 2015-09-14 | 2017-12-15 | 深圳市华星光电技术有限公司 | 一种图像的自适应转换方法 |
-
2018
- 2018-06-25 CN CN201810663995.8A patent/CN108876742B/zh active Active
- 2018-07-20 US US16/095,827 patent/US10937130B1/en active Active
- 2018-07-20 WO PCT/CN2018/096499 patent/WO2020000546A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1017241A2 (en) * | 1998-12-31 | 2000-07-05 | Eastman Kodak Company | A method for compensating image color when adjusting the contrast of a digital color image |
| US7734114B1 (en) * | 2005-12-07 | 2010-06-08 | Marvell International Ltd. | Intelligent saturation of video data |
| CN101325663A (zh) * | 2008-07-25 | 2008-12-17 | 北京中星微电子有限公司 | 一种提高图像质量的方法和装置 |
| CN103065551A (zh) * | 2013-01-16 | 2013-04-24 | 深圳市华星光电技术有限公司 | 一种拼接显示屏 |
| CN107529050A (zh) * | 2017-09-28 | 2017-12-29 | 深圳市华星光电技术有限公司 | 一种图像色彩增强方法、显示设备及存储装置 |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112258413A (zh) * | 2020-10-23 | 2021-01-22 | 浙江大华技术股份有限公司 | 图像增强方法、电子设备及存储介质 |
| CN116137022A (zh) * | 2023-04-20 | 2023-05-19 | 山东省三河口矿业有限责任公司 | 一种用于地下采矿远程监控的数据增强方法 |
| CN116137022B (zh) * | 2023-04-20 | 2023-08-22 | 山东省三河口矿业有限责任公司 | 一种用于地下采矿远程监控的数据增强方法 |
| CN118115398A (zh) * | 2024-04-23 | 2024-05-31 | 宝鸡拓普达钛业有限公司 | 一种加工刀具的图像特征增强方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108876742A (zh) | 2018-11-23 |
| US10937130B1 (en) | 2021-03-02 |
| CN108876742B (zh) | 2021-04-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020000546A1 (zh) | 图像色彩增强方法和装置 | |
| US10672363B2 (en) | Color rendering for images in extended dynamic range mode | |
| CN111899182B (zh) | 颜色增强方法及装置 | |
| CN110780961B (zh) | 一种调整应用界面文字颜色的方法、存储介质及终端设备 | |
| CN103593830B (zh) | 一种低照度视频图像增强方法 | |
| CN105513019B (zh) | 一种提升图像质量的方法和装置 | |
| WO2017024615A1 (zh) | 图像增强方法 | |
| CN111028181B (zh) | 一种图像增强处理方法、装置、设备及存储介质 | |
| CN101151883B (zh) | 显示图象处理方法、图象处理方法及装置、含图象处理装置的集成电路 | |
| WO2013185449A1 (zh) | 图像增强方法、图像增强装置和显示装置 | |
| US12450691B2 (en) | Neural network-based image processing with artifact compensation | |
| CN112116536A (zh) | 一种低光照图像增强方法及系统 | |
| JP2013013060A (ja) | 拡張rgb空間へのトーンマッピングを用いた高ダイナミックレンジ画像の処理方法 | |
| CN109493291A (zh) | 一种自适应伽马校正的彩色图像对比度增强方法 | |
| CN104463806B (zh) | 基于数据驱动技术的高度自适应图像对比度增强方法 | |
| CN111626967A (zh) | 图像增强方法、装置、计算机装置及可读存储介质 | |
| JP2000134486A (ja) | 画像処理装置及び画像処理方法及び記憶媒体 | |
| CN114374830A (zh) | 图像白平衡方法、电子设备及计算机可读存储介质 | |
| CN114266803A (zh) | 图像处理方法、装置、电子设备及存储介质 | |
| CN110880164A (zh) | 一种图像处理方法、装置、设备及计算机存储介质 | |
| CN115760621A (zh) | 图像去雾方法、装置、电子设备和存储介质 | |
| WO2019179059A1 (zh) | 基于模糊控制的饱和度增强方法及装置 | |
| CN107818285A (zh) | 一种肤色检测方法及装置 | |
| CN111161194A (zh) | 图像处理方法 | |
| CN101383975A (zh) | 图像处理的方法及装置及其电子装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18923869 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: 18923869 Country of ref document: EP Kind code of ref document: A1 |



