CN111861899A - A method and system for image enhancement based on uneven illumination - Google Patents

A method and system for image enhancement based on uneven illumination Download PDF

Info

Publication number
CN111861899A
CN111861899A CN202010431258.2A CN202010431258A CN111861899A CN 111861899 A CN111861899 A CN 111861899A CN 202010431258 A CN202010431258 A CN 202010431258A CN 111861899 A CN111861899 A CN 111861899A
Authority
CN
China
Prior art keywords
image
path
pixel value
luminance component
brightness
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.)
Withdrawn
Application number
CN202010431258.2A
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.)
Hohai University HHU
Original Assignee
Hohai University HHU
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 Hohai University HHU filed Critical Hohai University HHU
Priority to CN202010431258.2A priority Critical patent/CN111861899A/en
Publication of CN111861899A publication Critical patent/CN111861899A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/514Depth or shape recovery from specularities

Landscapes

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

Abstract

The invention discloses an image enhancement method and system based on uneven illumination, which convert an original color image from an RGB space to an HSV space to obtain a brightness component V of the image; processing the illumination component V by using a path-optimized MR algorithm; and converting the processed HSV space into an RGB space, and synthesizing a new image. The advantages are that: the method is based on the image enhancement algorithm with uneven illumination, and the brightness component V of the image is processed by using the MR algorithm with optimized path, so that the brightness distribution of the image is more uniform. Compared with other algorithms, the algorithm has the advantages that the used paths are more uniform, and the brightness of the processed image is more reasonable in consideration of various different directions such as clockwise direction, anticlockwise direction and the like.

Description

一种基于光照不均匀的图像增强方法及系统A method and system for image enhancement based on uneven illumination

技术领域technical field

本发明涉及一种基于光照不均匀的图像增强方法及系统,属于图像处理技术领域。The invention relates to an image enhancement method and system based on uneven illumination, and belongs to the technical field of image processing.

背景技术Background technique

成像设备在拍摄照片时,照片的质量受光照的影响较大。白天拍摄的照片清晰可见,但是晚上拍摄的照片就较为模糊。还有在水下成像特别是深水区域获取图像时,往往需要人造光源作为成像的辅助光源,这造成光照不均匀,获取的图像细节模糊。When an imaging device takes a photo, the quality of the photo is greatly affected by the light. The photos taken during the day are clearly visible, but the photos taken at night are more blurred. In addition, when acquiring images in underwater imaging, especially in deep water areas, artificial light sources are often required as auxiliary light sources for imaging, which results in uneven illumination and blurred details of the acquired images.

发明内容SUMMARY OF THE INVENTION

本发明所要解决的技术问题是克服现有技术的缺陷,提供一种基于光照不均匀的图像增强方法及系统。The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide an image enhancement method and system based on uneven illumination.

为解决上述技术问题,本发明提供一种基于光照不均匀的图像增强方法,将原始彩色图像从RGB空间转化到HSV空间,获取图像的亮度分量V;对亮度分量V使用路径优化的MR算法处理;将处理后的HSV空间转化到RGB空间,合成新的图像。In order to solve the above technical problems, the present invention provides an image enhancement method based on uneven illumination, which converts the original color image from RGB space to HSV space, and obtains the brightness component V of the image; uses the path-optimized MR algorithm to process the brightness component V. ; Convert the processed HSV space to RGB space to synthesize a new image.

进一步的,所述将原始彩色图像从RGB空间转换HSV空间的公式如下:Further, the formula for converting the original color image from RGB space to HSV space is as follows:

Figure BDA0002500677070000011
Figure BDA0002500677070000011

Figure BDA0002500677070000012
Figure BDA0002500677070000012

Figure BDA0002500677070000013
Figure BDA0002500677070000013

其中,

Figure BDA0002500677070000014
in,
Figure BDA0002500677070000014

H表示色调,V表示亮度,S表示饱和度,R表示红色通道的像素值,G表示绿色通道的像素值,B表示蓝色通道的像素值,θ表示旋转角,max()表示取最大值,min()表示取最小值。H represents the hue, V represents the brightness, S represents the saturation, R represents the pixel value of the red channel, G represents the pixel value of the green channel, B represents the pixel value of the blue channel, θ represents the rotation angle, and max() represents the maximum value , min() means take the minimum value.

进一步的,所述路径优化的MR算法处理的过程包括:Further, the MR algorithm processing process of the path optimization includes:

根据全局明暗变化确定若干条不同起点或不同方向的描绘图像明暗变化的路径;According to the global light and shade changes, determine several paths that describe the light and shade changes of the image with different starting points or different directions;

在其中一个路径上选择像素点,将被选中的像素点作为估计照度图像的一部分像素点;Select pixels on one of the paths, and use the selected pixels as part of the estimated luminance image;

利用获取的亮度分量V的中心像素点和估计照度图像的一部分像素点的明暗对比,对亮度分量V的像素值进行更新;The pixel value of the luminance component V is updated by utilizing the obtained central pixel point of the luminance component V and the light-dark contrast of a part of the pixel points of the estimated luminance image;

多次迭代,直至更新的亮度分量V的像素值包含整幅图明暗变化,确定为亮度分量V的迭代后像素值;Iterate multiple times until the updated pixel value of the brightness component V contains the light and dark changes of the entire image, and is determined as the iterative pixel value of the brightness component V;

确定每一条路径的亮度分量V的迭代后像素值,对所有路径的亮度分量V 的迭代后像素值进行求和取均值,得到亮度分量V的最终像素值。The iterative pixel value of the luminance component V of each path is determined, and the iterative pixel value of the luminance component V of all paths is summed and averaged to obtain the final pixel value of the luminance component V.

进一步的,所述路径的起点为(-offset,offset),其路径为一条覆盖整幅图像的螺旋路径,其中offset计算公式如下:Further, the starting point of the path is (-offset, offset), the path is a spiral path covering the entire image, and the offset calculation formula is as follows:

Figure BDA0002500677070000021
Figure BDA0002500677070000021

其中,offset表示是起点的坐标,

Figure BDA0002500677070000024
为向下取整函数;rows和cols分别表示图像的行数和列数;Among them, offset represents the coordinates of the starting point,
Figure BDA0002500677070000024
is the round-down function; rows and cols represent the number of rows and columns of the image, respectively;

路径上像素值的更新公式如下:The update formula of the pixel value on the path is as follows:

Figure BDA0002500677070000022
Figure BDA0002500677070000022

其中,n表示迭代次数,rn(x,y)表示第n次迭代得到的反射信息,In(x,y)表示第n次估计的亮度值,Among them, n represents the number of iterations, r n (x, y) represents the reflection information obtained by the nth iteration, I n (x, y) represents the nth estimated brightness value,

Figure BDA0002500677070000023
Figure BDA0002500677070000023

其中,max为原图像中像素的最大值,Δl=Sc-Sm是路径上的亮度差,Sc表示中心点像素值,Sm表示路径上点像素值,m=1,2,3....k表示路径上共k个像素点。Among them, max is the maximum value of the pixel in the original image, Δl=S c -S m is the brightness difference on the path, S c represents the pixel value of the center point, S m represents the pixel value of the point on the path, m=1,2,3 ....k represents a total of k pixels on the path.

进一步的,所述将处理后的HSV空间转化到RGB空间的公式如下:Further, the formula for converting the processed HSV space to RGB space is as follows:

Figure BDA0002500677070000031
Figure BDA0002500677070000031

hi=[H/60]mod6,f=H/60-hi,p=V×(1-S),q=V×(1-f×S),t=V×(1-(1-f)×S)h i =[H/60]mod6,f=H/60-h i , p=V×(1-S), q=V×(1-f×S), t=V×(1-(1 -f)×S)

其中,hi,p,q,f,t为中间变量,mod表示取余。Among them, h i , p, q, f, t are intermediate variables, and mod means remainder.

一种基于光照不均匀的图像增强系统,包括:An image enhancement system based on uneven illumination, including:

获取模块,用于将原始彩色图像从RGB空间转化到HSV空间,获取图像的亮度分量V;The acquisition module is used to convert the original color image from RGB space to HSV space, and obtain the luminance component V of the image;

处理模块,用于对亮度分量V使用路径优化的MR算法处理;a processing module, used for processing the luminance component V using the MR algorithm of path optimization;

合成模块,用于将处理后的HSV空间转化到RGB空间,合成新的图像。The synthesis module is used to convert the processed HSV space to RGB space and synthesize a new image.

进一步的,所述获取模块包括:Further, the acquisition module includes:

第一转化模块,用于通过下式将原始彩色图像从RGB空间转换HSV空间,The first conversion module is used to convert the original color image from RGB space to HSV space by the following formula,

Figure BDA0002500677070000032
Figure BDA0002500677070000032

Figure BDA0002500677070000033
Figure BDA0002500677070000033

Figure BDA0002500677070000034
Figure BDA0002500677070000034

其中,

Figure BDA0002500677070000035
in,
Figure BDA0002500677070000035

H表示色调,V表示亮度,S表示饱和度,R表示红色通道的像素值,G表示绿色通道的像素值,B表示蓝色通道的像素值,θ表示旋转角,max()表示取最大值,min()表示取最小值。H represents the hue, V represents the brightness, S represents the saturation, R represents the pixel value of the red channel, G represents the pixel value of the green channel, B represents the pixel value of the blue channel, θ represents the rotation angle, and max() represents the maximum value , min() means take the minimum value.

进一步的,所述处理模块包括:Further, the processing module includes:

第一确定模块,用于根据全局明暗变化确定若干条不同起点或不同方向的描绘图像明暗变化的路径;The first determination module is used for determining several paths of the image light and dark changes with different starting points or different directions according to the global light and dark changes;

选择模块,用于在其中一个路径上选择像素点,将被选中的像素点作为估计照度图像的一部分像素点;The selection module is used to select pixels on one of the paths, and use the selected pixels as a part of the estimated illuminance image;

更新模块,用于利用获取的亮度分量V的中心像素点和估计照度图像的一部分像素点的明暗对比,对亮度分量V的像素值进行更新;The updating module is used to update the pixel value of the luminance component V by utilizing the obtained central pixel point of the luminance component V and the light-dark contrast of a part of the pixel point of the estimated illuminance image;

第二确定模块,用于多次迭代,直至更新的亮度分量V的像素值包含整幅图明暗变化,确定为亮度分量V的迭代后像素值;The second determination module is used for multiple iterations, until the updated pixel value of the brightness component V includes the light and dark changes of the entire picture, and is determined as the iterative pixel value of the brightness component V;

第三确定模块,用于确定每一条路径的亮度分量V的迭代后像素值,对所有路径的亮度分量V的迭代后像素值进行求和取均值,得到亮度分量V的最终像素值。The third determination module is used for determining the iterative pixel value of the luminance component V of each path, and summing and averaging the iterated pixel values of the luminance component V of all paths to obtain the final pixel value of the luminance component V.

进一步的,所述第一确定模块包括:Further, the first determining module includes:

第一计算模块,用于计算路径的起点(-offset,offset),The first calculation module is used to calculate the starting point (-offset, offset) of the path,

所述路径为一条覆盖整幅图像的螺旋路径,其中offset计算公式如下:The path is a spiral path covering the entire image, and the offset calculation formula is as follows:

Figure BDA0002500677070000041
Figure BDA0002500677070000041

其中,offset表示是起点的坐标,

Figure BDA0002500677070000042
为向下取整函数;rows和cols分别表示图像的行数和列数;Among them, offset represents the coordinates of the starting point,
Figure BDA0002500677070000042
is the round-down function; rows and cols represent the number of rows and columns of the image, respectively;

所述更新模块包括:The update module includes:

第二计算模块,用于利用下式对路径上像素值进行更新,The second calculation module is used to update the pixel value on the path by using the following formula,

Figure BDA0002500677070000043
Figure BDA0002500677070000043

其中,n表示迭代次数,rn(x,y)表示第n次迭代得到的反射信息,In(x,y)表示第n次估计的亮度值,Among them, n represents the number of iterations, r n (x, y) represents the reflection information obtained by the nth iteration, I n (x, y) represents the nth estimated brightness value,

Figure BDA0002500677070000044
Figure BDA0002500677070000044

其中,max为原图像中像素的最大值,Δl=Sc-Sm是路径上的亮度差,Sc表示中心点像素值,Sm表示路径上点像素值,m=1,2,3....k表示路径上共k个像素点。Among them, max is the maximum value of the pixel in the original image, Δl=S c -S m is the brightness difference on the path, S c represents the pixel value of the center point, S m represents the pixel value of the point on the path, m=1,2,3 ....k represents a total of k pixels on the path.

进一步的,所述合成模块包括:Further, the synthesis module includes:

第二转化模块,用于利用下式将处理后的HSV空间转化到RGB空间,The second conversion module is used to convert the processed HSV space into RGB space by using the following formula,

Figure BDA0002500677070000051
Figure BDA0002500677070000051

hi=[H/60]mod6,f=H/60-hi,p=V×(1-S),q=V×(1-f×S),t=V×(1-(1-f)×S)h i =[H/60]mod6,f=H/60-h i , p=V×(1-S), q=V×(1-f×S), t=V×(1-(1 -f)×S)

其中,hi,p,q,f,t为中间变量,mod表示取余。Among them, h i , p, q, f, t are intermediate variables, and mod means remainder.

本发明所达到的有益效果:Beneficial effects achieved by the present invention:

本发明基于光照不均匀的图像增强算法,通过使用路径优化的MR算法对图像的亮度(V)进行处理,使得图像的亮度分布更加均匀。Based on the image enhancement algorithm of uneven illumination, the invention processes the brightness (V) of the image by using the MR algorithm of path optimization, so that the brightness distribution of the image is more uniform.

与其他算法相比,该算法使用的路径更加均匀,考虑到顺时针和逆时针等各种不同方向,使得处理后的图像亮度更加合理。Compared with other algorithms, the path used by this algorithm is more uniform, and considering various different directions such as clockwise and counterclockwise, the brightness of the processed image is more reasonable.

附图说明Description of drawings

图1为本发明为基于光照不均匀的图像增强算法流程图;1 is a flowchart of an image enhancement algorithm based on uneven illumination of the present invention;

图2为本发明中MR算法所使用的部分路径图;2 is a partial path diagram used by the MR algorithm in the present invention;

图3(a)为本发明中MR算法所使用的顺时针路径图,图3(b)为本发明中MR算法所使用的逆时针路径图;Figure 3 (a) is a clockwise path diagram used by the MR algorithm in the present invention, and Figure 3 (b) is a counterclockwise path diagram used by the MR algorithm in the present invention;

图4(a)为本发明中图像增强的前的原图,图4(b)为本发明中图像增强后的图。FIG. 4( a ) is the original image before image enhancement in the present invention, and FIG. 4( b ) is the image after image enhancement in the present invention.

具体实施方式Detailed ways

为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明一部分实施例,而非全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, features, and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the following The described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明公开了一种基于光照不均匀的图像增强算法,具体包括以下步骤The invention discloses an image enhancement algorithm based on uneven illumination, which specifically includes the following steps

(1)将原始彩色图像从RGB空间转化到HSV空间,获取图像的照度分量V;(1) Convert the original color image from RGB space to HSV space, and obtain the illuminance component V of the image;

(2)对照度分量V使用路径优化的MR算法处理;(2) Use the path-optimized MR algorithm to process the luminance component V;

(3)从HSV空间转会到RGB空间,合成新的图像。(3) Convert from HSV space to RGB space to synthesize new images.

步骤(1)中将原始彩色图像从RGB空间转换HSV空间的公式如下:The formula for converting the original color image from RGB space to HSV space in step (1) is as follows:

Figure BDA0002500677070000061
Figure BDA0002500677070000061

Figure BDA0002500677070000062
Figure BDA0002500677070000062

Figure BDA0002500677070000063
Figure BDA0002500677070000063

其中,

Figure BDA0002500677070000064
in,
Figure BDA0002500677070000064

步骤(2)中路径优化的MR算法步骤如下:The steps of the MR algorithm for path optimization in step (2) are as follows:

a根据全局明暗变化选择一条可以描绘图像明暗变化的路径;a Select a path that can describe the light and dark changes of the image according to the global light and shade changes;

b在指定路径上选择像素点,将被选中的像素点作为估计照度图像的一部分像素点;b Select pixels on the specified path, and use the selected pixels as a part of the estimated luminance image;

c利用中心像素点和路径上像素点的明暗对比,对像素值进行更新;c Use the contrast between the center pixel and the pixel on the path to update the pixel value;

d多次迭代后,中心像素值将包含整幅图明暗变化。d After many iterations, the center pixel value will contain the light and dark changes of the entire image.

在本发明中,路径的起点为(-offset,offset),其中offset表示与目标像素的距离,初始距离设为2的指数,指数部分小于输入图像的长、宽,表示如下:In the present invention, the starting point of the path is (-offset, offset), where offset represents the distance from the target pixel, the initial distance is set as an index of 2, and the index part is smaller than the length and width of the input image, which is expressed as follows:

Figure BDA0002500677070000065
Figure BDA0002500677070000065

上式中,

Figure BDA0002500677070000066
为向下取整函数;rows和cols分别表示图像的行数和列数。当确定了初始点(-offset,offset)后,随后需要确定的点为(offset,offset/2)、(offset/2,-offset)、 (-offset,-offset/2)。每次迭代时offset值较前一次减半,直到|offset|<1迭代结束。最终得到图2的路径。In the above formula,
Figure BDA0002500677070000066
is the round-down function; rows and cols represent the number of rows and columns of the image, respectively. After the initial point (-offset,offset) is determined, the subsequent points to be determined are (offset,offset/2), (offset/2,-offset), (-offset,-offset/2). At each iteration, the offset value is halved from the previous one until |offset|<1 iteration ends. Finally, the path shown in Figure 2 is obtained.

当选取到对应点后,需要比较路径上的点并更新,公式如下:When the corresponding point is selected, the points on the path need to be compared and updated. The formula is as follows:

Figure BDA0002500677070000067
Figure BDA0002500677070000067

在上式中,n表示迭代次数rn(x,y),表示第n次迭代得到的反射信息,In(x,y)表示第n次估计的亮度值,笨实验中n取4。为了保证不超过原图的最大像素值:In the above formula, n represents the number of iterations r n (x, y), which represents the reflection information obtained by the nth iteration, I n (x, y) represents the nth estimated brightness value, and n is 4 in the stupid experiment. In order to ensure that the maximum pixel value of the original image is not exceeded:

Figure BDA0002500677070000068
Figure BDA0002500677070000068

上式中,max为原图像中像素的最大值,Δl=Sc-Sm是路径上的亮度差,Sc表示中心点像素值,Sm表示路径上点像素值,m=1,2,3....k表示路径上共k个像素点。由此,根据不断的比较路径上的像素差并进行迭代操作,将整幅图像中不稳定的照度信息值,通过不断的迭代估算出来,从而消除照度信息的影响,求出反射分量值。In the above formula, max is the maximum value of the pixel in the original image, Δl=S c -S m is the brightness difference on the path, S c represents the pixel value of the center point, S m represents the pixel value of the point on the path, m=1,2 ,3....k represents a total of k pixels on the path. Therefore, according to the constant comparison of the pixel difference on the path and the iterative operation, the unstable illuminance information value in the whole image is estimated through continuous iteration, so as to eliminate the influence of the illuminance information and obtain the reflection component value.

虽然图2的路径已经覆盖了图像全局,但没有考虑到在初始点逆时针方向上的较远像素点的路径包括顺时针方向和逆时针方向,本发明分别在四个方向上进行上述路径的选择并完成迭代过程如图3(a)和3(b)所示。最后对四种不同路径求取的照度信息求均值。Although the path in Fig. 2 has covered the whole image, it does not take into account that the path of the farther pixels in the counterclockwise direction of the initial point includes clockwise and counterclockwise directions. The present invention performs the above paths in four directions respectively. The selection and completion of the iterative process is shown in Figures 3(a) and 3(b). Finally, the illuminance information obtained by the four different paths is averaged.

所述步骤(3)中将彩色图像从HSV空间转换RGB空间的公式如下:The formula for converting the color image from the HSV space to the RGB space in the step (3) is as follows:

Figure BDA0002500677070000071
Figure BDA0002500677070000071

hi=[H/60]mod6,f=H/60-hi,p=V×(1-S),q=V×(1-f×S),t=V×(1-(1-f)×S)h i =[H/60]mod6,f=H/60-h i , p=V×(1-S), q=V×(1-f×S), t=V×(1-(1 -f)×S)

为验证本算法的有效性,采用多幅图像测试,对增强前后的图像进行对比测试。In order to verify the effectiveness of this algorithm, multiple images are used to test the images before and after enhancement.

图4(a)为原图像存在模糊、光照不均匀衡等特点。经过算法处理后,如图4(b),图片清晰,图像亮度更加均匀,与原图像相比,增强效果显著。Figure 4(a) shows that the original image has the characteristics of blurring and uneven illumination. After the algorithm processing, as shown in Figure 4(b), the picture is clear and the image brightness is more uniform. Compared with the original image, the enhancement effect is remarkable.

对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的得同要件的含义和范围内的所有变化囊括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, but that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, which are therefore intended to fall within the scope of the appended claims. All changes within the meaning and scope of the same requirements are included in the present invention. Any reference signs in the claims shall not be construed as limiting the involved claim.

以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the present invention.

Claims (10)

1.一种基于光照不均匀的图像增强方法,其特征在于,1. an image enhancement method based on uneven illumination, is characterized in that, 将原始彩色图像从RGB空间转化到HSV空间,获取图像的亮度分量V;Convert the original color image from RGB space to HSV space, and obtain the luminance component V of the image; 对亮度分量V使用路径优化的MR算法处理;Use the path-optimized MR algorithm to process the luminance component V; 将处理后的HSV空间转化到RGB空间,合成新的图像。Convert the processed HSV space to RGB space to synthesize a new image. 2.根据权利要求1所述的基于光照不均匀的图像增强方法,其特征在于,2. The image enhancement method based on uneven illumination according to claim 1, wherein, 所述将原始彩色图像从RGB空间转换HSV空间的公式如下:The formula for converting the original color image from RGB space to HSV space is as follows:
Figure FDA0002500677060000011
Figure FDA0002500677060000011
Figure FDA0002500677060000012
Figure FDA0002500677060000012
Figure FDA0002500677060000013
Figure FDA0002500677060000013
其中,
Figure FDA0002500677060000014
in,
Figure FDA0002500677060000014
H表示色调,V表示亮度,S表示饱和度,R表示红色通道的像素值,G表示绿色通道的像素值,B表示蓝色通道的像素值,θ表示旋转角,max()表示取最大值,min()表示取最小值。H represents the hue, V represents the brightness, S represents the saturation, R represents the pixel value of the red channel, G represents the pixel value of the green channel, B represents the pixel value of the blue channel, θ represents the rotation angle, and max() represents the maximum value , min() means take the minimum value.
3.根据权利要求1所述的基于光照不均匀的图像增强方法,其特征在于,3. The image enhancement method based on uneven illumination according to claim 1, wherein, 所述路径优化的MR算法处理的过程包括:The MR algorithm processing process of the path optimization includes: 根据全局明暗变化确定若干条不同起点或不同方向的描绘图像明暗变化的路径;According to the global light and shade changes, determine several paths that describe the light and shade changes of the image with different starting points or different directions; 在其中一个路径上选择像素点,将被选中的像素点作为估计照度图像的一部分像素点;Select pixels on one of the paths, and use the selected pixels as part of the estimated luminance image; 利用获取的亮度分量V的中心像素点和估计照度图像的一部分像素点的明暗对比,对亮度分量V的像素值进行更新;The pixel value of the luminance component V is updated by utilizing the obtained central pixel point of the luminance component V and the light-dark contrast of a part of the pixel points of the estimated luminance image; 多次迭代,直至更新的亮度分量V的像素值包含整幅图明暗变化,确定为亮度分量V的迭代后像素值;Iterate multiple times until the updated pixel value of the brightness component V contains the light and dark changes of the entire image, and is determined as the iterative pixel value of the brightness component V; 确定每一条路径的亮度分量V的迭代后像素值,对所有路径的亮度分量V的迭代后像素值进行求和取均值,得到亮度分量V的最终像素值。Determine the iterative pixel value of the luminance component V of each path, sum and average the iterated pixel values of the luminance component V of all paths, and obtain the final pixel value of the luminance component V. 4.根据权利要求3所述的基于光照不均匀的图像增强方法,其特征在于,4. The image enhancement method based on uneven illumination according to claim 3, wherein, 所述路径的起点为(-offset,offset),其路径为一条覆盖整幅图像的螺旋路径,其中offset计算公式如下:The starting point of the path is (-offset, offset), and the path is a spiral path covering the entire image, where the offset calculation formula is as follows:
Figure FDA0002500677060000021
Figure FDA0002500677060000021
其中,offset表示是起点的坐标,
Figure FDA0002500677060000022
为向下取整函数;rows和cols分别表示图像的行数和列数;
Among them, offset represents the coordinates of the starting point,
Figure FDA0002500677060000022
is the round-down function; rows and cols represent the number of rows and columns of the image, respectively;
路径上像素值的更新公式如下:The update formula of the pixel value on the path is as follows:
Figure FDA0002500677060000023
Figure FDA0002500677060000023
其中,n表示迭代次数,rn(x,y)表示第n次迭代得到的反射信息,In(x,y)表示第n次估计的亮度值,Among them, n represents the number of iterations, r n (x, y) represents the reflection information obtained by the nth iteration, I n (x, y) represents the nth estimated brightness value,
Figure FDA0002500677060000024
Figure FDA0002500677060000024
其中,max为原图像中像素的最大值,Δl=Sc-Sm是路径上的亮度差,Sc表示中心点像素值,Sm表示路径上点像素值,m=1,2,3....k表示路径上共k个像素点。Among them, max is the maximum value of the pixel in the original image, Δl=S c -S m is the brightness difference on the path, S c represents the pixel value of the center point, S m represents the pixel value of the point on the path, m=1, 2, 3 ....k represents a total of k pixels on the path.
5.根据权利要求1所述的基于光照不均匀的图像增强方法,其特征在于,5. The image enhancement method based on uneven illumination according to claim 1, wherein, 所述将处理后的HSV空间转化到RGB空间的公式如下:The formula for converting the processed HSV space to RGB space is as follows:
Figure FDA0002500677060000025
Figure FDA0002500677060000025
hi=[H/60]mod6,f=H/60-hi,p=V×(1-S),q=V×(1-f×S),t=V×(1-(1-f)×S)h i =[H/60]mod6,f=H/60-h i , p=V×(1-S), q=V×(1-f×S), t=V×(1-(1 -f)×S) 其中,hi,p,q,f,t为中间变量,mod表示取余。Among them, h i , p, q, f, t are intermediate variables, and mod means remainder.
6.一种基于光照不均匀的图像增强系统,其特征在于,包括:6. An image enhancement system based on uneven illumination, characterized in that, comprising: 获取模块,用于将原始彩色图像从RGB空间转化到HSV空间,获取图像的亮度分量V;The acquisition module is used to convert the original color image from RGB space to HSV space, and obtain the luminance component V of the image; 处理模块,用于对亮度分量V使用路径优化的MR算法处理;a processing module, used for processing the luminance component V using the MR algorithm of path optimization; 合成模块,用于将处理后的HSV空间转化到RGB空间,合成新的图像。The synthesis module is used to convert the processed HSV space to RGB space and synthesize a new image. 7.根据权利要求6所述的基于光照不均匀的图像增强系统,其特征在于,所述获取模块包括:7. The image enhancement system based on uneven illumination according to claim 6, wherein the acquisition module comprises: 第一转化模块,用于通过下式将原始彩色图像从RGB空间转换HSV空间,The first conversion module is used to convert the original color image from RGB space to HSV space by the following formula,
Figure FDA0002500677060000031
Figure FDA0002500677060000031
Figure FDA0002500677060000032
Figure FDA0002500677060000032
Figure FDA0002500677060000033
Figure FDA0002500677060000033
其中,
Figure FDA0002500677060000034
in,
Figure FDA0002500677060000034
H表示色调,V表示亮度,S表示饱和度,R表示红色通道的像素值,G表示绿色通道的像素值,B表示蓝色通道的像素值,θ表示旋转角,max()表示取最大值,min()表示取最小值。H represents the hue, V represents the brightness, S represents the saturation, R represents the pixel value of the red channel, G represents the pixel value of the green channel, B represents the pixel value of the blue channel, θ represents the rotation angle, and max() represents the maximum value , min() means take the minimum value.
8.根据权利要求6所述的基于光照不均匀的图像增强系统,其特征在于,所述处理模块包括:8. The image enhancement system based on uneven illumination according to claim 6, wherein the processing module comprises: 第一确定模块,用于根据全局明暗变化确定若干条不同起点或不同方向的描绘图像明暗变化的路径;The first determination module is used for determining several paths of the image light and dark changes with different starting points or different directions according to the global light and dark changes; 选择模块,用于在其中一个路径上选择像素点,将被选中的像素点作为估计照度图像的一部分像素点;The selection module is used to select pixels on one of the paths, and use the selected pixels as a part of the estimated illuminance image; 更新模块,用于利用获取的亮度分量V的中心像素点和估计照度图像的一部分像素点的明暗对比,对亮度分量V的像素值进行更新;The updating module is used to update the pixel value of the luminance component V by utilizing the obtained central pixel point of the luminance component V and the light-dark contrast of a part of the pixel point of the estimated illuminance image; 第二确定模块,用于多次迭代,直至更新的亮度分量V的像素值包含整幅图明暗变化,确定为亮度分量V的迭代后像素值;The second determination module is used for multiple iterations, until the updated pixel value of the brightness component V includes the light and dark changes of the entire picture, and is determined as the iterative pixel value of the brightness component V; 第三确定模块,用于确定每一条路径的亮度分量V的迭代后像素值,对所有路径的亮度分量V的迭代后像素值进行求和取均值,得到亮度分量V的最终像素值。The third determination module is used for determining the iterative pixel value of the luminance component V of each path, and summing and averaging the iterated pixel values of the luminance component V of all paths to obtain the final pixel value of the luminance component V. 9.根据权利要求8所述的基于光照不均匀的图像增强系统,其特征在于,所述第一确定模块包括:9. The image enhancement system based on uneven illumination according to claim 8, wherein the first determining module comprises: 第一计算模块,用于计算路径的起点(-offset,offset),The first calculation module is used to calculate the starting point (-offset, offset) of the path, 所述路径为一条覆盖整幅图像的螺旋路径,其中offset计算公式如下:The path is a spiral path covering the entire image, and the offset calculation formula is as follows:
Figure FDA0002500677060000041
Figure FDA0002500677060000041
其中,offset表示是起点的坐标,
Figure FDA0002500677060000042
为向下取整函数;rows和cols分别表示图像的行数和列数;
Among them, offset represents the coordinates of the starting point,
Figure FDA0002500677060000042
is the round-down function; rows and cols represent the number of rows and columns of the image, respectively;
所述更新模块包括:The update module includes: 第二计算模块,用于利用下式对路径上像素值进行更新,The second calculation module is used to update the pixel value on the path by using the following formula,
Figure FDA0002500677060000043
Figure FDA0002500677060000043
其中,n表示迭代次数,rn(x,y)表示第n次迭代得到的反射信息,In(x,y)表示第n次估计的亮度值,Among them, n represents the number of iterations, r n (x, y) represents the reflection information obtained by the nth iteration, I n (x, y) represents the nth estimated brightness value,
Figure FDA0002500677060000044
Figure FDA0002500677060000044
其中,max为原图像中像素的最大值,Δl=Sc-Sm是路径上的亮度差,Sc表示中心点像素值,Sm表示路径上点像素值,m=1,2,3....k表示路径上共k个像素点。Among them, max is the maximum value of the pixel in the original image, Δl=S c -S m is the brightness difference on the path, S c represents the pixel value of the center point, S m represents the pixel value of the point on the path, m=1,2,3 ....k represents a total of k pixels on the path.
10.根据权利要求1所述的基于光照不均匀的图像增强系统,其特征在于,10. The image enhancement system based on uneven illumination according to claim 1, wherein, 所述合成模块包括:The synthesis module includes: 第二转化模块,用于利用下式将处理后的HSV空间转化到RGB空间,The second conversion module is used to convert the processed HSV space into RGB space by using the following formula,
Figure FDA0002500677060000045
Figure FDA0002500677060000045
hi=[H/60]mod6,f=H/60-hi,p=V×(1-S),q=V×(1-f×S),t=V×(1-(1-f)×S)h i =[H/60]mod6,f=H/60-h i , p=V×(1-S), q=V×(1-f×S), t=V×(1-(1 -f)×S) 其中,hi,p,q,f,t为中间变量,mod表示取余。Among them, h i , p, q, f, t are intermediate variables, and mod means remainder.
CN202010431258.2A 2020-05-20 2020-05-20 A method and system for image enhancement based on uneven illumination Withdrawn CN111861899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010431258.2A CN111861899A (en) 2020-05-20 2020-05-20 A method and system for image enhancement based on uneven illumination

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010431258.2A CN111861899A (en) 2020-05-20 2020-05-20 A method and system for image enhancement based on uneven illumination

Publications (1)

Publication Number Publication Date
CN111861899A true CN111861899A (en) 2020-10-30

Family

ID=72985142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010431258.2A Withdrawn CN111861899A (en) 2020-05-20 2020-05-20 A method and system for image enhancement based on uneven illumination

Country Status (1)

Country Link
CN (1) CN111861899A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968065A (en) * 2020-10-23 2020-11-20 浙江科技学院 Self-adaptive enhancement method for image with uneven brightness
CN114638765A (en) * 2022-03-30 2022-06-17 南京信息工程大学 Low-illumination image enhancement method based on complementary gamma conversion

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968065A (en) * 2020-10-23 2020-11-20 浙江科技学院 Self-adaptive enhancement method for image with uneven brightness
CN114638765A (en) * 2022-03-30 2022-06-17 南京信息工程大学 Low-illumination image enhancement method based on complementary gamma conversion

Similar Documents

Publication Publication Date Title
CN110021047B (en) Image processing method, image processing apparatus, and storage medium
CN112288658B (en) Underwater image enhancement method based on multi-residual joint learning
JP5954418B2 (en) Image demisting method and system
CN111292246B (en) Image color correction method, storage medium, and endoscope
WO2011122284A1 (en) Image processing device and image capturing apparatus using same
WO2011122283A1 (en) Image processing device and image capturing device using same
CN109068025B (en) Lens shadow correction method and system and electronic equipment
JP4328424B2 (en) Image conversion method
WO2011152174A1 (en) Image processing device, image processing method and program
CN101867832B (en) Apparatus and method for determining threshold value
TWI489416B (en) Image recovery method
CN113170028A (en) Method for generating image data of imaging algorithm based on machine learning
CN106886985A (en) A kind of self adaptation enhancement method of low-illumination image for reducing colour cast
CN112788322B (en) Adaptive white balance processing method, device, medium, and electronic apparatus
CN107864365B (en) Method for eliminating purple border of image
CN111861899A (en) A method and system for image enhancement based on uneven illumination
CN113284061A (en) Underwater image enhancement method based on gradient network
Koskinen et al. Reverse imaging pipeline for raw RGB image augmentation
US20140307963A1 (en) Defringing RAW Images
CN115937029A (en) A Method of Underwater Image Enhancement
CN114266803A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112492286B (en) Automatic white balance correction method, device and computer storage medium
WO2020062899A1 (en) Method for obtaining transparency masks by means of foreground and background pixel pairs and grayscale information
CN117541502A (en) Image defogging method and video defogging method
JP2014090410A (en) Method for white balance adjustment

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201030