CN101398929B - Method and device for restraining night image noise - Google Patents

Method and device for restraining night image noise Download PDF

Info

Publication number
CN101398929B
CN101398929B CN200810168365XA CN200810168365A CN101398929B CN 101398929 B CN101398929 B CN 101398929B CN 200810168365X A CN200810168365X A CN 200810168365XA CN 200810168365 A CN200810168365 A CN 200810168365A CN 101398929 B CN101398929 B CN 101398929B
Authority
CN
China
Prior art keywords
image
pixel
component value
intermediate images
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.)
Active
Application number
CN200810168365XA
Other languages
Chinese (zh)
Other versions
CN101398929A (en
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.)
Shenzhen Xunlei Networking Technologies Co Ltd
Original Assignee
Shenzhen Xunlei Networking Technologies 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 Shenzhen Xunlei Networking Technologies Co Ltd filed Critical Shenzhen Xunlei Networking Technologies Co Ltd
Priority to CN200810168365XA priority Critical patent/CN101398929B/en
Publication of CN101398929A publication Critical patent/CN101398929A/en
Application granted granted Critical
Publication of CN101398929B publication Critical patent/CN101398929B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method for suppressing noise of a night scene image. The method comprises the following steps: an original night scene image is copied twice to obtain a first temporary image and a second temporary image; a gray level image comprising noise of the original night scene image is obtained by threshold processing of the first temporary image, and a third temporary image is obtained by dimming the second temporary image; the original night scene image and the third temporary image are combined in Subtract mode by taking the gray level image comprising the noise of the original night scene image as a layer mask to obtain the finally desired image. The invention simultaneously discloses a device for suppressing noise of a night scene image. The method and the device can not affect the quality of the images while conveniently and effectively suppressing the noise of the night scene images, minimize the time and cost of users, and achieves more ideal treatment effect.

Description

一种抑制夜景图像噪声的方法和装置 A method and device for suppressing night scene image noise

技术领域technical field

本发明涉及图像处理中的图像去噪技术领域,特别涉及一种抑制夜景图像噪声的方法和装置。The invention relates to the technical field of image denoising in image processing, in particular to a method and device for suppressing night scene image noise.

背景技术Background technique

随着数码相机的日益普及,用户对所拍摄的数码照片的效果也提出了更高的要求。由于夜景拍摄时,夜晚光线本身不足,为了保证成像的清晰,一般采用了高灵敏度(ISO)的拍摄手段,虽然满足了希望的清晰要求,但同时也带来了噪声,这是因为数码相机本身所使用器材的局限性,导致拍摄出来的夜景噪声明显,严重影响了成像质量。With the increasing popularity of digital cameras, users have higher requirements for the effects of digital photos taken. Due to the lack of night light itself when shooting night scenes, in order to ensure the clarity of the image, a high-sensitivity (ISO) shooting method is generally used. Although it meets the desired clarity requirements, it also brings noise. This is because the digital camera itself The limitations of the equipment used lead to obvious noise in the night scene, which seriously affects the image quality.

为解决这一问题,用户通常需要采用一些软件来对拍摄到的夜景数码照片进行后期处理,此时对图像整体采用模糊化,明显地去除了噪声,但同时导致了整个图像的模糊化。而且,在后期处理过程中,需要靠用户来调整一系列的复杂参数,才能达到去除拍摄过程中引入的噪声的目的,不但实现起来很不方便,而且也很难达到理想的效果。To solve this problem, users usually need to use some software to post-process the night scene digital photos. At this time, the overall image is blurred, which obviously removes the noise, but at the same time causes the blurring of the entire image. Moreover, in the post-processing process, users need to adjust a series of complex parameters to achieve the purpose of removing the noise introduced in the shooting process, which is not only inconvenient to implement, but also difficult to achieve the desired effect.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种抑制夜景图像噪声的方法,能够方便有效地对夜景图像噪声进行抑制。In view of this, the main purpose of the present invention is to provide a method for suppressing night scene image noise, which can suppress night scene image noise conveniently and effectively.

本发明的另一目的在于提供一种抑制夜景图像噪声的装置,能够方便有效地对夜景图像噪声进行抑制。Another object of the present invention is to provide a device for suppressing night scene image noise, which can conveniently and effectively suppress night scene image noise.

为达到上述目的,本发明的技术方案具体是这样实现的:In order to achieve the above object, the technical solution of the present invention is specifically realized in the following way:

一种抑制夜景图像噪声的方法,该方法包括:A method for suppressing night scene image noise, the method comprising:

将原始夜景图像复制两份,得到第一临时图像和第二临时图像;Copying the original night scene image twice to obtain a first temporary image and a second temporary image;

对所述第一临时图像进行阈值处理,得到包含所述原始夜景图像噪声的灰度图像,对所述第二临时图像进行调暗处理,得到第三临时图像;Carrying out threshold processing on the first temporary image to obtain a grayscale image containing the noise of the original night scene image, and performing darkening processing on the second temporary image to obtain a third temporary image;

对所述原始夜景图像以及所述第三临时图像中的每一个像素点上的红R、绿G、蓝B分量,分别按照以下方式进行计算,得到最终所需图像,The red R, green G, and blue B components on each pixel in the original night scene image and the third temporary image are calculated in the following manner to obtain the final required image,

resultresult [[ ii ]] == [[ bmpbmp [[ ii ]] -- [[ bmpbmp 22 [[ ii ]] ** transparencytransparency ** 255255 -- MaskBmpMaskBmp [[ ii ]] 255255 ]] ]] ,,

其中,i表示任一像素点;所述bmp[i]表示所述原始夜景图像中的第i个像素点上的R、G或B分量值;所述bmp2[i]表示所述第三临时图像中的第i个像素点上的R、G或B分量值;所述MaskBmp[i]表示所述包含所述原始夜景图像噪声的灰度图像中的第i个像素点的灰度值;result[i]表示计算得到的最终所需图像中的第i个像素点上的R、G或B分量值;所述transparency表示透明度,其取值为一大于等于0且小于等于1的实数;所述*表示乘号,所述-表示减号。Wherein, i represents any pixel; the bmp[i] represents the R, G or B component value on the i-th pixel in the original night scene image; the bmp2[i] represents the third temporary R, G or B component value on the ith pixel in the image; Said MaskBmp[i] represents the grayscale value of the i'th pixel in the grayscale image that contains the noise of the original night scene image; result[i] represents the R, G or B component value on the i-th pixel in the calculated final required image; the transparency represents transparency, and its value is a real number greater than or equal to 0 and less than or equal to 1; The * represents a multiplication sign, and the - represents a minus sign.

一种抑制夜景图像噪声的装置,该装置包括:A device for suppressing night scene image noise, the device comprising:

复制单元,用于将原始夜景图像复制两份,得到第一临时图像和第二临时图像;a copying unit, for copying the original night scene image twice to obtain a first temporary image and a second temporary image;

处理单元,用于对所述第一临时图像进行阈值处理,得到包含所述原始夜景图像噪声的灰度图像,对所述第二临时图像进行调暗处理,得到第三临时图像;A processing unit, configured to perform threshold processing on the first temporary image to obtain a grayscale image containing noise in the original night scene image, and perform darkening processing on the second temporary image to obtain a third temporary image;

第三计算子单元,用于对所述原始夜景图像以及由所述处理单元得到的第三临时图像中的每一个像素点上的R、G、B分量,分别按照以下方式进行计算,得到最终所需图像,The third calculation subunit is used to calculate the R, G, and B components of each pixel in the original night scene image and the third temporary image obtained by the processing unit in the following manner to obtain the final desired image,

resultresult [[ ii ]] == [[ bmpbmp [[ ii ]] -- [[ bmpbmp 22 [[ ii ]] ** transparencytransparency ** 255255 -- MaskBmpMaskBmp [[ ii ]] 255255 ]] ]] ,,

其中,i表示任一像素点;所述bmp[i]表示所述原始夜景图像中的第i个像素点上的R、G或B分量值;所述bmp2[i]表示所述第三临时图像中的第i个像素点上的R、G或B分量值;所述MaskBmp[i]表示所述包含所述原始夜景图像噪声的灰度图像中的第i个像素点的灰度值;result[i]表示计算得到的最终所需图像中的第i个像素点上的红R、绿G或蓝B分量值;所述transparency表示透明度,其取值为一大于等于0且小于等于1的实数;所述*表示乘号,所述-表示减号。Wherein, i represents any pixel; the bmp[i] represents the R, G or B component value on the i-th pixel in the original night scene image; the bmp2[i] represents the third temporary R, G or B component value on the ith pixel in the image; Said MaskBmp[i] represents the grayscale value of the i'th pixel in the grayscale image that contains the noise of the original night scene image; result[i] represents the red R, green G or blue B component value on the i-th pixel in the calculated final required image; the transparency represents transparency, and its value is greater than or equal to 0 and less than or equal to 1 The real number; said * represents a multiplication sign, and said - represents a minus sign.

可见,采用本发明的技术方案,充分利用了夜景图像整体采光较少,一般整体呈现黑色的特点,对一定阈值内的像素做专门的处理以确定出夜景图像的噪声,再用原始夜景图像减去所述夜景图像的噪声,在保证图像整体效果不变的情况下,达到合理抑制夜景图像噪声的目的;本发明所述方案可应用于软件中,用户只需点击相应的按键,软件自身即可按照本发明所述方案在后台完成处理,省去了用户调整一系列复杂参数的过程,从而为用户节省了时间和费用,而且处理效果更加理想。It can be seen that the adoption of the technical solution of the present invention fully utilizes the feature that the overall lighting of the night scene image is less, and generally presents black as a whole, and special processing is performed on the pixels within a certain threshold to determine the noise of the night scene image, and then the original night scene image is used to reduce the noise. The noise of the night scene image is removed, and the purpose of reasonably suppressing the noise of the night scene image is achieved while ensuring that the overall effect of the image remains unchanged; the scheme of the present invention can be applied to software, and the user only needs to click the corresponding button, and the software itself will The processing can be completed in the background according to the scheme of the present invention, which saves the user the process of adjusting a series of complex parameters, thereby saving time and cost for the user, and the processing effect is more ideal.

附图说明Description of drawings

图1为本发明抑制夜景图像噪声方法实施例的流程图。FIG. 1 is a flow chart of an embodiment of the method for suppressing night scene image noise in the present invention.

图2为本发明抑制夜景图像噪声装置实施例的组成结构示意图。FIG. 2 is a schematic diagram of the composition and structure of an embodiment of the device for suppressing night scene image noise of the present invention.

具体实施方式Detailed ways

为解决现有技术中存在的问题,本发明针对夜景图像具有一些共有的特点,例如整体采光较少、一般呈现黑色、图像中有一些细节,但是细节多为高光彩色区域、暗部细节不多或者不明显等,提出了一种全新的抑制夜景图像噪声的方案:首先,为原始夜景图像设置一个阈值,通过该阈值确定出原始夜景图像的噪声;然后,将原始夜景图像减去所述噪声即得到了降噪后的夜景图像;该方案在不改变照片本身清晰度的前提下,能方便地对夜景照片中出现的噪声进行有效地抑制,从而使照片达到更完美的效果。In order to solve the problems existing in the prior art, the present invention has some common characteristics for night scene images, such as less overall lighting, generally black, and some details in the image, but the details are mostly high-light color areas, and there are few details in dark parts or Not obvious, etc., proposed a new scheme to suppress the noise of the night scene image: first, set a threshold for the original night scene image, and determine the noise of the original night scene image through the threshold; then, subtract the noise from the original night scene image The noise-reduced night scene image is obtained; under the premise of not changing the sharpness of the photo itself, this scheme can conveniently and effectively suppress the noise in the night scene photo, so that the photo can achieve a more perfect effect.

在介绍具体的实现方案之前,首先介绍一下红绿蓝(RGB)色彩模型的概念。RGB色彩模型是工业界的一种颜色标准,通过对R、G、B三个颜色通道进行变化以及对它们相互之间进行叠加来得到各种各样的颜色,所以,对于图像中的每一个像素点,均可用R、G、B三个分量(通道)来表示。通常,每个分量的取值范围为0~255;这样,当R、G、B分量分别取不同的值时,对应表示的颜色也将不同。比如,纯红色的R分量值为255,G分量值和B分量值均为0;亮红色的R分量值为246,G分量值为20,B分量值为50。Before introducing the specific implementation scheme, first introduce the concept of the red-green-blue (RGB) color model. The RGB color model is a color standard in the industry. Various colors are obtained by changing the three color channels of R, G, and B and superimposing them on each other. Therefore, for each image in the image Pixels can be represented by three components (channels) of R, G, and B. Usually, the value range of each component is 0 to 255; thus, when the R, G, and B components take different values, the corresponding colors will also be different. For example, the R component value of pure red is 255, the G component value and B component value are both 0; the R component value of bright red is 246, the G component value is 20, and the B component value is 50.

基于上述介绍,本发明所述方案的具体实现包括:将原始夜景图像复制两份,得到第一临时图像和第二临时图像;对第一临时图像进行阈值处理,得到包含所述原始夜景图像噪声的灰度图像,对第二临时图像进行调暗处理,得到第三临时图像;将原始夜景图像与第三临时图像以包含所述原始夜景图像噪声的灰度图像为蒙层通过Subtract模式进行合并,得到最终所需图像。Based on the above introduction, the specific implementation of the solution of the present invention includes: copying the original night scene image twice to obtain the first temporary image and the second temporary image; thresholding the first temporary image to obtain the noise containing the original night scene image The grayscale image of the second temporary image is darkened to obtain the third temporary image; the original night scene image and the third temporary image are merged by Subtract mode with the grayscale image containing the noise of the original night scene image as a mask , to get the final desired image.

为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举实施例,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.

图1为本发明抑制夜景图像噪声方法实施例的流程图。如图1所示,包括以下步骤:FIG. 1 is a flow chart of an embodiment of the method for suppressing night scene image noise in the present invention. As shown in Figure 1, the following steps are included:

步骤101:将原始夜景图像复制两份,得到第一临时图像和第二临时图像。Step 101: Duplicate the original night scene image twice to obtain a first temporary image and a second temporary image.

如何复制为现有技术,不再赘述。How to copy it as a prior art will not be described in detail.

需要说明的是,本步骤中对原始夜景图像进行复制仅为举例说明,并不用于限制本发明的技术方案。本实施例中,也可以直接对所述原始夜景图像进行下面的处理操作。It should be noted that the copying of the original night scene image in this step is only for illustration and is not intended to limit the technical solution of the present invention. In this embodiment, the following processing operations may also be directly performed on the original night scene image.

步骤102:对第一临时图像进行阈值处理,得到包含原始夜景图像噪声的灰度图像,对第二临时图像进行调暗处理,得到第三临时图像。Step 102: Perform threshold processing on the first temporary image to obtain a grayscale image containing noise in the original night scene image, and perform darkening processing on the second temporary image to obtain a third temporary image.

本步骤操作有两个目的:1)对图像进行阈值处理后,可以得到图像噪声的灰度图像,为后面去除噪声的操作做好了充分的准备;2)由于后面的操作会调整整个图像的亮度,而经过对图像的调暗处理,可以将图像的亮度变得暗一些,因此,再经过后面相关操作后,图像的亮度就可以跟原来的保持一致。This step has two purposes: 1) After the image is thresholded, the grayscale image of the image noise can be obtained, which is fully prepared for the subsequent operation of removing noise; 2) Since the subsequent operation will adjust the entire image Brightness, and after dimming the image, the brightness of the image can be made darker. Therefore, after related operations later, the brightness of the image can be kept consistent with the original.

在本步骤中,对第一临时图像进行阈值处理,得到包含原始夜景图像噪声的灰度图像的具体实现为:In this step, threshold processing is performed on the first temporary image to obtain a grayscale image containing noise in the original night scene image. The specific implementation is as follows:

通过分别比较所述第一临时图像中每一个像素点上的红(R)分量值、绿(G)分量值以及蓝(B)分量值,找出其中最大的分量值,并将所述最大的分量值设为r′;By comparing the red (R) component value, green (G) component value and blue (B) component value on each pixel in the first temporary image respectively, find out the maximum component value, and use the maximum The component value of is set to r′;

对于所述第一临时图像中的每一个r′,按照以下方式进行r分量值计算:For each r' in the first temporary image, the r component value is calculated in the following manner:

rr == 00 ;; rr &prime;&prime; << ThresholdThreshold rr == (( rr &prime;&prime; -- ThresholdThreshold )) ** 255255 // FeatherFeather ;; ThresholdThreshold &le;&le; rr &prime;&prime; &le;&le; ThresholdThreshold ++ FeatherFeather ,, rr == 255255 ;; rr &prime;&prime; >> ThresholdThreshold ++ FeatherFeather

其中,定义Threshold为阈值点,Feather为羽化参数,像素值小于Threshold的点黑化,像素值大于Feather的点白化,在[Threshold,Threshold+Feather]范围内,白化是自然过渡的;阈值Threshold和羽化参数Feather是经验值,根据用户反馈和多次调解后得到的,这里的默认值为:Threshold=70,Feather=80;所述r表示计算所述原始夜景图像中每一个像素点上的r′而得到的每一个像素点上的值;所述*表示乘号,所述/表示除号,所述+表示加号,所述-表示减号;Among them, Threshold is defined as the threshold point, and Feather is the feathering parameter. The point with a pixel value smaller than Threshold is blackened, and the point with a pixel value greater than Feather is whitened. Within the range of [Threshold, Threshold+Feather], whitening is a natural transition; threshold Threshold and The feathering parameter Feather is an empirical value, obtained according to user feedback and multiple mediations. The default value here is: Threshold=70, Feather=80; the r means to calculate the r on each pixel in the original night scene image ' and the value on each pixel obtained; the * represents a multiplication sign, the / represents a division sign, the + represents a plus sign, and the - represents a minus sign;

将计算得到的r分量值分别赋值给对应像素点上的R分量、G分量和B分量,得到包含所述原始夜景图像噪声的灰度图像。The calculated r component values are respectively assigned to the R component, G component and B component on the corresponding pixel points to obtain a grayscale image containing the noise of the original night scene image.

对第二临时图像进行调暗处理,得到第三临时图像的具体实现包括:The implementation of dimming the second temporary image to obtain the third temporary image includes:

将所述第二临时图像中的每一个像素点上的R分量值、G分量值和B分量值,分别按照以下方式进行计算:The R component value, the G component value and the B component value on each pixel in the second temporary image are calculated in the following manner:

t=t′-t′*Amount/255,得到所述第三临时图像,t=t'-t'*Amount/255, to obtain the third temporary image,

其中,t′表示所述第二临时图像每一个像素点上的R、G、B分量值,t表示计算得到的所述第三临时图像每一个像素点上的R、G、B分量值;阈值Amount=180;所述*表示乘号,所述/表示除号,所述-表示减号。Wherein, t' represents the R, G, and B component values on each pixel of the second temporary image, and t represents the calculated R, G, and B component values on each pixel of the third temporary image; Threshold Amount=180; the * indicates a multiplication sign, the / indicates a division sign, and the - indicates a minus sign.

步骤103:将原始夜景图像与第三临时图像以包含原始夜景图像噪声的灰度图像为蒙层通过Subtract模式进行合并,得到最终所需图像。Step 103: Merge the original night scene image and the third temporary image by using the grayscale image containing the noise of the original night scene image as a mask in Subtract mode to obtain the final desired image.

本步骤中的Subtract模式会调整整个图像的亮度。The Subtract mode in this step will adjust the brightness of the entire image.

其具体实现包括:Its specific implementation includes:

对所述原始夜景图像以及所述第三临时图像中的每一个像素点上的R、G、B分量,分别按照以下方式进行计算:The R, G, and B components on each pixel in the original night scene image and the third temporary image are calculated in the following manner:

resultresult [[ ii ]] == [[ bmpbmp [[ ii ]] -- [[ bmpbmp 22 [[ ii ]] ** transparencytransparency ** 255255 -- MaskBmpMaskBmp [[ ii ]] 255255 ]] ]] ,,

其中,i表示任一像素点;所述bmp[i]表示所述原始夜景图像中的第i个像素点上的R、G或B分量值;所述bmp2[i]表示所述第三临时图像中的第i个像素点上的R、G或B分量值;所述MaskBmp[i]表示所述包含所述原始夜景图像噪声的灰度图像中的第i个像素点的灰度值;result[i]表示计算得到的最终所需图像中的第i个像素点上的R、G或B分量值;所述transparency表示透明度,其取值为一大于等于0且小于等于1的实数;所述*表示乘号,所述-表示减号。Wherein, i represents any pixel; the bmp[i] represents the R, G or B component value on the i-th pixel in the original night scene image; the bmp2[i] represents the third temporary R, G or B component value on the ith pixel in the image; Said MaskBmp[i] represents the grayscale value of the i'th pixel in the grayscale image that contains the noise of the original night scene image; result[i] represents the R, G or B component value on the i-th pixel in the calculated final required image; the transparency represents transparency, and its value is a real number greater than or equal to 0 and less than or equal to 1; The * represents a multiplication sign, and the - represents a minus sign.

本实施例中,当透明度为transparency为1时,按Subtract模式进行合并后的图像的各个像素点上的R、G、B分量值为:In this embodiment, when the transparency is 1, the values of the R, G, and B components on each pixel of the merged image in the Subtract mode are:

resultresult [[ ii ]] == bmpbmp [[ ii ]] ,, rr >> ThresholdThreshold ++ FeatherFeather resultresult [[ ii ]] == bmpbmp [[ ii ]] -- bmpbmp 22 [[ ii ]] ,, rr << ThresholdThreshold resultresult [[ ii ]] == bmpbmp [[ ii ]] -- bmpbmp 22 [[ ii ]] ** 00 .. xx ,, ThresholdThreshold << rr << ThresholdThreshold ++ FeatherFeather ,,

则result即为去除噪声后的夜景图像。The result is the night scene image after noise removal.

本发明采用的夜景抑噪方法,只能应用在夜景中,是因为夜景图像中的大部分像素是比较黑的,也就是说R、G、B都比较小。如果R、G、B中的一个或多个像素值较高的话,这个像素就会比较亮。The night scene noise suppression method adopted by the present invention can only be applied in night scenes, because most of the pixels in the night scene images are relatively dark, that is to say, R, G, and B are relatively small. If one or more pixel values in R, G, and B are higher, the pixel will be brighter.

至此,即完成了本发明所述方法实施例中的抑制夜景图像噪声的处理过程。So far, the process of suppressing night scene image noise in the method embodiment of the present invention is completed.

基于上述方法,图2为本发明抑制夜景图像噪声装置实施例的组成结构示意图。如图2所示,该装置包括:Based on the above method, FIG. 2 is a schematic diagram of the composition and structure of an embodiment of the device for suppressing night scene image noise according to the present invention. As shown in Figure 2, the device includes:

复制单元21,用于将原始夜景图像复制两份,得到第一临时图像和第二临时图像;A copying unit 21, configured to copy two copies of the original night scene image to obtain a first temporary image and a second temporary image;

需要说明的是,本实施例中也可以没有复制单元21,而直接对原始夜景图像进行后面的处理操作。It should be noted that in this embodiment, there may be no copying unit 21, and the subsequent processing operations are directly performed on the original night scene image.

处理单元22,用于对所述第一临时图像进行阈值处理,得到包含所述原始夜景图像噪声的灰度图像,对第二临时图像进行调暗处理,得到第三临时图像;The processing unit 22 is configured to perform threshold processing on the first temporary image to obtain a grayscale image containing the noise of the original night scene image, and perform darkening processing on the second temporary image to obtain a third temporary image;

计算单元23,用于将所述原始夜景图像与所述第三临时图像以所述包含所述原始夜景图像噪声的灰度图像为蒙层通过Subtract模式进行合并,得到最终所需图像。The computing unit 23 is configured to combine the original night scene image and the third temporary image by using the grayscale image containing the noise of the original night scene image as a mask layer through a Subtract mode to obtain a final desired image.

其中,复制单元21包括:Wherein, the replication unit 21 includes:

待处理子单元211,用于保存原始夜景图像;The pending subunit 211 is used to save the original night scene image;

复制子单元212,用于对待处理子单元211中的原始夜景图像进行所述的复制。The copying subunit 212 is configured to perform the copying of the original night scene image in the subunit 211 to be processed.

需要说明的是,由于本实施例中可以没有复制单元21,因此,复制单元21中所包含的待处理子单元211和复制子单元212也可以没有。It should be noted that, since the replication unit 21 may not be present in this embodiment, the subunit to be processed 211 and the replication subunit 212 included in the replication unit 21 may also be absent.

处理单元22可具体包括:The processing unit 22 may specifically include:

第一处理子单元221,用于对所述第一临时图像进行阈值处理,得到包含所述原始夜景图像噪声的灰度图像,该子处理单元221又包括:The first processing subunit 221 is configured to perform threshold processing on the first temporary image to obtain a grayscale image containing the noise of the original night scene image, and the subprocessing unit 221 further includes:

查找子单元2211,用于找出所述第一临时图像中每一个像素点的红(R)分量值、绿(G)分量值以及蓝(B)分量值中最大的分量值,并将所述最大的分量值设为r′;The search subunit 2211 is used to find the largest component value among the red (R) component value, green (G) component value and blue (B) component value of each pixel in the first temporary image, and obtain the maximum component value The maximum component value is set to r';

第一计算子单元2212,用于对所述第一临时图像中的每一个r′,按照以下方式进行r分量值计算:The first calculation subunit 2212 is configured to calculate the value of the r component in the following manner for each r' in the first temporary image:

rr == 00 ;; rr &prime;&prime; << ThresholdThreshold rr == (( rr &prime;&prime; -- ThresholdThreshold )) ** 255255 // FeatherFeather ;; ThresholdThreshold << rr &prime;&prime; << ThresholdThreshold ++ FeatherFeather ,, rr == 255255 ;; rr &prime;&prime; >> ThresholdThreshold ++ FeatherFeather

其中,定义Threshold为阈值点,Feather为羽化参数,像素值小于Threshold的点黑化,像素值大于Feather的点白化,在[Threshold,Threshold+Feather]范围内,白化是自然过渡的;阈值Threshold和羽化参数Feather是经验值,根据用户反馈和多次调解后得到的,这里的默认值为:Threshold=70,Feather=80;所述r表示计算所述第一临时图像中每一个像素点上的r′而得到的每一个像素点上的值;所述*表示乘号,所述/表示除号,所述+表示加号,所述-表示减号;Among them, Threshold is defined as the threshold point, and Feather is the feathering parameter. The point with a pixel value smaller than Threshold is blackened, and the point with a pixel value greater than Feather is whitened. Within the range of [Threshold, Threshold+Feather], whitening is a natural transition; threshold Threshold and The feathering parameter Feather is an empirical value, obtained according to user feedback and multiple mediations, and the default value here is: Threshold=70, Feather=80; the r means to calculate the value of each pixel in the first temporary image The value on each pixel obtained by r'; the * represents a multiplication sign, the / represents a division sign, the + represents a plus sign, and the - represents a minus sign;

赋值子单元2213,用于将第一计算子单元2212计算得到的r分量值分别赋值给对应像素点上的R分量、G分量和B分量,得到包含所述原始夜景图像噪声的灰度图像。The assignment subunit 2213 is used to assign the r component value calculated by the first calculation subunit 2212 to the R component, G component and B component on the corresponding pixel, to obtain the grayscale image containing the noise of the original night scene image.

第二处理子单元222,用于对第二临时图像进行调暗处理,得到第三临时图像,该处理子单元222可以包括:The second processing subunit 222 is configured to perform dimming processing on the second temporary image to obtain a third temporary image, and the processing subunit 222 may include:

第二计算子单元2221,用于将所述第二临时图像中的每一个像素点上的R分量值、G分量值和B分量值,分别按照以下方式进行计算:The second calculation subunit 2221 is used to calculate the R component value, G component value and B component value of each pixel in the second temporary image in the following manner:

t=t′-t′*Amount/255,得到所述第三临时图像,t=t'-t'*Amount/255, to obtain the third temporary image,

其中,t′表示所述第二临时图像每一个像素点上的R、G、B分量值,t表示计算得到的所述第三临时图像每一个像素点上的R、G、B分量值;阈值Amount=180;所述*表示乘号,所述/表示除号,所述-表示减号。Wherein, t' represents the R, G, and B component values on each pixel of the second temporary image, and t represents the calculated R, G, and B component values on each pixel of the third temporary image; Threshold Amount=180; the * indicates a multiplication sign, the / indicates a division sign, and the - indicates a minus sign.

其中,计算单元23可具体为:Wherein, the computing unit 23 may specifically be:

第三计算子单元231,用于对于所述原始夜景图像以及所述第三临时图像中的每一个像素点上的R、G、B分量,分别按照以下方式进行计算:The third calculation subunit 231 is used to calculate the R, G, and B components of each pixel in the original night scene image and the third temporary image in the following manner:

resultresult [[ ii ]] == [[ bmpbmp [[ ii ]] -- [[ bmpbmp 22 [[ ii ]] ** transparencytransparency ** 255255 -- MaskBmpMaskBmp [[ ii ]] 255255 ]] ]] ,,

其中,i表示任一像素点;所述bmp[i]表示所述原始夜景图像中的第i个像素点上的R、G或B分量值;所述bmp2[i]表示所述第三临时图像中的第i个像素点上的R、G或B分量值;所述MaskBmp[i]表示所述包含所述原始夜景图像噪声的灰度图像中的第i个像素点的灰度值;result[i]表示计算得到最终所需图像中的第i个像素点上的R、G或B分量值;所述transparency表示透明度,其取值为一大于等于0且小于等于1的实数;所述*表示乘号,所述-表示减号。Wherein, i represents any pixel; the bmp[i] represents the R, G or B component value on the i-th pixel in the original night scene image; the bmp2[i] represents the third temporary R, G or B component value on the ith pixel in the image; Said MaskBmp[i] represents the grayscale value of the i'th pixel in the grayscale image that contains the noise of the original night scene image; result[i] represents the calculated R, G or B component value on the i-th pixel in the final required image; the transparency represents transparency, and its value is a real number greater than or equal to 0 and less than or equal to 1; The * represents a multiplication sign, and the - represents a minus sign.

图2所示装置的具体工作流程请参照图1所示方法实施例中的相应说明,此处不再赘述。For the specific working process of the device shown in FIG. 2 , please refer to the corresponding description in the method embodiment shown in FIG. 1 , which will not be repeated here.

由上述实施例可以看出,本发明采用的抑制夜景图像噪声的方法,充分利用了夜景图像整体采光较少,一般整体呈现黑色的特点,对一定阈值内的像素做专门的处理以确定出夜景图像的噪声,再用原始夜景图像减去所述夜景图像的噪声,在保证图像整体效果不变,达到合理抑制夜景图像噪声的目的;本发明所述方案可应用于软件中,用户只需点击相应的按键,软件自身即可按照本发明所述方案在后台完成处理,省去了用户调整一系列复杂参数的过程,从而为用户节省了时间和费用,而且处理效果更加理想。As can be seen from the above-mentioned embodiments, the method for suppressing night scene image noise adopted in the present invention fully utilizes the characteristics that the overall lighting of the night scene image is less, and generally presents black as a whole, and performs special processing on the pixels within a certain threshold to determine the night scene. The noise of the image, and then subtract the noise of the night scene image from the original night scene image, so as to ensure that the overall effect of the image remains unchanged and achieve the purpose of reasonably suppressing the noise of the night scene image; the scheme of the present invention can be applied to software, and the user only needs to click Corresponding keys, the software itself can complete the processing in the background according to the scheme of the present invention, eliminating the need for the user to adjust a series of complex parameters, thereby saving time and cost for the user, and the processing effect is more ideal.

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

Claims (8)

1. a method that suppresses night image noise is characterized in that, this method comprises:
With two parts of original night copying images, obtain first intermediate images and second intermediate images;
Described first intermediate images is carried out threshold process, obtain comprising the gray level image of described original night picture noise, described second intermediate images is dimmed processing, obtain the 3rd intermediate images;
To red R, green G on each pixel in described original night image and described the 3rd intermediate images, blue B component, calculate in such a way respectively, obtain final needing image,
result [ i ] = [ bmp [ i ] - [ bmp 2 [ i ] * transparency * 255 - MaskBmp [ i ] 255 ] ] ,
Wherein, i represents arbitrary pixel; Described bmp[i] R, G or B component value on i the pixel of expression in the described original night image; Described bmp2[i] R, G or B component value on i the pixel of expression in described the 3rd intermediate images; Described MaskBmp[i] i gray values of pixel points in the described gray level image that comprises described original night picture noise of expression; Result[i] R, G or B component value on i the pixel in the final needing image that calculates of expression; Described transparency represents transparency, and its value is one more than or equal to 0 and smaller or equal to 1 real number; Described * represents multiplication sign, and is described-the expression minus sign.
2. the method for claim 1 is characterized in that, described described first intermediate images is carried out threshold process, and the gray level image that obtains comprising described original night picture noise comprises:
Find out in the described original night image on each pixel component value maximum in R component value, G component value and the B component value, and the component value of described maximum is made as r ';
To the r ' on each pixel in the described original night image, carry out the r component value in such a way and calculate:
r = 0 ; r &prime; < Threshold r = ( r &prime; - Threshold ) * 255 / Feather ; Threshold &le; r &prime; &le; Threshold + Feather , r = 255 ; r &prime; > Threshold + Feather
Wherein, described r represents to calculate the r ' on each pixel in the described original night image and value on each pixel of obtaining; Described Threshold=70, described Feather=80; Described * represents multiplication sign, and is described/the expression division sign, described+the expression plus sige, described-the expression minus sign;
R component value on each pixel that calculates difference assignment to the R component on the corresponding pixel points, G component and B component, is obtained comprising the gray level image of described original night picture noise.
3. the method for claim 1 is characterized in that, described described second intermediate images is dimmed processing, obtains the 3rd intermediate images and comprises:
With the R component value on each pixel in the described original night image, G component value and B component value, calculate in such a way respectively:
T=t '-t ' * Amount/255 obtains described the 3rd intermediate images,
Wherein, R, G, B component value on described each pixel of the 3rd intermediate images that R, G, B component value on described each pixel of original night image of t ' expression, t are represented to calculate; Threshold value A mount=180; Described * represents multiplication sign, and is described/the expression division sign, described-the expression minus sign.
4. a device that suppresses night image noise is characterized in that, this device comprises:
Copied cells is used for two parts of original night copying images are obtained first intermediate images and second intermediate images;
Processing unit is used for described first intermediate images is carried out threshold process, obtains comprising the gray level image of described original night picture noise, and described second intermediate images is dimmed processing, obtains the 3rd intermediate images;
The 3rd computation subunit is used for R, G, B component on each pixel of the 3rd intermediate images that obtains to described original night image and by described processing unit, calculates in such a way respectively, obtains final needing image,
result [ i ] = [ bmp [ i ] - [ bmp 2 [ i ] * transparency * 255 - MaskBmp [ i ] 255 ] ] ,
Wherein, i represents arbitrary pixel; Described bmp[i] R, G or B component value on i the pixel of expression in the described original night image; Described bmp2[i] R, G or B component value on i the pixel of expression in described the 3rd intermediate images; Described MaskBmp[i] i gray values of pixel points in the described gray level image that comprises described original night picture noise of expression; Result[i] red R, green G or blue B component value on i the pixel in the final needing image that calculates of expression; Described transparency represents transparency, and its value is one more than or equal to 0 and smaller or equal to 1 real number; Described * represents multiplication sign, and is described-the expression minus sign.
5. method as claimed in claim 4 is characterized in that, described copied cells comprises:
Pending subelement is used to preserve the original night image;
The replicon unit is used for the original night image of pending subelement is duplicated.
6. device as claimed in claim 4 is characterized in that, described processing unit comprises:
First handles subelement, is used for described first intermediate images is carried out threshold process, obtains comprising the gray level image of described original night picture noise;
Second handles subelement, is used for described second intermediate images is dimmed processing, obtains the 3rd intermediate images.
7. device as claimed in claim 6 is characterized in that, described first handles subelement comprises:
Search subelement, be used for finding out on described each pixel of first intermediate images component value maximum in R component value, G component value and the B component value, and the component value of described maximum is made as r ';
First computation subunit is used for each r ' to described first intermediate images, carries out the r component value in such a way and calculates:
r = 0 ; r &prime; < Threshold r = ( r &prime; - Threshold ) * 255 / Feather ; Threshold &le; r &prime; &le; Threshold + Feather , r = 255 ; r &prime; > Threshold + Feather
Wherein, described r represents to calculate the r ' on each pixel in described first intermediate images and value on each pixel of obtaining; Described threshold value Threshold=70, described Feather=80; Described * represents multiplication sign, and is described/the expression division sign, described+the expression plus sige, described-the expression minus sign;
Assignment subelement, the r component value on each pixel that is used for first computation subunit is calculated assignment respectively obtain comprising the gray level image of described original night picture noise to the R component on the corresponding pixel points, G component and B component.
8. device as claimed in claim 6 is characterized in that, described second handles subelement comprises:
Second computation subunit is used for the R component value on each pixel of described second intermediate images, G component value and B component value are calculated respectively in such a way:
T=t '-t ' * Amount/255 obtains described the 3rd intermediate images,
Wherein, R, G, B component value on described each pixel of the 3rd intermediate images that R, G, B component value on described each pixel of second intermediate images of t ' expression, t are represented to calculate; Threshold value A mount=180; Described * represents multiplication sign, and is described/the expression division sign, described-the expression minus sign.
CN200810168365XA 2008-10-28 2008-10-28 Method and device for restraining night image noise Active CN101398929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810168365XA CN101398929B (en) 2008-10-28 2008-10-28 Method and device for restraining night image noise

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810168365XA CN101398929B (en) 2008-10-28 2008-10-28 Method and device for restraining night image noise

Publications (2)

Publication Number Publication Date
CN101398929A CN101398929A (en) 2009-04-01
CN101398929B true CN101398929B (en) 2010-08-11

Family

ID=40517461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810168365XA Active CN101398929B (en) 2008-10-28 2008-10-28 Method and device for restraining night image noise

Country Status (1)

Country Link
CN (1) CN101398929B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100289912A1 (en) * 2009-05-14 2010-11-18 Sony Ericsson Mobile Communications Ab Camera arrangement with image modification
CN104091317B (en) * 2014-06-03 2017-05-17 天津大学 Night scene image window mirror reflection effect removing method
CN105141857B (en) * 2015-09-21 2018-12-11 广东欧珀移动通信有限公司 Image processing method and device
CN107240081A (en) * 2017-06-20 2017-10-10 长光卫星技术有限公司 The denoising of night scene image and enhancing processing method
CN110378863A (en) * 2018-04-10 2019-10-25 深圳Tcl新技术有限公司 A kind of uniformity detecting method of display screen, system and storage medium
CN111369455B (en) * 2020-02-27 2022-03-18 复旦大学 Highlight object measuring method based on polarization image and machine learning

Also Published As

Publication number Publication date
CN101398929A (en) 2009-04-01

Similar Documents

Publication Publication Date Title
JP4041687B2 (en) Method and apparatus for removing flash artifacts
TWI704524B (en) Method and device for image polishing
Moroney Local color correction using non-linear masking
JP6395810B2 (en) Reference image selection for motion ghost filtering
TWI464706B (en) Dark portion exposure compensation method for simulating high dynamic range with single image and image processing device using the same
US20150170389A1 (en) Automatic selection of optimum algorithms for high dynamic range image processing based on scene classification
TWI511559B (en) Image processing method
Safonov et al. Adaptive image processing algorithms for printing
CN101398929B (en) Method and device for restraining night image noise
CN112734650A (en) Virtual multi-exposure fusion based uneven illumination image enhancement method
CN101404728B (en) Method and device for digital image exposure adjustment
CN101437169A (en) Method and apparatus for implementing black and white of color image
CN109300101A (en) A Multi-Exposure Image Fusion Method Based on Retinex Theory
CN106570838A (en) Image brightness optimization method and device
Kao High dynamic range imaging by fusing multiple raw images and tone reproduction
Liba et al. Sky optimization: Semantically aware image processing of skies in low-light photography
CN110807735A (en) Image processing method, image processing device, terminal equipment and computer readable storage medium
CN106550227A (en) A kind of image saturation method of adjustment and device
CN106709888B (en) A kind of high dynamic range images production method based on human vision model
CN101399898B (en) An image processing method and device
CN101408974B (en) An image processing method and device
CN107277369A (en) Image processing method, device, computer-readable recording medium and computer equipment
Chung et al. Under-exposed image enhancement using exposure compensation
CN118195976A (en) A single underwater image enhancement method based on contrast stretching and fusion
Zhang et al. Dualbln: Dual branch lut-aware network for real-time image retouching

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20170221

Address after: A District No. 9018 building 518057 Guangdong Han innovation city of Shenzhen province Nanshan District high tech park, North Central Avenue, 4 floor 401

Patentee after: Shenzhen thunder network culture Co., Ltd.

Address before: 518057 Guangdong, Shenzhen, Nanshan District science and technology in the road, Shenzhen, No. 11, software park, building 7, level 8, two

Patentee before: Xunlei Network Technology Co., Ltd., Shenzhen

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180301

Address after: Nanshan District Guangdong streets of science and technology of Shenzhen city in Guangdong province 518057 two Road No. 11 Shenzhen Software Park Building 7, 8 floor

Patentee after: Xunlei Network Technology Co., Ltd., Shenzhen

Address before: A District No. 9018 Han innovation building 518057 Shenzhen city Nanshan District high tech park, North Central Avenue, 4 floor 401

Patentee before: Shenzhen thunder network culture Co., Ltd.