Movatterモバイル変換


[0]ホーム

URL:


CN104021531A - Improved method for enhancing dark environment images on basis of single-scale Retinex - Google Patents

Improved method for enhancing dark environment images on basis of single-scale Retinex
Download PDF

Info

Publication number
CN104021531A
CN104021531ACN201410273333.1ACN201410273333ACN104021531ACN 104021531 ACN104021531 ACN 104021531ACN 201410273333 ACN201410273333 ACN 201410273333ACN 104021531 ACN104021531 ACN 104021531A
Authority
CN
China
Prior art keywords
value
image
gray level
gray
scale
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
CN201410273333.1A
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.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu 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 Xiamen Meitu Technology Co LtdfiledCriticalXiamen Meitu Technology Co Ltd
Priority to CN201410273333.1ApriorityCriticalpatent/CN104021531A/en
Publication of CN104021531ApublicationCriticalpatent/CN104021531A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

The invention relates to an improved method for enhancing dark environment images on basis of single-scale Retinex. The method includes the following steps that (1) gray level processing is carried out on original images to obtain gray level images; (2) all pixels of the gray level images are associated with a curve of a logarithmic function, and brightness enhancing is conducted on the gray level images to obtain gray level enhanced images; (3) the gray level enhanced images, the gray level images and the original images are integrated to obtain a result image. Due to the fact that brightnesses of all the pixels are processed in different methods, the light supplement effect is more natural and vivid compared with other light supplement technologies in the prior art.

Description

Improved dark environment image enhancement method based on single-scale Retinex
Technical Field
The invention relates to an image brightness increasing method, in particular to an improved method for enhancing a dark environment image based on single-scale Retinex.
Background
At present, although the hardware of camera constantly promotes, under the darker environment of light, the luminance of the photo of shooing is too dark, leads to the appearance of the unobvious scheduling problem of detail. The single-scale Retinex process is as follows: and (3) carrying out Gaussian filtering on the image to obtain a filtered image, then turning the image and the filtered image to a logarithmic domain under the Log condition, then carrying out subtraction calculation, and finally carrying out Exp exponential operation to obtain a result image. And the image processed by the single-scale Retinex has obvious color cast effect.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide an improved method for enhancing a dark environment image based on single-scale Retinex, which has a natural light supplement effect, wherein the single-scale Retinex is combined with a saturation coefficient, so that the color cast problem is avoided.
The technical scheme of the invention is as follows:
an improved method for enhancing a dark environment image based on single-scale Retinex comprises the following steps:
1) carrying out gray level processing on the original image to obtain a gray level image;
2) associating each pixel of the gray level image with a curve of a logarithmic function, and performing brightness enhancement on the gray level image to obtain a gray level enhanced image;
3) and fusing the gray level enhanced image, the gray level image and the original image to obtain a result image.
Preferably, the algorithm of the gray scale processing in step 1) is as follows:
GRAY=0.299*RED+0.587*GREEN+0.114*BLUE;
or,
GRAY=(RED*306+GREEN*601+BLUE*117+512)/1024;
wherein, GRAY is the GRAY value of the current pixel point of the GRAY image; RED, GREEN and BLUE channel color values of the current pixel point of the original image are respectively obtained by RED, GREEN and BLUE.
Preferably, step 2) is specifically:
2.1) carrying out fuzzy processing on the gray level image to obtain a gray level fuzzy image;
2.2) respectively carrying out logarithmic functions based on natural logarithm as a base on the gray level image and the gray level fuzzy image to obtain gray level data and gray level fuzzy data, subtracting the gray level fuzzy data from the gray level data to obtain gray level difference data, and calculating the maximum value and the minimum value in the gray level difference;
and 2.3) comparing the gray scale difference data of each pixel with the maximum value and the minimum value in the gray scale difference based on the maximum value and the minimum value in the gray scale difference, and assigning a preset rule to each pixel according to a comparison result to obtain final gray scale enhancement data.
Preferably, the blurring process in step 2.1) comprises: median fuzzy processing, Gaussian fuzzy processing, mean fuzzy processing and convolution processing.
Preferably, in step 2.2), the brightness of each pixel of the grayscale image associated with the curve of the logarithmic function is increased by using the characteristic that the slope of the curve of the logarithmic function decreases, wherein the brightness of the pixel with high grayscale value is increased to a smaller extent than that of the pixel with low grayscale value, so as to obtain an image with improved overall brightness; and calculating the maximum value and the minimum value in the gray difference through a maximum value and minimum value theorem.
Preferably, in step 2.3), the preset rule is: if the gray scale difference data of the current pixel is less than or equal to the minimum value, the value is assigned to be 0, if the gray scale difference data of the current pixel is greater than the maximum value, the value is assigned to be 255, and the rest pixels are calculated by the following formula:
resultvalue=(value-vMin)*255/(vMax-vMin)
wherein, resultvalue is a result value; value is the value of the gray scale difference data; vMin is said minimum value; vMax is the maximum value.
Preferably, step 3) is specifically:
3.1) dividing the data of the gray level enhanced image in the step 2) by the data of the gray level image in the step 1) to obtain a relation value;
3.2) judging the maximum value and the minimum value in the color values of the three RGB channels of the original image, and calculating the saturation coefficient of the original image: if the maximum value is 0, the saturation factor is 0, otherwise the saturation factor is (max-min)/max 1.5;
3.3) carrying out enhancement operation on the original image through the preset relation between the saturation parameter and the relation value in the step 3.1) to obtain a final color value.
Preferably, step 3.1) further determines the obtained relationship value, first determines whether the relationship value is greater than a preset value P, if so, the relationship value is equal to the preset value P, then determines whether the relationship value is less than a preset value K, and if so, the relationship value is equal to the preset value K.
Preferably, in step 3.2), the specific determination method is as follows:
judging whether the color value of the R channel of the current pixel is larger than the color value of the G channel, if so, judging whether the color value of the R channel of the current pixel is larger than the color value of the G channel
cMax=max(rValue,bValue);cMin=min(gValue,bValue);
If not, then,
cMax=max(gValue,bValue);cMin=min(rValue,bValue);
finally, if cMax is not equal to 0, srat ═ cMax-cMin)/cMax 1.5; otherwise srat is 0;
wherein, cMax and cMIN are the temporary maximum value and the temporary minimum value; rValue, gValue and bValue are color values of the RGB three channels of the current pixel; sra is the saturation coefficient.
Preferably, step 3.3) is specifically:
result=factor*value*(1.0-srat)+srat*value;
wherein, result is the color value of the RGB channel of each pixel point in the result image; factor is a relation value; value is the color value of each channel of red, green and blue of each pixel point in the original image; sra is the saturation parameter.
The invention has the following beneficial effects:
the improved method for enhancing the dark environment image based on the single-scale Retinex utilizes the principle that the slope of a logarithmic function is decreased progressively, so that the phase difference is relatively smaller at places with high gray values, and is relatively larger at places with low gray values, and finally the local brightness of the photo shot in the dark environment is enhanced. According to the method, different processing is performed according to the brightness condition of each pixel, so that compared with other light supplement technologies in the prior art, the light supplement effect is more natural and vivid.
Drawings
FIG. 1 is an original image;
FIG. 2 is a resulting image;
fig. 1 and 2 are color images, and since the application document requires the colors of the pictures, fig. 1 and 2 are set as grayscale images in the application document.
Detailed Description
The present invention will be described in further detail with reference to the following drawings and examples.
The invention provides an improved method for enhancing a dark environment image based on single-scale Retinex, which comprises the following steps:
1) receiving an original image shown in fig. 1, and performing gray processing on the original image to obtain a gray image;
2) associating each pixel of the gray level image with a curve of a logarithmic function, and performing brightness enhancement on the gray level image to obtain a gray level enhanced image;
3) and fusing the gray level enhanced image, the gray level image and the original image to obtain a result image, as shown in fig. 2.
The method of the invention is realized specifically as follows:
the gray level processing algorithm in the step 1) is as follows:
GRAY=0.299*RED+0.587*GREEN+0.114*BLUE;
or,
GRAY=(RED*306+GREEN*601+BLUE*117+512)/1024;
wherein, GRAY is the GRAY value of the current pixel point of the GRAY image; RED, GREEN and BLUE channel color values of the current pixel point of the original image are respectively obtained by RED, GREEN and BLUE.
The step 2) is specifically as follows:
and 2.1) carrying out fuzzy processing on the gray level image to obtain a gray level fuzzy image. The blurring process includes: median fuzzy processing, Gaussian fuzzy processing, mean fuzzy processing and convolution processing.
The median fuzzy processing, namely median filtering processing, mainly sorts the color values of the N x N template pixel points around the pixel point to be processed from large to small or from small to large to obtain the color value at the middle after sorting, namely the median, and then sets the color value of the pixel point as the color value of the median; where N is the radius of the blur.
Gaussian blur processing mainly adopts normal distribution to calculate the transformation of each pixel in an image, wherein the normal distribution equation in an N-dimensional space is as follows:
<math> <mrow> <mi>G</mi> <mrow> <mo>(</mo> <mi>r</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mn>1</mn> <msup> <msqrt> <msup> <mrow> <mn>2</mn> <mi>&pi;&sigma;</mi> </mrow> <mn>2</mn> </msup> </msqrt> <mi>N</mi> </msup> </mfrac> <msup> <mi>e</mi> <mrow> <mo>-</mo> <msup> <mi>r</mi> <mn>2</mn> </msup> <mo>/</mo> <mrow> <mo>(</mo> <mn>2</mn> <msup> <mi>&sigma;</mi> <mn>2</mn> </msup> <mo>)</mo> </mrow> </mrow> </msup> <mo>;</mo> </mrow></math>
the normal distribution equation in two dimensions is:
<math> <mrow> <mi>G</mi> <mrow> <mo>(</mo> <mi>u</mi> <mo>,</mo> <mi>v</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mn>1</mn> <msup> <mrow> <mn>2</mn> <mi>&pi;&sigma;</mi> </mrow> <mn>2</mn> </msup> </mfrac> <msup> <mi>e</mi> <mrow> <mo>-</mo> <mrow> <mo>(</mo> <msup> <mi>u</mi> <mn>2</mn> </msup> <mo>-</mo> <msup> <mi>v</mi> <mn>2</mn> </msup> <mo>)</mo> </mrow> <mo>/</mo> <mrow> <mo>(</mo> <msup> <mrow> <mn>2</mn> <mi>&sigma;</mi> </mrow> <mn>2</mn> </msup> <mo>)</mo> </mrow> </mrow> </msup> <mo>;</mo> </mrow></math>
where r is the blur radius (r)2=u2+v2) σ is the standard deviation of the normal distribution, u is the position deviation value of the original pixel point on the x axis, and v is the position deviation value of the original pixel point on the y axis.
The mean value blurring process is a typical linear filtering algorithm, and means that a template is given to a target pixel on an image, and the template comprises adjacent pixels around the target pixel; the adjacent pixel is 8 pixels around the target pixel as the center, and forms a filtering template, namely the target pixel is removed; the average value of all pixels in the template is then used instead of the original pixel value.
Convolution processing: convolution is an operation performed on each element in a matrix, the function realized by the convolution is determined by the form of a convolution kernel of the convolution kernel, the convolution kernel is a matrix with fixed size and formed by numerical parameters, the center of the matrix is a reference point or an anchor point, and the size of the matrix is called as kernel support; to calculate the color value of a pixel after convolution, firstly, positioning a reference point of a kernel to the pixel, and covering corresponding local surrounding points in a matrix by other elements of the kernel; for the pixel point in each kernel, obtaining the product of the value of the pixel point and the value of a specific point in the convolution kernel array, solving the accumulated sum of all the products, namely the convolution value of the specific point, and replacing the color value of the pixel point with the result; this operation is repeated for each pixel point of the image by moving the convolution kernel over the entire image.
And 2.2) respectively carrying out logarithmic functions based on natural logarithm as a base on the gray level image and the gray level fuzzy image to obtain gray level data and gray level fuzzy data, subtracting the gray level fuzzy data from the gray level data to obtain gray level difference data, and calculating the maximum value and the minimum value in the gray level difference. Increasing the brightness of each pixel of the gray level image associated with the curve of the logarithmic function by utilizing the characteristic that the slope of the curve of the logarithmic function is decreased, wherein the brightness increase degree of the pixel with high gray level is smaller than that of the pixel with low gray level, so that the image with the improved overall brightness is obtained; and calculating the maximum value and the minimum value in the gray difference through a maximum value and minimum value theorem.
And 2.3) comparing the gray level difference data of each pixel with the maximum value and the minimum value in the gray level difference based on the maximum value and the minimum value in the gray level difference, and assigning a preset rule to each pixel according to a comparison result to obtain final gray level enhancement data. The preset rule is as follows: if the gray scale difference data of the current pixel is less than or equal to the minimum value, the value is assigned to be 0, if the gray scale difference data of the current pixel is greater than the maximum value, the value is assigned to be 255, and the rest pixels are calculated by the following formula:
resultvalue=(value-vMin)*255/(vMax-vMin)
wherein, resultvalue is a result value; value is the value of the gray scale difference data; vMin is said minimum value; vMax is the maximum value.
The step 3) is specifically as follows:
and 3.1) dividing the data of the gray level enhanced image in the step 2) by the data of the gray level image in the step 1) to obtain a relation value. And further, judging the obtained relation value, namely judging whether the relation value is greater than a preset value P or not, if so, judging whether the relation value is equal to the preset value P, then judging whether the relation value is smaller than a preset value K or not, and if not, judging whether the relation value is equal to the preset value K. In this embodiment, the preset value P is 2, and the preset value K is 0.5.
Step 3.2) judging the maximum value and the minimum value in the color values of the RGB three channels of the original image, and calculating the saturation coefficient of the original image: if the maximum value is 0, the saturation factor is 0, otherwise the saturation factor is (max-min)/max 1.5.
The specific judgment method comprises the following steps:
judging whether the color value of the R channel of the current pixel is larger than the color value of the G channel, if so, judging whether the color value of the R channel of the current pixel is larger than the color value of the G channel
cMax=max(rValue,bValue);cMin=min(gValue,bValue);
If not, then,
cMax=max(gValue,bValue);cMin=min(rValue,bValue);
finally, if cMax is not equal to 0, srat ═ cMax-cMin)/cMax 1.5; otherwise srat is 0;
wherein, cMax and cMIN are the temporary maximum value and the temporary minimum value; rValue, gValue and bValue are color values of the RGB three channels of the current pixel; sra is the saturation coefficient.
And 3.3) performing enhancement operation on the original image through the preset relation between the saturation parameter and the relation value in the step 3.1) to obtain a final color value. The method specifically comprises the following steps:
result=factor*value*(1.0-srat)+srat*value;
wherein, result is the color value of the RGB channel of each pixel point in the result image; factor is a relation value; value is the color value of each channel of red, green and blue of each pixel point in the original image; sra is the saturation parameter.
The above examples are provided only for illustrating the present invention and are not intended to limit the present invention. Changes, modifications, etc. to the above-described embodiments are intended to fall within the scope of the claims of the present invention as long as they are in accordance with the technical spirit of the present invention.

Claims (10)

CN201410273333.1A2014-06-182014-06-18Improved method for enhancing dark environment images on basis of single-scale RetinexPendingCN104021531A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201410273333.1ACN104021531A (en)2014-06-182014-06-18Improved method for enhancing dark environment images on basis of single-scale Retinex

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201410273333.1ACN104021531A (en)2014-06-182014-06-18Improved method for enhancing dark environment images on basis of single-scale Retinex

Publications (1)

Publication NumberPublication Date
CN104021531Atrue CN104021531A (en)2014-09-03

Family

ID=51438270

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201410273333.1APendingCN104021531A (en)2014-06-182014-06-18Improved method for enhancing dark environment images on basis of single-scale Retinex

Country Status (1)

CountryLink
CN (1)CN104021531A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104320576A (en)*2014-09-302015-01-28百度在线网络技术(北京)有限公司Image processing method and image processing apparatus for portable terminal
CN104361566A (en)*2014-11-172015-02-18厦门美图之家科技有限公司Picture processing method for optimizing dark region
CN104680490A (en)*2015-02-132015-06-03中科创达软件股份有限公司Method for enhancing visuality of text image
CN106097286A (en)*2016-06-212016-11-09浙江大华技术股份有限公司A kind of method and device of image procossing
CN106991947A (en)*2015-10-272017-07-28船井电机株式会社Display device and display signal generating apparatus
CN107025641A (en)*2017-04-282017-08-08南京觅踪电子科技有限公司Image interfusion method based on Analysis of Contrast
CN108734676A (en)*2018-05-212018-11-02Oppo广东移动通信有限公司Image processing method and device, electronic equipment, computer readable storage medium
CN113129245A (en)*2021-04-192021-07-16厦门喵宝科技有限公司Document picture processing method and device and electronic equipment
US11094045B2 (en)2016-06-212021-08-17Zhejiang Dahua Technology Co., Ltd.Systems and methods for image processing
CN114881184A (en)*2022-04-262022-08-09中冶赛迪信息技术(重庆)有限公司Method, device, equipment and medium for identifying label of bar in metallurgical production process

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20060227149A1 (en)*2005-04-082006-10-12Microsoft CorporationInterpolated color transform for changing color of an application user interface
CN102024264A (en)*2010-10-132011-04-20广东威创视讯科技股份有限公司Dimensional-histogram-statistic-based touch pen color recognition method
CN102752605A (en)*2011-09-302012-10-24新奥特(北京)视频技术有限公司Method and system for regulating image/video color saturation degree

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20060227149A1 (en)*2005-04-082006-10-12Microsoft CorporationInterpolated color transform for changing color of an application user interface
CN102024264A (en)*2010-10-132011-04-20广东威创视讯科技股份有限公司Dimensional-histogram-statistic-based touch pen color recognition method
CN102752605A (en)*2011-09-302012-10-24新奥特(北京)视频技术有限公司Method and system for regulating image/video color saturation degree

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
CHANG-HSING LEE 等: "Adaptive Multiscale Retinex for Image Contrast Enhancement", 《2013 INTERNATIONAL CONFERENCE ON SIGNAL-IMAGE TECHNOLOGY & INTERNET-BASED SYSTEMS》*
ZIA-UR RAHMAN 等: "Multi-sensor fusion and enhancement using the Retinex image enhancement algorithm", 《PROCEEDING OF SPIE-THE INTERNATIONAL SOCIETY FOR OPTICAL ENGINEERING》*
冯亚丽: "一种新的基于MSRCR 光照补偿算法", 《计算机系统应用》*
李艳梅: "图像增强的相关技术及应用研究", 《中国博士学位论文全文数据库•信息科技辑》*
王大雷: "雾天图像增强技术的分析与研究", 《中国优秀硕士学位论文全文数据库•信息科技辑》*
芮义斌 等: "一种图像去薄雾方法", 《计算机应用》*
黄凯奇 等: "色彩恒常性在彩色图像增强中的应用", 《应用科学学报》*

Cited By (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104320576A (en)*2014-09-302015-01-28百度在线网络技术(北京)有限公司Image processing method and image processing apparatus for portable terminal
CN104320576B (en)*2014-09-302018-11-13百度在线网络技术(北京)有限公司A kind of image processing method and image processing apparatus for portable terminal
CN104361566A (en)*2014-11-172015-02-18厦门美图之家科技有限公司Picture processing method for optimizing dark region
CN104361566B (en)*2014-11-172018-08-10厦门美图之家科技有限公司A kind of image processing method in optimization dark portion region
CN104680490B (en)*2015-02-132018-08-10中科创达软件股份有限公司A method of enhancing text image is visual
CN104680490A (en)*2015-02-132015-06-03中科创达软件股份有限公司Method for enhancing visuality of text image
CN106991947A (en)*2015-10-272017-07-28船井电机株式会社Display device and display signal generating apparatus
CN106097286A (en)*2016-06-212016-11-09浙江大华技术股份有限公司A kind of method and device of image procossing
CN106097286B (en)*2016-06-212019-02-12浙江大华技术股份有限公司A kind of method and device of image procossing
US11094045B2 (en)2016-06-212021-08-17Zhejiang Dahua Technology Co., Ltd.Systems and methods for image processing
CN107025641A (en)*2017-04-282017-08-08南京觅踪电子科技有限公司Image interfusion method based on Analysis of Contrast
CN108734676A (en)*2018-05-212018-11-02Oppo广东移动通信有限公司Image processing method and device, electronic equipment, computer readable storage medium
CN113129245A (en)*2021-04-192021-07-16厦门喵宝科技有限公司Document picture processing method and device and electronic equipment
CN114881184A (en)*2022-04-262022-08-09中冶赛迪信息技术(重庆)有限公司Method, device, equipment and medium for identifying label of bar in metallurgical production process

Similar Documents

PublicationPublication DateTitle
CN104021531A (en)Improved method for enhancing dark environment images on basis of single-scale Retinex
CN104156921B (en) An Adaptive Image Enhancement Method for Images with Low Illumination or Uneven Brightness
CN114331873B (en)Non-uniform illumination color image correction method based on region division
CN109147005B (en)Self-adaptive dyeing method and system for infrared image, storage medium and terminal
CN107680056B (en)Image processing method and device
CN113256533B (en)Self-adaptive low-illumination image enhancement method and system based on MSRCR
CN102789635B (en)Image enhancement method and image enhancement device
US9396526B2 (en)Method for improving image quality
CN105809643B (en)A kind of image enchancing method based on adaptive block channel extrusion
CN103295206B (en)A kind of twilight image Enhancement Method and device based on Retinex
CN110473152B (en) Image Enhancement Method Based on Improved Retinex Algorithm
CN107256539B (en) An Image Sharpening Method Based on Local Contrast
CN107644409B (en)Image enhancement method, display device and computer-readable storage medium
CN111383181B (en)Image enhancement method and device, storage medium and terminal
CN104537634A (en)Method and system for removing raindrop influences in dynamic image
CN112116536A (en)Low-illumination image enhancement method and system
CN113450272B (en)Image enhancement method based on sinusoidal variation and application thereof
CN101211459A (en)Boundary point processed histogram balancing method
CN103295205B (en)A kind of low-light-level image quick enhancement method based on Retinex and device
CN107025641A (en)Image interfusion method based on Analysis of Contrast
Li et al.Soft binary segmentation-based backlit image enhancement
CN119402759B (en)Image signal processing method, system and cradle head equipment
CN108550124B (en)Illumination compensation and image enhancement method based on bionic spiral
CN116977190A (en)Image processing method, apparatus, device, storage medium, and program product
CN118071634B (en)Self-adaptive enhancement method for low-illumination color cast image

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20140903


[8]ページ先頭

©2009-2025 Movatter.jp