TWI767750B - Image white balance method and system thereof - Google Patents
Image white balance method and system thereof Download PDFInfo
- Publication number
- TWI767750B TWI767750B TW110121237A TW110121237A TWI767750B TW I767750 B TWI767750 B TW I767750B TW 110121237 A TW110121237 A TW 110121237A TW 110121237 A TW110121237 A TW 110121237A TW I767750 B TWI767750 B TW I767750B
- Authority
- TW
- Taiwan
- Prior art keywords
- image
- expressed
- value
- weight value
- white
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 238000001914 filtration Methods 0.000 claims abstract 3
- 238000012545 processing Methods 0.000 claims description 56
- 238000006243 chemical reaction Methods 0.000 claims description 44
- 238000012216 screening Methods 0.000 claims description 33
- 230000014759 maintenance of location Effects 0.000 claims description 17
- 230000002349 favourable effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 4
- 238000004148 unit process Methods 0.000 description 4
- 238000012935 Averaging Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Color Television Image Signal Generators (AREA)
- Processing Of Color Television Signals (AREA)
Abstract
Description
本發明是關於一種影像的處理方法及其系統,特別是關於一種影像白平衡方法及其系統。The present invention relates to an image processing method and system, in particular to an image white balance method and system.
近年來,由於習知的自動白平衡方法(Automatic White Balance)大多需要假設影像處於特定情況下才進行白平衡調整,因此習知的自動白平衡方法無法適用於前述特定情況以外的影像。此外,習知的自動白平衡方法在對於不同的色溫下的多張連續影像進行調整時,容易會出現色偏的問題而導致在連續且不同的色溫情況下無法準確地調整影像。由此可知,習知的自動白平衡方法不管在室內或室外都有色溫的問題存在,其中在室內拍攝時會因為燈泡有從暖系色溫到冷系色溫的影響,在室外拍攝時則會因為太陽位置、天氣溼度以及視野可見度而受到影響。In recent years, since most of the conventional automatic white balance methods need to assume that the image is in a specific situation before performing white balance adjustment, the conventional automatic white balance method cannot be applied to images other than the above-mentioned specific situation. In addition, when the conventional automatic white balance method is used to adjust a plurality of continuous images with different color temperatures, the problem of color shift is likely to occur, so that the images cannot be accurately adjusted under the continuous and different color temperature conditions. It can be seen from this that the conventional automatic white balance method has the problem of color temperature whether indoors or outdoors. When shooting indoors, it will be affected by the light bulb from warm color temperature to cool color temperature, and when shooting outdoors, it will be caused by Sun position, weather humidity, and field of view visibility are affected.
有鑑於此,針對習知的自動白平衡方法所存在之問題點,如何建立一種可避免影像出現色偏問題的影像白平衡方法及其系統,實為民眾所殷切企盼,亦係相關業者須努力研發突破之目標及方向。In view of this, in view of the problems existing in the conventional automatic white balance method, how to establish an image white balance method and system that can avoid the problem of color cast in the image is really eagerly expected by the public, and it is also necessary for the relevant industry to work hard. The goal and direction of R&D breakthrough.
因此,本發明之目的在於提供一種影像白平衡方法及其系統,其透過在第一影像中選取出多個候選亮度值,再利用計算此些候選亮度值而產生多個增益參數,然後根據此些增益參數轉換第一影像為第二影像,進而避免第一影像在連續且不同的色溫調整上的色偏問題。Therefore, an object of the present invention is to provide an image white balance method and a system thereof, which select a plurality of candidate luminance values in a first image, and then use the candidate luminance values to generate a plurality of gain parameters, and then generate a plurality of gain parameters according to the These gain parameters convert the first image into the second image, thereby avoiding the color shift problem of the first image in continuous and different color temperature adjustment.
依據本發明的一實施方式提供一種影像白平衡方法,其用以轉換一第一影像為一第二影像。影像白平衡方法包含一第一色彩轉換步驟、一絕對差產生步驟、一似白點區域篩選步驟、一候選白點保留步驟以及一第二色彩轉換步驟。第一色彩轉換步驟係驅動一處理單元根據一色彩轉換程序轉換對應一第一色彩格式之第一影像為對應一第二色彩格式之一轉換影像。轉換影像包含複數影像平均值及一最大亮度值。絕對差產生步驟係驅動處理單元根據一運算程序處理此些影像平均值而產生複數平均絕對差。似白點區域篩選步驟係驅動處理單元根據一篩選程序處理此些平均絕對差而從轉換影像篩選出一似白點區域。候選白點保留步驟係驅動處理單元根據一選取權重值從似白點區域中保留複數候選白點。第二色彩轉換步驟係驅動處理單元根據此些候選白點計算最大亮度值以產生複數增益參數,然後根據此些增益參數轉換第一影像為對應第一色彩格式之第二影像。An embodiment of the present invention provides an image white balance method for converting a first image into a second image. The image white balance method includes a first color conversion step, an absolute difference generation step, a white point-like area screening step, a candidate white point retention step, and a second color conversion step. The first color conversion step drives a processing unit to convert a first image corresponding to a first color format into a converted image corresponding to a second color format according to a color conversion program. The converted image includes an average value of the complex images and a maximum luminance value. In the step of generating the absolute difference, the driving processing unit processes the average values of the images according to an operation program to generate a complex average absolute difference. In the step of screening the white-spot-like region, the driving processing unit processes the average absolute differences according to a screening procedure to filter out a white-spot-like region from the converted image. In the step of retaining candidate white points, the driving processing unit retains a plurality of candidate white points from the white point-like region according to a selection weight value. In the second color conversion step, the driving processing unit calculates the maximum luminance value according to the candidate white points to generate complex gain parameters, and then converts the first image into a second image corresponding to the first color format according to the gain parameters.
藉此,本發明之影像白平衡方法根據篩選程序調整似白點區域的範圍大小,並透過選取權重值來選取出指定數量的候選白點,然後計算出增益參數,進而轉換第一影像為第二影像,達到有效地解決在連續多張影像中進行色溫調整所造成的色偏問題。Thereby, the image white balance method of the present invention adjusts the size of the area of the white point-like area according to the screening procedure, selects a specified number of candidate white points by selecting the weight value, then calculates the gain parameter, and then converts the first image into the first image. Two images, to effectively solve the color shift problem caused by color temperature adjustment in multiple consecutive images.
前述實施方式之其他實施例如下:前述運算程序包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標及一像素數目,此些影像平均值分別表示為 與 ,此些平均絕對差分別表示為 與 ,此些色度值分別表示為 與 ,水平座標表示為 ,垂直座標表示為 ,像素數目表示為 且符合下式: ; 。 Other examples of the aforementioned implementation manner are as follows: the aforementioned computing procedure includes the image average values, the average absolute differences, complex chromaticity values, a horizontal coordinate, a vertical coordinate, and a number of pixels, and the image average values are respectively expressed as and , these mean absolute differences are expressed as and , these chromaticity values are expressed as and , the horizontal coordinates are expressed as , the vertical coordinates are expressed as , the number of pixels is expressed as and conform to the following formula: ; .
前述實施方式之其他實施例如下:前述篩選程序包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標、一拓展權重值及一符號函數,此些影像平均值分別表示為 與 ,此些平均絕對差分別表示為 與 ,此些色度值分別表示為 與 ,水平座標表示為 ,垂直座標表示為 ,拓展權重值表示為 ,符號函數表示為 且符合下式: ; 。 Other examples of the aforementioned embodiments are as follows: the aforementioned screening procedure includes the image mean values, the mean absolute differences, complex chromaticity values, a horizontal coordinate, a vertical coordinate, an extended weight value, and a sign function, the images The mean values are expressed as and , these mean absolute differences are expressed as and , these chromaticity values are expressed as and , the horizontal coordinates are expressed as , the vertical coordinates are expressed as , the extended weight value is expressed as , the symbolic function is expressed as and conform to the following formula: ; .
前述實施方式之其他實施例如下:前述影像白平衡方法更包含一權重值調整步驟。權重值調整步驟包含一第一調整步驟與一第二調整步驟。第一調整步驟係驅動處理單元根據一亮度值比對程序調整拓展權重值。第二調整步驟係驅動處理單元根據一分數值比對程序調整選取權重值。其中,處理單元根據已調整的拓展權重值與已調整的選取權重值重新執行第一色彩轉換步驟、絕對差產生步驟、似白點區域篩選步驟、候選白點保留步驟及第二色彩轉換步驟而產生對應第一色彩格式之已調整的第二影像。Other examples of the aforementioned embodiments are as follows: the aforementioned image white balance method further includes a weight value adjustment step. The weight value adjustment step includes a first adjustment step and a second adjustment step. In the first adjustment step, the drive processing unit adjusts the extended weight value according to a luminance value comparison procedure. In the second adjustment step, the drive processing unit adjusts the selection weight value according to a score comparison procedure. Wherein, the processing unit re-executes the first color conversion step, the absolute difference generation step, the white point-like area screening step, the candidate white point retention step, and the second color conversion step according to the adjusted extension weight value and the adjusted selection weight value to obtain a An adjusted second image corresponding to the first color format is generated.
前述實施方式之其他實施例如下:前述亮度值比對程序包含拓展權重值、一目標亮度值及一參考亮度值,拓展權重值表示為 ,目標亮度值表示為 ,參考亮度值表示為 且符合下式: 。 Other examples of the aforementioned embodiments are as follows: the aforementioned luminance value comparison procedure includes an extended weight value, a target luminance value and a reference luminance value, and the extended weight value is expressed as , the target brightness value is expressed as , the reference luminance value is expressed as and conform to the following formula: .
前述實施方式之其他實施例如下:前述分數值比對程序包含選取權重值、一目標分數值及一參考分數值,選取權重值表示為 ,目標分數值表示為 ,參考分數值表示為 且符合下式: 。 Other examples of the aforementioned embodiments are as follows: the aforementioned score value comparison procedure includes a selection weight value, a target score value and a reference score value, and the selection weight value is expressed as , the target score value is expressed as , the reference score value is expressed as and conform to the following formula: .
依據本發明的另一實施方式提供一種影像白平衡系統,其用以轉換一第一影像為一第二影像。影像白平衡系統包含一儲存單元以及一處理單元。儲存單元用以存取第一影像、一色彩轉換程序、一運算程序、一篩選程序及一選取權重值。處理單元連接儲存單元,且經配置以實施一第一色彩轉換步驟、一絕對差產生步驟、一似白點區域篩選步驟、一候選白點保留步驟及一第二色彩轉換步驟。第一色彩轉換步驟係根據色彩轉換程序轉換對應一第一色彩格式之第一影像為對應一第二色彩格式之一轉換影像。轉換影像包含複數影像平均值及一最大亮度值。絕對差產生步驟係根據運算程序處理此些影像平均值而產生複數平均絕對差。似白點區域篩選步驟係根據篩選程序處理此些平均絕對差而從轉換影像篩選出一似白點區域。候選白點保留步驟係根據選取權重值從似白點區域中保留複數候選白點。第二色彩轉換步驟係根據此些候選白點計算最大亮度值以產生複數增益參數,然後根據此些增益參數轉換第一影像為對應第一色彩格式之第二影像。Another embodiment of the present invention provides an image white balance system for converting a first image into a second image. The image white balance system includes a storage unit and a processing unit. The storage unit is used for accessing the first image, a color conversion program, an operation program, a filtering program and a selection weight value. The processing unit is connected to the storage unit, and is configured to implement a first color conversion step, an absolute difference generation step, a white point-like area screening step, a candidate white point retention step, and a second color conversion step. The first color conversion step is to convert a first image corresponding to a first color format into a converted image corresponding to a second color format according to a color conversion program. The converted image includes an average value of the complex images and a maximum luminance value. The absolute difference generating step is to process the average values of the images according to the operation program to generate a complex average absolute difference. The white-spot-like region screening step processes the mean absolute differences according to a screening procedure to filter out a white-spot-like region from the converted image. The candidate white point retaining step is to retain a plurality of candidate white points from the white point-like region according to the selected weight value. The second color conversion step calculates the maximum luminance value according to the candidate white points to generate complex gain parameters, and then converts the first image into a second image corresponding to the first color format according to the gain parameters.
藉此,本發明之影像白平衡系統向外拓展轉換影像的似白點區域,且加入選取權重值來選取出指定數量的候選白點,然後計算出增益參數,進而轉換第一影像為第二影像,達到有效地解決在連續色溫調整上的色偏問題。Thereby, the image white balance system of the present invention expands the white point-like area of the converted image outward, and adds a selection weight value to select a specified number of candidate white points, then calculates the gain parameter, and then converts the first image into the second image, to effectively solve the color shift problem in continuous color temperature adjustment.
前述實施方式之其他實施例如下:前述運算程序包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標及一像素數目,此些影像平均值分別表示為 與 ,此些平均絕對差分別表示為 與 ,此些色度值分別表示為 與 ,水平座標表示為 ,垂直座標表示為 ,像素數目表示為 且符合下式: ; 。 Other examples of the aforementioned implementation manner are as follows: the aforementioned computing procedure includes the image average values, the average absolute differences, complex chromaticity values, a horizontal coordinate, a vertical coordinate, and a number of pixels, and the image average values are respectively expressed as and , these mean absolute differences are expressed as and , these chromaticity values are expressed as and , the horizontal coordinates are expressed as , the vertical coordinates are expressed as , the number of pixels is expressed as and conform to the following formula: ; .
前述實施方式之其他實施例如下:前述篩選程序包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標、一拓展權重值及一符號函數,此些影像平均值分別表示為 與 ,此些平均絕對差分別表示為 與 ,此些色度值分別表示為 與 ,水平座標表示為 ,垂直座標表示為 ,拓展權重值表示為 ,符號函數表示為 且符合下式: ; 。 Other examples of the aforementioned embodiments are as follows: the aforementioned screening procedure includes the image mean values, the mean absolute differences, complex chromaticity values, a horizontal coordinate, a vertical coordinate, an extended weight value, and a sign function, the images The mean values are expressed as and , these mean absolute differences are expressed as and , these chromaticity values are expressed as and , the horizontal coordinates are expressed as , the vertical coordinates are expressed as , the extended weight value is expressed as , the symbolic function is expressed as and conform to the following formula: ; .
前述實施方式之其他實施例如下:前述處理單元經配置以更實施一權重值調整步驟。權重值調整步驟包含一第一調整步驟與一第二調整步驟。第一調整步驟係根據一亮度值比對程序調整拓展權重值。第二調整步驟係根據一分數值比對程序調整選取權重值。其中,處理單元根據已調整的拓展權重值與已調整的選取權重值重新執行第一色彩轉換步驟、絕對差產生步驟、似白點區域篩選步驟、候選白點保留步驟及第二色彩轉換步驟而產生對應第一色彩格式已調整的第二影像。Other examples of the aforementioned embodiments are as follows: the aforementioned processing unit is configured to further implement a weight value adjustment step. The weight value adjustment step includes a first adjustment step and a second adjustment step. The first adjustment step is to adjust the extended weight value according to a luminance value comparison procedure. The second adjustment step is to adjust the selection weight value according to a score comparison procedure. The processing unit re-executes the first color conversion step, the absolute difference generation step, the white point-like region screening step, the candidate white point retention step, and the second color conversion step according to the adjusted extension weight value and the adjusted selection weight value to achieve A second image adjusted corresponding to the first color format is generated.
前述實施方式之其他實施例如下:前述亮度值比對程序包含拓展權重值、一目標亮度值及一參考亮度值,拓展權重值表示為 ,目標亮度值表示為 ,參考亮度值表示為 且符合下式: 。 Other examples of the aforementioned embodiments are as follows: the aforementioned luminance value comparison procedure includes an extended weight value, a target luminance value and a reference luminance value, and the extended weight value is expressed as , the target brightness value is expressed as , the reference luminance value is expressed as and conform to the following formula: .
前述實施方式之其他實施例如下:前述分數值比對程序包含選取權重值、一目標分數值及一參考分數值,選取權重值表示為 ,目標分數值表示為 ,參考分數值表示為 且符合下式: 。 Other examples of the aforementioned embodiments are as follows: the aforementioned score value comparison procedure includes a selection weight value, a target score value and a reference score value, and the selection weight value is expressed as , the target score value is expressed as , the reference score value is expressed as and conform to the following formula: .
以下將參照圖式說明本發明之複數個實施例。為明確說明起見,許多實務上的細節將在以下敘述中一併說明。然而,應瞭解到,這些實務上的細節不應用以限制本發明。也就是說,在本發明部分實施例中,這些實務上的細節是非必要的。此外,為簡化圖式起見,一些習知慣用的結構與元件在圖式中將以簡單示意的方式繪示之;並且重複之元件將可能使用相同的編號表示之。Several embodiments of the present invention will be described below with reference to the drawings. For the sake of clarity, many practical details are set forth in the following description. It should be understood, however, that these practical details should not be used to limit the invention. That is, in some embodiments of the present invention, these practical details are unnecessary. In addition, for the purpose of simplifying the drawings, some well-known and conventional structures and elements will be shown in a simplified and schematic manner in the drawings; and repeated elements may be denoted by the same reference numerals.
此外,本文中當某一元件(或單元或模組等)「連接/連結」於另一元件,可指所述元件是直接連接/連結於另一元件,亦可指某一元件是間接連接/連結於另一元件,意即,有其他元件介於所述元件及另一元件之間。而當有明示某一元件是「直接連接/連結」於另一元件時,才表示沒有其他元件介於所述元件及另一元件之間。而第一、第二、第三等用語只是用來描述不同元件,而對元件本身並無限制,因此,第一元件亦可改稱為第二元件。且本文中之元件/單元/電路之組合非此領域中之一般周知、常規或習知之組合,不能以元件/單元/電路本身是否為習知,來判定其組合關係是否容易被技術領域中之通常知識者輕易完成。In addition, when a certain element (or unit or module, etc.) is "connected/connected" to another element herein, it may mean that the element is directly connected/connected to another element, or that a certain element is indirectly connected /Connected to another element means that there is another element between the element and the other element. When it is expressly stated that an element is "directly connected/connected" to another element, it means that no other element is interposed between the element and the other element. The terms first, second, and third are only used to describe different elements, and do not limit the elements themselves. Therefore, the first element can also be renamed as the second element. And the combination of elements/units/circuits in this article is not a commonly known, conventional or well-known combination in this field, and it cannot be determined whether the combination relationship of the elements/units/circuits is well-known or not easily understood by those in the technical field. Usually the knowledgeable can do it easily.
請參閱第1圖,其係繪示依照本發明一第一實施例的影像白平衡方法100的流程示意圖。如第1圖所示,影像白平衡方法100包含一第一色彩轉換步驟S1、一絕對差產生步驟S2、一似白點區域篩選步驟S3、一候選白點保留步驟S4以及一第二色彩轉換步驟S5,且用以轉換一第一影像110為一第二影像140。Please refer to FIG. 1 , which is a schematic flowchart of an image
第一色彩轉換步驟S1係驅動一處理單元根據一色彩轉換程序321轉換對應一第一色彩格式之第一影像110為對應一第二色彩格式之轉換影像120。轉換影像120包含複數影像平均值及一最大亮度值。The first color conversion step S1 drives a processing unit to convert the
絕對差產生步驟S2係驅動處理單元根據一運算程序322處理此些影像平均值而產生複數平均絕對差。In the absolute difference generating step S2 , the driving processing unit processes the average values of the images according to an
似白點區域篩選步驟S3係驅動處理單元根據一篩選程序323處理此些平均絕對差而從轉換影像120篩選出一似白點區域130。In the step S3 of screening the white-spot-like region, the driving processing unit processes the average absolute differences according to a
候選白點保留步驟S4係驅動處理單元根據一選取權重值
從似白點區域130中保留複數候選白點131。
The candidate white point retention step S4 is that the drive processing unit selects a weight value according to a A plurality of candidate
第二色彩轉換步驟S5係驅動處理單元根據此些候選白點131計算最大亮度值以產生複數增益參數,然後根據此些增益參數轉換第一影像110為對應第一色彩格式之第二影像140。In the second color conversion step S5, the driving processing unit calculates the maximum luminance value according to the candidate
藉此,本發明之影像白平衡方法100根據篩選程序323調整似白點區域130的範圍大小,並透過選取權重值
來選取出指定數量的候選白點131,然後計算出增益參數,進而轉換第一影像110為第二影像140,可有效地解決在連續多張影像中進行色溫調整所造成的色偏問題。
Thereby, the image
具體而言,第一色彩格式可為應用於三原色的一RGB色彩空間,第二色彩格式可為應用於顏色編碼的一YUV色彩空間。色彩轉換程序321主要用以將採用RGB色彩空間的第一影像110轉換成採用YUV色彩空間的轉換影像120。一般的攝影裝置所產生的影像,其像素分量分別為對應紅色分量的紅色彩值、對應綠色分量的綠色彩值及對應藍色分量的藍色彩值。處理單元透過色彩轉換程序321將第一影像110內的各個像素之RGB分量轉換為對應各個像素之一亮度值(即Y)、一色度值(即
)及另一色度值(即
)。接著,處理單元將轉換影像120的加總像素值除以轉換影像120的影像大小而產生此些影像平均值。處理單元將轉換影像120內的所有像素中選取亮度值最大者作為此最大亮度值。
Specifically, the first color format may be an RGB color space applied to three primary colors, and the second color format may be a YUV color space applied to color coding. The
於絕對差產生步驟S2中,運算程序322可包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標及一像素數目,此些影像平均值分別表示為
與
,此些平均絕對差分別表示為
與
,此些色度值分別表示為
與
,水平座標表示為
,垂直座標表示為
,像素數目表示為
且符合下列式子(1)與式子(2):
(1);
(2)。
In the absolute difference generating step S2, the
其中,平均絕對差
、
主要用以尋找轉換影像120的色度中心點。
及
表示在轉換影像120中位於水平座標
與垂直座標
的像素所對應的色度值。
where the mean absolute difference , It is mainly used to find the chromaticity center point of the converted
請一併參閱第1圖與第2圖,其中第2圖係繪示本發明之似白點區域130及多個候選白點131的示意圖。於似白點區域篩選步驟S3中,篩選程序323可包含此些影像平均值、此些平均絕對差、複數色度值、一水平座標、一垂直座標、一拓展權重值及一符號函數,此些影像平均值分別表示為
與
,此些平均絕對差分別表示為
與
,此些色度值分別表示為
與
,水平座標表示為
,垂直座標表示為
,拓展權重值表示為
,符號函數表示為
且符合下列式子(3)與式子(4):
(3);
(4)。
Please refer to FIG. 1 and FIG. 2 together, wherein FIG. 2 is a schematic diagram illustrating the white point-
在第2圖中,水平座標
的單位為色度值
,垂直座標
的單位為色度值
。此外,拓展權重值
主要用以調整以第2圖中的色度中心點Q為基準向外拓展的似白點區域130之範圍,且拓展權重值
的數值可為1,但本發明不以此為限。
In Figure 2, the horizontal coordinates The unit is the chromaticity value , vertical coordinates The unit is the chromaticity value . In addition, expanding the weight value It is mainly used to adjust the range of the white-
需說明的是,習知的自動白平衡方法在篩選似白點時固定了篩選範圍而導致有些接近顏色空間的真正白點沒被篩選到。然而,由第2圖、式子(3)及式子(4)可知,本發明考慮到首張的第一影像110的色溫值與對應首張的第一影像110之似白點區域130不一定會與下一張的另一第一影像110的色溫值與對應下一張的第一影像110之似白點區域130相同,因此在篩選似白點區域130時加入了拓展權重值
,來調整以色度中心點Q為基準向外拓展的似白點區域130之範圍,其中第2圖內的虛線方框為習知的自動白平衡方法所對應的似白點區域。
It should be noted that the conventional automatic white balance method fixes the screening range when screening the pseudo-white points, so that some true white points close to the color space are not screened. However, as can be seen from FIG. 2, Equation (3) and Equation (4), the present invention considers that the color temperature value of the first
另外,習知的自動白平衡方法選取候選白點的方式是直接選取似白點區域內的似白點亮度值較大者作為候選白點。例如:亮度值為前10%者作為候選白點;不同的是,於候選白點保留步驟S4中,本發明之選取候選白點131的方式係在似白點區域130內選取似白點亮度值較大的前選取權重值
者作為此些候選白點131,因此選取權重值
主要用以在似白點區域130中控制候選白點131的選取數量,且選取權重值
的數值可為0.1,但本發明不以此為限。
In addition, the conventional automatic white balance method selects the candidate white point by directly selecting the white point candidate with the larger brightness value of the white point in the white point-like area. For example, the top 10% of the brightness values are used as candidate white points; the difference is that in the candidate white point retention step S4, the method of selecting the candidate
於第二色彩轉換步驟S5中,各個候選白點131具有對應第二色彩格式的一候選亮度值(即Y)、一候選色度值(即
)及另一候選色度值(即
)。處理單元分別計算此些候選白點131的複數個候選亮度值、複數個候選色度值及複數個另一候選色度值而產生一平均亮度值、一平均色度值及另一平均色度值。接著,處理單元根據色彩轉換程序321的一逆轉換程序(即YUV色彩空間轉換RGB色彩空間)分別計算平均亮度值、平均色度值及另一平均色度值而產生對應第一色彩格式的一平均紅色彩值、一平均綠色彩值及一平均藍色彩值。接著,處理單元計算平均紅色彩值、平均綠色彩值及平均藍色彩值及最大亮度值以產生此些增益參數且符合下列式子(5)、式子(6)及式子(7):
(5);
(6);
(7)。
In the second color conversion step S5, each candidate
其中,最大亮度值表示為 ,平均紅色彩值表示為 ,平均綠色彩值表示為 ,平均藍色彩值表示為 ,此些增益參數分別表示為 、 及 。 Among them, the maximum brightness value is expressed as , the average red color value is expressed as , the average green color value is expressed as , the average blue color value is expressed as , these gain parameters are expressed as , and .
處理單元根據此些增益參數
、
轉換第一影像110的紅色彩值、綠色彩值及藍色彩值為對應第一色彩格式之第二影像140的另一紅色彩值、另一綠色彩值及另一藍色彩值且符合下列式子(8)、式子(9)及式子(10):
(8);
(9);
(10)。
The processing unit according to these gain parameters , Convert the red color value, green color value and blue color value of the
其中,第一影像110的紅色彩值、綠色彩值及藍色彩值分別表示為
、
及
,第二影像140的另一紅色彩值、另一綠色彩值及另一藍色彩值分別表示為
、
及
。
The red color value, green color value and blue color value of the
請一併參閱第3圖與第4圖,其中第3圖係繪示依照本發明一第二實施例的影像白平衡方法200的流程示意圖;以及第4圖係繪示第3圖的影像白平衡方法200之權重值調整步驟S6的流程示意圖。第二實施例中的第一色彩轉換步驟S1、絕對差產生步驟S2、似白點區域篩選步驟S3、候選白點保留步驟S4及第二色彩轉換步驟S5與第一實施例中的流程步驟相同,在此不另贅述。Please refer to FIG. 3 and FIG. 4 together, wherein FIG. 3 shows a schematic flowchart of an image
如第3圖與第4圖所示,影像白平衡方法200更包含一權重值調整步驟S6,且權重值調整步驟S6可包含一第一調整步驟S61與一第二調整步驟S62。第一調整步驟S61係驅動處理單元根據一亮度值比對程序324調整拓展權重值
。第二調整步驟S62係驅動處理單元根據一分數值比對程序325調整選取權重值
。其中,處理單元根據已調整的調整拓展權重值
與已調整的選取權重值
重新執行下一次的第一色彩轉換步驟S1、絕對差產生步驟S2、似白點區域篩選步驟S3、候選白點保留步驟S4及第二色彩轉換步驟S5而產生對應第一色彩格式之已調整的第二影像140。須注意的是,在下一次(即第二次)的第一色彩轉換步驟S1中,處理單元會將第一影像110替換成尚未調整的第二影像140。
As shown in FIGS. 3 and 4, the image
同理,處理單元遞迴地重複執行四次的第一色彩轉換步驟S1、絕對差產生步驟S2、似白點區域篩選步驟S3、候選白點保留步驟S4、第二色彩轉換步驟S5及權重值調整步驟S6;換言之,本發明會對首次的第一影像110進行至少五次的調整,以求得最後調整的第二影像140作為輸出影像。Similarly, the processing unit recursively executes the first color conversion step S1, the absolute difference generation step S2, the white point-like region screening step S3, the candidate white point retention step S4, the second color conversion step S5 and the weight value. Adjustment step S6; in other words, the present invention will adjust the first
於第一調整步驟S61中,亮度值比對程序324可包含拓展權重值、一目標亮度值及一參考亮度值,拓展權重值表示為
,目標亮度值表示為
,參考亮度值表示為
且符合下列式子(11):
(11)。
In the first adjustment step S61, the brightness
其中,拓展權重值
的初始值為1,目標亮度值
為當次的平均亮度值的Y值,參考亮度值
為首張的第一影像110轉換至第二色彩格式的Y值和下一張的另一第一影像110轉換至第二色彩格式的Y值取平均後的Y值。本發明藉由式子(11)調整拓展權重值
的大小,進而改變已調整的第二影像140的色溫走向與亮度,且拓展權重值
的數值範圍可落在0.5-1.5之間,但本發明不限於此。
Among them, the extended weight value The initial value of 1, the target brightness value is the Y value of the current average brightness value, the reference brightness value A Y value obtained by averaging the Y value of the
於第二調整步驟S62中,分數值比對程序325可包含選取權重值、一目標分數值及一參考分數值,選取權重值表示為
,目標分數值表示為
,參考分數值表示為
且符合下列式子(12):
(12)。
In the second adjustment step S62, the
其中,選取權重值
的初始值為0.1,目標分數值
為處理單元根據一CIE 2000色彩差異公式計算當次的第一影像110與第二影像140而產生的分數值。參考分數值
為處理單元根據CIE 2000色彩差異公式計算首張的第一影像110和下一張的另一第一影像110而產生的另一分數值,且選取權重值
的數值範圍可落在0.1-0.5之間,但本發明不限於此。
Among them, choose the weight value The initial value of 0.1, the target score value It is a score value generated by the processing unit calculating the current
此外,於每一次的遞迴步驟中,參考亮度值
會根據前次的目標分數值
與參考分數值
進行比較而選擇出下一次的參考亮度值
。例如:若是前次的目標分數值
為較低者,則處理單元利用當次第二影像140的Y值替換掉原參考亮度值
並進入下次的遞迴運算;若是前次的參考分數值
為較低者,則處理單元繼續沿用原參考亮度值
並進入下次的遞迴運算。
In addition, in each recursive step, the reference luminance value will be based on the previous target score value with reference score values Compare and select the next reference brightness value . For example: if the previous target score value is the lower one, the processing unit replaces the original reference luminance value with the Y value of the current
另外,於每一次的遞迴步驟中,參考分數值 也會根據前次的目標分數值 與參考分數值 進行比較而選擇出下一次的參考分數值 。例如:若是前次的目標分數值 為較低者,則處理單元利用前次的目標分數值 替換掉原參考分數值 並進入下次的遞迴運算;若是前次的參考分數值 為較低者,則處理單元繼續沿用原參考分數值 並進入下次的遞迴運算。 In addition, in each recursive step, the reference score value Also based on the previous target score value with reference score values Compare and choose the next reference score value . For example: if the previous target score value is the lower, the processing unit uses the previous target score value Replace the original reference score value And enter the next recursive operation; if the previous reference score value is lower, the processing unit continues to use the original reference score value And enter the next recursive operation.
請一併參閱第1-4圖及第5圖,其中第5圖係繪示依照本發明一第三實施例的影像白平衡系統300的方塊示意圖。如1-5圖所示,影像白平衡系統300用以轉換一第一影像110為一第二影像140,且包含一攝影單元310、儲存單元320以及一處理單元330。攝影單元310用以拍攝一物體並輸出第一影像110。儲存單元320訊號連接攝影單元310,且用以存取第一影像110、一色彩轉換程序321、一運算程序322、一篩選程序323、一選取權重值
、一拓展權重值
、一亮度值比對程序324及一分數值比對程序325。處理單元330電性連接儲存單元320,且經配置以實施一第一色彩轉換步驟S1、一絕對差產生步驟S2、一似白點區域篩選步驟S3、一候選白點保留步驟S4及一第二色彩轉換步驟S5。
Please refer to FIGS. 1-4 and FIG. 5 together, wherein FIG. 5 is a block diagram illustrating an image
第一色彩轉換步驟S1係根據色彩轉換程序321轉換對應一第一色彩格式之第一影像110為對應一第二色彩格式之一轉換影像120。轉換影像120包含複數影像平均值及一最大亮度值。絕對差產生步驟S2係根據運算程序322處理此些影像平均值而產生複數平均絕對差。似白點區域篩選步驟S3係根據篩選程序323處理此些平均絕對差而從轉換影像120篩選出一似白點區域130。候選白點保留步驟S4係根據選取權重值
從似白點區域130中保留複數候選白點131。第二色彩轉換步驟S5係根據此些候選白點131計算最大亮度值以產生複數增益參數,然後根據此些增益參數轉換第一影像110為對應第一色彩格式之第二影像140。
The first color conversion step S1 is to convert the
此外,處理單元330經配置以更可實施一權重值調整步驟S6。權重值調整步驟S6可包含一第一調整步驟S61與一第二調整步驟S62。第一調整步驟S61係根據亮度值比對程序324調整拓展權重值
。第二調整步驟S62係根據分數值比對程序325調整選取權重值
。再者,處理單元330根據已調整的拓展權重值
與已調整的選取權重值
重新執行第一色彩轉換步驟S1、絕對差產生步驟S2、似白點區域篩選步驟S3、候選白點保留步驟S4及第二色彩轉換步驟S5而產生對應第一色彩格式已調整的第二影像140。處理單元330可為微處理器、中央處理器(Central Processing Unit;CPU)、影像處理器或其他電子處理器,本發明不以此為限。
In addition, the
藉此,本發明之影像白平衡系統300向外拓展轉換影像120的似白點區域130,且加入選取權重值
來選取出指定數量的候選白點131,然後計算出增益參數,進而轉換第一影像110為第二影像140,達到有效地解決在連續色溫調整上的色偏問題。
Thereby, the image
綜上所述,本發明具有下列優點:其一,有效地解決在連續多張影像中進行色溫調整所造成的色偏問題。其二,透過加入拓展權重值來調整似白點區域的範圍大小,進而避免接近顏色空間的似白點沒被篩選到。其三,透過加入選取權重值可靈活地在不同色溫的情況下篩選出較適用數量的候選白點。To sum up, the present invention has the following advantages: First, it effectively solves the color shift problem caused by performing color temperature adjustment in multiple consecutive images. Second, by adding an extended weight value to adjust the size of the white-like point area, so as to prevent the white-like points close to the color space from not being screened. Third, by adding a selection weight value, a suitable number of candidate white points can be flexibly screened under different color temperatures.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何熟習此技藝者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed as above with examples, it is not intended to limit the present invention. Anyone skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection of the present invention The scope shall be determined by the scope of the appended patent application.
100,200:影像白平衡方法 S1:第一色彩轉換步驟 S2:絕對差產生步驟 S3:似白點區域篩選步驟 S4:候選白點保留步驟 S5:第二色彩轉換步驟 S6:權重值調整步驟 S61:第一調整步驟 S62:第二調整步驟 110:第一影像 120:轉換影像 130:似白點區域 131:候選白點 140:第二影像 300:影像白平衡系統 310:攝影單元 320:儲存單元 321:色彩轉換程序 322:運算程序 323:篩選程序 324:亮度值比對程序 325:分數值比對程序 330:處理單元 :水平座標 :垂直座標 , :色度值 :篩選程序 :選取權重值 Q:色度中心點100,200: image white balance method S1: first color conversion step S2: absolute difference generation step S3: similar white point area screening step S4: candidate white point retention step S5: second color conversion step S6: weight value adjustment step S61: first An adjustment step S62: Second adjustment step 110: First image 120: Converted image 130: Like white point area 131: Candidate white point 140: Second image 300: Image white balance system 310: Photography unit 320: Storage unit 321: Color conversion program 322: Operation program 323: Screening program 324: Brightness value comparison program 325: Fractional value comparison program 330: Processing unit : Horizontal coordinates : vertical coordinates , : chromaticity value : filter program : select weight value Q: chromaticity center point
為讓本發明之上述和其他目的、特徵、優點與實施例能更明顯易懂,所附圖式之說明如下: 第1圖係繪示依照本發明一第一實施例的影像白平衡方法的流程示意圖; 第2圖係繪示本發明之似白點區域及多個候選白點的示意圖; 第3圖係繪示依照本發明一第二實施例的影像白平衡方法的流程示意圖; 第4圖係繪示第3圖的影像白平衡方法之權重值調整步驟的流程示意圖;以及 第5圖係繪示依照本發明一第三實施例的影像白平衡系統的方塊示意圖。 In order to make the above and other objects, features, advantages and embodiments of the present invention more clearly understood, the accompanying drawings are described as follows: FIG. 1 is a schematic flowchart of an image white balance method according to a first embodiment of the present invention; FIG. 2 is a schematic diagram illustrating a white point-like region and a plurality of candidate white points according to the present invention; FIG. 3 is a schematic flowchart of an image white balance method according to a second embodiment of the present invention; FIG. 4 is a schematic flowchart illustrating a weight value adjustment step of the image white balance method of FIG. 3; and FIG. 5 is a block diagram illustrating an image white balance system according to a third embodiment of the present invention.
100:影像白平衡方法 100: Image white balance method
S1:第一色彩轉換步驟 S1: First color conversion step
S2:絕對差產生步驟 S2: Absolute difference generation step
S3:似白點區域篩選步驟 S3: Screening step of the white-like area
S4:候選白點保留步驟 S4: candidate white point retention step
S5:第二色彩轉換步驟 S5: Second color conversion step
110:第一影像 110: First image
120:轉換影像 120: Convert Image
130:似白點區域 130: White spot area
131:候選白點 131: Candidate White Point
140:第二影像 140:Second Image
321:色彩轉換程序 321: Color Conversion Program
322:運算程序 322: Operation program
323:篩選程序 323: Screener
W p :選取權重值 W p : select the weight value
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW110121237A TWI767750B (en) | 2021-06-10 | 2021-06-10 | Image white balance method and system thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW110121237A TWI767750B (en) | 2021-06-10 | 2021-06-10 | Image white balance method and system thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI767750B true TWI767750B (en) | 2022-06-11 |
| TW202248957A TW202248957A (en) | 2022-12-16 |
Family
ID=83103803
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW110121237A TWI767750B (en) | 2021-06-10 | 2021-06-10 | Image white balance method and system thereof |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI767750B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TW201340727A (en) * | 2012-03-19 | 2013-10-01 | Altek Corp | White balance method and apparatus thereof |
| CN104618703A (en) * | 2015-02-09 | 2015-05-13 | 傅邓文 | White balance adjusting method |
| CN107135384A (en) * | 2017-05-19 | 2017-09-05 | 中国科学院深圳先进技术研究院 | White balance adjusting method, device, image processing terminal and storage medium |
| US20190253683A1 (en) * | 2018-02-09 | 2019-08-15 | Shanghai Xiaoyi Technology Co., Ltd. | White balance parameter determination method and white balance adjustment method, device, and storage medium thereof |
-
2021
- 2021-06-10 TW TW110121237A patent/TWI767750B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TW201340727A (en) * | 2012-03-19 | 2013-10-01 | Altek Corp | White balance method and apparatus thereof |
| CN104618703A (en) * | 2015-02-09 | 2015-05-13 | 傅邓文 | White balance adjusting method |
| CN107135384A (en) * | 2017-05-19 | 2017-09-05 | 中国科学院深圳先进技术研究院 | White balance adjusting method, device, image processing terminal and storage medium |
| US20190253683A1 (en) * | 2018-02-09 | 2019-08-15 | Shanghai Xiaoyi Technology Co., Ltd. | White balance parameter determination method and white balance adjustment method, device, and storage medium thereof |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202248957A (en) | 2022-12-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100791375B1 (en) | Color correction device and method | |
| US8164649B2 (en) | White balance adjusting device, imaging apparatus, and recording medium storing white balance adjusting program | |
| JP4904440B2 (en) | Image processing method and apparatus, image processing program, and medium storing this program | |
| CN103929631B (en) | White balance adjustment method using scene detection and apparatus thereof | |
| TWI660633B (en) | White balance calibration method based on skin color data and image processing apparatus thereof | |
| JPH08289314A (en) | Automatic white balance adjustment device | |
| US8059904B2 (en) | Image-processing device, electronic camera, image-processing program, and image-processing method | |
| JP6520578B2 (en) | Image processing apparatus and display determination method | |
| JP2002281348A (en) | Image processor, image processing method and recording medium | |
| JP6789904B2 (en) | Dynamic range compression device and image processing device | |
| TWI767750B (en) | Image white balance method and system thereof | |
| KR101144265B1 (en) | Method and apparatus for transforming color temperature with luminance transformation | |
| JP2009004966A (en) | Imaging device | |
| CN103384334A (en) | Image processing apparatus, image processing method and program | |
| CN109285113B (en) | Improved color image interpolation method based on gradient | |
| JP5858735B2 (en) | Color correction apparatus and color correction method | |
| US20090256928A1 (en) | Method and device for detecting color temperature | |
| JP4947624B2 (en) | White balance adjustment method | |
| JP5330291B2 (en) | Signal processing apparatus and imaging apparatus | |
| JP2007515876A (en) | Image data conversion processing system and image data conversion processing method for effectively executing image data conversion processing | |
| KR20150091717A (en) | Method and apparatus for interpolating color signal of image and medium record of | |
| KR20070091208A (en) | Auto white balance control | |
| JP2019004281A (en) | Image processing device | |
| JP2005354585A (en) | Device, method and program of image processing | |
| US20080316343A1 (en) | Method and Apparatus For Allowing Access to Individual Memory |