TWI459795B - Noise reduction method - Google Patents

Noise reduction method Download PDF

Info

Publication number
TWI459795B
TWI459795B TW99147316A TW99147316A TWI459795B TW I459795 B TWI459795 B TW I459795B TW 99147316 A TW99147316 A TW 99147316A TW 99147316 A TW99147316 A TW 99147316A TW I459795 B TWI459795 B TW I459795B
Authority
TW
Taiwan
Prior art keywords
pixel
pseudo
source
image
value
Prior art date
Application number
TW99147316A
Other languages
Chinese (zh)
Other versions
TW201228346A (en
Inventor
Shih Yuan Peng
Chung Ta Wu
Original Assignee
Altek Corp
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 Altek Corp filed Critical Altek Corp
Priority to TW99147316A priority Critical patent/TWI459795B/en
Priority to CN201110094256.XA priority patent/CN102547160B/en
Publication of TW201228346A publication Critical patent/TW201228346A/en
Application granted granted Critical
Publication of TWI459795B publication Critical patent/TWI459795B/en

Links

Landscapes

  • Image Processing (AREA)
  • Processing Of Color Television Signals (AREA)

Description

雜訊抑制方法Noise suppression method

本發明是有關於一種影像處理方法,且特別是有關於一種用於消弭影像雜訊的方法。The present invention relates to an image processing method, and more particularly to a method for eliminating image noise.

多媒體技術的精進使現代人對高畫質影像的要求日漸提高。而影像品質的好壞與在擷取影像、訊號轉換以及傳輸過程中所伴隨產生的雜訊量有相當大的關連。為了有效地去除雜訊以提高影像品質,在影像處理領域中關於雜訊消除的研究也越來越受到重視。常見的雜訊消除方式可分為基於空間的去雜訊處理方法以及基於時間的去雜訊處理方法。The advancement of multimedia technology has made modern people's demands for high-quality images increasingly. The quality of the image is quite related to the amount of noise accompanying the capture of images, signal conversion and transmission. In order to effectively remove noise to improve image quality, research on noise cancellation in the field of image processing has received more and more attention. Common noise cancellation methods can be divided into space-based de-noising processing methods and time-based de-noising processing methods.

基於空間的去雜訊處理方法主要是針對單張影像進行處理。然而由於在處理過程中經常會破壞原始影像中的邊緣或紋理等細節,因此在去除雜訊後容易產生較模糊的結果。The space-based de-noising processing method is mainly for processing a single image. However, since the details such as edges or textures in the original image are often destroyed during processing, it is easy to produce a blurring result after removing noise.

基於時間的去雜訊處理方法則是利用多張影像進行處理,雖然較能保留影像中的細節,但也容易在對影像中的移動物件進行濾波處理時產生移動殘影的情況,因而容易在觀看時造成不適。除此之外,利用多張影像進行處理的複雜度高且運算量大,因此較難滿足即時去除雜訊的需求。The time-based de-noising processing method utilizes multiple images for processing. Although the details in the image can be preserved, it is easy to generate a moving afterimage when filtering the moving objects in the image, so that it is easy to Discomfort caused by viewing. In addition, the processing with multiple images is highly complex and computationally intensive, so it is difficult to meet the need for instant noise removal.

有鑑於此,本發明提供一種雜訊抑制方法,透過兩階段的去雜訊處理以更有效地消除來源影像中的雜訊。In view of the above, the present invention provides a noise suppression method for more effectively eliminating noise in a source image through two-stage denoising processing.

本發明提出一種雜訊抑制方法,以利用參考影像濾除來源影像中的雜訊。其中來源影像與參考影像分別包括n個2×2像素區塊,且各2×2像素區塊中的每一像素係依照貝爾圖(Bayer pattern)色彩排列規則而具有對應紅色通道(R color channel)、第一綠色通道(Gr color channel)、第二綠色通道(Gb color channel)以及藍色通道(B color channel)其中之一的像素值,且n為正整數。此方法包括產生對應來源影像的第一擬似影像以及對應參考影像的第二擬似影像。其中,第一擬似影像包括n個來源擬似像素,且每一來源擬似像素分別對應來源影像中的一個2×2像素區塊。而第二擬似影像包括n個參考擬似像素,且每一參考擬似像素分別對應參考影像中的一個2×2像素區塊。此方法還包括計算第一擬似影像與第二擬似影像之間的全域移動向量,依據全域移動向量對參考影像進行動態補償處理以取得多個動態補償結果,並利用上述動態補償結果對來源影像進行時間疊合(temporal blending)處理以產生第一階雜訊抑制影像,以及對第一階雜訊抑制影像進行空間去雜訊(spatial noise reduction)處理以產生第二階雜訊抑制影像。The invention provides a noise suppression method for filtering noise in a source image by using a reference image. The source image and the reference image respectively comprise n 2×2 pixel blocks, and each pixel in each 2×2 pixel block has a corresponding red channel according to a Bayer pattern color arrangement rule (R color channel) a pixel value of one of a first green channel (Gr color channel), a second green channel (Gb color channel), and a blue color channel (B color channel), and n is a positive integer. The method includes generating a first quasi-image of the corresponding source image and a second quasi-image of the corresponding reference image. The first pseudo-image includes n source pseudo-pixels, and each source pseudo-pixel corresponds to a 2×2 pixel block in the source image. The second pseudo-image includes n reference pseudo-pixels, and each reference quasi-pixel corresponds to a 2×2 pixel block in the reference image. The method further includes calculating a global motion vector between the first pseudo image and the second pseudo image, performing dynamic compensation processing on the reference image according to the global motion vector to obtain a plurality of dynamic compensation results, and performing the source image by using the dynamic compensation result. Temporal blending processing to generate a first-order noise suppression image, and spatial noise reduction processing on the first-order noise suppression image to generate a second-order noise suppression image.

在本發明之一實施例中,其中依據全域移動向量對參考影像進行動態補償處理以取得數個動態補償結果的步驟包括令參考影像依據全域移動向量對齊來源影像,以產生分別對應紅色通道、第一綠色通道、第二綠色通道以及藍色通道的第一動態補償結果、第二動態補償結果、第三動態補償結果,以及第四動態補償結果。In an embodiment of the present invention, the step of performing dynamic compensation processing on the reference image according to the global motion vector to obtain the plurality of dynamic compensation results includes aligning the reference image according to the global motion vector to generate the corresponding red channel, respectively. a first dynamic compensation result, a second dynamic compensation result, a third dynamic compensation result, and a fourth dynamic compensation result of a green channel, a second green channel, and a blue channel.

在本發明之一實施例中,其中利用上述動態補償結果對來源影像進行時間疊合處理以產生第一階雜訊抑制影像的步驟更包括針對每一個來源擬似像素,在所有的參考擬似像素中找出與來源擬似像素具有對應位置的參考擬似像素。根據來源擬似像素與參考擬似像素之間的顏色與亮度差距,判斷是否要對來源擬似像素所對應之2×2像素區塊進行時間疊合處理。若要進行時間疊合處理,則將來源擬似像素所對應之2×2像素區塊中的各像素值與在第一動態補償結果、第二動態補償結果、第三動態補償結果,以及第四動態補償結果中處於對應位置的像素值疊合,以產生一局部疊合結果。若不進行時間疊合處理,則以來源擬似像素所對應之2×2像素區塊作為局部疊合結果。最後再依照貝爾圖色彩排列規則重組每一來源擬似像素所分別對應的局部疊合結果,從而產生第一階雜訊抑制影像。In an embodiment of the invention, the step of performing time superimposition processing on the source image by using the dynamic compensation result to generate the first-order noise suppression image further includes quasi-pixels for each source, in all reference pseudo-pixels. Find a reference quasi-pixel that has a corresponding position to the source pseudo-pixel. According to the color and brightness difference between the source pseudo-pixel and the reference quasi-pixel, it is judged whether the 2×2 pixel block corresponding to the source pseudo-pixel is time-superimposed. To perform time superimposition processing, each pixel value in the 2×2 pixel block corresponding to the source pseudo pixel is matched with the first dynamic compensation result, the second dynamic compensation result, the third dynamic compensation result, and the fourth The pixel values at the corresponding positions in the dynamic compensation result are superimposed to produce a partial overlap result. If the time superimposition process is not performed, the 2×2 pixel block corresponding to the source pseudo-pixel is used as the partial superposition result. Finally, according to the Belle color arrangement rule, the partial superposition results corresponding to the pseudo-pixels of each source are reconstructed, thereby generating the first-order noise suppression image.

在本發明之一實施例中,其中根據來源擬似像素與參考擬似像素之間的顏色與亮度差距,判斷是否對來源擬似像素所對應之2×2像素區塊進行時間疊合處理的步驟包括:將來源擬似像素的像素值與來源擬似像素所對應之2×2像素區塊中對應藍色通道之像素值這兩者的絕對差值定義為一來源擬似藍色色度。將來源擬似像素的像素值與來源擬似像素所對應之2×2像素區塊中對應紅色通道之像素值的絕對差值定義為一來源擬似紅色色度。將參考擬似像素的像素值與參考擬似像素所對應之2×2像素區塊中對應藍色通道之像素值的絕對差值定義為一參考擬似藍色色度。將參考擬似像素的像素值與參考擬似像素所對應之2×2像素區塊中對應紅色通道之像素值的絕對差值定義為一參考擬似紅色色度。並且,取得對應來源擬似像素的亮度門檻值、藍色色度門檻值以及紅色色度門檻值。當來源擬似像素之像素值與參考擬似像素之像素值的絕對差值小於亮度門檻值,來源擬似藍色色度與參考擬似藍色色度的絕對差值小於藍色色度門檻值,且來源擬似紅色色度與參考擬似紅色色度的絕對差值小於紅色色度門檻值時,判定要對來源擬似像素所對應之2×2像素區塊進行時間疊合處理。In an embodiment of the invention, the step of determining whether to perform time superimposition processing on the 2×2 pixel block corresponding to the source pseudo pixel according to the color and brightness difference between the source pseudo pixel and the reference quasi pixel includes: The absolute difference between the pixel value of the source pseudo-pixel and the pixel value of the corresponding blue channel in the 2×2 pixel block corresponding to the source pseudo-pixel is defined as a source pseudo-blue chromaticity. The absolute difference between the pixel value of the source pseudo-pixel and the pixel value of the corresponding red channel in the 2×2 pixel block corresponding to the source pseudo-pixel is defined as a source pseudo-red chromaticity. The absolute difference between the pixel value of the reference pseudo pixel and the pixel value of the corresponding blue channel in the 2×2 pixel block corresponding to the reference pseudo pixel is defined as a reference pseudo blue chromaticity. The absolute difference between the pixel value of the reference pseudo-pixel and the pixel value of the corresponding red channel in the 2×2 pixel block corresponding to the reference pseudo-pixel is defined as a reference pseudo-red chromaticity. And, a luminance threshold value, a blue chrominance threshold value, and a red chrominance threshold value corresponding to the source pseudo-pixel are obtained. When the absolute difference between the pixel value of the source pseudo-pixel and the pixel value of the reference pseudo-pixel is less than the luminance threshold, the absolute difference between the source pseudo-blue chromaticity and the reference pseudo-blue chromaticity is less than the blue chrominance threshold, and the source is pseudo-red When the absolute difference between the degree and the reference pseudo-red chromaticity is less than the red chrominance threshold, it is determined that the 2×2 pixel block corresponding to the source pseudo-pixel is time-superimposed.

在本發明之一實施例中,其中取得對應來源擬似像素之亮度門檻值的步驟包括在第一擬似影像中,以來源擬似像素為中心取得一m×m像素區塊,其中m為正整數。計算m×m像素區塊中的各像素值的平均絕對誤差(Mean Absolute Error,MAE)。根據平均絕對誤差取得一亮度初始值,並根據來源擬似像素的像素值取得一亮度增益值,再以亮度初始值與亮度增益值的乘積作為對應來源擬似像素的亮度門檻值。In an embodiment of the invention, the step of obtaining a luminance threshold value corresponding to the source pseudo-pixel includes obtaining, in the first pseudo-image, an m×m pixel block centered on the source pseudo-pixel, wherein m is a positive integer. Calculate the Mean Absolute Error (MAE) of each pixel value in the m×m pixel block. An initial luminance value is obtained according to the average absolute error, and a luminance gain value is obtained according to the pixel value of the source pseudo pixel, and the product of the luminance initial value and the luminance gain value is used as the luminance threshold of the corresponding source pseudo pixel.

在本發明之一實施例中,其中取得對應來源擬似像素之藍色色度門檻值的步驟包括根據來源擬似藍色色度取得一藍色色度增益值。再以亮度初始值與藍色色度增益值的乘積作為對應來源擬似像素的藍色色度門檻值。In an embodiment of the invention, the step of obtaining a blue chrominance threshold corresponding to the source pseudo-pixel comprises obtaining a blue chrominance gain value based on the source pseudo-blue chromaticity. Then, the product of the luminance initial value and the blue chrominance gain value is used as the blue chrominance threshold of the corresponding source pseudo-pixel.

在本發明之一實施例中,其中取得對應來源擬似像素之紅色色度門檻值的步驟包括根據來源擬似紅色色度取得一紅色色度增益值,並且以亮度初始值與紅色色度增益值的乘積作為對應來源擬似像素的紅色色度門檻值。In an embodiment of the invention, the step of obtaining a red chrominance threshold corresponding to the source pseudo-pixel includes obtaining a red chrominance gain value according to the source pseudo-red chromaticity, and using the luminance initial value and the red chrominance gain value The product is used as the red chrominance threshold for the pixel of the corresponding source.

在本發明之一實施例中,其中產生對應來源擬似像素之局部疊合結果的步驟更包括定義第一權重預設值與第二權重預設值。在第一擬似影像中,以來源擬似像素為中心取得m×m像素區塊,其中m為正整數,並計算m×m像素區塊中的各像素值的平均絕對誤差。根據平均絕對誤差取得一時間疊合權重值,並且依據時間疊合權重值產生對應來源擬似像素的局部疊合結果。In an embodiment of the invention, the step of generating a partial overlay result corresponding to the source pseudo-pixel further comprises defining a first weight preset value and a second weight preset value. In the first pseudo-image, an m×m pixel block is obtained centering on the source pseudo-pixel, where m is a positive integer, and the average absolute error of each pixel value in the m×m pixel block is calculated. A time overlap weight value is obtained according to the average absolute error, and a partial overlap result corresponding to the source pseudo pixel is generated according to the time overlap weight value.

在本發明之一實施例中,其中依據時間疊合權重值產生對應來源擬似像素之局部疊合結果的步驟包括以式(1)來計算:In an embodiment of the invention, the step of generating a partial superposition result corresponding to the source pseudo-pixel according to the time-stacked weight value comprises calculating by the formula (1):

其中BR表示對應來源擬似像素的局部疊合結果。Wc表示時間疊合權重值、C_base表示預設係數。Rs、Grs、Gbs、Bs分別表示在來源擬似像素所對應之2×2像素區塊中對應紅色通道、第一綠色通道、第二綠色通道以及藍色通道的像素值。而Ra、Gra、Gba、Ba分別表示在第一動態補償結果、第二動態補償結果、第三動態補償結果與第四動態補償結果中,與來源擬似像素所對應之2×2像素區塊中的各像素處於對應位置的像素值。Where BR represents the local superposition result of the corresponding source pseudo-pixel. Wc represents the time overlap weight value, and C_base represents the preset coefficient. Rs, Grs, Gbs, and Bs respectively represent pixel values of the corresponding red channel, the first green channel, the second green channel, and the blue channel in the 2×2 pixel block corresponding to the source pseudo pixel. And Ra, Gra, Gba, and Ba respectively indicate that in the first dynamic compensation result, the second dynamic compensation result, the third dynamic compensation result, and the fourth dynamic compensation result, in the 2×2 pixel block corresponding to the source pseudo pixel Each pixel is at the pixel value of the corresponding position.

基於上述,本發明在對符合貝爾圖色彩排列規則的來源影像進行雜訊消除時,利用至少一張參考影像以取得對應不同色彩通道的動態補償結果,並利用上述動態補償結果先對來源影像進行一次時間疊合處理,接著再對由時間疊合處理所產生的結果進行空間去雜訊處理,據此有效地消除雜訊對來源影像造成的負面影響。Based on the above, the present invention uses at least one reference image to obtain dynamic compensation results corresponding to different color channels when performing noise cancellation on the source image conforming to the Belle color arrangement rule, and uses the dynamic compensation result to perform the source image first. The time overlap processing is performed, and then the result of the time superimposition processing is spatially denoised, thereby effectively eliminating the negative influence of the noise on the source image.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the present invention will be more apparent from the following description.

圖1是依照本發明之一實施例所繪示之雜訊抑制方法的流程圖。本實施例所述之雜訊抑制方法係利用至少一張參考影像來濾除來源影像中的雜訊,此方法適用於具有電荷耦合元件(Charge Coupled Device,CCD)或互補性氧化金屬半導體(Complementary Metal-Oxide Semiconductor,CMOS)等影像感測元件的數位影像擷取裝置,例如數位相機或數位攝影機等等。由於影像感測元件只能偵測光線的強度而無法辨別光線的波長,因此不能分辨出色彩,故需要在影像感測元件前加裝一貝爾(Bayer)濾鏡,以分別過濾出紅光、藍光以及綠光,進而才能取得紅、藍、綠三色的強度。換句話說,在本實施例要去除雜訊的來源影像中,每一像素係依照貝爾圖(Bayer pattern)色彩排列規則而具有對應紅色通道(R color channel)、第一綠色通道(Gr color channel)、第二綠色通道(Gb color channel)以及藍色通道(B color channel)其中之一色彩通道的像素值。FIG. 1 is a flow chart of a method for suppressing noise according to an embodiment of the invention. The noise suppression method in this embodiment uses at least one reference image to filter out noise in the source image. The method is applicable to a charge coupled device (CCD) or a complementary metal oxide semiconductor (Complementary). A digital image capturing device such as a digital camera or a digital camera, such as a metal-Oxide semiconductor (CMOS). Since the image sensing component can only detect the intensity of the light and cannot distinguish the wavelength of the light, the color cannot be distinguished. Therefore, a Bayer filter needs to be installed in front of the image sensing component to filter out the red light, Blue light and green light can achieve the intensity of red, blue and green. In other words, in the source image from which the noise is to be removed in this embodiment, each pixel has a corresponding red channel (R color channel) and a first green channel (Gr color channel according to the Bayer pattern color arrangement rule). ), the pixel value of one of the second green channel (Gb color channel) and the blue color channel (B color channel).

以圖2所示之來源影像200為例,來源影像200具有8×6個像素,而該些像素可分為12個大小為2×2的像素區塊(例如像素區塊210_a、220_a)。每一像素區塊包括四個像素,其中左上像素具有對應第一綠色通道的像素值(在圖2中標示為Gr)、右上像素具有對應紅色通道的像素值(在圖2中標示為R)、左下像素具有對應藍色通道的像素值(在圖2中標示為B)、而右下像素具有對應第二綠色通道的像素值(在圖2中標示為Gb)。在其他實施例中,每一像素區塊所包括之左上、右上、左下以及右下像素所具有的像素值也可以分別對應紅色通道、第一綠色通道、第二綠色通道,以及藍色通道。Taking the source image 200 shown in FIG. 2 as an example, the source image 200 has 8×6 pixels, and the pixels can be divided into 12 pixel blocks (eg, pixel blocks 210_a, 220_a) having a size of 2×2. Each pixel block includes four pixels, wherein the upper left pixel has a pixel value corresponding to the first green channel (labeled as Gr in FIG. 2), and the upper right pixel has a pixel value corresponding to the red channel (labeled as R in FIG. 2) The lower left pixel has a pixel value corresponding to the blue channel (labeled B in FIG. 2), and the lower right pixel has a pixel value corresponding to the second green channel (labeled as Gb in FIG. 2). In other embodiments, the pixel values of the upper left, upper right, lower left, and lower right pixels included in each pixel block may also correspond to the red channel, the first green channel, the second green channel, and the blue channel, respectively.

在本實施例中,用以輔助濾除雜訊的參考影像和來源影像具有相同的大小。假設來源影像包括n個2×2像素區塊(n為正整數),那麼參考影像亦包括n個2×2像素區塊,且參考影像之每一像素區塊中的各個像素也是依照貝爾圖色彩排列規則而具有對應紅色通道、第一綠色通道、第二綠色通道以及藍色通道其中之一色彩通道的像素值。In this embodiment, the reference image and the source image for assisting in filtering noise have the same size. Assuming that the source image includes n 2×2 pixel blocks (n is a positive integer), the reference image also includes n 2×2 pixel blocks, and each pixel in each pixel block of the reference image is also in accordance with the Bell diagram. The color arrangement rules have pixel values corresponding to one of the red channel, the first green channel, the second green channel, and the blue channel.

以下將說明利用參考影像濾除來源影像之雜訊的詳細步驟。首先如步驟S210所示,產生對應來源影像的第一擬似影像以及對應參考影像的第二擬似影像。若來源影像包括n個2×2像素區塊,第一擬似影像則包括n個來源擬似像素,且各來源擬似像素分別對應來源影像中的一個2×2像素區塊。而第二擬似影像包括n個參考擬似像素,且各參考擬似像素分別對應參考影像中的一個2×2像素區塊。換言之,倘若來源影像與參考影像的大小為W×H,那麼第一擬似影像與第二擬似影像的大小則會是(W/2)×(H/2)。The detailed steps of filtering the noise of the source image using the reference image will be described below. First, as shown in step S210, a first pseudo image corresponding to the source image and a second pseudo image corresponding to the reference image are generated. If the source image includes n 2×2 pixel blocks, the first quasi-image includes n source pseudo-pixels, and each source pseudo-pixel corresponds to a 2×2 pixel block in the source image. The second pseudo-image includes n reference pseudo-pixels, and each reference quasi-pixel corresponds to a 2×2 pixel block in the reference image. In other words, if the size of the source image and the reference image is W×H, the size of the first pseudo image and the second pseudo image may be (W/2)×(H/2).

以圖2所示之來源影像200為例,對應來源影像200所產生的第一擬似影像300如圖3所示。請同時參閱圖2與圖3,第一擬似影像300中的來源擬似像素210_b係對應來源影像200中的像素區塊210_a、第一擬似影像300中的來源擬似像素220_b則是對應來源影像200中的像素區塊220_a,以此類推。在本實施利中,第一擬似影像300之每一來源擬似像素的像素值會是所對應之像素區塊中的四個像素值的平均。例如,來源擬似像素210_b的像素值是像素區塊210_a所包括之左上、右上、左下以及右下這四個像素的像素值平均。Taking the source image 200 shown in FIG. 2 as an example, the first pseudo image 300 generated corresponding to the source image 200 is as shown in FIG. 3. Referring to FIG. 2 and FIG. 3 , the source pseudo-pixel 210_b in the first pseudo-image 300 corresponds to the pixel block 210_a in the source image 200, and the source pseudo-pixel 220_b in the first quasi-image 300 is in the corresponding source image 200. Pixel block 220_a, and so on. In this implementation, the pixel value of each source of the first pseudo-image 300 may be an average of four pixel values in the corresponding pixel block. For example, the pixel value of the source pseudo-pixel 210_b is the pixel value average of the four pixels of the upper left, upper right, lower left, and lower right included in the pixel block 210_a.

由於來源影像與參考影像中的每一像素係分別對應藍色、紅色以及綠色其中一種顏色,因此無法直接利用來源影像與參考影像來計算稍後進行移動補償處理時所需要的移動向量。對此,本實施例將利用第一與第二擬似影像來計算移動向量。如步驟S120所示,計算第一擬似影像與第二擬似影像之間的全域移動向量。接著在步驟S130中,依據全域移動向量對參考影像進行動態補償處理,進而取得多個動態補償結果。Since each of the source image and the reference image corresponds to one of blue, red, and green, respectively, the source image and the reference image cannot be directly used to calculate the motion vector required for the motion compensation process to be performed later. In this regard, the present embodiment will utilize the first and second pseudo-images to calculate the motion vector. As shown in step S120, a global motion vector between the first pseudo image and the second quasi image is calculated. Next, in step S130, the reference image is subjected to dynamic compensation processing according to the global motion vector, thereby obtaining a plurality of dynamic compensation results.

本發明並不對計算全域移動向量的方式加以限制。而在進行動態補償處理時,係先令參考影像依據全域移動向量對齊來源影像。具體而言,假設全域移動向量為(p,q),則將參考影像向右移動p個像素並向下移動q個像素。接著,從對齊結果中分離出所有對應紅色通道的像素值,以產生對應紅色通道的第一動態補償結果。類似地,分別從對齊結果中分離出所有對應第一綠色通道、第二綠色通道以及藍色通道的像素值,便可產生對應第一綠色通道的第二動態補償結果、對應第二綠色通道的第三動態補償結果,以及對應藍色通道的第四動態補償結果。The present invention does not limit the manner in which global motion vectors are computed. In the case of dynamic compensation processing, the reference image is first ordered to align the source image according to the global motion vector. Specifically, assuming that the global motion vector is (p, q), the reference image is shifted to the right by p pixels and moved downward by q pixels. Then, the pixel values of all corresponding red channels are separated from the alignment result to generate a first dynamic compensation result corresponding to the red channel. Similarly, the pixel values corresponding to the first green channel, the second green channel, and the blue channel are respectively separated from the alignment result, and the second dynamic compensation result corresponding to the first green channel is generated, corresponding to the second green channel. The third dynamic compensation result and the fourth dynamic compensation result corresponding to the blue channel.

接下來在步驟S140中,利用上述動態補償結果對來源影像進行時間疊合(temporal blending)處理以產生第一階雜訊抑制影像。在本實施例中,進行時間疊合處理時會考慮來源影像的特徵細節與亮度,進而採用不同的權重值進行疊合。產生第一階雜訊抑制影像的詳細步驟將於後配合圖示再做說明。Next, in step S140, temporal fusion processing is performed on the source image by using the dynamic compensation result to generate a first-order noise suppression image. In this embodiment, the feature details and brightness of the source image are taken into consideration when performing the time superimposition process, and then the different weight values are used for superposition. The detailed steps for generating the first-order noise suppression image will be described later in conjunction with the illustration.

最後如步驟S150所示,進一步地對第一階雜訊抑制影像進行空間去雜訊(spatial noise reduction)處理,從而產生第二階雜訊抑制影像。本發明並不對空間去雜訊處理的方式加以限制。Finally, as shown in step S150, spatial noise reduction processing is further performed on the first-order noise suppression image to generate a second-order noise suppression image. The present invention does not limit the manner in which spatial noise removal processing is performed.

如圖1所示,本實施例是透過進行時間疊合處理以及空間去雜訊處理來達到三維去除雜訊的效果。基此,對於具有高訊框率(frame rate)與高解析度的數位影像擷取裝置來說,便能藉由圖1所示之各步驟而更有效地消除其所拍攝之影像中的雜訊,進而提昇影像品質。As shown in FIG. 1 , in this embodiment, the effect of three-dimensional noise removal is achieved by performing time superimposition processing and spatial de-noise processing. Therefore, for a digital image capturing device having a high frame rate and a high resolution, the steps in the image captured by the method can be more effectively eliminated by the steps shown in FIG. News, and thus improve image quality.

以下將以圖4來說明在圖1之步驟S140中利用數個動態補償結果對來源影像進行時間疊合處理,據以產生第一階雜訊抑制影像的詳細步驟。簡言之,在本實施例中係先針對每一來源擬似像素產生一個大小為2×2像素的局部疊合結果,接著再利用每一來源擬似像素所對應的局部疊合結果來產生第一階雜訊抑制影像。The detailed steps of generating a first-order noise suppression image by using a plurality of dynamic compensation results to perform time superimposition processing on the source image in step S140 of FIG. 1 will be described below with reference to FIG. In short, in this embodiment, a partial superposition result of 2×2 pixels is generated for each source pseudo pixel, and then the partial superposition result corresponding to each source pseudo pixel is used to generate the first. Order noise suppresses the image.

請參閱圖4,首先如步驟S410所示,從第一擬似影像包括的所有來源擬似像素中取得一個來源擬似像素。舉例來說,本實施例係依據像素位置依序取得來源擬似像素。為了方便說明,以下以(x,y)表示目前要處理之來源擬似像素在第一擬似影像中的像素位置。Referring to FIG. 4, first, as shown in step S410, a source pseudo-pixel is obtained from all source pseudo-pixels included in the first pseudo-image. For example, in this embodiment, the source pseudo-pixels are sequentially obtained according to the pixel position. For convenience of explanation, the following (x, y) indicates the pixel position of the source pseudo-pixel in the first pseudo-image to be processed.

接著如步驟S420所示,在所有的參考擬似像素中找出與來源擬似像素具有對應位置的參考擬似像素。亦即,在第二擬似影像中找出位於(x,y)這個像素位置的參考擬似像素。Next, as shown in step S420, a reference quasi-pixel having a corresponding position to the source pseudo-pixel is found among all the reference pseudo-pixels. That is, the reference pseudo-pixel located at the pixel position of (x, y) is found in the second pseudo-image.

接下來在步驟S430中,根據來源擬似像素與參考擬似像素之間的顏色與亮度差距,判斷是否要對來源擬似像素所對應之2×2像素區塊進行時間疊合處理。此步驟是為了避免在來源擬似像素與參考擬似像素之間的顏色與亮度差距過大時,進行不當疊合處理而使第一階雜訊抑制影像產生鬼影(ghosting)的狀況。Next, in step S430, according to the color and brightness difference between the source pseudo-pixel and the reference pseudo-pixel, it is determined whether the 2×2 pixel block corresponding to the source pseudo-pixel is to be time-stacked. This step is to prevent the first-order noise suppression image from generating ghosting when the color-to-luminance difference between the source pseudo-pixel and the reference quasi-pixel is too large.

詳細地說,首先計算來源擬似藍色色度CBs、來源擬似紅色色度CRs、參考擬似藍色色度CBr,以及參考擬似紅色色度CRr。假設以Ys表示來源擬似像素的像素值、Bs表示在來源擬似像素所對應之2×2像素區塊中對應藍色通道的像素值,Rs表示在來源擬似像素所對應之2×2像素區塊中對應紅色通道的像素值,本實施例係將Ys與Bs的絕對差值定義為來源擬似藍色色度CBs,並將Ys與Rs的絕對差值定義為來源擬似紅色色度CRs。另外,倘若以Yr表示參考擬似像素的像素值、Br表示在參考擬似像素所對應之2×2像素區塊中對應藍色通道的像素值、Rr表示在參考擬似像素所對應之2×2像素區塊中對應紅色通道的像素值,本實施例會將Yr與Br的絕對差值定義為參考擬似藍色色度CBr,並且將Yr與Rr的絕對差值定義為參考擬似紅色色度CRr。In detail, first, the source-like blue chromaticity CBs, the source-like red chrominance CRs, the reference pseudo-blue chromaticity CBr, and the reference pseudo-red chrominance CRr are calculated. Suppose that Ys represents the pixel value of the source pseudo-pixel, Bs represents the pixel value of the corresponding blue channel in the 2×2 pixel block corresponding to the source pseudo-pixel, and Rs represents the 2×2 pixel block corresponding to the source pseudo-pixel. In this embodiment, the absolute difference between Ys and Bs is defined as the source pseudo-blue chromaticity CBs, and the absolute difference between Ys and Rs is defined as the source pseudo-red chrominance CRs. In addition, if Yr represents the pixel value of the reference pseudo pixel, Br represents the pixel value of the corresponding blue channel in the 2×2 pixel block corresponding to the reference pseudo pixel, and Rr represents the 2×2 pixel corresponding to the reference pseudo pixel. The pixel value corresponding to the red channel in the block, this embodiment defines the absolute difference between Yr and Br as the reference pseudo-blue chrominance CBr, and defines the absolute difference between Yr and Rr as the reference pseudo-red chrominance CRr.

接著取得對應來源擬似像素的亮度門檻值、藍色色度門檻值以及紅色色度門檻值。必須特別說明的是,上述門檻值都不是固定不變的數值,而會隨著目前所處理之來源擬似像素的影像特徵及亮度而有所不同。而如何取得適用的亮度門檻值、藍色色度門檻值以及紅色色度門檻值將於後配合圖示再做說明。Then, the luminance threshold value, the blue chrominance threshold value, and the red chrominance threshold value of the corresponding source pseudo-pixel are obtained. It must be specifically stated that the above threshold values are not fixed values, but will vary with the image features and brightness of the source-like pixels currently being processed. How to obtain the applicable brightness threshold, blue chrominance threshold and red chromatic threshold will be explained later with the icon.

當來源擬似像素的像素值Ys與參考擬似像素的像素值Yr的絕對差值小於亮度門檻值、來源擬似藍色色度CBs與參考擬似藍色色度CBr的絕對差值小於藍色色度門檻值,且來源擬似紅色色度CRs與參考擬似紅色色度CRr的絕對差值小於紅色色度門檻值時,表示來源擬似像素與參考擬似像素之間顏色與亮度差距在容許範圍之內,在此情況下才判定要對來源擬似像素所對應之像素區塊進行時間疊合處理。When the absolute difference between the pixel value Ys of the source pseudo-pixel and the pixel value Yr of the reference pseudo-pixel is smaller than the luminance threshold, the absolute difference between the source pseudo-blue chrominance CBs and the reference pseudo-blue chrominance CBr is smaller than the blue chrominance threshold, and When the absolute difference between the source-like red chrominance CRs and the reference pseudo-red chrominance CRr is less than the red chromaticity threshold, it indicates that the color and brightness difference between the source pseudo-pixel and the reference pseudo-pixel is within the allowable range. It is determined that the pixel blocks corresponding to the source pseudo-pixels are time-stacked.

不難想見,為了產生較佳的第一階雜訊抑制影像,如何判斷是否要對像素區塊進行時間疊合處理便顯得格外重要。而亮度門檻值、藍色色度門檻值以及紅色色度門檻值的數值高低便是影響上述判斷機制之準確性的重要參數。It is not difficult to imagine that in order to generate a better first-order noise suppression image, it is particularly important to determine whether or not to perform time-stacking processing on the pixel block. The value of the threshold value of the luminance threshold, the threshold of the blue chromaticity threshold, and the threshold value of the red chromaticity threshold are important parameters that affect the accuracy of the above-mentioned judgment mechanism.

以下說明的是針對目前處理之來源擬似像素以取得對應之亮度門檻值的方式。首先,在第一擬似影像中,以來源擬似像素為中心取得大小為m×m的像素區塊,其中m為正整數。接著再計算m×m像素區塊中的各像素值的平均絕對誤差(Mean Absolute Error,MAE)。以m為3為例,圖5繪示的是以來源擬似像素(x,y)為中心且大小為3×3之像素區塊的示意圖。在此範例中,平均絕對誤差MAE的算式如下:Described below is a way to approximate a pixel of the current processing to obtain a corresponding luminance threshold. First, in the first pseudo-image, a pixel block of size m×m is obtained centering on the source pseudo-pixel, where m is a positive integer. Then, the average absolute error (MAE) of each pixel value in the m×m pixel block is calculated. Taking m as an example, FIG. 5 is a schematic diagram of a pixel block centered on a pixel (x, y) and having a size of 3×3. In this example, the average absolute error MAE is calculated as follows:

其中,N為m×m像素區塊所包括之像素的數量(在圖5所示之實施例中,N為9)、Ysi 表示m×m像素區塊中各像素的像素值,而表示m×m像素區塊中所有像素的像素平均值。本實施例將根據平均絕對誤差以取得對應的亮度初始值。Where N is the number of pixels included in the m×m pixel block (in the embodiment shown in FIG. 5, N is 9), and Ys i represents the pixel value of each pixel in the m×m pixel block, and Represents the pixel average of all pixels in an m×m pixel block. This embodiment will obtain the corresponding initial brightness value based on the average absolute error.

圖6是依照本發明之一實施例所繪示之平均絕對誤差與亮度初始值的關係曲線圖。如圖6所示,第一預設值a與第二預設值b的大小係預先定義,且例如會與影像特徵有關。當平均絕對誤差的數值較小(例如小於M1)時,表示對應的來源擬似像素係處於影像中較為平坦的區域,一般而言影像中的平坦區域較利於去除雜訊,因此當平均絕對誤差小於M1時,所對應的亮度初始值為數值較高的第二預設值b,基此能提高進行時間疊合處理的機會。反之,當平均絕對誤差越大(例如大於M2)時,表示來源擬似像素可能具有如硬邊(hard edge)等影像特徵。由於對硬邊處進行不當的疊合處理容易產生鬼影情形,因此在平均絕對誤差大於M2時,所對應的亮度初始值為數值較低的第一預設值a,據以減少進行時間疊合處理的機會。而介於M1與M2之間的平均絕對誤差,則會線性對應至介於第一預設值a與第二預設值b之間的亮度初始值。FIG. 6 is a graph showing the relationship between the average absolute error and the initial brightness value according to an embodiment of the invention. As shown in FIG. 6, the sizes of the first preset value a and the second preset value b are predefined and related to, for example, image features. When the value of the average absolute error is small (for example, less than M1), it indicates that the corresponding source pseudo-pixel system is in a relatively flat region of the image. Generally, the flat region in the image is more favorable for removing noise, so when the average absolute error is smaller than At M1, the corresponding initial brightness value is a second predetermined value b with a higher value, which can improve the chance of performing the time overlapping process. Conversely, when the average absolute error is larger (eg, greater than M2), it indicates that the source pseudo-pixel may have image features such as hard edges. Since the ghosting situation is easily generated by improperly superimposing the hard edges, when the average absolute error is greater than M2, the corresponding initial brightness value is the first preset value a with a lower value, thereby reducing the time stack. The opportunity to deal with. The average absolute error between M1 and M2 linearly corresponds to the initial luminance value between the first preset value a and the second preset value b.

圖7是依照本發明之一實施例所繪示之來源擬似像素之像素值與亮度增益值的關係曲線圖。如圖7所示,預先定義的第三預設值c與第四預設值d例如會與影像亮度有關。而當來源擬似像素的像素值越小(例如小於Y1)時,表示其亮度越低。由於影像中的暗部易有較多雜訊,為了盡可能地消除該些雜訊,當來源擬似像素的像素值小於Y1時,其對應的亮度增益值會是數值較高的第四預設值d,如此便可提升進行時間疊合處理的機會。反之,當來源擬似像素的像素值越大(例如大於Y2)時,表示其具有較高的亮度,故倘若來源擬似像素的像素值大於Y2,其對應的亮度增益值則會是數值較低的第三預設值c,以降低進行時間疊合處理的機會。而在來源擬似像素的像素值介於Y1與Y2之間的情況下,其對應的亮度增益值則會是介於第三預設值c與第四預設值d之間的數值。FIG. 7 is a graph showing pixel values of source pseudo-pixels and luminance gain values according to an embodiment of the invention. As shown in FIG. 7, the preset third preset value c and the fourth preset value d may be related to image brightness, for example. The smaller the pixel value of the source pseudo-pixel (for example, less than Y1), the lower the brightness. Since the dark part of the image is more likely to have more noise, in order to eliminate the noise as much as possible, when the pixel value of the source pseudo pixel is less than Y1, the corresponding brightness gain value will be the fourth preset value with higher value. d, this will increase the chances of time stacking. Conversely, when the pixel value of the source pseudo-pixel is larger (for example, greater than Y2), it indicates that it has higher brightness, so if the pixel value of the source pseudo-pixel is greater than Y2, the corresponding brightness gain value will be lower. The third preset value c is to reduce the chance of performing the time superposition process. In the case where the pixel value of the source pseudo pixel is between Y1 and Y2, the corresponding brightness gain value is a value between the third preset value c and the fourth preset value d.

在分別取得亮度初始值與亮度增益值後,本實施例將以亮度初始值與亮度增益值的乘積作為對應來源擬似像素的亮度門檻值。After obtaining the luminance initial value and the luminance gain value respectively, the present embodiment takes the product of the luminance initial value and the luminance gain value as the luminance threshold value of the corresponding source pseudo-pixel.

本實施例會以類似上述的方式根據所計算出的來源擬似藍色色度CBs取得一藍色色度增益值,並將平均絕對誤差所對應的亮度初始值與藍色色度增益值的乘積作為藍色色度門檻值。紅色色度門檻值的取得方式與藍色色度門檻值的取得方式相似,在根據來源擬似紅色色度CRs取得一紅色色度增益值後,將平均絕對誤差所對應的亮度初始值與紅色色度增益值的乘積作為紅色色度門檻值。In this embodiment, a blue chrominance gain value is obtained according to the calculated source pseudo blue chromaticity CBs in a manner similar to the above, and the product of the luminance initial value corresponding to the average absolute error and the blue chrominance gain value is taken as the blue chromaticity. Threshold value. The red chrominance threshold is obtained in a similar manner to the blue chrominance threshold. After obtaining a red chrominance gain value based on the source pseudo-red chrominance CRs, the initial luminance value and the red chromaticity corresponding to the average absolute error are obtained. The product of the gain values is taken as the red chrominance threshold.

請回到圖4,若步驟S430的判斷結果是不要進行時間疊合處理,接著如步驟S440所示,直接以來源擬似像素所對應之2×2像素區塊作為對應來源擬似像素的局部疊合結果。Please return to FIG. 4, if the result of the determination in step S430 is that the time superimposing process is not performed, then as shown in step S440, the 2×2 pixel block corresponding to the source pseudo-pixel is directly used as the partial superposition of the corresponding source pseudo-pixel. result.

倘若要進行時間疊合處理,則如步驟S450所示,將來源擬似像素所對應之大小為2×2的像素區塊中的各像素值與在第一動態補償結果、第二動態補償結果、第三動態補償結果,以及第四動態補償結果中處於對應位置的像素值疊合,據以產生對應來源擬似像素的局部疊合結果。在一實施例中,疊合的方式是計算位置對應之兩個像素值的平均。在另一實施例中,則會取得對應目前處理之來源擬似像素的時間疊合權重值,並依照時間疊合權重值來產生局部疊合結果。If the time superimposing process is to be performed, as shown in step S450, each pixel value in the pixel block of the size 2×2 corresponding to the source pseudo-pixel is compared with the first dynamic compensation result, the second dynamic compensation result, The third dynamic compensation result, and the pixel values at the corresponding positions in the fourth dynamic compensation result are superimposed, thereby generating a partial overlapping result corresponding to the source pseudo-pixel. In one embodiment, the method of superimposing is to calculate an average of two pixel values corresponding to the position. In another embodiment, the time overlap weight value corresponding to the currently processed source pseudo-pixel is obtained, and the partial overlap result is generated according to the time overlap weight value.

圖8是依照本發明之一實施例所繪示之平均絕對誤差與時間疊合權重值的關係曲線圖。如圖8所示,當平均絕對誤差越大(例如大於M4),表示來源擬似像素可能具有如硬邊等影像特徵,為了要產生邊緣清楚的第一階雜訊抑制影像,在以前述方式取得平均絕對誤差後,若平均絕對誤差大於M4,其對應的時間疊合權重值便是數值較高的第二權重預設值f。倘若平均絕對誤差小於M3,其對應的時間疊合權重值便是數值較低的第一權重預設值e。而倘若平均絕對誤差介於M3與M4之間,則會線性對應至介於第一權重預設值e與第二權重預設值f之間的時間疊合權重。FIG. 8 is a graph showing the relationship between the average absolute error and the time overlap weight value according to an embodiment of the invention. As shown in FIG. 8, when the average absolute error is larger (for example, greater than M4), it means that the source pseudo-pixel may have image features such as hard edges, in order to generate a first-order noise suppression image with clear edges, obtained in the foregoing manner. After the average absolute error, if the average absolute error is greater than M4, the corresponding time overlap weight value is the second weight preset value f with a higher value. If the average absolute error is less than M3, the corresponding time overlap weight value is the first weight preset value e with a lower value. If the average absolute error is between M3 and M4, it will linearly correspond to the time overlap weight between the first weight preset value e and the second weight preset value f.

本實施例例如是以式(1)來計算對應來源擬似像素的局部疊合結果BR:In this embodiment, for example, the partial superposition result BR of the corresponding source pseudo-pixel is calculated by the formula (1):

其中,Wc表示時間疊合權重值、C_base表示預設係數(例如128或512,本發明並不加以限制)。Rs、Grs、Gbs、Bs分別表示在來源擬似像素所對應之2×2像素區塊中對應紅色通道、第一綠色通道、第二綠色通道以及藍色通道的像素值。而Ra、Gra、Gba、Ba分別表示在第一動態補償結果、第二動態補償結果、第三動態補償結果與第四動態補償結果中,與來源擬似像素所對應之2×2像素區塊中的各像素處於對應位置的像素值。Wherein, Wc represents a time overlap weight value, and C_base represents a preset coefficient (for example, 128 or 512, which is not limited in the present invention). Rs, Grs, Gbs, and Bs respectively represent pixel values of the corresponding red channel, the first green channel, the second green channel, and the blue channel in the 2×2 pixel block corresponding to the source pseudo pixel. And Ra, Gra, Gba, and Ba respectively indicate that in the first dynamic compensation result, the second dynamic compensation result, the third dynamic compensation result, and the fourth dynamic compensation result, in the 2×2 pixel block corresponding to the source pseudo pixel Each pixel is at the pixel value of the corresponding position.

以圖3之第一擬似影像300為例,假設目前所處理的是第一擬似影像300中的來源擬似像素210_b。在判定要對來源擬似像素210_b所對應的像素區塊210_a進行時間疊合處理的情況下,當要對像素區塊210_a中的左上像素(其具有對應第一綠色通道的像素值)進行疊合時,假設該左上像素在來源影像200中的像素位置為(1,1)且像素值為Grs,本實施例將在對應第一綠色通道的第二動態補償結果中,找出屬於(1,1)這個像素位置的像素值Gra,接著將Grs與Gra代入算式(Wc×Grs+(C_base-Wc)×Gra)/C_base,以求得像素區塊210_a之左上像素的疊合結果。以類似的方式亦能求得像素區塊210_a之右上、左下以及右下像素的疊合結果。這四個疊合結果便是來源擬似像素210_b所對應的局部疊合結果。Taking the first pseudo-image 300 of FIG. 3 as an example, it is assumed that the source pseudo-pixel 210_b in the first pseudo-image 300 is currently processed. In the case where it is determined that the pixel block 210_a corresponding to the source pseudo-pixel 210_b is to be time-stacked, the upper left pixel (which has the pixel value corresponding to the first green channel) in the pixel block 210_a is to be superimposed. If the pixel position of the upper left pixel in the source image 200 is (1, 1) and the pixel value is Grs, this embodiment will find that the second dynamic compensation result corresponding to the first green channel belongs to (1, 1) The pixel value Gra of this pixel position, and then Grs and Gra are substituted into the equation (Wc × Grs + (C_base - Wc) × Gra) / C_base to find the superposition result of the upper left pixel of the pixel block 210_a. The result of superposition of the upper right, lower left, and lower right pixels of the pixel block 210_a can also be obtained in a similar manner. The result of these four superpositions is the partial superposition result corresponding to the source pseudo-pixel 210_b.

本實施例將反覆執行步驟S420至步驟S470,以針對每一個來源擬似像素都分別取得對應的局部疊合結果。最後如步驟S480所示,依照貝爾圖色彩排列規則重組各來源擬似像素所分別對應的局部疊合結果,以產生第一階雜訊抑制影像。其中,第一階雜訊抑制影像與來源影像的大小相同。In this embodiment, step S420 to step S470 are repeatedly performed to obtain corresponding partial overlapping results for each of the source pseudo-pixels. Finally, as shown in step S480, the partial superposition results corresponding to the respective pseudo-pixels of the respective sources are reconstructed according to the Belle color arrangement rule to generate the first-order noise suppression image. The first-order noise suppression image is the same size as the source image.

再次以圖3之第一擬似影像300為例,若以(α,β)表示對應之第一階雜訊抑制影像中的像素位置,其中α介於1至8之間且β介於1至6之間。若(1,1)是第一階雜訊抑制影像最左上角的像素位置,且(8,6)是第一階雜訊抑制影像最右下角的像素位置,那麼來源擬似像素210_b所對應的局部疊合結果將依照貝爾圖色彩排列規則而分別作為位於(1,1)、(1,2)、(2,1),以及(2,2)這四個像素的像素值,而來源擬似像素220_b所對應的局部疊合結果將依照貝爾圖色彩排列規則而分別作為位於(1,3)、(1,4)、(2,3),以及(2,4)這四個像素的像素值,以此類推。Taking the first pseudo image 300 of FIG. 3 as an example again, if (α, β) is used, the pixel position in the corresponding first-order noise suppression image is represented, where α is between 1 and 8 and β is between 1 and Between 6. If (1,1) is the pixel position of the top left corner of the first-order noise suppression image, and (8,6) is the pixel position of the bottom right corner of the first-order noise suppression image, then the source is similar to the pixel 210_b. The partial superposition result will be the pixel values of the four pixels located at (1,1), (1,2), (2,1), and (2,2) according to the Belle color arrangement rule, and the source is pseudo-like The partial superposition result corresponding to the pixel 220_b will be respectively used as the pixels of the four pixels (1, 3), (1, 4), (2, 3), and (2, 4) according to the Belle color arrangement rule. Value, and so on.

對於會連續擷取多張影像的數位影像擷取裝置來說,每次利用圖1所示之各步驟而產生的第二階雜訊抑制影像可作為去除下一張來源影像之雜訊時的參考影像。詳言之,在根據第一與第二張來源影像產生第一張第二階雜訊抑制影像後,在準備去除第三張來源影像的雜訊時,便可以第一張第二階雜訊抑制影像作為參考影像,從而取得第二張第二階雜訊抑制影像。而第二張第二階雜訊抑制影像亦可在對第四張來源影像進行去除雜訊處理時作為參考影像。如此一來,便能在有限的硬體資源環境下達到層疊(cascade)式的三維去除雜訊效果。For a digital image capturing device that continuously captures multiple images, the second-order noise suppression image generated by using each step shown in FIG. 1 can be used as a noise for removing the next source image. Reference image. In detail, after generating the first second-order noise suppression image based on the first and second source images, the first second-order noise can be obtained when preparing to remove the noise of the third source image. The image is suppressed as a reference image to obtain a second second-order noise suppression image. The second second-order noise suppression image can also be used as a reference image when the fourth source image is subjected to noise removal processing. In this way, cascaded three-dimensional noise removal can be achieved in a limited hardware resource environment.

必須特別說明的是,在上述實施例中雖然是以一張參考影像為例來對本發明進行說明,然而在其他實施例中,亦可採用多張參考影像來去除來源影像中的雜訊。當使用多張參考影像時,若判定要以前述式(1)來來計算一來源擬似像素的局部疊合結果,則需將(C_base-Wc)這部份的權重值平分給各個參考影像。由於利用多張參考影像來產生第二階雜訊抑制影像的步驟與前述實施例相同或相似,故在此不再贅述。It should be particularly noted that although the present invention is described by taking a reference image as an example in the above embodiment, in other embodiments, multiple reference images may be used to remove noise in the source image. When a plurality of reference images are used, if it is determined that the partial superposition result of a source pseudo-pixel is to be calculated by the above formula (1), the weight value of the portion of (C_base-Wc) is equally divided into the respective reference images. Since the steps of generating the second-order noise suppression image by using the plurality of reference images are the same as or similar to those of the foregoing embodiment, they are not described herein again.

綜上所述,本發明所述之雜訊抑制方法係利用來源影像與參考影像之間的關連性,分析色彩資訊而先後進行時間疊合處理以及空間去雜訊處理來達到三維去除雜訊的效果。其中,在進行時間疊合處理時會考慮影像的細節與亮暗程度,因而可避免疊合出具有鬼影情況的影像。而空間去雜訊處理更能進一步地消除雜訊,據此產生較佳的雜訊去除結果。In summary, the noise suppression method of the present invention utilizes the correlation between the source image and the reference image, analyzes the color information, and performs time superposition processing and spatial denoising processing to achieve three-dimensional noise removal. effect. Among them, the details of the image and the degree of lightness and darkness are taken into consideration when performing the time superimposition processing, thereby avoiding overlapping images with ghosting conditions. Space-to-noise processing further eliminates noise, which results in better noise removal results.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,故本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

S110~S150‧‧‧本發明之一實施例所述之雜訊抑制方法的各步驟S110~S150‧‧‧ steps of the noise suppression method according to an embodiment of the present invention

200‧‧‧來源影像200‧‧‧ source image

210_a、220_a‧‧‧像素區塊210_a, 220_a‧‧‧ pixel blocks

300‧‧‧第一擬似影像300‧‧‧First quasi-image

210_b、220_b‧‧‧來源擬似像素210_b, 220_b‧‧‧ source quasi-pixel

S410~S480‧‧‧本發明之一實施例所述之產生第一階雜訊抑制影像的各步驟S410~S480‧‧‧ steps of generating a first-order noise suppression image according to an embodiment of the present invention

a‧‧‧第一預設值A‧‧‧first preset value

b‧‧‧第二預設值B‧‧‧second preset value

M1、M2、M3、M4‧‧‧平均絕對誤差M1, M2, M3, M4‧‧‧ average absolute error

c‧‧‧第三預設值C‧‧‧ third preset value

d‧‧‧第四預設值D‧‧‧ fourth preset

Y1、Y2‧‧‧來源擬似像素的像素值Y1, Y2‧‧‧ source pixel-like pixel values

e‧‧‧第一權重預設值e‧‧‧First weight preset

f‧‧‧第二權重預設值F‧‧‧second weight preset

圖1是依照本發明之一實施例所繪示之雜訊抑制方法的流程圖。FIG. 1 is a flow chart of a method for suppressing noise according to an embodiment of the invention.

圖2是依照本發明之一實施例所繪示之來源影像的示意圖。2 is a schematic diagram of a source image according to an embodiment of the invention.

圖3是依照本發明之一實施例所繪示之第一擬似影像的示意圖。3 is a schematic diagram of a first pseudo-image as depicted in an embodiment of the invention.

圖4是依照本發明之一實施例所繪示之產生第一階雜訊抑制影像的流程圖。4 is a flow chart of generating a first-order noise suppression image according to an embodiment of the invention.

圖5是依照本發明之一實施例所繪示之以來源擬似像素為中心之像素區塊的示意圖。FIG. 5 is a schematic diagram of a pixel block centered on a source pseudo-pixel according to an embodiment of the invention.

圖6是依照本發明之一實施例所繪示之平均絕對誤差與亮度初始值的關係曲線圖。FIG. 6 is a graph showing the relationship between the average absolute error and the initial brightness value according to an embodiment of the invention.

圖7是依照本發明之一實施例所繪示之來源擬似像素之像素值與亮度增益值的關係曲線圖。FIG. 7 is a graph showing pixel values of source pseudo-pixels and luminance gain values according to an embodiment of the invention.

圖8是依照本發明之一實施例所繪示之平均絕對誤差與時間疊合權重值的關係曲線圖。FIG. 8 is a graph showing the relationship between the average absolute error and the time overlap weight value according to an embodiment of the invention.

S110~S150...本發明之一實施例所述之雜訊抑制方法的各步驟S110~S150. . . Each step of the noise suppression method according to an embodiment of the present invention

Claims (5)

一種雜訊抑制方法,以利用一參考影像濾除一來源影像中的雜訊,其中該來源影像與該參考影像分別包括n個2×2像素區塊,且各該些2×2像素區塊中的每一像素係依照貝爾圖(Bayer pattern)色彩排列規則而具有對應一紅色通道(R color channel)、一第一綠色通道(Gr color channel)、一第二綠色通道(Gb color channel)以及一藍色通道(B color channel)其中之一的像素值,且n為正整數,該方法包括:產生對應該來源影像的一第一擬似影像以及對應該參考影像的一第二擬似影像,其中該第一擬似影像包括n個來源擬似像素,且各該些來源擬似像素分別對應該來源影像中的該些2×2像素區塊其中之一,而該第二擬似影像包括n個參考擬似像素,且各該些參考擬似像素分別對應該參考影像中的該些2×2像素區塊其中之一;計算該第一擬似影像與該第二擬似影像之間的一全域移動向量;依據該全域移動向量對該參考影像進行一動態補償處理以取得多個動態補償結果;利用該些動態補償結果對該來源影像進行一時間疊合(temporal blending)處理以產生一第一階雜訊抑制影像,包括:針對各該些來源擬似像素,在該些參考擬似像素中找出與該來源擬似像素具有對應位置的該參考擬似像 素;根據該來源擬似像素與該參考擬似像素之間的顏色與亮度差距,判斷是否對該來源擬似像素所對應之2×2像素區塊進行該時間疊合處理,包括:將該來源擬似像素的像素值與該來源擬似像素所對應之2×2像素區塊中對應該藍色通道之像素值的絕對差值定義為一來源擬似藍色色度;將該來源擬似像素的像素值與該來源擬似像素所對應之2×2像素區塊中對應該紅色通道之像素值的絕對差值定義為一來源擬似紅色色度;將該參考擬似像素的像素值與該參考擬似像素所對應之2×2像素區塊中對應該藍色通道之像素值的絕對差值定義為一參考擬似藍色色度;將該參考擬似像素的像素值與該參考擬似像素所對應之2×2像素區塊中對應該紅色通道之像素值的絕對差值定義為一參考擬似紅色色度;取得對應該來源擬似像素的一亮度門檻值、一藍色色度門檻值以及一紅色色度門檻值,包括:在該第一擬似影像中,以該來源擬似像素為中心取得一m×m像素區塊,其中m為正整數;計算該m×m像素區塊中的各像素值的一平均絕對誤差(Mean Absolute Error,MAE);根據該平均絕對誤差取得一亮度初始值; 根據該來源擬似像素的像素值取得一亮度增益值;以該亮度初始值與該亮度增益值的乘積作為對應該來源擬似像素的該亮度門檻值;根據該來源擬似藍色色度取得一藍色色度增益值;以該亮度初始值與該藍色色度增益值的乘積作為對應該來源擬似像素的該藍色色度門檻值;根據該來源擬似紅色色度取得一紅色色度增益值;以及以該亮度初始值與該紅色色度增益值的乘積作為對應該來源擬似像素的該紅色色度門檻值;以及當該來源擬似像素之像素值與該參考擬似像素之像素值的絕對差值小於該亮度門檻值,該來源擬似藍色色度與該參考擬似藍色色度的絕對差值小於該藍色色度門檻值,且該來源擬似紅色色度與該參考擬似紅色色度的絕對差值小於該紅色色度門檻值時,判定要對該來源擬似像素所對應之2×2像素區塊進行該時間疊合處理;以及對該第一階雜訊抑制影像進行一空間去雜訊(spatial noise reduction)處理以產生一第二階雜訊抑制影像。 A noise suppression method for filtering noise in a source image by using a reference image, wherein the source image and the reference image respectively comprise n 2×2 pixel blocks, and each of the 2×2 pixel blocks Each of the pixels has a corresponding R color channel, a first green channel (Gr color channel), a second green channel (Gb color channel) according to a Bayer pattern color arrangement rule. a pixel value of one of the B color channels, and n is a positive integer, the method comprising: generating a first pseudo image corresponding to the source image and a second pseudo image corresponding to the image, wherein The first pseudo-image includes n source pseudo-pixels, and each of the source pseudo-pixels respectively corresponds to one of the 2×2 pixel blocks in the source image, and the second quasi-image includes n reference quasi-pixels And each of the reference pseudo-pixels respectively corresponds to one of the 2×2 pixel blocks in the image; calculating a global motion vector between the first quasi-image and the second quasi-image; The global motion vector performs a dynamic compensation process on the reference image to obtain a plurality of dynamic compensation results. The dynamic compensation result is used to perform a temporal blending process on the source image to generate a first-order noise suppression image. Included, for each of the sources, a pseudo-pixel, in which the reference quasi-like image has a corresponding position corresponding to the source pseudo-pixel And determining, according to the color and brightness difference between the source pseudo-pixel and the reference pseudo-pixel, whether to perform the time superimposition processing on the 2×2 pixel block corresponding to the source pseudo-pixel, including: the source pseudo-pixel The absolute difference between the pixel value and the pixel value corresponding to the blue channel in the 2×2 pixel block corresponding to the source pseudo-pixel is defined as a source pseudo-blue chromaticity; the pixel value of the source pseudo-pixel and the source The absolute difference of the pixel values corresponding to the red channel in the 2×2 pixel block corresponding to the pseudo-pixel is defined as a source pseudo-red chromaticity; the pixel value of the reference pseudo-pixel corresponds to the reference pseudo-pixel 2× The absolute difference value of the pixel value corresponding to the blue channel in the 2-pixel block is defined as a reference pseudo-blue chromaticity; the pixel value of the reference pseudo-pixel is in the 2×2 pixel block corresponding to the reference pseudo-pixel The absolute difference of the pixel values of the red channel should be defined as a reference pseudo-red chromaticity; a luminance threshold corresponding to the source-like pixel, a blue chrominance threshold, and a red The chrominance threshold includes: obtaining, in the first pseudo-image, an m×m pixel block centered on the source pseudo-pixel, wherein m is a positive integer; calculating each pixel value in the m×m pixel block Mean Absolute Error (MAE); obtaining an initial brightness value based on the average absolute error; Obtaining a brightness gain value according to the pixel value of the source pseudo pixel; taking the product of the brightness initial value and the brightness gain value as the brightness threshold corresponding to the pseudo pixel; obtaining a blue color according to the source pseudo blue color a gain value; a product of the luminance initial value and the blue chrominance gain value as a blue chrominance threshold corresponding to the source pseudo pixel; a red chrominance gain value obtained from the source pseudo red chromaticity; and the luminance The product of the initial value and the red chrominance gain value is used as the red chrominance threshold corresponding to the source pseudo pixel; and the absolute difference between the pixel value of the source pseudo pixel and the pixel value of the reference pseudo pixel is less than the brightness threshold a value, the absolute difference between the source-like blue chromaticity and the reference pseudo-blue chromaticity is less than the blue chromaticity threshold, and the absolute difference between the source-like red chromaticity and the reference pseudo-red chromaticity is less than the red chromaticity When the threshold is thresholded, it is determined that the time overlap processing is performed on the 2×2 pixel block corresponding to the source pseudo pixel; and the first order is The noise suppression image performs a spatial noise reduction process to generate a second order noise suppression image. 如申請專利範圍第1項所述之雜訊抑制方法,其中依據該全域移動向量對該參考影像進行該動態補償處理以取得該些動態補償結果的步驟包括: 令該參考影像依據該全域移動向量對齊該來源影像以產生分別對應該紅色通道、該第一綠色通道、該第二綠色通道以及該藍色通道的一第一動態補償結果、一第二動態補償結果、一第三動態補償結果,以及一第四動態補償結果。 The method for suppressing noise according to claim 1, wherein the step of performing the dynamic compensation processing on the reference image according to the global motion vector to obtain the dynamic compensation results comprises: Aligning the source image according to the global motion vector to generate a first dynamic compensation result corresponding to the red channel, the first green channel, the second green channel, and the blue channel, and a second dynamic compensation The result, a third dynamic compensation result, and a fourth dynamic compensation result. 如申請專利範圍第2項所述之雜訊抑制方法,其中利用該些動態補償結果對該來源影像進行該時間疊合處理以產生該第一階雜訊抑制影像的步驟更包括:當判斷對該來源擬似像素所對應之2×2像素區塊進行該時間疊合處理時,則將該來源擬似像素所對應之2×2像素區塊中的各像素值與在該第一動態補償結果、該第二動態補償結果、該第三動態補償結果,以及該第四動態補償結果中處於對應位置的像素值疊合,以產生對應該來源擬似像素的一局部疊合結果;當判斷不對該來源擬似像素所對應之2×2像素區塊進行該時間疊合處理時,則以該來源擬似像素所對應之2×2像素區塊作為對應該來源擬似像素的該局部疊合結果;以及依照貝爾圖色彩排列規則重組各該來源擬似像素所分別對應的該局部疊合結果,以產生該第一階雜訊抑制影像。 The method for suppressing noise according to claim 2, wherein the step of performing the time superimposition processing on the source image by using the dynamic compensation results to generate the first-order noise suppression image further comprises: when determining When the source is similar to the 2×2 pixel block corresponding to the pixel, when the time overlap processing is performed, each pixel value in the 2×2 pixel block corresponding to the source pseudo pixel is compared with the first dynamic compensation result. The second dynamic compensation result, the third dynamic compensation result, and the pixel values at the corresponding positions in the fourth dynamic compensation result are superimposed to generate a partial overlapping result corresponding to the source pseudo pixel; when the source is not determined When the 2×2 pixel block corresponding to the pseudo-pixel is subjected to the time superimposition processing, the 2×2 pixel block corresponding to the source pseudo-pixel is used as the local superposition result corresponding to the pseudo-pixel; and according to Bell The color arrangement rule reorganizes the partial superposition results corresponding to the respective pseudo-pixels of the source to generate the first-order noise suppression image. 如申請專利範圍第3項所述之雜訊抑制方法,其中產生對應該來源擬似像素之該局部疊合結果的步驟更包括: 根據該平均絕對誤差取得一時間疊合權重值;以及依據該時間疊合權重值產生對應該來源擬似像素的該局部疊合結果。 The method for suppressing noise according to claim 3, wherein the step of generating the partial overlap result corresponding to the source of the pseudo-pixels further comprises: And obtaining a time overlap weight value according to the average absolute error; and generating the partial overlap result corresponding to the source pseudo pixel according to the time overlap weight value. 如申請專利範圍第4項所述之雜訊抑制方法,其中依據該時間疊合權重值產生對應該來源擬似像素之該局部疊合結果的步驟包括以式(1)來計算: 其中BR表示對應該來源擬似像素的該局部疊合結果,Wc表示該時間疊合權重值、C_base表示一預設係數,Rs、Grs、Gbs、Bs分別表示在該來源擬似像素所對應之2×2像素區塊中對應該紅色通道、該第一綠色通道、該第二綠色通道以及該藍色通道的像素值,Ra、Gra、Gba、Ba分別表示在該第一動態補償結果、該第二動態補償結果、該第三動態補償結果與該第四動態補償結果中,與該來源擬似像素所對應之2×2像素區塊中的各像素處於對應位置的像素值。The method for suppressing noise according to claim 4, wherein the step of generating the partial overlap result corresponding to the source pseudo pixel according to the time overlap weight value comprises calculating by the formula (1): Where BR denotes the partial superposition result corresponding to the source pseudo-pixel, Wc denotes the time superimposed weight value, C_base denotes a preset coefficient, and Rs, Grs, Gbs, Bs respectively represent 2× corresponding to the source pseudo-pixel The pixel values corresponding to the red channel, the first green channel, the second green channel, and the blue channel in the 2 pixel block, Ra, Gra, Gba, and Ba respectively represent the first dynamic compensation result and the second In the dynamic compensation result, the third dynamic compensation result, and the fourth dynamic compensation result, each pixel in the 2×2 pixel block corresponding to the source pseudo pixel is at a pixel value corresponding to the position.
TW99147316A 2010-12-31 2010-12-31 Noise reduction method TWI459795B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW99147316A TWI459795B (en) 2010-12-31 2010-12-31 Noise reduction method
CN201110094256.XA CN102547160B (en) 2010-12-31 2011-04-13 Noise point suppression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99147316A TWI459795B (en) 2010-12-31 2010-12-31 Noise reduction method

Publications (2)

Publication Number Publication Date
TW201228346A TW201228346A (en) 2012-07-01
TWI459795B true TWI459795B (en) 2014-11-01

Family

ID=46352994

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99147316A TWI459795B (en) 2010-12-31 2010-12-31 Noise reduction method

Country Status (2)

Country Link
CN (1) CN102547160B (en)
TW (1) TWI459795B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100405150B1 (en) * 2001-06-29 2003-11-10 주식회사 성진씨앤씨 Method of adaptive noise smoothing/restoration in spatio-temporal domain and high-definition image capturing device thereof
US8340185B2 (en) * 2006-06-27 2012-12-25 Marvell World Trade Ltd. Systems and methods for a motion compensated picture rate converter
CN101175219B (en) * 2006-11-03 2010-11-03 兆宏电子股份有限公司 Color interpolation method and image processing apparatus using the same
TWI423666B (en) * 2008-12-31 2014-01-11 Altek Corp Image elimination method for image sequence

Also Published As

Publication number Publication date
CN102547160A (en) 2012-07-04
TW201228346A (en) 2012-07-01
CN102547160B (en) 2014-07-02

Similar Documents

Publication Publication Date Title
TWI407800B (en) Improved processing of mosaic images
US8295595B2 (en) Generating full color images by demosaicing noise removed pixels from images
US8068700B2 (en) Image processing apparatus, image processing method, and electronic appliance
JP6352617B2 (en) Video processing apparatus and method
US20150310594A1 (en) Method for imaging processing, and image processing device
KR101665137B1 (en) Apparatus and method for reducing noise from image sensor
JP2004522372A (en) Spatio-temporal adaptive noise removal / high-quality image restoration method and high-quality image input device using the same
TWI459810B (en) Image processing apparatus and processing method thereof
TWI382754B (en) Method of adjusting blur image
CN110517206B (en) Method and device for eliminating color moire
JP2009303139A (en) Solid-state imaging apparatus
TWI423666B (en) Image elimination method for image sequence
CN111539893A (en) Bayer image joint demosaicing denoising method based on guided filtering
CN112400185A (en) Method, device and system for multi-stage bilateral noise filtering
WO2017154293A1 (en) Image processing apparatus, imaging apparatus, image processing method, and program
TWI528815B (en) Image processing method capable of reducing image noise
JP2012142827A (en) Image processing device and image processing method
US8532373B2 (en) Joint color channel image noise filtering and edge enhancement in the Bayer domain
CN104038752A (en) Multi-view video histogram color correcting method based on three-dimensional Gaussian mixed model
CN101778297B (en) Interference elimination method of image sequence
US8693798B2 (en) Image sharpness processing apparatus and image sharpness processing method
TWI459795B (en) Noise reduction method
TWI479455B (en) Method for generating all-in-focus image
TW201441974A (en) Global spatial domain detail controlling method
US9076200B2 (en) Method and apparatus for reducing noise of digital image

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees