[go: up one dir, main page]

CN110197470A - Image processing method, device, electronic equipment and computer readable storage medium - Google Patents

Image processing method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN110197470A
CN110197470A CN201910566715.6A CN201910566715A CN110197470A CN 110197470 A CN110197470 A CN 110197470A CN 201910566715 A CN201910566715 A CN 201910566715A CN 110197470 A CN110197470 A CN 110197470A
Authority
CN
China
Prior art keywords
saturation
pixel
value
preset
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910566715.6A
Other languages
Chinese (zh)
Inventor
鲁方波
樊鸿飞
蔡媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201910566715.6A priority Critical patent/CN110197470A/en
Publication of CN110197470A publication Critical patent/CN110197470A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof

Landscapes

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

Abstract

The embodiment of the present application provides a kind of image processing method, device, electronic equipment and computer readable storage medium, method includes: for each pixel in picture frame to be processed, according to the initial intensity value of default saturation degree threshold value and the pixel, determine the saturation gradation of the pixel, enhance algorithm according to the corresponding saturation degree of the saturation gradation of the pixel, enhancing processing is carried out to the initial intensity value of the pixel, obtain the alternative intensity value of the pixel, according to the brightness value of the alternative intensity value of the pixel and the pixel, obtain the target intensity value of the pixel, target intensity value based on each pixel in picture frame to be processed, the picture frame to be processed that obtains that treated.Based on above-mentioned processing, the picture quality for the picture frame that can be improved that treated.

Description

图像处理方法、装置、电子设备及计算机可读存储介质Image processing method, device, electronic device, and computer-readable storage medium

技术领域technical field

本申请涉及图像处理技术领域,特别是涉及一种图像处理方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of image processing, in particular to an image processing method, device, electronic equipment and computer-readable storage medium.

背景技术Background technique

随着计算机技术的快速发展,图像帧也越来越趋向于高分辨率,导致图像帧构成的视频资源的大小也成倍增加。为了降低视频资源在传输过程中所占用的带宽,节省网络成本,通常需要对视频资源中的图像帧进行压缩处理。对图像帧进行压缩处理,会在一定程度上降低图像帧的画质,比如,压缩处理后的图像帧中颜色偏暗,或,会导致图像帧的细节丢失等。With the rapid development of computer technology, image frames tend to be more and more high-resolution, which results in a multiplied size of video resources composed of image frames. In order to reduce the bandwidth occupied by video resources during transmission and save network costs, it is usually necessary to perform compression processing on image frames in video resources. Compressing the image frame will reduce the image quality of the image frame to a certain extent, for example, the color of the compressed image frame is dark, or the details of the image frame will be lost.

现有技术中,通常可以对压缩后的图像帧(可以称为待处理图像帧)进行色彩增强处理,以提高待处理图像帧的图像质量。例如,根据像素点的饱和度值,可以将待处理图像帧中的像素点划分为不同饱和度等级的像素点,针对不同饱和度等级的像素点,可以进行不同程度的饱和度增强处理,进而,根据增强处理后的饱和度值,得到色彩增强后的待处理图像帧。In the prior art, usually, color enhancement processing may be performed on compressed image frames (which may be referred to as image frames to be processed), so as to improve the image quality of the image frames to be processed. For example, according to the saturation value of the pixel, the pixels in the image frame to be processed can be divided into pixels of different saturation levels, and different degrees of saturation enhancement processing can be performed for pixels of different saturation levels, and then , according to the enhanced saturation value, the image frame to be processed after color enhancement is obtained.

然而,现有技术中,仅根据像素点的饱和度进行色彩增强处理,可能会导致处理后的图像帧的图像质量较低。However, in the prior art, color enhancement processing is performed only according to the saturation of pixels, which may result in low image quality of the processed image frame.

发明内容Contents of the invention

本申请实施例的目的在于提供一种图像处理方法、装置、电子设备及计算机可读存储介质,可以提高处理后的图像帧的图像质量。具体技术方案如下:The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device, and computer-readable storage medium, which can improve the image quality of processed image frames. The specific technical scheme is as follows:

第一方面,为了达到上述目的,本申请实施例公开了一种图像处理方法,所述方法包括:In the first aspect, in order to achieve the above purpose, the embodiment of the present application discloses an image processing method, the method comprising:

针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;For each pixel in the image frame to be processed, according to the preset saturation threshold and the initial saturation value of the pixel, determine the saturation level of the pixel, wherein the saturation level is used to represent the pixel The initial saturation value of the high and low;

根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;According to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the alternative saturation value of the pixel point;

根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;According to the alternative saturation value of the pixel point and the brightness value of the pixel point, the target saturation value of the pixel point is obtained;

基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。Based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained.

可选的,在针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级之前,所述方法还包括:Optionally, before determining the saturation level of the pixel for each pixel in the image frame to be processed according to the preset saturation threshold and the initial saturation value of the pixel, the method further includes:

基于预设图像平滑算法,对所述待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理;Based on the preset image smoothing algorithm, the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed are processed;

基于所述各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到所述各像素在色调饱和度明度HSV格式下各自的饱和度值,作为所述各像素点各自的初始饱和度值。Based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, obtain the respective saturation values of each pixel in the hue-saturation-brightness HSV format, as the pixels Points with their respective initial saturation values.

可选的,在针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级之前,所述方法还包括:Optionally, before determining the saturation level of the pixel for each pixel in the image frame to be processed according to the preset saturation threshold and the initial saturation value of the pixel, the method further includes:

根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值。The preset saturation threshold is determined according to the distribution of the initial saturation values of each pixel in the image frame to be processed.

可选的,所述根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值,包括:Optionally, the determining the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed includes:

根据所述待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值,其中,所述各像素点中初始饱和度值小于和等于所述下限饱和度值的像素点所占的比例为第一预设比值,所述各像素点中初始饱和度值大于和等于所述上限饱和度值的像素点所占的比例为第二预设比值;Determine a lower limit saturation value and an upper limit saturation value according to the distribution histogram of the initial saturation value of each pixel in the image frame to be processed, wherein the initial saturation value in each pixel is less than or equal to the lower limit The proportion of pixels with saturation values is the first preset ratio, and the proportion of pixels with initial saturation values greater than or equal to the upper limit saturation value among the pixels is the second preset ratio;

基于所述下限饱和度值、所述上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,其中,所述第一预设公式为:Based on the lower limit saturation value, the upper limit saturation value and a first preset formula, a first saturation threshold, a second saturation threshold and a third saturation threshold are obtained, wherein the first preset formula is :

S1=max(min(T1,L),T2)S1=max(min(T1,L),T2)

S3=min(max(T3,H),T4)S3=min(max(T3,H),T4)

S2=(S1+S3)/2S2=(S1+S3)/2

L表示所述下限饱和度值,H表示所述上限饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,S3表示所述第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值;L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents The first preset value, T2 represents the second preset value, T3 represents the third preset value, and T4 represents the fourth preset value;

将所述第一饱和度阈值、所述第二饱和度阈值和所述第三饱和度阈值,作为所述预设饱和度阈值。The first saturation threshold, the second saturation threshold, and the third saturation threshold are used as the preset saturation threshold.

可选的,针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,包括:Optionally, for each pixel in the image frame to be processed, the saturation level of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel, including:

针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于所述第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级;For each pixel in the image frame to be processed, if the initial saturation value of the pixel is less than the first saturation threshold, determine the saturation level of the pixel as the first saturation level;

如果该像素点的初始饱和度值不小于所述第一饱和度阈值,且小于所述第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级;If the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, determine that the saturation level of the pixel is the second saturation level;

如果该像素点的初始饱和度值不小于所述第二饱和度阈值,且小于所述第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级;If the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, determine that the saturation level of the pixel is the third saturation level;

如果该像素点的初始饱和度值不小于所述第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。If the initial saturation value of the pixel is not less than the third saturation threshold, determine that the saturation level of the pixel is the fourth saturation level.

可选的,所述根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值,包括:Optionally, performing enhancement processing on the initial saturation value of the pixel according to the saturation enhancement algorithm corresponding to the saturation level of the pixel to obtain an alternative saturation value of the pixel, including:

如果该像素点的饱和度等级为所述第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值;If the saturation level of the pixel is the first saturation level, the product of the initial saturation value of the pixel and the first preset coefficient is used as an alternative saturation value of the pixel;

如果该像素点的饱和度等级为所述第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值,其中,所述第二预设公式为:If the saturation level of the pixel is the second saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula, wherein the first The second preset formula is:

Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值;Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and A1 represents the second preset coefficient , T5 represents the fifth preset value;

如果该像素点的饱和度等级为所述第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值,其中,所述第三预设公式为:If the saturation level of the pixel is the third saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a third preset formula, wherein the first The three preset formulas are:

S3表示所述第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值;S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value;

如果该像素点的饱和度等级为所述第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值,其中,所述第四预设公式为:If the saturation level of the pixel is the fourth saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a fourth preset formula, wherein the fourth The four preset formulas are:

Z=A3×(C-1)+1Z=A3×(C-1)+1

A3表示第四预设系数。A3 represents the fourth preset coefficient.

可选的,所述根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值,包括:Optionally, the obtaining the target saturation value of the pixel according to the alternative saturation value of the pixel and the brightness value of the pixel includes:

获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值;Obtain the average value of the brightness values of the pixels in the image area of the preset size to which the pixel belongs, as the average brightness value corresponding to the pixel;

根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值,其中,所述第五预设公式为:According to the alternative saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel and the fifth preset formula, the target saturation value of the pixel is obtained, wherein the fifth The default formula is:

M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation.

第二方面,为了达到上述目的,本申请实施例还公开了一种图像处理装置,所述装置包括:In the second aspect, in order to achieve the above purpose, the embodiment of the present application also discloses an image processing device, the device includes:

第一确定模块,用于针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;The first determination module is configured to determine the saturation level of the pixel point for each pixel point in the image frame to be processed according to the preset saturation threshold value and the initial saturation value of the pixel point, wherein the saturation level Level is used to indicate the level of the initial saturation value of the pixel;

第一处理模块,用于根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;The first processing module is configured to perform enhancement processing on the initial saturation value of the pixel point according to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, to obtain an alternative saturation value of the pixel point;

第二处理模块,用于根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;The second processing module is used to obtain the target saturation value of the pixel according to the alternative saturation value of the pixel and the brightness value of the pixel;

生成模块,用于基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。A generating module, configured to obtain the processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed.

可选的,所述装置还包括:Optionally, the device also includes:

第三处理模块,用于基于预设图像平滑算法,对所述待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理;The third processing module is configured to process the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed based on a preset image smoothing algorithm;

基于所述各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到所述各像素在色调饱和度明度HSV格式下各自的饱和度值,作为所述各像素点各自的初始饱和度值。Based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, obtain the respective saturation values of each pixel in the hue-saturation-brightness HSV format, as the pixels Points with their respective initial saturation values.

可选的,所述装置还包括:Optionally, the device also includes:

第二确定模块,用于根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值。The second determination module is configured to determine the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed.

可选的,所述第二确定模块,具体用于根据所述待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值,其中,所述各像素点中初始饱和度值小于和等于所述下限饱和度值的像素点所占的比例为第一预设比值,所述各像素点中初始饱和度值大于和等于所述上限饱和度值的像素点所占的比例为第二预设比值;Optionally, the second determining module is specifically configured to determine a lower limit saturation value and an upper limit saturation value according to a distribution histogram of initial saturation values of each pixel in the image frame to be processed, wherein the The proportion of pixels whose initial saturation value is less than or equal to the lower limit saturation value in each pixel is the first preset ratio, and the initial saturation value of each pixel is greater than or equal to the upper limit saturation value The proportion of the pixel points is the second preset ratio;

基于所述下限饱和度值、所述上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,其中,所述第一预设公式为:Based on the lower limit saturation value, the upper limit saturation value and a first preset formula, a first saturation threshold, a second saturation threshold and a third saturation threshold are obtained, wherein the first preset formula is :

S1=max(min(T1,L),T2)S1=max(min(T1,L),T2)

S3=min(max(T3,H),T4)S3=min(max(T3,H),T4)

S2=(S1+S3)/2S2=(S1+S3)/2

L表示所述下限饱和度值,H表示所述上限饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,S3表示所述第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值;L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents The first preset value, T2 represents the second preset value, T3 represents the third preset value, and T4 represents the fourth preset value;

将所述第一饱和度阈值、所述第二饱和度阈值和所述第三饱和度阈值,作为所述预设饱和度阈值。The first saturation threshold, the second saturation threshold, and the third saturation threshold are used as the preset saturation threshold.

可选的,所述第一确定模块,具体用于针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于所述第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级;Optionally, the first determination module is specifically configured to, for each pixel in the image frame to be processed, if the initial saturation value of the pixel is less than the first saturation threshold, determine the saturation of the pixel The saturation level is the first saturation level;

如果该像素点的初始饱和度值不小于所述第一饱和度阈值,且小于所述第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级;If the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, determine that the saturation level of the pixel is the second saturation level;

如果该像素点的初始饱和度值不小于所述第二饱和度阈值,且小于所述第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级;If the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, determine that the saturation level of the pixel is the third saturation level;

如果该像素点的初始饱和度值不小于所述第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。If the initial saturation value of the pixel is not less than the third saturation threshold, determine that the saturation level of the pixel is the fourth saturation level.

可选的,所述第一处理模块,具体用于如果该像素点的饱和度等级为所述第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值;Optionally, the first processing module is specifically configured to, if the saturation level of the pixel point is the first saturation level, multiplying the initial saturation value of the pixel point by a first preset coefficient, As an alternative saturation value for the pixel;

如果该像素点的饱和度等级为所述第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值,其中,所述第二预设公式为:If the saturation level of the pixel is the second saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula, wherein the first The second preset formula is:

Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值;Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and A1 represents the second preset coefficient , T5 represents the fifth preset value;

如果该像素点的饱和度等级为所述第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值,其中,所述第三预设公式为:If the saturation level of the pixel is the third saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a third preset formula, wherein the first The three preset formulas are:

S3表示所述第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值;S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value;

如果该像素点的饱和度等级为所述第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值,其中,所述第四预设公式为:If the saturation level of the pixel is the fourth saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a fourth preset formula, wherein the fourth The four preset formulas are:

Z=A3×(C-1)+1Z=A3×(C-1)+1

A3表示第四预设系数。A3 represents the fourth preset coefficient.

可选的,所述第二处理模块,具体用于获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值;Optionally, the second processing module is specifically configured to obtain an average value of brightness values of pixels in an image region of a preset size to which the pixel belongs, as the average brightness value corresponding to the pixel;

根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值,其中,所述第五预设公式为:According to the alternative saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel and the fifth preset formula, the target saturation value of the pixel is obtained, wherein the fifth The default formula is:

M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation.

另一方面,为了达到上述目的,本申请实施例还公开了一种电子设备,所述电子设备包括存储器和处理器;On the other hand, in order to achieve the above purpose, the embodiment of the present application also discloses an electronic device, the electronic device includes a memory and a processor;

所述存储器,用于存放计算机程序;The memory is used to store computer programs;

所述处理器,用于执行存储器上所存放的程序时,实现如上述第一方面所述的图像处理方法步骤。The processor is configured to implement the steps of the image processing method described in the first aspect when executing the program stored in the memory.

另一方面,为了达到上述目的,本申请实施例还公开了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时,实现如上述第一方面所述的图像处理方法步骤。On the other hand, in order to achieve the above purpose, the embodiment of the present application also discloses a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned The steps of the image processing method described in the first aspect.

另一方面,为了达到上述目的,本申请实施例还公开了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的图像处理方法步骤。On the other hand, in order to achieve the above purpose, the embodiment of the present application also discloses a computer program product containing instructions, which when run on a computer, causes the computer to execute the steps of the image processing method described in the above first aspect.

本申请实施例提供了一种图像处理方法,针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值,根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值,基于待处理图像帧中各像素点的目标饱和度值,得到处理后的待处理图像帧。由于人眼对不同亮度值的图像区域的色彩的敏感度不同,因此,结合像素点的饱和度值和亮度值,对像素点进行色彩增强处理,相对于现有技术中仅根据像素点的饱和度进行色彩增强处理,可以提高处理后的图像帧的图像质量。The embodiment of the present application provides an image processing method. For each pixel in the image frame to be processed, the saturation level of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel. The saturation enhancement algorithm corresponding to the saturation level of the pixel performs enhancement processing on the initial saturation value of the pixel to obtain the alternative saturation value of the pixel, and according to the alternative saturation value of the pixel and the The brightness value of the pixel point is used to obtain the target saturation value of the pixel point, and the processed image frame to be processed is obtained based on the target saturation value of each pixel point in the image frame to be processed. Since human eyes have different sensitivities to the color of image regions with different brightness values, therefore, combining the saturation value and brightness value of the pixel point to perform color enhancement processing on the pixel point, compared with the prior art only based on the saturation value of the pixel point Color enhancement processing can be performed at a high degree, which can improve the image quality of the processed image frame.

当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。Of course, implementing any product or method of the present application does not necessarily need to achieve all the above-mentioned advantages at the same time.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为本申请实施例提供的一种图像处理方法的流程图;FIG. 1 is a flow chart of an image processing method provided in an embodiment of the present application;

图2为本申请实施例提供的一种图像处理方法示例的流程图;FIG. 2 is a flow chart of an example of an image processing method provided in an embodiment of the present application;

图3为本申请实施例提供的一种图像处理装置的结构图;FIG. 3 is a structural diagram of an image processing device provided in an embodiment of the present application;

图4为本申请实施例提供的一种电子设备的结构图。FIG. 4 is a structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

相关技术中,仅根据像素点的饱和度进行色彩增强处理,可能会导致处理后的图像帧的图像质量较低。In the related art, the color enhancement processing is only performed according to the saturation of the pixels, which may result in low image quality of the processed image frame.

为了解决上述问题,本申请实施例提供了一种图像处理方法,可以应用于电子设备,该电子设备可以为终端,或者,电子设备也可以为服务器,该电子设备用于对图像帧进行处理。In order to solve the above problems, an embodiment of the present application provides an image processing method, which can be applied to an electronic device, and the electronic device can be a terminal, or the electronic device can also be a server, and the electronic device is used to process image frames.

针对待处理图像帧中的每一像素点,电子设备可以根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级。For each pixel in the image frame to be processed, the electronic device can determine the saturation level of the pixel according to the preset saturation threshold and the initial saturation value of the pixel.

然后,电子设备根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值,并根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值。Then, according to the saturation enhancement algorithm corresponding to the saturation level of the pixel, the electronic device performs enhancement processing on the initial saturation value of the pixel to obtain the candidate saturation value of the pixel, and according to the candidate saturation value of the pixel, Select the saturation value and the brightness value of the pixel to get the target saturation value of the pixel.

进而,电子设备基于待处理图像帧中各像素点的目标饱和度值,得到处理后的待处理图像帧。Furthermore, the electronic device obtains the processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed.

由于人眼对不同亮度值的图像区域的色彩的敏感度不同,因此,结合像素点的饱和度值和亮度值,对像素点进行色彩增强处理,相对于现有技术中仅根据像素点的饱和度进行色彩增强处理,可以提高处理后的图像帧的图像质量。Since human eyes have different sensitivities to the color of image regions with different brightness values, therefore, combining the saturation value and brightness value of the pixel point to perform color enhancement processing on the pixel point, compared with the prior art only based on the saturation value of the pixel point Color enhancement processing can be performed at a high degree, which can improve the image quality of the processed image frame.

参见图1,图1为本申请实施例提供的一种图像处理方法的流程图,该方法可以包括以下步骤:Referring to FIG. 1, FIG. 1 is a flow chart of an image processing method provided in an embodiment of the present application, and the method may include the following steps:

S101:针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级。S101: For each pixel in the image frame to be processed, determine the saturation level of the pixel according to the preset saturation threshold and the initial saturation value of the pixel.

其中,饱和度等级用于表示该像素点的初始饱和度值的高低。Wherein, the saturation level is used to indicate the level of the initial saturation value of the pixel.

待处理图像帧可以为单独的一幅图像,或者,也可以是电子设备从视频资源中提取得到的任一图像帧,通常可以将待处理图像帧转换为HSV格式,将HSV格式下每一像素点的S分量的数值,作为该像素点的初始饱和度值。The image frame to be processed can be a single image, or it can be any image frame extracted by the electronic device from the video resource. Usually, the image frame to be processed can be converted to HSV format, and each pixel in the HSV format The value of the S component of the point is used as the initial saturation value of the pixel point.

进而,针对待处理图像帧中的每一像素点,可以根据该像素点的初始饱和度值和预设饱和度阈值的大小关系,确定该像素点的饱和度等级,以根据饱和度等级对该像素点进行色彩增强处理。Furthermore, for each pixel in the image frame to be processed, the saturation level of the pixel can be determined according to the magnitude relationship between the initial saturation value of the pixel and the preset saturation threshold, so as to determine the saturation level of the pixel according to the saturation level. Pixels are color enhanced.

一种方式中,电子设备在获取待处理图像帧后,如果待处理图像帧为YUV格式,则电子设备可以直接将待处理图像帧转换为HSV格式,进而,得到每一像素点的初始饱和度值。In one way, after the electronic device acquires the image frame to be processed, if the image frame to be processed is in YUV format, the electronic device can directly convert the image frame to be processed into the HSV format, and then obtain the initial saturation of each pixel value.

然而,在对图像帧进行传输的过程中,很容易在UV通道中引入图像噪声,因此,在将待处理图像帧转换为HSV格式之前,电子设备还可以对待处理图像帧的UV通道的图像参数进行处理,以去除图像噪声,进一步提高图像质量。However, in the process of transmitting the image frame, it is easy to introduce image noise in the UV channel. Therefore, before converting the image frame to be processed into the HSV format, the electronic device can also use the image parameters of the UV channel of the image frame to be processed. Processing is performed to remove image noise and further improve image quality.

可选的,在S101之前,该方法还可以包括以下步骤:Optionally, before S101, the method may further include the following steps:

步骤一,基于预设图像平滑算法,对待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理。Step 1: Based on a preset image smoothing algorithm, the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed are processed.

其中,预设图像平滑算法可以为导向图滤波算法,或相关技术中其他用于去除图像噪声的算法。Wherein, the preset image smoothing algorithm may be a guided graph filtering algorithm, or other algorithms for removing image noise in the related art.

一种实现方式中,电子设备可以分别获取待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数,然后,根据导向图滤波算法,分别对U通道的图像参数和V通道的图像参数进行处理,以去除UV通道中的图像噪声。In one implementation, the electronic device can respectively obtain the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed, and then, according to the guided graph filtering algorithm, separately analyze the image parameters of the U channel and the V channel The image parameters are processed to remove image noise in the UV channel.

步骤二,基于各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到各像素在HSV格式下各自的饱和度值,作为各像素点各自的初始饱和度值。Step 2, based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, the respective saturation values of each pixel in the HSV format are obtained as the respective initial saturation values of each pixel .

在去除UV通道中的图像噪声后,电子设备可以结合待处理图像帧中各像素点的亮度值(即Y通道的图像参数),以及处理后的U通道的图像参数和V通道的图像参数,得到每一像素点对应的HSV格式下的图像参数,将得到的每一像素点在HSV格式下的饱和度值,作为该像素点的初始饱和度值,进而,可以根据该像素点的初始饱和度值和预设饱和度阈值的大小关系,确定该像素点的饱和度等级,以根据饱和度等级对该像素点进行色彩增强处理。After removing the image noise in the UV channel, the electronic device can combine the brightness values of each pixel in the image frame to be processed (ie, the image parameters of the Y channel), and the processed image parameters of the U channel and the image parameters of the V channel, Obtain the image parameters in the HSV format corresponding to each pixel, and use the obtained saturation value of each pixel in the HSV format as the initial saturation value of the pixel, and then, according to the initial saturation of the pixel Determine the saturation level of the pixel according to the magnitude relationship between the saturation value and the preset saturation threshold, so as to perform color enhancement processing on the pixel according to the saturation level.

另外,为了进一步提高图像处理的效果,可以根据待处理图像帧中像素点的初始饱和度值,确定用于划分饱和度等级的预设饱和度阈值。In addition, in order to further improve the effect of image processing, a preset saturation threshold for dividing saturation levels may be determined according to the initial saturation values of pixels in the image frame to be processed.

可选的,在S101之前,该方法还可以包括以下步骤:Optionally, before S101, the method may further include the following steps:

根据待处理图像帧中各像素点的初始饱和度值的分布情况,确定预设饱和度阈值。The preset saturation threshold is determined according to the distribution of the initial saturation values of each pixel in the image frame to be processed.

由于不同的图像帧中像素点的饱和度分布情况差别较大,针对不同的图像帧,如果均采用同一饱和度阈值确定像素点的饱和度等级,可能会导致确定的饱和度等级的准确度较低,进而,导致处理后的图像帧的质量较低。Since the saturation distribution of pixels in different image frames is quite different, if the same saturation threshold is used to determine the saturation level of pixels for different image frames, the accuracy of the determined saturation level may be relatively low. Low, in turn, results in lower quality of the processed image frame.

基于此,本申请可以根据待处理图像帧中各像素点的初始饱和度值的分布情况,确定预设饱和度阈值。Based on this, the present application can determine the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed.

可选的,确定预设饱和度阈值的方法可以包括以下步骤:Optionally, the method for determining the preset saturation threshold may include the following steps:

步骤1,根据待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值。Step 1: Determine the lower limit saturation value and the upper limit saturation value according to the distribution histogram of the initial saturation value of each pixel in the image frame to be processed.

其中,各像素点中初始饱和度值小于和等于下限饱和度值的像素点所占的比例为第一预设比值,各像素点中初始饱和度值大于和等于上限饱和度值的像素点所占的比例为第二预设比值。Among them, the proportion of pixels whose initial saturation value is less than or equal to the lower limit saturation value in each pixel is the first preset ratio, and the proportion of pixels whose initial saturation value is greater than or equal to the upper limit saturation value in each pixel is The proportion is the second preset ratio.

第一预设比值和第二预设比值可以由技术人员根据经验进行设置,例如,第一预设比值可以为20%,第二预设比值也可以为20%。The first preset ratio and the second preset ratio can be set by a technician based on experience, for example, the first preset ratio can be 20%, and the second preset ratio can also be 20%.

一种实现方式中,在得到待处理图像帧中各像素点的初始饱和度值后,电子设备可以生成初始饱和度值的分布直方图,然后,电子设备可以将该分布直方图左侧包含20%的像素点的范围对应的初始饱和度值,作为下限饱和度值;将该分布直方图右侧包含20%的像素点的范围对应的初始饱和度值,作为上限饱和度值。In an implementation manner, after obtaining the initial saturation value of each pixel in the image frame to be processed, the electronic device may generate a distribution histogram of the initial saturation value, and then, the electronic device may include 20 on the left side of the distribution histogram. The initial saturation value corresponding to the range of % pixels is used as the lower limit saturation value; the initial saturation value corresponding to the range containing 20% of the pixels on the right side of the distribution histogram is used as the upper limit saturation value.

即,电子设备可以根据公式(1),确定下限饱和度值和上限饱和度值。That is, the electronic device can determine the lower limit saturation value and the upper limit saturation value according to formula (1).

其中,C表示初始饱和度值,Hist(C)表示初始饱和度值的分布,L表示下限饱和度值,H表示上限饱和度值。C的范围为[0,1]。Among them, C represents the initial saturation value, Hist(C) represents the distribution of the initial saturation value, L represents the lower limit saturation value, and H represents the upper limit saturation value. The range of C is [0, 1].

步骤2,基于下限饱和度值、上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值。Step 2: Obtain a first saturation threshold, a second saturation threshold, and a third saturation threshold based on the lower limit saturation value, the upper limit saturation value, and the first preset formula.

其中,第一预设公式为:Wherein, the first preset formula is:

S1=max(min(T1,L),T2)S1=max(min(T1,L),T2)

S3=min(max(T3,H),T4)S3=min(max(T3,H),T4)

S2=(S1+S3)/2S2=(S1+S3)/2

L表示下限饱和度值,H表示上限饱和度值,S1表示第一饱和度阈值,S2表示第二饱和度阈值,S3表示第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值。一种实现方式中,T1可以为0.2,T2可以为1,T3可以为0.8,T4可以为0.9。L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents the first preset value, T2 represents the second The preset values, T3 represents the third preset value, and T4 represents the fourth preset value. In an implementation manner, T1 may be 0.2, T2 may be 1, T3 may be 0.8, and T4 may be 0.9.

步骤3,将第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,作为预设饱和度阈值。In step 3, the first saturation threshold, the second saturation threshold and the third saturation threshold are used as preset saturation thresholds.

在得到下限饱和度值和上限饱和度值后,电子设备可以根据第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,作为预设饱和度阈值,用于确定像素点的饱和度等级。After obtaining the lower limit saturation value and the upper limit saturation value, the electronic device can obtain the first saturation threshold, the second saturation threshold and the third saturation threshold according to the first preset formula as the preset saturation threshold, using Used to determine the saturation level of a pixel.

可选的,在确定预设饱和度阈值包括第一饱和度阈值、第二饱和度阈值和第三饱和度阈值的情况下,S101可以包括以下情况:Optionally, when it is determined that the preset saturation threshold includes the first saturation threshold, the second saturation threshold, and the third saturation threshold, S101 may include the following situations:

情况一,针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级。Case 1, for each pixel in the image frame to be processed, if the initial saturation value of the pixel is smaller than the first saturation threshold, the saturation level of the pixel is determined to be the first saturation level.

情况二,如果该像素点的初始饱和度值不小于第一饱和度阈值,且小于第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级。In the second case, if the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, it is determined that the saturation level of the pixel is the second saturation level.

情况三,如果该像素点的初始饱和度值不小于第二饱和度阈值,且小于第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级。In case three, if the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, it is determined that the saturation level of the pixel is the third saturation level.

情况四,如果该像素点的初始饱和度值不小于第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。Case 4, if the initial saturation value of the pixel is not less than the third saturation threshold, it is determined that the saturation level of the pixel is the fourth saturation level.

一种实现方式中,电子设备可以根据第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,将待处理图像帧中的各像素点划分为四个饱和度等级。In an implementation manner, the electronic device may divide each pixel point in the image frame to be processed into four saturation levels according to the first saturation threshold, the second saturation threshold, and the third saturation threshold.

其中,第一饱和度等级的像素点(可以称为超低饱和度像素点)的初始饱和度值小于第一饱和度阈值;第二饱和度等级的像素点(可以称为低饱和度像素点)的初始饱和度值不小于第一饱和度阈值,且小于第二饱和度阈值;第三饱和度等级的像素点(可以称为高饱和度像素点)的初始饱和度值不小于第二饱和度阈值,且小于第三饱和度阈值;第四饱和度等级的像素点(可以称为超高饱和度像素点)的初始饱和度值不小于第三饱和度阈值。Among them, the initial saturation value of the pixels of the first saturation level (which may be referred to as ultra-low saturation pixels) is smaller than the first saturation threshold; the pixels of the second saturation level (which may be referred to as low-saturation pixels) )'s initial saturation value is not less than the first saturation threshold, and is less than the second saturation threshold; the initial saturation value of the pixels of the third saturation level (which can be called high-saturation pixels) is not less than the second saturation threshold The saturation threshold is smaller than the third saturation threshold; the initial saturation value of the pixels of the fourth saturation level (which may be called ultra-high saturation pixels) is not smaller than the third saturation threshold.

S102:根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值。S102: Perform enhancement processing on the initial saturation value of the pixel according to the saturation enhancement algorithm corresponding to the saturation level of the pixel to obtain an alternative saturation value of the pixel.

为了提高图像处理效果,针对不同饱和度的像素点,通常采用不同的方式进行色彩增强处理。In order to improve the effect of image processing, different methods are usually used for color enhancement processing for pixels with different saturations.

因此,针对每一像素点,在确定该像素点的饱和度等级后,则可以根据该像素点的饱和度等级所对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,处理后的饱和度值即备选饱和度值。Therefore, for each pixel, after determining the saturation level of the pixel, the initial saturation value of the pixel can be enhanced according to the saturation enhancement algorithm corresponding to the saturation level of the pixel, The processed saturation value is the alternative saturation value.

一种实现方式中,针对超低饱和度像素点、低饱和度像素点、高饱和度像素点和超高饱和度像素点,电子设备可以分别采取不同的色彩增强方式进行处理,得到像素点的备选饱和度值。In one implementation, for ultra-low-saturation pixels, low-saturation pixels, high-saturation pixels, and ultra-high-saturation pixels, the electronic device can adopt different color enhancement methods for processing to obtain pixel values Alternative saturation value.

可选的,步骤S102可以包括以下方式:Optionally, step S102 may include the following methods:

方式一,如果该像素点的饱和度等级为第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值。Way 1: If the saturation level of the pixel is the first saturation level, the product of the initial saturation value of the pixel and the first preset coefficient is used as the candidate saturation value of the pixel.

其中,第一预设系数可以由技术人员根据经验进行设置,例如,第一预设系数可以为0.5,但并不限于此。Wherein, the first preset coefficient may be set by a technician based on experience, for example, the first preset coefficient may be 0.5, but it is not limited thereto.

方式二,如果该像素点的饱和度等级为第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值。Method 2, if the saturation level of the pixel is the second saturation level, then an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula.

其中,第二预设公式为:Wherein, the second preset formula is:

Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示第一饱和度阈值,S2表示第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值。例如,A1可以为0.5,T5可以为0.6,但并不限于此。Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, A1 represents the second preset coefficient, T5 represents the first Five preset values. For example, A1 may be 0.5, and T5 may be 0.6, but not limited thereto.

方式三,如果该像素点的饱和度等级为第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值。Mode 3, if the saturation level of the pixel point is the third saturation level, an alternative saturation value of the pixel point is obtained according to the initial saturation value of the pixel point and a third preset formula.

其中,第三预设公式为:Wherein, the third preset formula is:

S3表示第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值。例如,A2可以为0.5,T6可以为0.1,T7可以为0.6,但并不限于此。S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value. For example, A2 may be 0.5, T6 may be 0.1, and T7 may be 0.6, but not limited thereto.

方式四,如果该像素点的饱和度等级为第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值。Mode 4, if the saturation level of the pixel point is the fourth saturation level, an alternative saturation value of the pixel point is obtained according to the initial saturation value of the pixel point and a fourth preset formula.

其中,第四预设公式为:Wherein, the fourth preset formula is:

Z=A3×(C-1)+1Z=A3×(C-1)+1

A3表示第四预设系数,例如,A3可以为0.5,但并不限于此。A3 represents a fourth preset coefficient, for example, A3 may be 0.5, but it is not limited thereto.

基于上述处理,针对不同饱和度的像素点,采取不同的方式进行处理,能够提高色彩增强处理的针对性,进而,能够进一步提高处理后的图像帧的图像质量。Based on the above processing, pixels with different saturations are processed in different ways, which can improve the pertinence of the color enhancement processing, and further improve the image quality of the processed image frame.

S103:根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值。S103: Obtain the target saturation value of the pixel according to the candidate saturation value of the pixel and the brightness value of the pixel.

由于人眼对不同亮度值的图像区域的色彩的敏感度不同,因此,为了进一步提高处理后的图像帧的图像质量,针对待处理图像帧中的每一像素点,电子设备在得到该像素点的备选饱和度值后,还可以结合该像素点的亮度值,确定出该像素点的目标饱和度值,进而,根据各像素点的目标饱和度值,得到处理后的待处理图像帧。Since human eyes have different sensitivities to the colors of image regions with different brightness values, in order to further improve the image quality of the processed image frame, for each pixel in the image frame to be processed, the electronic device obtains the pixel After selecting the saturation value of the pixel, the target saturation value of the pixel can be determined in combination with the brightness value of the pixel, and then, the processed image frame to be processed can be obtained according to the target saturation value of each pixel.

可选的,S103可以包括以下步骤:Optionally, S103 may include the following steps:

步骤一,获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值。Step 1: Obtain an average value of brightness values of pixels in the image area of a preset size to which the pixel belongs, as an average brightness value corresponding to the pixel.

针对待处理图像帧中的一个像素点,为了体现该像素点的亮度的相对大小,电子设备可以获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值(即平均亮度值),以根据平均亮度值来衡量该像素点的亮度。For a pixel in the image frame to be processed, in order to reflect the relative size of the brightness of the pixel, the electronic device can obtain the average value of the brightness of the pixel in the image area of the preset size to which the pixel belongs (that is, the average brightness value), to measure the brightness of the pixel according to the average brightness value.

预设大小可以由技术人员根据经验进行设置。The preset size can be set by a technician based on experience.

例如,可以以该像素点为中心,将该像素点周围5×5大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值。For example, the average value of brightness values of pixels in a 5×5 image area around the pixel point may be taken as the average brightness value corresponding to the pixel point.

步骤二,根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值。Step 2: Obtain the target saturation value of the pixel according to the candidate saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel, and the fifth preset formula.

其中,第五预设公式为:Wherein, the fifth preset formula is:

M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。一种实现方式中,A4的数值可以属于[0,5]范围。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation. In an implementation manner, the value of A4 may belong to the range [0, 5].

针对每一像素点,电子设备可以根据第五预设公式,确定该像素点的目标饱和度值。For each pixel, the electronic device can determine the target saturation value of the pixel according to the fifth preset formula.

由第五预设公式可见,如果某一像素点的亮度值大于该像素点对应的平均亮度值,则会增强该像素点的饱和度;如果该像素点的亮度值小于该像素点对应的平均亮度值,则会降低该像素点的饱和度值,通过上述处理,能够适应人眼对不同亮度的像素点的色彩的敏感度,以提高处理后的图像帧的图像质量。It can be seen from the fifth preset formula that if the brightness value of a pixel point is greater than the average brightness value corresponding to the pixel point, the saturation of the pixel point will be enhanced; if the brightness value of the pixel point is smaller than the average brightness value corresponding to the pixel point If the brightness value is lowered, the saturation value of the pixel will be reduced. Through the above processing, the sensitivity of human eyes to the color of pixels with different brightness can be adapted to improve the image quality of the processed image frame.

S104:基于待处理图像帧中各像素点的目标饱和度值,得到处理后的待处理图像帧。S104: Obtain a processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed.

一种实现方式中,在得到各像素点的目标饱和度值后,电子设备可以对根据各像素点的目标饱和度值(即处理后的S分量的数值)、H分量的数值和V分量的数值,进行格式转换,得到对应的YUV格式的图像帧,即,处理后的待处理图像帧。In an implementation manner, after obtaining the target saturation value of each pixel, the electronic device can perform a calculation based on the target saturation value of each pixel (that is, the value of the processed S component), the value of the H component, and the value of the V component. Numerical value, format conversion is performed to obtain the corresponding image frame in YUV format, that is, the processed image frame to be processed.

参见图2,图2为本申请实施例提供的一种图像处理方法示例的流程图,该方法可以包括以下步骤:Referring to FIG. 2, FIG. 2 is a flow chart of an example of an image processing method provided in an embodiment of the present application. The method may include the following steps:

S201:获取YUV格式的待处理图像帧。S201: Acquire image frames to be processed in YUV format.

S202:基于预设图像平滑算法,对待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理。S202: Based on a preset image smoothing algorithm, process the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed.

S203:基于各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到各像素在HSV格式下各自的饱和度值,作为各像素点各自的初始饱和度值。S203: Based on the brightness value of each pixel, and the processed image parameters of U channel and V channel, obtain the respective saturation values of each pixel in HSV format as the respective initial saturation values of each pixel.

S204:根据待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值。S204: Determine a lower limit saturation value and an upper limit saturation value according to the distribution histogram of the initial saturation value of each pixel in the image frame to be processed.

其中,各像素点中初始饱和度值小于和等于下限饱和度值的像素点所占的比例为20%,各像素点中初始饱和度值大于和等于上限饱和度值的像素点所占的比例为20%。Among them, the proportion of pixels whose initial saturation value is less than or equal to the lower limit saturation value in each pixel is 20%, and the proportion of pixels whose initial saturation value is greater than or equal to the upper limit saturation value in each pixel is 20%.

S205:基于下限饱和度值、上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值。S205: Obtain a first saturation threshold, a second saturation threshold, and a third saturation threshold based on the lower limit saturation value, the upper limit saturation value, and a first preset formula.

其中,第一预设公式为:Wherein, the first preset formula is:

L表示下限饱和度值,H表示上限饱和度值,S1表示第一饱和度阈值,S2表示第二饱和度阈值,S3表示第三饱和度阈值。L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and S3 represents the third saturation threshold.

S206:针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级。S206: For each pixel in the image frame to be processed, determine the saturation level of the pixel according to the preset saturation threshold and the initial saturation value of the pixel.

其中,饱和度等级用于表示该像素点的初始饱和度值的高低。预设饱和度阈值包括第一饱和度阈值、第二饱和度阈值和第三饱和度阈值。第一饱和度等级的像素点的初始饱和度值小于第一饱和度阈值;第二饱和度等级的像素点的初始饱和度值不小于第一饱和度阈值,且小于第二饱和度阈值;第三饱和度等级的像素点的初始饱和度值不小于第二饱和度阈值,且小于第三饱和度阈值;第四饱和度等级的像素点的初始饱和度值不小于第三饱和度阈值。Wherein, the saturation level is used to indicate the level of the initial saturation value of the pixel. The preset saturation thresholds include a first saturation threshold, a second saturation threshold and a third saturation threshold. The initial saturation value of the pixel at the first saturation level is less than the first saturation threshold; the initial saturation value of the pixel at the second saturation level is not less than the first saturation threshold and is less than the second saturation threshold; The initial saturation value of the pixels of the third saturation level is not less than the second saturation threshold and less than the third saturation threshold; the initial saturation value of the pixel of the fourth saturation level is not less than the third saturation threshold.

S207:如果该像素点的饱和度等级为第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值。S207: If the saturation level of the pixel is the first saturation level, the product of the initial saturation value of the pixel and the first preset coefficient is used as an alternative saturation value of the pixel.

第一预设系数为0.5。The first default coefficient is 0.5.

S208:如果该像素点的饱和度等级为第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值。S208: If the saturation level of the pixel is the second saturation level, obtain an alternative saturation value of the pixel according to the initial saturation value of the pixel and a second preset formula.

其中,第二预设公式为:Wherein, the second preset formula is:

Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示第一饱和度阈值,S2表示第二饱和度阈值。Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, and S2 represents the second saturation threshold.

S209:如果该像素点的饱和度等级为第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值。S209: If the saturation level of the pixel is the third saturation level, obtain an alternative saturation value of the pixel according to the initial saturation value of the pixel and a third preset formula.

其中,第三预设公式为:Wherein, the third preset formula is:

S3表示第三饱和度阈值。S3 represents the third saturation threshold.

S2010:如果该像素点的饱和度等级为第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值。S2010: If the saturation level of the pixel is the fourth saturation level, obtain an alternative saturation value of the pixel according to the initial saturation value of the pixel and a fourth preset formula.

其中,第四预设公式为:Wherein, the fourth preset formula is:

Z=0.5×(C-1)+1Z=0.5×(C-1)+1

S2011:获取该像素点所属的5×5大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值。S2011: Obtain an average value of brightness values of pixels in the 5×5 image area to which the pixel belongs, as an average brightness value corresponding to the pixel.

S2012:根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值。S2012: Obtain the target saturation value of the pixel according to the candidate saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel, and a fifth preset formula.

其中,第五预设公式为:Wherein, the fifth preset formula is:

M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数,A4表示第五预设系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel, r indicates the correlation coefficient between brightness and saturation, and A4 indicates the fifth preset coefficient.

S2013:基于待处理图像帧中各像素点的目标饱和度值,得到处理后的待处理图像帧。S2013: Obtain a processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed.

与图1的方法实施例相对应,参见图3,图3为本申请实施例提供的一种图像处理装置的结构图,该装置可以包括:Corresponding to the method embodiment in Figure 1, see Figure 3, Figure 3 is a structural diagram of an image processing device provided in an embodiment of the present application, the device may include:

第一确定模块301,用于针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;The first determination module 301 is configured to, for each pixel in the image frame to be processed, determine the saturation level of the pixel according to the preset saturation threshold and the initial saturation value of the pixel, wherein the saturation The saturation level is used to indicate the level of the initial saturation value of the pixel;

第一处理模块302,用于根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;The first processing module 302 is configured to perform enhancement processing on the initial saturation value of the pixel point according to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, to obtain an alternative saturation value of the pixel point;

第二处理模块303,用于根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;The second processing module 303 is configured to obtain the target saturation value of the pixel point according to the alternative saturation value of the pixel point and the brightness value of the pixel point;

生成模块304,用于基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。The generating module 304 is configured to obtain the processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed.

可选的,所述装置还包括:Optionally, the device also includes:

第三处理模块,用于基于预设图像平滑算法,对所述待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理;The third processing module is configured to process the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed based on a preset image smoothing algorithm;

基于所述各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到所述各像素在色调饱和度明度HSV格式下各自的饱和度值,作为所述各像素点各自的初始饱和度值。Based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, obtain the respective saturation values of each pixel in the hue-saturation-brightness HSV format, as the pixels Points with their respective initial saturation values.

可选的,所述装置还包括:Optionally, the device also includes:

第二确定模块,用于根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值。The second determination module is configured to determine the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed.

可选的,所述第二确定模块,具体用于根据所述待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值,其中,所述各像素点中初始饱和度值小于和等于所述下限饱和度值的像素点所占的比例为第一预设比值,所述各像素点中初始饱和度值大于和等于所述上限饱和度值的像素点所占的比例为第二预设比值;Optionally, the second determining module is specifically configured to determine a lower limit saturation value and an upper limit saturation value according to a distribution histogram of initial saturation values of each pixel in the image frame to be processed, wherein the The proportion of pixels whose initial saturation value is less than or equal to the lower limit saturation value in each pixel is the first preset ratio, and the initial saturation value of each pixel is greater than or equal to the upper limit saturation value The proportion of the pixel points is the second preset ratio;

基于所述下限饱和度值、所述上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,其中,所述第一预设公式为:Based on the lower limit saturation value, the upper limit saturation value and a first preset formula, a first saturation threshold, a second saturation threshold and a third saturation threshold are obtained, wherein the first preset formula is :

S1=max(min(T1,L),T2)S1=max(min(T1,L),T2)

S3=min(max(T3,H),T4)S3=min(max(T3,H),T4)

S2=(S1+S3)/2S2=(S1+S3)/2

L表示所述下限饱和度值,H表示所述上限饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,S3表示所述第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值;L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents The first preset value, T2 represents the second preset value, T3 represents the third preset value, and T4 represents the fourth preset value;

将所述第一饱和度阈值、所述第二饱和度阈值和所述第三饱和度阈值,作为所述预设饱和度阈值。The first saturation threshold, the second saturation threshold, and the third saturation threshold are used as the preset saturation threshold.

可选的,所述第一确定模块301,具体用于针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于所述第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级;Optionally, the first determining module 301 is specifically configured to, for each pixel in the image frame to be processed, if the initial saturation value of the pixel is less than the first saturation threshold, determine the The saturation level is the first saturation level;

如果该像素点的初始饱和度值不小于所述第一饱和度阈值,且小于所述第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级;If the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, determine that the saturation level of the pixel is the second saturation level;

如果该像素点的初始饱和度值不小于所述第二饱和度阈值,且小于所述第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级;If the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, determine that the saturation level of the pixel is the third saturation level;

如果该像素点的初始饱和度值不小于所述第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。If the initial saturation value of the pixel is not less than the third saturation threshold, determine that the saturation level of the pixel is the fourth saturation level.

可选的,所述第一处理模块302,具体用于如果该像素点的饱和度等级为所述第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值;Optionally, the first processing module 302 is specifically configured to: if the saturation level of the pixel point is the first saturation level, the product of the initial saturation value of the pixel point and the first preset coefficient , as the alternative saturation value of the pixel;

如果该像素点的饱和度等级为所述第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值,其中,所述第二预设公式为:If the saturation level of the pixel is the second saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula, wherein the first The second preset formula is:

Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值;Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and A1 represents the second preset coefficient , T5 represents the fifth preset value;

如果该像素点的饱和度等级为所述第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值,其中,所述第三预设公式为:If the saturation level of the pixel is the third saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a third preset formula, wherein the first The three preset formulas are:

S3表示所述第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值;S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value;

如果该像素点的饱和度等级为所述第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值,其中,所述第四预设公式为:If the saturation level of the pixel is the fourth saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a fourth preset formula, wherein the fourth The four preset formulas are:

Z=A3×(C-1)+1Z=A3×(C-1)+1

A3表示第四预设系数。A3 represents the fourth preset coefficient.

可选的,所述第二处理模块303,具体用于获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值;Optionally, the second processing module 303 is specifically configured to obtain an average value of brightness values of pixels in an image region of a preset size to which the pixel belongs, as the average brightness value corresponding to the pixel;

根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值,其中,所述第五预设公式为:According to the alternative saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel and the fifth preset formula, the target saturation value of the pixel is obtained, wherein the fifth The default formula is:

M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation.

由以上可见,基于本申请实施例的图像处理装置,针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值,根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值,基于待处理图像帧中各像素点的目标饱和度值,得到处理后的待处理图像帧。由于人眼对不同亮度值的图像区域的色彩的敏感度不同,因此,结合像素点的饱和度值和亮度值,对像素点进行色彩增强处理,相对于现有技术中仅根据像素点的饱和度进行色彩增强处理,可以提高处理后的图像帧的图像质量。It can be seen from the above that, based on the image processing device of the embodiment of the present application, for each pixel in the image frame to be processed, the saturation level of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel , according to the saturation enhancement algorithm corresponding to the saturation level of the pixel, the initial saturation value of the pixel is enhanced to obtain the alternative saturation value of the pixel, and according to the alternative saturation value of the pixel and the brightness value of the pixel to obtain the target saturation value of the pixel, and based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained. Since human eyes have different sensitivities to the color of image regions with different brightness values, therefore, combining the saturation value and brightness value of the pixel point to perform color enhancement processing on the pixel point, compared with the prior art only based on the saturation value of the pixel point Color enhancement processing can be performed at a high degree, which can improve the image quality of the processed image frame.

本申请实施例还提供了一种电子设备,如图4所示,包括存储器401和处理器402;The embodiment of the present application also provides an electronic device, as shown in FIG. 4 , including a memory 401 and a processor 402;

存储器401,用于存放计算机程序;Memory 401, used to store computer programs;

处理器402,用于执行存储器401上所存放的程序时,实现本申请实施例提供的图像处理方法。The processor 402 is configured to implement the image processing method provided by the embodiment of the present application when executing the program stored in the memory 401 .

具体的,上述图像处理方法,包括:Specifically, the above-mentioned image processing method includes:

针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;For each pixel in the image frame to be processed, according to the preset saturation threshold and the initial saturation value of the pixel, determine the saturation level of the pixel, wherein the saturation level is used to represent the pixel The initial saturation value of the high and low;

根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;According to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the alternative saturation value of the pixel point;

根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;According to the alternative saturation value of the pixel point and the brightness value of the pixel point, the target saturation value of the pixel point is obtained;

基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。Based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained.

需要说明的是,上述图像处理方法的其他实现方式与前述方法实施例部分相同,这里不再赘述。It should be noted that other implementation manners of the above image processing method are partly the same as those in the foregoing method embodiments, and will not be repeated here.

上述电子设备可以具备有实现上述电子设备与其他设备之间通信的通信接口。The above-mentioned electronic device may be provided with a communication interface for implementing communication between the above-mentioned electronic device and other devices.

上述的处理器,通信接口,存储器通过通信总线完成相互间的通信,此处提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。Above-mentioned processor, communication interface, memory finish the mutual communication through communication bus, and communication bus mentioned here can be the peripheral components interconnect standard (Peripheral Component Interconnect, be called for short PCI) bus or extended industry standard structure (Extended Industry Standard Architecture, referred to as EISA) bus and so on. The communication bus can be divided into an address bus, a data bus, a control bus, and the like.

存储器可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(Non-Volatile Memory,简称NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include a random access memory (Random Access Memory, RAM for short), and may also include a non-volatile memory (Non-Volatile Memory, NVM for short), such as at least one magnetic disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.

上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application SpecificIntegrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC for short), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行本申请实施例提供的图像处理方法。The embodiment of the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the image processing method provided in the embodiment of the present application.

具体的,上述图像处理方法,包括:Specifically, the above-mentioned image processing method includes:

针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;For each pixel in the image frame to be processed, according to the preset saturation threshold and the initial saturation value of the pixel, determine the saturation level of the pixel, wherein the saturation level is used to represent the pixel The initial saturation value of the high and low;

根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;According to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the alternative saturation value of the pixel point;

根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;According to the alternative saturation value of the pixel point and the brightness value of the pixel point, the target saturation value of the pixel point is obtained;

基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。Based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained.

需要说明的是,上述图像处理方法的其他实现方式与前述方法实施例部分相同,这里不再赘述。It should be noted that other implementation manners of the above image processing method are partly the same as those in the foregoing method embodiments, and will not be repeated here.

本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行本申请实施例提供的图像处理方法。The embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the image processing method provided in the embodiment of the present application.

具体的,上述图像处理方法,包括:Specifically, the above-mentioned image processing method includes:

针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;For each pixel in the image frame to be processed, according to the preset saturation threshold and the initial saturation value of the pixel, determine the saturation level of the pixel, wherein the saturation level is used to represent the pixel The initial saturation value of the high and low;

根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;According to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the alternative saturation value of the pixel point;

根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;According to the alternative saturation value of the pixel point and the brightness value of the pixel point, the target saturation value of the pixel point is obtained;

基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。Based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained.

需要说明的是,上述图像处理方法的其他实现方式与前述方法实施例部分相同,这里不再赘述。It should be noted that other implementation manners of the above image processing method are partly the same as those in the foregoing method embodiments, and will not be repeated here.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备、计算机可读存储介质、计算机程序产品实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus, electronic equipment, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For relevant parts, please refer to the part of the description of the method embodiments.

以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application are included within the protection scope of this application.

Claims (16)

1.一种图像处理方法,其特征在于,所述方法包括:1. An image processing method, characterized in that the method comprises: 针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;For each pixel in the image frame to be processed, according to the preset saturation threshold and the initial saturation value of the pixel, determine the saturation level of the pixel, wherein the saturation level is used to represent the pixel The initial saturation value of the high and low; 根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;According to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the alternative saturation value of the pixel point; 根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;According to the alternative saturation value of the pixel point and the brightness value of the pixel point, the target saturation value of the pixel point is obtained; 基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。Based on the target saturation value of each pixel in the image frame to be processed, the processed image frame to be processed is obtained. 2.根据权利要求1所述的方法,其特征在于,在针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级之前,所述方法还包括:2. The method according to claim 1, wherein, for each pixel in the image frame to be processed, the saturation of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel. Before degree grades, the method also includes: 基于预设图像平滑算法,对所述待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理;Based on the preset image smoothing algorithm, the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed are processed; 基于所述各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到所述各像素在色调饱和度明度HSV格式下各自的饱和度值,作为所述各像素点各自的初始饱和度值。Based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, obtain the respective saturation values of each pixel in the hue-saturation-brightness HSV format, as the pixels Points with their respective initial saturation values. 3.根据权利要求1所述的方法,其特征在于,在针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级之前,所述方法还包括:3. The method according to claim 1, wherein, for each pixel in the image frame to be processed, the saturation of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel. Before degree grades, the method also includes: 根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值。The preset saturation threshold is determined according to the distribution of the initial saturation values of each pixel in the image frame to be processed. 4.根据权利要求3所述的方法,其特征在于,所述根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值,包括:4. The method according to claim 3, wherein the determining the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed comprises: 根据所述待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值,其中,所述各像素点中初始饱和度值小于和等于所述下限饱和度值的像素点所占的比例为第一预设比值,所述各像素点中初始饱和度值大于和等于所述上限饱和度值的像素点所占的比例为第二预设比值;Determine a lower limit saturation value and an upper limit saturation value according to the distribution histogram of the initial saturation value of each pixel in the image frame to be processed, wherein the initial saturation value in each pixel is less than or equal to the lower limit The proportion of pixels with saturation values is the first preset ratio, and the proportion of pixels with initial saturation values greater than or equal to the upper limit saturation value among the pixels is the second preset ratio; 基于所述下限饱和度值、所述上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,其中,所述第一预设公式为:Based on the lower limit saturation value, the upper limit saturation value and a first preset formula, a first saturation threshold, a second saturation threshold and a third saturation threshold are obtained, wherein the first preset formula is : S1=max(min(T1,L),T2)S1=max(min(T1,L),T2) S3=min(max(T3,H),T4)S3=min(max(T3,H),T4) S2=(S1+S3)/2S2=(S1+S3)/2 L表示所述下限饱和度值,H表示所述上限饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,S3表示所述第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值;L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents The first preset value, T2 represents the second preset value, T3 represents the third preset value, and T4 represents the fourth preset value; 将所述第一饱和度阈值、所述第二饱和度阈值和所述第三饱和度阈值,作为所述预设饱和度阈值。The first saturation threshold, the second saturation threshold, and the third saturation threshold are used as the preset saturation threshold. 5.根据权利要求4所述的方法,其特征在于,针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,包括:5. The method according to claim 4, characterized in that, for each pixel in the image frame to be processed, the saturation of the pixel is determined according to the preset saturation threshold and the initial saturation value of the pixel grades, including: 针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于所述第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级;For each pixel in the image frame to be processed, if the initial saturation value of the pixel is less than the first saturation threshold, determine the saturation level of the pixel as the first saturation level; 如果该像素点的初始饱和度值不小于所述第一饱和度阈值,且小于所述第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级;If the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, determine that the saturation level of the pixel is the second saturation level; 如果该像素点的初始饱和度值不小于所述第二饱和度阈值,且小于所述第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级;If the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, determine that the saturation level of the pixel is the third saturation level; 如果该像素点的初始饱和度值不小于所述第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。If the initial saturation value of the pixel is not less than the third saturation threshold, determine that the saturation level of the pixel is the fourth saturation level. 6.根据权利要求5所述的方法,其特征在于,所述根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值,包括:6. The method according to claim 5, characterized in that, according to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, the initial saturation value of the pixel point is enhanced to obtain the saturation value of the pixel point Alternative saturation values, including: 如果该像素点的饱和度等级为所述第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值;If the saturation level of the pixel is the first saturation level, the product of the initial saturation value of the pixel and the first preset coefficient is used as an alternative saturation value of the pixel; 如果该像素点的饱和度等级为所述第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值,其中,所述第二预设公式为:If the saturation level of the pixel is the second saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula, wherein the first The second preset formula is: Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值;Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and A1 represents the second preset coefficient , T5 represents the fifth preset value; 如果该像素点的饱和度等级为所述第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值,其中,所述第三预设公式为:If the saturation level of the pixel is the third saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a third preset formula, wherein the first The three preset formulas are: S3表示所述第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值;S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value; 如果该像素点的饱和度等级为所述第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值,其中,所述第四预设公式为:If the saturation level of the pixel is the fourth saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a fourth preset formula, wherein the fourth The four preset formulas are: Z=A3×(C-1)+1Z=A3×(C-1)+1 A3表示第四预设系数。A3 represents the fourth preset coefficient. 7.根据权利要求1所述的方法,其特征在于,所述根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值,包括:7. The method according to claim 1, wherein said obtaining the target saturation value of the pixel according to the alternative saturation value of the pixel and the brightness value of the pixel comprises: 获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值;Obtain the average value of the brightness values of the pixels in the image area of the preset size to which the pixel belongs, as the average brightness value corresponding to the pixel; 根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值,其中,所述第五预设公式为:According to the alternative saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel and the fifth preset formula, the target saturation value of the pixel is obtained, wherein the fifth The default formula is: M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation. 8.一种图像处理装置,其特征在于,所述装置包括:8. An image processing device, characterized in that the device comprises: 第一确定模块,用于针对待处理图像帧中的每一像素点,根据预设饱和度阈值和该像素点的初始饱和度值,确定该像素点的饱和度等级,其中,所述饱和度等级用于表示该像素点的初始饱和度值的高低;The first determination module is configured to determine the saturation level of the pixel point for each pixel point in the image frame to be processed according to the preset saturation threshold value and the initial saturation value of the pixel point, wherein the saturation level Level is used to indicate the level of the initial saturation value of the pixel; 第一处理模块,用于根据该像素点的饱和度等级对应的饱和度增强算法,对该像素点的初始饱和度值进行增强处理,得到该像素点的备选饱和度值;The first processing module is configured to perform enhancement processing on the initial saturation value of the pixel point according to the saturation enhancement algorithm corresponding to the saturation level of the pixel point, to obtain an alternative saturation value of the pixel point; 第二处理模块,用于根据该像素点的备选饱和度值和该像素点的亮度值,得到该像素点的目标饱和度值;The second processing module is used to obtain the target saturation value of the pixel according to the alternative saturation value of the pixel and the brightness value of the pixel; 生成模块,用于基于所述待处理图像帧中各像素点的目标饱和度值,得到处理后的所述待处理图像帧。A generating module, configured to obtain the processed image frame to be processed based on the target saturation value of each pixel in the image frame to be processed. 9.根据权利要求8所述的装置,其特征在于,所述装置还包括:9. The device according to claim 8, further comprising: 第三处理模块,用于基于预设图像平滑算法,对所述待处理图像帧中各像素点的U通道的图像参数和V通道的图像参数进行处理;The third processing module is configured to process the image parameters of the U channel and the image parameters of the V channel of each pixel in the image frame to be processed based on a preset image smoothing algorithm; 基于所述各像素点的亮度值,以及处理后的U通道的图像参数和V通道的图像参数,得到所述各像素在色调饱和度明度HSV格式下各自的饱和度值,作为所述各像素点各自的初始饱和度值。Based on the brightness value of each pixel, and the processed image parameters of the U channel and the image parameters of the V channel, obtain the respective saturation values of each pixel in the hue-saturation-brightness HSV format, as the pixels Points with their respective initial saturation values. 10.根据权利要求8所述的装置,其特征在于,所述装置还包括:10. The device according to claim 8, further comprising: 第二确定模块,用于根据所述待处理图像帧中各像素点的初始饱和度值的分布情况,确定所述预设饱和度阈值。The second determination module is configured to determine the preset saturation threshold according to the distribution of the initial saturation values of each pixel in the image frame to be processed. 11.根据权利要求10所述的装置,其特征在于,所述第二确定模块,具体用于11. The device according to claim 10, wherein the second determination module is specifically used for 根据所述待处理图像帧中各像素点的初始饱和度值的分布直方图,确定下限饱和度值和上限饱和度值,其中,所述各像素点中初始饱和度值小于和等于所述下限饱和度值的像素点所占的比例为第一预设比值,所述各像素点中初始饱和度值大于和等于所述上限饱和度值的像素点所占的比例为第二预设比值;Determine a lower limit saturation value and an upper limit saturation value according to the distribution histogram of the initial saturation value of each pixel in the image frame to be processed, wherein the initial saturation value in each pixel is less than or equal to the lower limit The proportion of pixels with saturation values is the first preset ratio, and the proportion of pixels with initial saturation values greater than or equal to the upper limit saturation value among the pixels is the second preset ratio; 基于所述下限饱和度值、所述上限饱和度值和第一预设公式,得到第一饱和度阈值、第二饱和度阈值和第三饱和度阈值,其中,所述第一预设公式为:Based on the lower limit saturation value, the upper limit saturation value and a first preset formula, a first saturation threshold, a second saturation threshold and a third saturation threshold are obtained, wherein the first preset formula is : S1=max(min(T1,L),T2)S1=max(min(T1,L),T2) S3=min(max(T3,H),T4)S3=min(max(T3,H),T4) S2=(S1+S3)/2S2=(S1+S3)/2 L表示所述下限饱和度值,H表示所述上限饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,S3表示所述第三饱和度阈值,T1表示第一预设数值,T2表示第二预设数值,T3表示第三预设数值,T4表示第四预设数值;L represents the lower limit saturation value, H represents the upper limit saturation value, S1 represents the first saturation threshold, S2 represents the second saturation threshold, S3 represents the third saturation threshold, T1 represents The first preset value, T2 represents the second preset value, T3 represents the third preset value, and T4 represents the fourth preset value; 将所述第一饱和度阈值、所述第二饱和度阈值和所述第三饱和度阈值,作为所述预设饱和度阈值。The first saturation threshold, the second saturation threshold, and the third saturation threshold are used as the preset saturation threshold. 12.根据权利要求11所述的装置,其特征在于,所述第一确定模块,具体用于针对待处理图像帧中的每一像素点,如果该像素点的初始饱和度值小于所述第一饱和度阈值,确定该像素点的饱和度等级为第一饱和度等级;12. The device according to claim 11, wherein the first determining module is specifically configured to, for each pixel in the image frame to be processed, if the initial saturation value of the pixel is smaller than the first A saturation threshold, determining that the saturation level of the pixel point is the first saturation level; 如果该像素点的初始饱和度值不小于所述第一饱和度阈值,且小于所述第二饱和度阈值,确定该像素点的饱和度等级为第二饱和度等级;If the initial saturation value of the pixel is not less than the first saturation threshold and is less than the second saturation threshold, determine that the saturation level of the pixel is the second saturation level; 如果该像素点的初始饱和度值不小于所述第二饱和度阈值,且小于所述第三饱和度阈值,确定该像素点的饱和度等级为第三饱和度等级;If the initial saturation value of the pixel is not less than the second saturation threshold and is less than the third saturation threshold, determine that the saturation level of the pixel is the third saturation level; 如果该像素点的初始饱和度值不小于所述第三饱和度阈值,确定该像素点的饱和度等级为第四饱和度等级。If the initial saturation value of the pixel is not less than the third saturation threshold, determine that the saturation level of the pixel is the fourth saturation level. 13.根据权利要求12所述的装置,其特征在于,所述第一处理模块,具体用于如果该像素点的饱和度等级为所述第一饱和度等级,则将该像素点的初始饱和度值与第一预设系数的乘积,作为该像素点的备选饱和度值;13. The device according to claim 12, wherein the first processing module is specifically configured to: if the saturation level of the pixel point is the first saturation level, the initial saturation level of the pixel point The product of the saturation value and the first preset coefficient is used as an alternative saturation value of the pixel; 如果该像素点的饱和度等级为所述第二饱和度等级,则根据该像素点的初始饱和度值和第二预设公式,得到该像素点的备选饱和度值,其中,所述第二预设公式为:If the saturation level of the pixel is the second saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a second preset formula, wherein the first The second preset formula is: Z表示该像素点的备选饱和度值,C表示该像素点的初始饱和度值,S1表示所述第一饱和度阈值,S2表示所述第二饱和度阈值,A1表示第二预设系数,T5表示第五预设数值;Z represents the alternative saturation value of the pixel, C represents the initial saturation value of the pixel, S1 represents the first saturation threshold, S2 represents the second saturation threshold, and A1 represents the second preset coefficient , T5 represents the fifth preset value; 如果该像素点的饱和度等级为所述第三饱和度等级,则根据该像素点的初始饱和度值和第三预设公式,得到该像素点的备选饱和度值,其中,所述第三预设公式为:If the saturation level of the pixel is the third saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a third preset formula, wherein the first The three preset formulas are: S3表示所述第三饱和度阈值,A2表示第三预设系数,T6表示第六预设数值,T7表示第七预设数值;S3 represents the third saturation threshold, A2 represents the third preset coefficient, T6 represents the sixth preset value, and T7 represents the seventh preset value; 如果该像素点的饱和度等级为所述第四饱和度等级,则根据该像素点的初始饱和度值和第四预设公式,得到该像素点的备选饱和度值,其中,所述第四预设公式为:If the saturation level of the pixel is the fourth saturation level, an alternative saturation value of the pixel is obtained according to the initial saturation value of the pixel and a fourth preset formula, wherein the fourth The four preset formulas are: Z=A3×(C-1)+1Z=A3×(C-1)+1 A3表示第四预设系数。A3 represents the fourth preset coefficient. 14.根据权利要求8所述的装置,其特征在于,所述第二处理模块,具体用于获取该像素点所属的预设大小的图像区域内像素点的亮度值的平均值,作为该像素点对应的平均亮度值;14. The device according to claim 8, wherein the second processing module is specifically configured to acquire the average value of brightness values of pixels in the image area of a preset size to which the pixel belongs, as the pixel The average brightness value corresponding to the point; 根据该像素点的备选饱和度值、该像素点的亮度值、该像素点对应的平均亮度值和第五预设公式,得到得到该像素点的目标饱和度值,其中,所述第五预设公式为:According to the alternative saturation value of the pixel, the brightness value of the pixel, the average brightness value corresponding to the pixel and the fifth preset formula, the target saturation value of the pixel is obtained, wherein the fifth The default formula is: M表示该像素点的目标饱和度值,Z表示该像素点的备选饱和度值,A4表示第五预设系数,N表示该像素点的亮度值,表示该像素点对应的平均亮度值,r表示亮度与饱和度之间的相关系数。M represents the target saturation value of the pixel, Z represents the alternative saturation value of the pixel, A4 represents the fifth preset coefficient, N represents the brightness value of the pixel, Indicates the average brightness value corresponding to the pixel point, and r indicates the correlation coefficient between brightness and saturation. 15.一种电子设备,其特征在于,包括存储器和处理器;15. An electronic device, comprising a memory and a processor; 所述存储器,用于存放计算机程序;The memory is used to store computer programs; 所述处理器,用于执行所述存储器上所存放的程序时,实现权利要求1-7任一所述的方法步骤。The processor is configured to implement the method steps described in any one of claims 1-7 when executing the program stored in the memory. 16.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-7任一所述的方法步骤。16. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of any one of claims 1-7 are implemented.
CN201910566715.6A 2019-06-27 2019-06-27 Image processing method, device, electronic equipment and computer readable storage medium Pending CN110197470A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910566715.6A CN110197470A (en) 2019-06-27 2019-06-27 Image processing method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910566715.6A CN110197470A (en) 2019-06-27 2019-06-27 Image processing method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110197470A true CN110197470A (en) 2019-09-03

Family

ID=67755384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910566715.6A Pending CN110197470A (en) 2019-06-27 2019-06-27 Image processing method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110197470A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113436126A (en) * 2021-07-13 2021-09-24 上海艾为电子技术股份有限公司 Image saturation enhancement method and system and electronic equipment
CN113449730A (en) * 2020-03-27 2021-09-28 苏州科瓴精密机械科技有限公司 Image processing method, system, automatic walking device and readable storage medium
WO2024198680A1 (en) * 2023-03-30 2024-10-03 深圳市中兴微电子技术有限公司 Image color saturation enhancement method, computer device, and readable medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1613089A (en) * 2001-11-05 2005-05-04 夏普株式会社 Color image processing method, color image processor, color display, computer program for implementing the color image processing method
CN101115211A (en) * 2007-08-30 2008-01-30 四川长虹电器股份有限公司 Color independent reinforcement processing method
CN101137069A (en) * 2006-09-01 2008-03-05 联发科技股份有限公司 Method and related device for adjusting saturation and contrast of area in image
CN106161990A (en) * 2015-04-28 2016-11-23 腾讯科技(北京)有限公司 A kind of image processing method and device
CN106210446A (en) * 2016-07-18 2016-12-07 北京小米移动软件有限公司 saturation enhancement method and device
CN106998456A (en) * 2017-03-28 2017-08-01 建荣半导体(深圳)有限公司 A kind of method of adjustment, device and the picture processing chip of image color saturation
US20180315365A1 (en) * 2015-08-06 2018-11-01 Mediatek Inc. Electronic Device Capable Of Displaying And Performing Color Compensation And Color Compensation Method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1613089A (en) * 2001-11-05 2005-05-04 夏普株式会社 Color image processing method, color image processor, color display, computer program for implementing the color image processing method
CN101137069A (en) * 2006-09-01 2008-03-05 联发科技股份有限公司 Method and related device for adjusting saturation and contrast of area in image
CN101115211A (en) * 2007-08-30 2008-01-30 四川长虹电器股份有限公司 Color independent reinforcement processing method
CN106161990A (en) * 2015-04-28 2016-11-23 腾讯科技(北京)有限公司 A kind of image processing method and device
US20180315365A1 (en) * 2015-08-06 2018-11-01 Mediatek Inc. Electronic Device Capable Of Displaying And Performing Color Compensation And Color Compensation Method
CN106210446A (en) * 2016-07-18 2016-12-07 北京小米移动软件有限公司 saturation enhancement method and device
CN106998456A (en) * 2017-03-28 2017-08-01 建荣半导体(深圳)有限公司 A kind of method of adjustment, device and the picture processing chip of image color saturation

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113449730A (en) * 2020-03-27 2021-09-28 苏州科瓴精密机械科技有限公司 Image processing method, system, automatic walking device and readable storage medium
CN113436126A (en) * 2021-07-13 2021-09-24 上海艾为电子技术股份有限公司 Image saturation enhancement method and system and electronic equipment
CN113436126B (en) * 2021-07-13 2022-06-10 上海艾为电子技术股份有限公司 Image saturation enhancement method and system and electronic equipment
WO2024198680A1 (en) * 2023-03-30 2024-10-03 深圳市中兴微电子技术有限公司 Image color saturation enhancement method, computer device, and readable medium

Similar Documents

Publication Publication Date Title
US10074162B2 (en) Brightness control for spatially adaptive tone mapping of high dynamic range (HDR) images
CN112150368B (en) Image processing method, device, electronic device and computer readable storage medium
US9621767B1 (en) Spatially adaptive tone mapping for display of high dynamic range (HDR) images
US9129388B2 (en) Global approximation to spatially varying tone mapping operators
CN112819702B (en) Image enhancement method, image enhancement device, electronic equipment and computer readable storage medium
CN105323459B (en) Image processing method and mobile terminal
WO2022143421A1 (en) Noise intensity estimation method and apparatus, and electronic device
CN110197470A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN115311161B (en) Image enhancement method, device, equipment and storage medium based on artificial intelligence
Nnolim An adaptive RGB colour enhancement formulation for logarithmic image processing-based algorithms
WO2014070273A1 (en) Recursive conditional means image denoising
Mu et al. Low and non-uniform illumination color image enhancement using weighted guided image filtering
EP3203439B1 (en) Method and device for reducing noise in a component of a picture
CN104902143B (en) A kind of image de-noising method and device based on resolution ratio
CN107895350B (en) HDR image generation method based on self-adaptive double gamma transformation
WO2017172103A1 (en) Temporal control for spatially adaptive tone mapping of high dynamic range video
CN105227805A (en) A kind of image processing method and mobile terminal
Sun et al. Brightness preserving image enhancement based on a gradient and intensity histogram
CN113344801A (en) Image enhancement method, system, terminal and storage medium applied to gas metering facility environment
US20140092116A1 (en) Wide dynamic range display
CN107404600B (en) Image processing device and method
KR101516632B1 (en) Bipartite histogram equalization apparatus maintain the rate of mean brightness of video using visual threshold
CN111311610A (en) Image segmentation method and terminal device
CN115660997B (en) Image data processing method and device and electronic equipment
TWI727306B (en) Contrast adjustment system and contrast adjustment method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190903