TWI664606B - Method and system for filtering signals using a dynamic window smoothing filter - Google Patents

Method and system for filtering signals using a dynamic window smoothing filter Download PDF

Info

Publication number
TWI664606B
TWI664606B TW107128458A TW107128458A TWI664606B TW I664606 B TWI664606 B TW I664606B TW 107128458 A TW107128458 A TW 107128458A TW 107128458 A TW107128458 A TW 107128458A TW I664606 B TWI664606 B TW I664606B
Authority
TW
Taiwan
Prior art keywords
signal
filtering
value
dynamic window
window
Prior art date
Application number
TW107128458A
Other languages
Chinese (zh)
Other versions
TW202009867A (en
Inventor
周暘庭
姜昊天
陳世澤
Original Assignee
瑞昱半導體股份有限公司
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 瑞昱半導體股份有限公司 filed Critical 瑞昱半導體股份有限公司
Priority to TW107128458A priority Critical patent/TWI664606B/en
Application granted granted Critical
Publication of TWI664606B publication Critical patent/TWI664606B/en
Publication of TW202009867A publication Critical patent/TW202009867A/en

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Picture Signal Circuits (AREA)

Abstract

一種利用動態視窗平滑濾波器的訊號濾波方法,以及實現方法的系統,在方法中,接收影像訊號,或是聲音訊號,並取得訊號的統計值,如一種直方圖統計,接著根據一最大濾波視窗寬度,於前後訊號變化大的訊號值上,往前尋找或向後尋找一濾波視窗寬度,此濾波視窗寬度將依據需求而可調整,於是將根據此濾波視窗寬度執行動態視窗平滑濾波,並可運算一累積分布函數,得到相對平滑而符合原始訊號趨勢的累積分布函數,之後將經過動態視窗平滑濾波後的訊號值映射至輸出訊號。 A signal filtering method using a dynamic window smoothing filter and a system for implementing the method. In the method, an image signal or a sound signal is received, and a statistical value of the signal is obtained, such as a histogram statistics, and then based on a maximum filtering window Width. On the signal value where the front and rear signals change greatly, look forward or backward to find a filter window width. This filter window width will be adjusted according to the requirements. Therefore, a dynamic window smoothing filter will be performed according to this filter window width. A cumulative distribution function to obtain a relatively smooth cumulative distribution function that conforms to the original signal trend, and then maps the signal value after dynamic window smoothing filtering to the output signal.

Description

利用動態視窗平滑濾波器的訊號濾波方法與系統 Signal filtering method and system using dynamic window smoothing filter

說明書關於一種訊號濾波方法,特別是以利用非固定視窗的一種使用動態視窗平滑濾波器的訊號濾波方法與系統。 The description relates to a signal filtering method, especially a signal filtering method and system using a dynamic window smoothing filter using a non-fixed window.

直方圖(Histogram)統計常用於影像處理中,可用來分析影像數據,例如通過直方圖呈現圖像中的影像亮度與對比分布,如此也提供使用者可通過直方圖調整影像訊號分布,並對整體亮度重新分配,可以藉此調整整體影像的特性,例如提昇對比度、提昇影像暗部的亮度、解像力調整等。 Histogram statistics are often used in image processing and can be used to analyze image data. For example, the histogram is used to display the image brightness and contrast distribution in the image. This also provides users with the ability to adjust the image signal distribution through the histogram, and Brightness redistribution can be used to adjust the characteristics of the overall image, such as increasing contrast, increasing the brightness of dark parts of the image, and adjusting resolution.

然而,利用直方圖在這過程中往往會因為連續的像素值間的統計量差異過大,導致計算的累積分布函數(Cumulative Distribution Function,CDF)的斜率過陡,若以影像處理為例,可能在畫面上會過度強化,呈現出同樣區域中亮暗差異過大的不自然現象。因此,習知技術也會在統計的直方圖上進行平滑濾波器(smoother)處理,用於模糊化與去除雜訊,可使得連續像素值間的統計量不會有急遽增加的情形,以緩解圖像上不自然的狀況。 However, in the process of using the histogram, the slope of the calculated Cumulative Distribution Function (CDF) is often too steep due to the statistical difference between consecutive pixel values. If image processing is used as an example, The picture will be over-emphasized, showing an unnatural phenomenon with too much difference between light and dark in the same area. Therefore, the conventional technique also performs a smoothing filter (smoother) processing on the statistical histogram for blurring and removing noise, so that the statistics between consecutive pixel values will not increase sharply, in order to alleviate Unnatural conditions on the image.

常見平滑濾波器有很多不同的類型,而這些類型往往都會在最亮與最暗數值上使用鏡射(Mirroring)或是補白(Padding)或是剪裁(Clipping)的方式來進行使濾波器可以用預先設定好的視窗大小進行計算,但這樣往往會使得在較亮與較暗的資料處理上 與原生訊號有很大的差距。換句話說,這類的做法會讓畫面的暗處與亮處並不協調。 There are many different types of common smoothing filters, and these types often use Mirroring, Padding, or Clipping on the brightest and darkest values to make the filter available. The pre-set window size is calculated, but this often results in lighter and darker data processing. There is a big gap with the native signal. In other words, this kind of approach will make the dark and bright parts of the picture uncoordinated.

舉例來說,如圖1A所示之直方圖,在影像中最亮與最暗處設定一視窗10,避免影像差異過大,對視窗10邊界的影像訊號執行鏡射處理(Mirroring),在像素值-1,-2與-3處複製視窗10中像素值1,2,3的值,形成視窗10外的鏡射區101,同理形成鏡射區102,如此雖可以解決部分累積分布函數斜率過陡的問題,但是在特定情況下仍產生不自然現象。例如,當像素值為0時的累積分布函數值若為2,像素值為1時的累積分布函數值為23,以3x1濾波器處理後,在像素值為0時的平滑濾波結果為(23+2+23)/3=16,如此將與原本像素值0時的2差異過大。 For example, as shown in the histogram shown in FIG. 1A, a window 10 is set in the brightest and darkest part of the image to avoid excessive image differences. Mirroring is performed on the image signal at the boundary of the window 10, and the pixel value -1, -2, and -3 copy the pixel values 1,2,3 in window 10 to form the mirror region 101 outside the window 10, and the mirror region 102 is formed in the same way. Although this can solve part of the cumulative distribution function slope The problem is too steep, but it still produces unnatural phenomena under certain circumstances. For example, if the cumulative distribution function value is 2 when the pixel value is 0, and the cumulative distribution function value is 23 when the pixel value is 1, after processing with a 3x1 filter, the smooth filtering result when the pixel value is 0 is (23 + 2 + 23) / 3 = 16, which will be too different from 2 when the original pixel value is 0.

圖1B顯示的直方圖係在視窗11邊界執行補白處理(Padding),如圖所示,視窗11的像素值0以外像素值-1,-2與-3(補白區103)以及像素值255之外(補白區104)都補零。同樣以上述像素值為0時的累積分布函數值若為2以及像素值為1時的累積分布函數值為23為例,以3x1濾波器處理後,在像素值為0時的平滑濾波結果為(0+2+23)/3=8,與原本像素值0時的2有不小的差距,也產生不自然的現象。 The histogram shown in FIG. 1B performs padding on the border of window 11. As shown in the figure, pixel values -1, -2, and -3 (padding area 103) and pixel values 255 other than pixel value 0 of window 11 are 0. Outside (filling area 104) are filled with zeros. Similarly, if the cumulative distribution function value when the pixel value is 0 is 2 and the cumulative distribution function value is 23 when the pixel value is 1, for example, after 3x1 filter processing, the smooth filtering result when the pixel value is 0 is (0 + 2 + 23) / 3 = 8, which is not too small from 2 when the original pixel value is 0, and also produces an unnatural phenomenon.

圖1C則顯示執行剪裁(Clipping)處理的直方圖,像素值0到255之間形成一個視窗12,邊界經剪裁處理後,形成圖示中像素值0以外的剪裁區105,也就將像素值-1,-2與-3的值剪裁如同像素值0的高度,另在像素值255以外也形成剪裁區106。若以上述範例而言,經平滑濾波中剪裁處理後的累積分布函數,在像素值0的結果為(2+2+23)/3=9,結果都與原先統計的累積分布函數值2相差不小,同理,在像素值255處也存在著相同的問題。 FIG. 1C shows a histogram that performs clipping processing. A window 12 is formed between the pixel values 0 to 255. After the boundary is processed, a clipping area 105 other than the pixel value 0 in the figure is formed. The values of -1, -2, and -3 are clipped as the height of the pixel value 0, and the clip area 106 is formed in addition to the pixel value 255. Taking the above example, the cumulative distribution function after the clipping process in the smoothing filter, the result at the pixel value 0 is (2 + 2 + 23) / 3 = 9, and the results are all different from the original cumulative distribution function value 2 No small, for the same reason, the same problem exists at the pixel value of 255.

有鑑於習知技術利用平滑化濾波改善統計值在連續像素值間 的統計量差異過大而導致計算的累積分布函數(Cumulative Distribution Function,CDF)斜率過陡的問題時,仍可能在較暗處與較亮處無法取得有參考價值的統計量,為了克服這個問題,說明書公開一種利用動態視窗平滑濾波器的訊號濾波方法,能以非固定的視窗大小計算有效參考統計量而避免在計算累積分布函數時較暗處或較亮處的斜率過陡現象。 In view of the conventional technology, smoothing filtering is used to improve the statistical value between consecutive pixel values. When the difference of the statistics is too large and the calculated Cumulative Distribution Function (CDF) slope is too steep, it may still be impossible to obtain reference statistics in the darker and brighter areas. In order to overcome this problem, The specification discloses a signal filtering method using a dynamic window smoothing filter, which can calculate effective reference statistics with a non-fixed window size and avoid excessively steep slopes in darker or brighter areas when calculating the cumulative distribution function.

根據利用動態視窗平滑濾波器的訊號濾波方法的實施例,應用在影像訊號、聲音訊號,或是其他,先取得訊號的一統計值,並能在前後訊號變化較大的訊號值前後,根據一最大濾波視窗寬度往前尋找或向後尋找一濾波視窗寬度,之後根據濾波視窗寬度執行動態視窗平滑濾波,並將經過動態視窗平滑濾波後的訊號值映射至輸出訊號。 According to the embodiment of the signal filtering method using the dynamic window smoothing filter, it is applied to image signals, sound signals, or other. First, a statistical value of the signal can be obtained first, and before and after the signal value with a large change in signal before and after, according to a The maximum filtering window width is searched forward or backward to find a filtering window width, and then dynamic window smoothing filtering is performed according to the filtering window width, and the signal value after the dynamic window smoothing filtering is mapped to the output signal.

在一方法實施例中,於執行動態視窗平滑濾波之後,可運算一累積分布函數,並再執行一次動態視窗平滑濾波。其中,可以在取得訊號的統計值時,更執行一對比限制的步驟,步驟包括取得一最大訊號值,加總所有訊號值,以加總的訊號值除以最大訊號值,計算一平均訊號統計值後,判斷是否有訊號值大於一門檻,如果有,即限制訊號值,使得訊號值不超過門檻。 In a method embodiment, after performing the dynamic window smoothing filtering, a cumulative distribution function may be calculated and the dynamic window smoothing filtering may be performed again. Wherein, when obtaining the statistical value of the signal, a step of comparison limitation may be further performed. The steps include obtaining a maximum signal value, summing all signal values, dividing the total signal value by the maximum signal value, and calculating an average signal statistics. After the value, determine whether any signal value is greater than a threshold. If so, the signal value is limited so that the signal value does not exceed the threshold.

而相關利用動態視窗平滑濾波器的訊號濾波系統係可應用於一電腦系統,其中包括接收訊號的輸入介面、暫存記憶體、一訊號處理單元,以及以軟體模組實現的統計模組與動態視窗平滑濾波模組,訊號處理單元對輸入訊號執行一利用動態視窗平滑濾波器的訊號濾波方法。 The related signal filtering system using a dynamic window smoothing filter can be applied to a computer system, which includes an input interface for receiving signals, a temporary memory, a signal processing unit, and a statistical module and dynamics implemented by software modules. The window smoothing filter module, the signal processing unit executes a signal filtering method using a dynamic window smoothing filter on the input signal.

為了能更進一步瞭解本發明為達成既定目的所採取之技術、方法及功效,請參閱以下有關本發明之詳細說明、圖式,相信本發明之目的、特徵與特點,當可由此得以深入且具體之瞭解,然而所附圖式僅提供參考與說明用,並非用來對本發明加以限制。 In order to further understand the technology, methods and effects adopted by the present invention to achieve the intended purpose, please refer to the following detailed description and drawings of the present invention. It is believed that the purpose, features and characteristics of the present invention can be deepened and specific It is understood, however, the drawings are provided for reference and description only, and are not intended to limit the present invention.

10,11,12‧‧‧視窗 10,11,12‧‧‧window

101,102‧‧‧鏡射區 101,102‧‧‧Mirror area

103,104‧‧‧補白區 103,104‧‧‧Filling area

105,106‧‧‧剪裁區 105,106‧‧‧cut area

201‧‧‧輸入訊號 201‧‧‧ input signal

21‧‧‧輸入介面 21‧‧‧Input interface

22‧‧‧訊號處理單元 22‧‧‧Signal Processing Unit

23‧‧‧統計模組 23‧‧‧Statistics Module

24‧‧‧動態視窗平滑濾波模組 24‧‧‧Dynamic window smoothing filter module

25‧‧‧暫存記憶體 25‧‧‧Temporary memory

26‧‧‧輸出介面 26‧‧‧Output interface

202‧‧‧輸出訊號 202‧‧‧output signal

501,502,503‧‧‧濾波視窗 501,502,503‧‧‧Filter window

701‧‧‧原統計曲線 701‧‧‧The original statistical curve

702‧‧‧鏡射濾波統計曲線 702‧‧‧Mirror filter statistical curve

703‧‧‧剪裁濾波統計曲線 703‧‧‧Cropped filter statistical curve

704‧‧‧補白濾波統計曲線 704‧‧‧Filling filter statistical curve

705‧‧‧動態視窗平滑濾波統計曲線 705‧‧‧Dynamic window smoothing filtering statistical curve

801‧‧‧動態視窗強度曲線 801‧‧‧Dynamic window intensity curve

802‧‧‧鏡射視窗強度曲線 802‧‧‧Mirror window intensity curve

803‧‧‧剪裁視窗強度曲線 803‧‧‧Clip window intensity curve

804‧‧‧補白視窗強度曲線 804‧‧‧Filling window intensity curve

步驟S301~S315‧‧‧訊號濾波流程 Steps S301 ~ S315‧‧‧Signal filtering process

步驟S601~S607‧‧‧決定濾波視窗寬度的流程 Steps S601 ~ S607‧‧‧‧Determining the filtering window width

圖1A至1C分別描述習知應用鏡射、補白與剪裁等平滑濾波的示意圖;圖2描述一個訊號處理系統的功能方塊實施例圖;圖3所示為描述利用動態視窗平滑濾波器的訊號濾波方法的實施例流程圖;圖4A~4C描述應用對比限制程序後的曲線圖;圖5示意表示動態視窗平滑濾波器採用的動態濾波視窗實施例圖;圖6描述利用動態視窗平滑濾波器的訊號濾波方法中決定濾波視窗寬度的實施例流程圖;圖7顯示通過不同的濾波手段得到直方圖統計值的平滑效果曲線圖;圖8顯示經過各式平滑濾波器後的累積分布函數得到的輸出強度曲線圖;圖9顯示可應用利用動態視窗平滑濾波器的訊號濾波方法的聲音訊號。 Figures 1A to 1C respectively describe the conventional application of smooth filtering such as mirroring, filler and clipping; Figure 2 describes a functional block embodiment of a signal processing system; Figure 3 shows the signal filtering using a dynamic window smoothing filter Method embodiment flowchart; Figures 4A to 4C describe the graphs after the application of the contrast limit program; Figure 5 schematically shows an embodiment of the dynamic filtering window used by the dynamic window smoothing filter; Figure 6 describes the signal using the dynamic window smoothing filter The flowchart of the embodiment of determining the filtering window width in the filtering method; Figure 7 shows the smoothing effect curve graph of the histogram statistics obtained by different filtering methods; Figure 8 shows the output intensity obtained by the cumulative distribution function after various smoothing filters Graph; FIG. 9 shows a sound signal to which a signal filtering method using a dynamic window smoothing filter can be applied.

說明書公開一種利用動態視窗平滑濾波器的訊號濾波方法,以及實現此方法的系統,其特別是能夠解決習知技術在使用平滑化濾波改善連續像素值間的統計量差異過大時,反而會在特定情況下發生計算的累積分布函數(Cumulative Distribution Function,CDF)斜率過陡的問題。 The specification discloses a signal filtering method using a dynamic window smoothing filter, and a system for implementing the method, which can specifically solve the conventional technology that when smoothing filtering is used to improve the statistical difference between consecutive pixel values is too large, it will The calculated Cumulative Distribution Function (CDF) slope is too steep.

例如在處理影像訊號、聲音訊號,或是其他特定訊號時,可取得統計數據,例如,針對影像訊號,可以直方圖(Histogram)統計呈現出訊號特性,可以表示影像訊號的亮度(Brightness)與對比(Contrast)分布。另外,方法亦適用於聲音訊號的振幅 (Amplitude)或頻率(Frequency)上,可讓系統執行動態視窗平滑濾波調整訊號分布,一般目的是要能提昇訊號整體的特性,例如影像的對比度、亮度,以及音訊的強度或頻率,利用直方圖可增強局部訊號的某一特性,如對比度,而不影響整體。然而,利用累積分布函數(CDF)得到的直方圖處理時可能會因訊號間統計量差異過大而導致計算得到的累積分布函數形成的曲線的斜率過陡的問題,於是說明書提出一種動態視窗平滑濾波器(Dynamic Window Smoothing Filter),用以優化使用直方圖調整訊號的方法,而此利用動態視窗平滑濾波器的訊號濾波方法,除了可以緩解影像或聲音訊號不自然的狀況外,還可改善傳統一般平滑化濾波器無法解決的特殊情況。利用動態視窗平滑濾波器的訊號濾波方法與相關系統為針對統計值進行濾波或是累積分布函數(CDF)濾波。 For example, when processing image signals, sound signals, or other specific signals, statistical data can be obtained. For example, for image signals, the histogram (Histogram) can be used to statistically display the signal characteristics, which can indicate the brightness and contrast of image signals. (Contrast) distribution. In addition, the method is also applicable to the amplitude of the sound signal (Amplitude) or Frequency (Frequency), allows the system to perform dynamic window smooth filtering to adjust the signal distribution. The general purpose is to improve the overall characteristics of the signal, such as the contrast and brightness of the image, and the intensity or frequency of the audio. Can enhance a certain characteristic of a local signal, such as contrast, without affecting the overall. However, the histogram obtained by using the cumulative distribution function (CDF) may have an excessively steep slope due to the difference in statistics between signals. Therefore, the description proposes a dynamic window smoothing filter. (Dynamic Window Smoothing Filter), which is used to optimize the method of adjusting signals using histograms. This signal filtering method using dynamic window smoothing filters can not only alleviate the unnatural situation of video or audio signals, but also improve the traditional general Special cases that smoothing filters cannot solve. The signal filtering method and related systems using a dynamic window smoothing filter are filtering for statistical values or cumulative distribution function (CDF) filtering.

累積分布函數是一種機率密度函數的積分,用以描述隨機變量的機率分布,是指將所給定的點之前的所有機率值累加所得到的機率值函數,而用於調整訊號的直方圖係可以線段表示離散型的機率密度函數,機率對應直方圖之面積。 Cumulative distribution function is an integral of a probability density function. It is used to describe the probability distribution of a random variable. It refers to the probability value function obtained by accumulating all probability values before a given point, and is used to adjust the histogram system of the signal. Line segments can be used to represent discrete probability density functions, with probability corresponding to the area of the histogram.

利用動態視窗平滑濾波器的訊號濾波方法可至少用於影像訊號的濾波方法,以及聲音訊號的濾波方法上,根據實施例,利用動態視窗平滑濾波器的訊號濾波方法係實現於特定硬體裝置內的系統中,如運行於電腦裝置的作業系統中,或以套裝軟體或是軟體程式的形式運行於特定作業系統或是積體電路中。 The signal filtering method using the dynamic window smoothing filter can be used at least for the image signal filtering method and the sound signal filtering method. According to the embodiment, the signal filtering method using the dynamic window smoothing filter is implemented in a specific hardware device. In the system, such as running in the operating system of a computer device, or running in a specific operating system or integrated circuit in the form of packaged software or software programs.

圖2描述一個訊號處理系統的功能方塊實施例圖,其中描述實現利用動態視窗平滑濾波器的訊號濾波方法的電腦系統,可以軟體配合硬體運行,其中包括訊號處理單元22,並電性連接系統內各單元,系統以輸入介面21接收待處理濾波的輸入訊號201,經訊號處理單元22初步處理後,可先暫存於暫存記憶體25,訊號處理單元22接著取出以一統計模組23以一統計方法製作統計 圖,實施例可以製作出直方圖統計,可以在必要時執行對比限制濾除雜訊,並在統計圖上以動態視窗平滑濾波模組24在設定的濾波視窗寬度中執行平滑濾波,可以防止鄰近訊號(如兩個像素間)的變化太大導致全域曲線的部分區域過陡而產生的問題。之後映射到全域訊號,經輸出介面26輸出訊號202。 FIG. 2 illustrates a functional block embodiment of a signal processing system, which describes a computer system that implements a signal filtering method using a dynamic window smoothing filter, which can be run in software with hardware, including a signal processing unit 22, and is electrically connected to the system In each unit, the system receives the input signal 201 to be processed and filtered through the input interface 21. After the signal processing unit 22 initially processes the signal, it can be temporarily stored in the temporary memory 25. The signal processing unit 22 then takes out a statistical module 23 Make statistics by a statistical method In the example, histogram statistics can be made in the embodiment. Contrast limit filtering can be performed when necessary, and a dynamic window smoothing filter module 24 can be used to perform smoothing filtering in the set filtering window width on the statistical map, which can prevent adjacent The problem that the signal (such as between two pixels) changes too much causes part of the global curve to be too steep. It is then mapped to the global signal, and the signal 202 is output through the output interface 26.

圖3所示為描述利用動態視窗平滑濾波器的訊號濾波方法的實施例流程圖,為應用上述系統的方法。 FIG. 3 is a flowchart illustrating an embodiment of a signal filtering method using a dynamic window smoothing filter, which is a method of applying the above system.

流程一開始,如步驟S301,由特定訊號源輸入訊號,包括影像訊號、聲音訊號,或是其他訊號,再如步驟S303,對這些訊號運算統計值,可以圖表表示訊號分布情況,如可以直方圖表示影像統計值。舉例來說,直方圖可以用來表示數位影像的亮度分布,包括標示出每個亮度值的像素數,如此可以用來了解如何調整亮度分布。 At the beginning of the process, as in step S301, a signal is input from a specific signal source, including an image signal, a sound signal, or other signals. Then, as in step S303, the statistical value of these signals is calculated, and the signal distribution can be represented graphically. Represents image statistics. For example, a histogram can be used to represent the brightness distribution of a digital image, including the number of pixels indicating each brightness value, so that it can be used to understand how to adjust the brightness distribution.

因為要避免雜訊或是直方圖中的凸波影響所造成的累積分布函數過陡現象,所以會進行濾除的動作,如步驟S305,在濾除凸波的需求下,可以使用一種對比限制的演算,用以限制訊號達到濾除凸波的目的。 Because the cumulative distribution function is too steep due to the noise or the impact of the convex wave in the histogram, a filtering action is performed. For example, in step S305, a contrast limitation can be used under the requirement of filtering convex waves. Calculation to limit the signal to achieve the purpose of filtering out convex waves.

在一實施例中,系統接收一訊號源輸入的訊號,可為影像訊號或聲音訊號,對訊號先作直方圖的統計,為了要避免雜訊或是直方圖中的凸波影響所造成的累積分布函數過陡現象,所以會進行一初步濾除的動作,例如一種對比限制(Contrast Limit)方法,此方法是計算平均的統計量,公式方程式(一)所示, In an embodiment, the system receives a signal input from a signal source, which can be an image signal or a sound signal. The signal is first histogramized. In order to avoid the accumulation of noise or the impact of convex waves in the histogram, The distribution function is too steep, so a preliminary filtering action will be performed, such as a Contrast Limit method. This method calculates the average statistic, as shown in equation (1).

其中,bin為直方圖中訊號值,如以影像值0至255為例,bin為0至255,max(bin)為最大的訊號值,即第0至255個訊號值中最大的統計值,C bin 為第bin個訊號值的統計值,經加總訊號值, 也就是第0個訊號值到第255(bin-1)個訊號值,除以最大統計值(max(bin)),得到平均每一訊號值(影像值或音訊值)應該分配到的統計量,即平均訊號統計值m。 Among them, bin is the signal value in the histogram. For example, if the image values are 0 to 255, bin is 0 to 255, and max (bin) is the largest signal value, that is, the largest statistical value among the 0th to 255th signal values. C bin is the statistical value of the bin signal value. After summing the signal values, that is, the 0th signal value to the 255 (bin-1) signal value, divided by the maximum statistical value (max (bin)), we get The average statistic to which each signal value (image value or audio value) should be allocated, that is, the average signal statistic m.

接著進行訊號限制,先判斷是否有訊號值大於上述平均訊號統計值m的某一倍數(α)門檻,如方程式(二)所述,若第bin個訊號統計值C bin 超過平均訊號統計值m的α倍,則會將其限制住,達到限制訊號的目的,使之不超過一個上限訊號統計值,此例中,設此上限訊號統計值C’ bin =α×m,其中α值可以依照實際需求決定;反之,若第bin個訊號統計值C bin 並未超過平均訊號統計值m的α倍,將C’ bin 設為C bin Then carry on the signal restriction, first determine whether the signal value is greater than the threshold value of a multiple (α) of the average signal statistical value m, as described in equation (2), if the bin signal statistical value C bin exceeds the average signal statistical value m Α times, it will be limited to achieve the purpose of limiting the signal so that it does not exceed a statistical value of the upper limit signal. In this example, set the statistical value of the upper limit signal C ′ bin = α × m, where the value of α can be determined according to The actual demand is determined; conversely, if the bin signal statistical value C bin does not exceed α times the average signal statistical value m, set C ′ bin to C bin .

為了避免能量損失而保留整體訊號能量,所以系統會再將其限制扣除的統計量平均於每一個訊號統計量上。如方程式(三)所表示,在第bin個訊號統計值C bin 超過平均訊號統計值m的α倍情況下,算出每個訊號統計值C bin 與平均訊號統計值m的α倍的差值(C bin -C’ bin ),其中C’ bin =α×m,加總後,除以最大的訊號值max(bin),得到被扣除的統計量△C。 In order to avoid energy loss, the overall signal energy is retained, so the system will average the statistics of its limit deduction on each signal statistics. As shown in equation (3), in the case where the bin signal statistic value C bin exceeds α times the average signal statistic value m, the difference between each signal statistic value C bin and the α signal statistic value m is calculated ( C bin - C ' bin ), where C' bin = α × m, after adding up, divide by the maximum signal value max (bin) to get the subtracted statistic △ C.

接著,當完成對比限制的步驟後,再將經前述門檻(如上限訊號統計值)限制而扣除的統計量平均加到每個訊號值,如方程式(四),將被扣除的統計量加上上限訊號統計值C’ bin ,得到每個訊號值經對比限制後的第bin個訊號統計值C” bin Then, after completing the comparison limitation step, add the statistics deducted by the aforementioned threshold (such as the upper limit signal statistics value) to each signal value, such as equation (4), and add the deducted statistics value. The upper limit signal statistical value C ' bin is obtained to obtain the bin signal statistical value C ” bin after each signal value is compared and restricted.

根據以上實施例所描述的對比限制的演算法,對照圖4A至4C顯示某種訊號下的直方圖例,其中圖4A顯示為原本訊號所產生的直方圖統計,圖中顯示橫軸標示訊號值1至4000,在接近訊 號值1的附近有個明顯凸波,此例之統計值可達35000,這類訊號為可能影響整體表現的雜訊,因此可通過上述對比限制的演算濾除雜訊,例如利用方程式(一)與方程式(二)演算,以平均訊號統計值m的α倍限制訊號發展,形成圖4B所示的直方圖統計圖,圖式顯示出接近訊號值1的統計值即被限制在合理的數值,如此例的450。 According to the algorithm of contrast limitation described in the above embodiment, a histogram example under a certain signal is shown with reference to FIGS. 4A to 4C, wherein FIG. 4A shows the histogram statistics generated by the original signal, and the horizontal axis indicates the signal value 1 Up to 4000 in approaching news There is an obvious convex wave near the value 1. The statistical value of this example can reach 35000. This type of signal is noise that may affect the overall performance. Therefore, the noise can be filtered by the above calculation of the comparison limit. For example, using the equation (a ) And equation (2) calculus, limit the signal development by α times the average signal statistic value m to form the histogram statistical graph shown in Figure 4B. The graph shows that the statistic value close to the signal value 1 is limited to a reasonable value , Such as 450.

然而,為了避免能量損失而保留整體訊號能量,系統再將經對比限制而扣除的統計量平均加回每一個訊號統計值上,如圖4C,將能量加回的結果顯示整體統計值水平有提昇的狀況,接近訊號值1的統計值則接近600。 However, in order to avoid energy loss and retain the overall signal energy, the system adds the statistics deducted by the comparison limit back to each signal average value, as shown in Figure 4C. The result of adding the energy back shows that the overall statistical value level has improved. The situation is close to 600 when the signal value is close to 1.

經過對比限制的程序後,可以有效濾除雜訊,使得整體訊號品質一致,若以影像訊號為例,可以讓影像畫面不至於有相同區域有著差異極大的亮度問題,而使得畫面比較自然。 After the procedure of contrast limitation, noise can be effectively filtered to make the overall signal quality consistent. If an image signal is taken as an example, the image picture can be prevented from having the same area with extremely different brightness problems, which makes the picture more natural.

再如圖3所示流程中的步驟S307,對經對比限制後的訊號執行一動態視窗平滑濾波。其中手段包括系統對經過濾除雜訊的訊號執行一動態視窗平滑濾波的程序,應用說明書所揭露的動態視窗平滑濾波器,其目的之一是在於防止鄰近訊號之間的變化太大導致全域曲線的部分區域過陡而導致訊號不自然的現象。動態視窗平滑濾波器的運作可參考圖5所示圖例,相對於習知採用固定視窗的平滑濾波器的方式,說明書所提出的動態視窗平滑濾波器係採用一種動態濾波視窗的方式。 Then, as shown in step S307 in the flow shown in FIG. 3, a dynamic window smoothing filtering is performed on the signal after the contrast limitation. The means include a system that performs a dynamic window smoothing process on the filtered and noise-removed signal, and one of the purposes of the dynamic window smoothing filter disclosed in the application manual is to prevent the variation between adjacent signals from causing a global curve. Part of the area is too steep, resulting in unnatural signals. For the operation of the dynamic window smoothing filter, please refer to the legend shown in FIG. 5. Compared to the conventional method of using a fixed window smoothing filter, the dynamic window smoothing filter proposed in the specification uses a dynamic filtering window method.

同時參考圖6所示描述取得動態濾波視窗寬度的實施例流程。根據實施例之一,判斷輸入訊號中前後差異大的訊號值(步驟S601),可以一門檻值作為判斷依據,可以依照需求設定此門檻值,於是系統可針對訊號中差異較大的部分,例如影像訊號中較暗處與較亮處,特別在影像訊號的邊界處常常會有亮暗差異過大的現象,或是聲音訊號中振幅變化過大的部分,採用當前訊號值(選擇具有前後訊號值差異大的訊號值),比對系統預設最大濾波 視窗寬度(步驟S603),並往前尋找或向後尋找的最小有效數值(步驟S605),以此設定為訊號值平滑濾波器的濾波視窗寬度(步驟S607)。 At the same time, the process of obtaining the width of the dynamic filtering window is described with reference to FIG. 6. According to one of the embodiments, a signal value having a large difference between the front and back of the input signal is determined (step S601), and a threshold value can be used as a basis for determination. This threshold value can be set according to requirements, so the system can target the larger difference in the signal. The darker and brighter parts of the video signal, especially at the boundaries of the video signal, often have a large difference between light and dark, or the part of the audio signal that has excessive amplitude changes, using the current signal value (select the difference between the front and back signal values) Large signal value), compared with the preset maximum filtering of the system The window width (step S603), and the minimum significant value searched forward or backward (step S605), is set as the filter window width of the signal value smoothing filter (step S607).

範例可參考圖5所示,訊號如8位元訊號,訊號值範圍在0至255;12位元訊號的訊號值範圍在0至4095,濾波視窗的大小可以依據實際需要而可動態決定,但可能受限於整體訊號值,以及整體訊號的變化量(Variation)。例如,整體訊號值愈大,可以選擇較寬的濾波視窗;或是,整體訊號變化量愈大,可能也需要愈寬的濾波視窗。 For an example, refer to Figure 5. The signal is an 8-bit signal with a signal value ranging from 0 to 255; the 12-bit signal has a signal value ranging from 0 to 4095. The size of the filter window can be dynamically determined according to actual needs, but May be limited by the overall signal value and the variation of the overall signal. For example, the larger the overall signal value, a wider filtering window can be selected; or, the larger the overall signal variation, a wider filtering window may also be required.

計算有效點數(數值)的方式可參考方程式(五)與方程式(六),其中參數可以依照需求改變,如訊號值bin的範圍可以根據影像或聲音訊號而調整。方程式(六)顯示訊號值bin在0至255之間,以此為例,可適用於影像訊號統計的濾波手段上。 For the method of calculating effective points (values), please refer to Equation (5) and Equation (6). The parameters can be changed according to requirements. For example, the range of the signal value bin can be adjusted according to the image or sound signal. Equation (6) shows that the signal value bin is between 0 and 255. Taking this as an example, it can be applied to the filtering method of image signal statistics.

其中,bin為訊號值,Ws為預設最大的濾波視窗寬度,可以為總點數,或是依照需求設定的訊號點數,W(bin)即為最後擷取到的有效點數。 Among them, bin is the signal value, W s is the preset maximum filtering window width, which can be the total number of points, or the number of signal points set according to requirements, and W (bin) is the last effective number of points retrieved.

根據當兩倍訊號值bin加上1的值小於為預設最大的濾波視窗大小Ws時,如圖5顯示示意圖的左方訊號值,有效點數W(bin)即等於2×bin+1(兩倍訊號值bin加上1)。舉例來說,可參考圖5範例,當訊號值bin為0時,以方程式(五)運算,得到有效點數W(bin)為1,也可反映出濾波視窗寬度為1,例如圖5中的濾波視窗501;當訊號值bin為1時,根據方程式(五),有效點數W(bin)為3,可對應出濾波視窗寬度為3,可參考圖示的濾波視窗502; 像素值bin為2時,可得有效點數W(bin)為5,如此可決定濾波視窗寬度為5,如圖示的濾波視窗503。可以此類推。 According to when the double signal value bin plus 1 is smaller than the preset maximum filtering window size W s , as shown in the left signal value of the schematic diagram in FIG. 5, the effective point number W (bin) is equal to 2 × bin + 1 (Twice the signal value bin plus 1). For example, you can refer to the example in Figure 5. When the signal value bin is 0, you can use Equation (5) to calculate the number of valid points W (bin) is 1. It can also reflect that the width of the filtering window is 1. Filter window 501; when the signal value bin is 1, according to equation (5), the effective point number W (bin) is 3, which can correspond to the filter window width of 3, refer to the filter window 502 shown in the figure; pixel value bin When it is 2, the effective number of points W (bin) is 5, so that the width of the filtering window can be determined to be 5, such as the filtering window 503 shown in the figure. And so on.

繼續參考以上計算有效點數W(bin)的方程式(五),當2倍的(255-bin)加上1的值仍小於預設最大的濾波視窗寬度Ws,可對比圖5所示的右方靠近邊界的訊號值,有效點數W(bin)等於2×(255-bin)+1。反之,若不符以上兩個條件,有效點數W(bin)即等於預設最大的濾波視窗寬度WsContinue to refer to the above equation (5) for calculating the effective number of points W (bin). When the value of 2 (255-bin) plus 1 is still less than the preset maximum filtering window width W s , you can compare with The value of the signal on the right near the boundary. The number of valid points W (bin) is equal to 2 × (255-bin) +1. Conversely, if the above two conditions are not met, the number of valid points W (bin) is equal to the preset maximum filtering window width W s .

需要一提的是,方程式(五)係基於於訊號值bin在0至255之間(方程式(六)),可得出動態依據實際需要調整濾波視窗的方式,方程式(五)應依照方程式(六)所設定不同訊號值的範圍而調整。 It should be mentioned that Equation (5) is based on the signal value bin between 0 and 255 (Equation (6)), which can be used to dynamically adjust the filtering window according to actual needs. Equation (5) should be based on Equation ( 6) Adjust the range of different signal values.

當以最小有效數值(點數)作為訊號值平滑濾波器的視窗寬度,僅針對此濾波視窗寬度中的訊號進行平滑濾波,濾波視窗寬度形成一個濾波遮罩,經平滑濾波器處理在此濾波視窗寬度內的訊號值(像素或是聲音訊號),適當的濾波視窗寬度可以避免訊號失真過多而使得訊號過於模糊。 When the minimum effective value (points) is used as the window width of the signal smoothing filter, only the signals in this filtering window width are smoothed. The filtering window width forms a filtering mask, which is processed by the smoothing filter in this filtering window. The signal value (pixel or sound signal) within the width, the appropriate filter window width can avoid signal distortion and make the signal too blurry.

圖7顯示通過不同的濾波手段得到統計值的平滑效果曲線圖,其中橫軸標示為輸入的訊號強度(Intensity),縱軸則標示每個訊號強度的統計值(Statistic Count),此圖證明在揭露書所提出的利用動態視窗平滑濾波器的訊號濾波方法擁有更佳的濾波表現。 Figure 7 shows the smoothing effect curve statistics obtained by different filtering methods. The horizontal axis is the input signal intensity (Intensity), and the vertical axis is the statistical value (Statistic Count) of each signal intensity. This figure proves that The signal filtering method proposed by the disclosure using a dynamic window smoothing filter has better filtering performance.

圖中顯示描述有原統計值形成的曲線701,原始訊號顯示細節上有不少的變化,鏡射濾波統計值形成的曲線702表示經過鏡射平滑濾波後的統計值變化;剪裁濾波統計值形成的曲線703表示經過剪裁平滑濾波後的統計值變化,相對於鏡射濾波統計值702形成的曲線,比較接近原始訊號;補白濾波統計值形成的曲線704相對來說,在低強度的部位相對原始訊號有很大的落差,在高強度的部位也與原始訊號分離。而相對地,系統提供的鏡射濾波統 計值形成的曲線702形成的動態視窗平滑濾波統計值曲線705為更貼近原來統計值形成的曲線701。 The figure shows the curve 701 formed by the original statistical value. There are many changes in the display details of the original signal. The curve 702 formed by the statistical value of the mirror filtering indicates the statistical value change after the smooth filtering by the mirror. The statistical value of the clipping filter is formed. The curve 703 indicates the change in the statistical value after clipping and smoothing filtering. Compared to the curve formed by the mirror filtering statistical value 702, it is closer to the original signal. The curve 704 formed by the filler filtering statistical value is relatively original in the low-intensity part. The signal has a large drop and is separated from the original signal at high intensity parts. In contrast, the mirror filtering system provided by the system The dynamic window smoothing filtering statistical value curve 705 formed by the calculated value curve 702 is a curve 701 formed closer to the original statistical value.

從圖中濾波的結果可知,無論是習知平滑濾波器採用的鏡射濾波方法、補白濾波方法或是剪裁濾波方法在邊界的地方差異性都很大,但都與原始資料(原統計曲線701)相差甚遠。 From the results of the filtering in the figure, it can be seen that whether it is the mirroring filtering method, the filler filtering method or the clipping filtering method used in the conventional smoothing filter has great differences at the boundary, but all are different from the original data (the original statistical curve 701 ) It's a big difference.

而說明書所提出的利用動態視窗平滑濾波器的訊號濾波方法可以得出更為平滑的統計曲線(動態視窗平滑濾波統計曲線705),包括頭尾的統計值可以接近原始訊號的統計值,而中間段得到更好的平滑化結果。接著可以將經過動態視窗平滑濾波後的訊號值映射至輸出訊號。 The signal filtering method using the dynamic window smoothing filter proposed in the specification can obtain a smoother statistical curve (dynamic window smoothing filtering statistical curve 705), including the head and tail statistics can be close to the original signal statistics, and the middle Segments get better smoothing results. Then, the signal value after dynamic window smoothing filtering can be mapped to the output signal.

接續執行圖3步驟S309,利用動態視窗平滑濾波器的訊號濾波方法繼續運算累積分布函數,經過各式平滑濾波器後的累積分布函數得到的輸出強度曲線圖可參考圖8。 Continue to execute step S309 in FIG. 3, and use the signal filtering method of the dynamic window smoothing filter to continue to calculate the cumulative distribution function. The output intensity curve obtained through the cumulative distribution function after various smoothing filters can refer to FIG. 8.

圖8橫軸標示為輸入訊號強度(Input Intensity),而縱軸則是經過累積分布函數運算產生的輸出訊號強度(Output Intensity),其中描述有利用動態視窗平滑濾波器的訊號濾波方法所應用的動態視窗所執行平滑濾波,形成鏡射視窗強度曲線801,經累積分布函數運算得到的曲線,相對於其他利用鏡射視窗、剪裁視窗以及補白視窗等執行平滑濾波所運算得到的累積分布函數曲線(鏡射視窗強度曲線802、剪裁視窗強度曲線803與補白視窗強度曲線804),利用動態視窗平滑濾波器的訊號濾波方法除了可以解決累積分布函數斜率過陡造成影像訊號或是聲音訊號的不自然問題,更可解決傳統濾波器方法的問題。 The horizontal axis of Figure 8 is the input signal intensity (Input Intensity), while the vertical axis is the output signal intensity (Output Intensity) generated by the cumulative distribution function operation, which describes the application of the signal filtering method using a dynamic window smoothing filter. The smoothing filtering performed by the dynamic window forms the mirrored window intensity curve 801, which is a curve obtained by the cumulative distribution function calculation. Compared with other cumulative distribution function curves obtained by performing smoothing filtering using mirrored windows, cropped windows, and filler windows, etc. ( Mirror window intensity curve 802, clipping window intensity curve 803, and filler window intensity curve 804). In addition to the signal filtering method using a dynamic window smoothing filter, in addition to solving the unnatural problem of the image signal or sound signal caused by the excessively steep slope of the cumulative distribution function, , Can solve the problem of traditional filter methods.

更細節地,從圖7顯示以各式平滑濾波方式得到的輸出訊號曲線可知,以說明書提出的利用動態視窗平滑濾波器的訊號濾波方法,其中採用動態濾波視窗的方式產生的濾波結果如當中邊界動態視窗強度曲線701,再經累積分布函數(CDF)運算後,顯示為緩和向上的曲線,且在輸入訊號值0時,保有累積分布函數為0 的輸出結果,也就是獲得更佳的累積分布函數結果。 In more detail, it can be seen from FIG. 7 that the output signal curves obtained by various smoothing filtering methods are used. According to the signal filtering method using a dynamic window smoothing filter proposed in the specification, the filtering results generated by using the dynamic filtering window method are like the middle boundary. The dynamic window intensity curve 701 is displayed as a gently upward curve after the cumulative distribution function (CDF) calculation, and when the input signal value is 0, the cumulative distribution function is maintained at 0. The output result of, that is, a better cumulative distribution function result.

反之,以鏡射方法決定濾波視窗(鏡射視窗強度曲線702)的平滑濾波結果,經累積分布函數運算後,顯示對於較暗的地方,如在強度1000位置附近,以及較亮的地方,如在強度3000位置附近,皆有一個較大幅度的轉折,若以處理影像訊號為例,在畫面上即為亮處或暗處可能會有比較大幅度的突然變化,原因與選取的視窗的設定會使得鏡射視窗強度曲線702可以取得的有效點數較少,可參考方程式(五)。 On the contrary, the smoothing result of the filter window (mirror window intensity curve 702) is determined by the mirror method. After the cumulative distribution function operation is performed, it shows that for darker places, such as near the intensity 1000 position, and brighter places, such as Around the intensity 3000 position, there is a large turning point. If the image signal is processed as an example, there may be a relatively large sudden change in the bright or dark place on the screen. The reason is the setting of the selected window. As a result, the number of effective points that can be obtained by the mirror window intensity curve 702 can be made smaller. Refer to equation (5).

當以補白方式決定濾波視窗(補白視窗強度曲線704)的平滑濾波後,經累積分布函數運算結果來看,因為在超過邊界的位置會是補0的,所以會導致在前1000亮度與後面亮度3000以後的輸入訊號的累積分布曲線數值會較低,也就是說,無法確保原始訊號亮度最亮的4095能維持於最亮,這將導致影像很有可能會有反轉的現象,如圖中曲線在強度4095附近向下轉折的狀況。另外,在平滑濾波後,最亮的位置落於強度約3000的地方,導致在訊號值為0時,經平滑濾波後就會特別的大,會使得畫面中會使得暗處拉亮,間接的將暗部的雜訊放大,導致畫面的不自然。 After the smoothing filtering of the filter window (filler window intensity curve 704) is determined in a filler mode, the cumulative distribution function calculation results show that, because it will be zero-filled at the position beyond the boundary, it will result in the first 1000 brightness and the rear brightness. The value of the cumulative distribution curve of the input signal after 3000 will be lower, that is, it cannot be guaranteed that the brightest of the original signal, 4095, can be maintained at the brightest, which will cause the image to be likely to be inverted, as shown in the figure The curve turns downward around the strength of 4095. In addition, after the smoothing filter, the brightest position falls at an intensity of about 3000. As a result, when the signal value is 0, the smoothing filter will be particularly large, which will make the dark areas brighter in the picture, indirectly. The noise in the dark part is enlarged, resulting in an unnatural picture.

當以剪裁方式決定濾波視窗(剪裁視窗強度曲線703)的平滑濾波並經累積分布函數運算結果來看,得知其暗部因為統計的數量偏多,因而導致在訊號值為0時經平滑濾波後就會特別的大,也在畫面中會使得暗處拉的特別亮,間接的將暗部的雜訊放大,導致畫面的不協調感。接著步驟S309運算得到統計值中較平緩的累積分布函數值後。 When the smoothing filtering of the filtering window (clipping window intensity curve 703) is determined by the trimming method and the cumulative distribution function calculation results are seen, it is learned that the dark part is because the number of statistics is too large, resulting in smoothing filtering when the signal value is 0. It will be particularly large, and in the picture, the dark place will be particularly bright, indirectly magnifying the noise in the dark part, resulting in a sense of disharmony in the picture. Then in step S309, a relatively smooth cumulative distribution function value in the statistical value is obtained.

接著,除了如步驟S307所述,可以在累積分布函數(CDF)運算之前執行動態視窗平滑濾波;或如步驟S311,表示使用動態濾波視窗寬度的方式執行平滑濾波的順序可以在步驟S309運算累積分布函數值之後。可參考上述以方程式(五)與方程式(六)為例的描述,針對訊號中差異較大的部分採用當前訊號值往前尋 找或向後尋找的有效數值(如最小有效數值),以此設定為訊號值平滑濾波器的視窗寬度,當整體訊號的變化量愈大(如影像明暗對比大、聲音振幅變化大),可以選擇較寬的濾波視窗。 Then, except as described in step S307, dynamic window smoothing filtering can be performed before the cumulative distribution function (CDF) calculation; or as in step S311, the order of performing smoothing filtering using the dynamic filtering window width can be used to calculate the cumulative distribution in step S309. After the function value. You can refer to the above description using Equation (5) and Equation (6) as examples, and use the current signal value to look forward for the part that is significantly different in the signal Find the effective value (such as the minimum effective value) or backward, and set it as the window width of the signal value smoothing filter. When the overall signal change is larger (such as a large contrast between light and dark, and a large change in sound amplitude), you can choose Wider filtering window.

不論動態視窗平滑濾波程序是執行在演算累積分布函數之前,或是之後,接著執行步驟S313,執行全域曲線映射,將經過平滑濾波處理的訊號一一映射到輸出的訊號上,如步驟S315,輸出訊號。 Regardless of whether the dynamic window smoothing filtering program is executed before or after calculating the cumulative distribution function, then step S313 is performed to perform global curve mapping, and the smoothed filtering signals are mapped to the output signals one by one, as in step S315, the output Signal.

在此列舉一實施例,以影像訊號為例,當累積分布函數為輸入亮度0時映射至1,輸入亮度1時映射至3,輸入亮度2時映射至3,輸入亮度3時映射至4,輸入亮度4時映射至5,輸入亮度5時映射至5。當以視窗大小為3為例,其鏡射視窗平均後的結果為,輸入亮度0時映射至(3+1+3)/3=7/3,輸入亮度1時映射至(1+3+3)/3=7/3,輸入亮度2時映射至(3+3+4)/3=10/3,輸入亮度3時映射至(3+4+5)/3=4,輸入亮度4時映射至(4+5+5)/3=14/3,輸入亮度5時映射至(5+5+5)/3=5。補白視窗平均後的結果為,輸入亮度0時映射至(0+1+3)/3=4/3,輸入亮度1時映射至(1+3+3)/3=7/3,輸入亮度2時映射至(3+3+4)/3=10/3,輸入亮度3時映射至(3+4+5)/3=4,輸入亮度4時映射至(4+5+5)/3=14/3,輸入亮度5時映射至(5+5+0)/3=10/3,當均化至輸出範圍0~5後的結果變為,0時映射至5*(4/3)/(14/3)=20/14,輸入亮度1時映射至5*(7/3)/(14/3)=5/2,輸入亮度2時映射至5*(10/3)/(14/3)=25/7,輸入亮度3時映射至5*4/(14/3)=30/7,輸入亮度4時映射至5*(14/3)/(14/3)=5,輸入亮度5時映射至5*(10/3)/(14/3)=25/7。剪裁視窗則為,輸入亮度0時映射至(1+1+3)/3=5/3,輸入亮度1時映射至(1+3+3)/3=7/3,輸入亮度2時映射至(3+3+4)/3=10/3,輸入亮度3時映射至(3+4+5)/3=4,輸入亮度4時映射至(4+5+5)/3=14/3,輸入亮度5時映射至(5+5+5)/3=5。而邊界視窗的結果則為,輸入亮度0時映射至1,輸入亮度1時映射至(1+3+3)/3=7/3, 輸入亮度2時映射至(3+3+4)/3=10/3,輸入亮度3時映射至(3+4+5)/3=4,輸入亮度4時映射至(4+5+5)/3=14/3,輸入亮度5時映射至5。從此結果可以看到補白視窗有亮度反轉的現象,鏡射視窗與剪裁視窗在邊界處也與原先特性有些許差距。 Here is an example. Taking the image signal as an example, when the cumulative distribution function is input brightness 0, it is mapped to 1, when input brightness 1 is mapped to 3, when input brightness 2 is mapped to 3, and when input brightness 3 is mapped to 4, Maps to 5 when inputting brightness 4 and maps to 5 when inputting brightness 5. When the window size is 3 as an example, the result of averaging the mirror window is: when the brightness is 0, it is mapped to (3 + 1 + 3) / 3 = 7/3, and when the brightness is 1, it is mapped to (1 + 3 + 3) / 3 = 7/3, when inputting brightness 2, it is mapped to (3 + 3 + 4) / 3 = 10/3, when inputting brightness 3, it is mapped to (3 + 4 + 5) / 3 = 4, and input brightness 4 When mapping to (4 + 5 + 5) / 3 = 14/3, when inputting brightness 5, mapping to (5 + 5 + 5) / 3 = 5. The result after averaging the blanking window is: when inputting brightness 0, it is mapped to (0 + 1 + 3) / 3 = 4/3, and when inputting brightness 1, it is mapped to (1 + 3 + 3) / 3 = 7/3, input brightness At 2 it is mapped to (3 + 3 + 4) / 3 = 10/3, when input brightness 3 is mapped to (3 + 4 + 5) / 3 = 4, when input brightness 4 is mapped to (4 + 5 + 5) / 3 = 14/3, when the input brightness is 5, it is mapped to (5 + 5 + 0) / 3 = 10/3, when the result is equalized to the output range of 0 ~ 5, the result becomes, when 0, it is mapped to 5 * (4 / 3) / (14/3) = 20/14, when inputting brightness 1, it is mapped to 5 * (7/3) / (14/3) = 5/2, when inputting brightness 2, it is mapped to 5 * (10/3) / (14/3) = 25/7, when inputting brightness 3, it is mapped to 5 * 4 / (14/3) = 30/7, when inputting brightness 4, it is mapped to 5 * (14/3) / (14/3) = 5, when inputting brightness 5, it will be mapped to 5 * (10/3) / (14/3) = 25/7. The trimming window is: when inputting brightness 0, it is mapped to (1 + 1 + 3) / 3 = 5/3, when inputting brightness 1, it is mapped to (1 + 3 + 3) / 3 = 7/3, and when inputting brightness 2, it is mapped To (3 + 3 + 4) / 3 = 10/3, when inputting brightness 3, it is mapped to (3 + 4 + 5) / 3 = 4, and when inputting brightness 4, it is mapped to (4 + 5 + 5) / 3 = 14 / 3, when inputting brightness 5, it is mapped to (5 + 5 + 5) / 3 = 5. The result of the boundary window is: when the brightness is 0, it is mapped to 1, and when the brightness is 1, it is mapped to (1 + 3 + 3) / 3 = 7/3. When inputting brightness 2, it is mapped to (3 + 3 + 4) / 3 = 10/3; when inputting brightness 3, it is mapped to (3 + 4 + 5) / 3 = 4; when inputting brightness 4, it is mapped to (4 + 5 + 5 ) / 3 = 14/3, which is mapped to 5 when you enter a brightness of 5. From this result, it can be seen that the filler window has a brightness inversion phenomenon, and the mirror window and the crop window are also slightly different from the original characteristics at the boundary.

值得一提的是,除應用於上述影像訊號的實施例,利用動態視窗平滑濾波器的訊號濾波方法與系統同樣適用於聲音訊號上,往往會接收到如圖9的訊號,橫軸是時間,縱軸為隨著時間的訊號振幅(或頻率),為了使訊號的雜訊影響降低,可在時域上進行濾波,例如在訊號邊界處採用說明書所提出的利用動態視窗平滑濾波器的訊號濾波方法,可以根據實際狀況調整濾波視窗寬度,如此執行平滑濾波可以避免訊號在起點與終點處的失真。 It is worth mentioning that in addition to the above-mentioned embodiment of the image signal, the signal filtering method and system using the dynamic window smoothing filter are also applicable to the sound signal, and the signal shown in FIG. 9 is often received, and the horizontal axis is time. The vertical axis is the amplitude (or frequency) of the signal over time. In order to reduce the noise effect of the signal, filtering can be performed in the time domain. For example, at the signal boundary, the signal filtering using the dynamic window smoothing filter proposed by the instruction manual is used. Method, the filter window width can be adjusted according to the actual situation, so performing smooth filtering can avoid signal distortion at the start and end points.

綜上所述,說明書所揭露的利用動態視窗平滑濾波器的訊號濾波方法與系統的技術手段之一是通過動態濾波視窗寬度的決定,在邊界只取有效視窗大小進行平滑濾波,目的之一要使得得到的累積分布函數(CDF)曲線在頭尾的統計值可以接近原始訊號的統計值,而中間段得到更好的平滑化結果,並保有原有訊號特性,達到緩解影像、聲音訊號或是其他一維訊號不自然或失真情況的目的。 In summary, one of the signal filtering methods and systems using the dynamic window smoothing filter disclosed in the specification is to determine the width of the dynamic filtering window and use only the effective window size for smoothing at the boundary. The statistics of the cumulative distribution function (CDF) curve at the head and the tail can be close to the statistics of the original signal, and the middle section gets better smoothing results, and retains the original signal characteristics, so as to ease the image, sound, or The purpose of other one-dimensional signals is unnatural or distorted.

惟以上所述僅為本發明之較佳可行實施例,非因此即侷限本發明之專利範圍,故舉凡運用本發明說明書及圖示內容所為之等效結構變化,均同理包含於本發明之範圍內,合予陳明。 However, the above description is only a preferred and feasible embodiment of the present invention, and thus does not limit the scope of the patent of the present invention. Therefore, any equivalent structural changes made by using the description and illustrated contents of the present invention are also included in the present invention. Within the scope, joint Chen Ming.

Claims (10)

一種利用動態視窗平滑濾波器的訊號濾波方法,包括:取得訊號的一統計值;根據一最大濾波視窗寬度,於一選擇的訊號值往前尋找或向後尋找一濾波視窗寬度;根據該濾波視窗寬度執行動態視窗平滑濾波;以及將經過該動態視窗平滑濾波後的訊號值映射至輸出訊號。A signal filtering method using a dynamic window smoothing filter includes: obtaining a statistical value of a signal; searching forward or backward for a filtering window width at a selected signal value according to a maximum filtering window width; and according to the filtering window width Performing dynamic window smoothing filtering; and mapping the signal value after the dynamic window smoothing filtering to the output signal. 如請求項1所述的利用動態視窗平滑濾波器的訊號濾波方法,其中係於該選擇的訊號值往前尋找或向後尋找一最小有效數值,以決定該濾波視窗寬度。The signal filtering method using the dynamic window smoothing filter according to claim 1, wherein the selected signal value is searched forward or backward to find a minimum significant value to determine the filtering window width. 如請求項2所述的利用動態視窗平滑濾波器的訊號濾波方法,其中所選擇的訊號值為影像訊號的邊界亮暗差異過大的訊號值,或是聲音訊號中振幅變化過大的訊號值。The signal filtering method using the dynamic window smoothing filter as described in claim 2, wherein the selected signal value is a signal value with an excessively large boundary brightness difference between image signals, or a signal value with a large amplitude change in a sound signal. 如請求項1所述的利用動態視窗平滑濾波器的訊號濾波方法,其中該動態視窗平滑濾波程序執行於運算該累積分布函數的步驟之前,或是之後。The signal filtering method using the dynamic window smoothing filter according to claim 1, wherein the dynamic window smoothing filtering program is executed before or after the step of calculating the cumulative distribution function. 如請求項1至4其中之任一項所述的利用動態視窗平滑濾波器的訊號濾波方法,其中於取得該訊號的統計值時,更執行一對比限制的步驟,包括:取得一最大訊號值;加總所有訊號值;以加總的訊號值除以最大訊號值,計算一平均訊號統計值;以及判斷是否有訊號值大於一門檻,如果有,即限制該訊號值,使得該訊號值不超過該門檻。The signal filtering method using the dynamic window smoothing filter according to any one of claims 1 to 4, wherein when obtaining the statistical value of the signal, a step of performing a comparison limitation is further performed, including: obtaining a maximum signal value ; Sum up all signal values; calculate the average signal statistic by dividing the summed signal value by the maximum signal value; and determine if any signal value is greater than a threshold; if so, limit the signal value so that the signal value does not Exceeded that threshold. 如請求項5所述的利用動態視窗平滑濾波器的訊號濾波方法,其中該門檻為一上限訊號統計值,設為該平均訊號統計值的一倍數。The signal filtering method using the dynamic window smoothing filter according to claim 5, wherein the threshold is an upper limit signal statistical value, which is set to a multiple of the average signal statistical value. 如請求項6所述的利用動態視窗平滑濾波器的訊號濾波方法,其中該完成該對比限制的步驟後,再將經該門檻限制而扣除的統計量平均加到每個訊號值。The signal filtering method using the dynamic window smoothing filter according to claim 6, wherein after the step of comparing the restrictions is completed, the statistics deducted by the threshold limit are added to each signal value on average. 一種利用動態視窗平滑濾波器的訊號濾波系統,應用於一電腦系統,包括:一輸入介面,用以接收待處理濾波的輸入訊號;一暫存記憶體,用以暫存該輸入訊號;一訊號處理單元,電性連接該暫存記憶體,對該輸入訊號執行一利用動態視窗平滑濾波器的訊號濾波方法,以:取得訊號的一統計值;根據一最大濾波視窗寬度,於一選擇的訊號值往前尋找或向後尋找一濾波視窗寬度;根據該濾波視窗寬度執行動態視窗平滑濾波;以及將經過該動態視窗平滑濾波後的訊號值映射至輸出訊號。A signal filtering system using a dynamic window smoothing filter, which is applied to a computer system, includes: an input interface for receiving a filtered input signal to be processed; a temporary memory for temporarily storing the input signal; a signal The processing unit is electrically connected to the temporary memory, and executes a signal filtering method using a dynamic window smoothing filter on the input signal to obtain a statistical value of the signal; based on a maximum filtering window width, at a selected signal Search forward or backward for a filtering window width; perform dynamic window smoothing filtering according to the filtering window width; and map the signal value after the dynamic window smoothing filtering to the output signal. 如請求項8所述的利用動態視窗平滑濾波器的訊號濾波系統,於該利用動態視窗平滑濾波器的訊號濾波方法中,係於該選擇的訊號值往前尋找或向後尋找一最小有效數值,以決定該濾波視窗寬度。The signal filtering system using the dynamic window smoothing filter according to claim 8, in the signal filtering method using the dynamic window smoothing filter, the selected signal value is searched forward or backward to find a minimum significant value, To determine the filter window width. 如請求項8或9所述的利用動態視窗平滑濾波器的訊號濾波系統,於該利用動態視窗平滑濾波器的訊號濾波方法中,當取得該訊號的統計值時,更執行一對比限制的步驟,包括:取得一最大訊號值;加總所有訊號值;以加總的訊號值除以最大訊號值,計算一平均訊號統計值;以及判斷是否有訊號值大於一門檻,如果有,即限制該訊號值,使得該訊號值不超過該門檻。The signal filtering system using the dynamic window smoothing filter according to claim 8 or 9. In the signal filtering method using the dynamic window smoothing filter, when a statistical value of the signal is obtained, a comparison limitation step is further performed. , Including: obtaining a maximum signal value; adding all signal values; dividing the total signal value by the maximum signal value to calculate an average signal statistic; and determining whether any signal value is greater than a threshold, and if so, limiting the The signal value, so that the signal value does not exceed the threshold.
TW107128458A 2018-08-15 2018-08-15 Method and system for filtering signals using a dynamic window smoothing filter TWI664606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107128458A TWI664606B (en) 2018-08-15 2018-08-15 Method and system for filtering signals using a dynamic window smoothing filter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107128458A TWI664606B (en) 2018-08-15 2018-08-15 Method and system for filtering signals using a dynamic window smoothing filter

Publications (2)

Publication Number Publication Date
TWI664606B true TWI664606B (en) 2019-07-01
TW202009867A TW202009867A (en) 2020-03-01

Family

ID=68049456

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107128458A TWI664606B (en) 2018-08-15 2018-08-15 Method and system for filtering signals using a dynamic window smoothing filter

Country Status (1)

Country Link
TW (1) TWI664606B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488219A (en) * 2008-12-19 2009-07-22 四川虹微技术有限公司 Fast video image bilateral filtering method
TWM458747U (en) * 2013-03-27 2013-08-01 Regulus Technologies Co Ltd Image processing module
CN104700376A (en) * 2014-11-25 2015-06-10 桂林电子科技大学 Gamma correction and smoothing filtering based image histogram equalization enhancing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488219A (en) * 2008-12-19 2009-07-22 四川虹微技术有限公司 Fast video image bilateral filtering method
TWM458747U (en) * 2013-03-27 2013-08-01 Regulus Technologies Co Ltd Image processing module
CN104700376A (en) * 2014-11-25 2015-06-10 桂林电子科技大学 Gamma correction and smoothing filtering based image histogram equalization enhancing method

Also Published As

Publication number Publication date
TW202009867A (en) 2020-03-01

Similar Documents

Publication Publication Date Title
KR100756318B1 (en) Image Processing Method and System Using Gain-Controllable Clipped Histogram Equalization
CN107527333B (en) Quick image enhancement method based on gamma transformation
Lin et al. Multi-scale retinex improvement for nighttime image enhancement
US10424054B2 (en) Low-illumination image processing method and device
KR102317613B1 (en) Systems and methods for localized contrast enhancement
US7734111B2 (en) Image processing apparatus, image processing method, and computer product
KR20070050249A (en) Method and apparatus for contrast enhancement
CN112365424A (en) Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium
KR101499461B1 (en) Histogram equalization apparatus using histogram compression
JP6097588B2 (en) Image processing apparatus and image processing method
CN103854259A (en) Image processing apparatus and method of processing image
CN110766639A (en) Image enhancement method and device, mobile equipment and computer readable storage medium
JP3545979B2 (en) Contour correction device
JP2010503056A (en) Image enhancement method and apparatus
CN112950499A (en) Image processing method, image processing device, electronic equipment and storage medium
JP2009025862A (en) Image processor, image processing method, image processing program and image display device
KR101516632B1 (en) Bipartite histogram equalization apparatus maintain the rate of mean brightness of video using visual threshold
TWI664606B (en) Method and system for filtering signals using a dynamic window smoothing filter
Jiji et al. A novel imaging system for underwater haze enhancement
CN110874822B (en) Signal filtering method and system using dynamic window smoothing filter
KR101499463B1 (en) Histogram equalization apparatus using visual threshold
TWI727306B (en) Contrast adjustment system and contrast adjustment method
JP6126054B2 (en) Image signal processing method and image signal processing apparatus
JP2005109875A (en) Picture processor
JP7145651B2 (en) Image processing device and program