TW201408038A - Color calibration method and image processing device using the same - Google Patents

Color calibration method and image processing device using the same Download PDF

Info

Publication number
TW201408038A
TW201408038A TW101129559A TW101129559A TW201408038A TW 201408038 A TW201408038 A TW 201408038A TW 101129559 A TW101129559 A TW 101129559A TW 101129559 A TW101129559 A TW 101129559A TW 201408038 A TW201408038 A TW 201408038A
Authority
TW
Taiwan
Prior art keywords
values
value
measurement
output
standard
Prior art date
Application number
TW101129559A
Other languages
Chinese (zh)
Other versions
TWI527428B (en
Inventor
Po-Nian Chu
Chih-Jung Chang
Original Assignee
Cal Comp Electronics & Comm Co
Kinpo Elect Inc
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 Cal Comp Electronics & Comm Co, Kinpo Elect Inc filed Critical Cal Comp Electronics & Comm Co
Priority to TW101129559A priority Critical patent/TWI527428B/en
Priority to US13/615,605 priority patent/US8824029B2/en
Priority to CN201210349245.6A priority patent/CN103595895A/en
Publication of TW201408038A publication Critical patent/TW201408038A/en
Application granted granted Critical
Publication of TWI527428B publication Critical patent/TWI527428B/en

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

A color calibration method is provided. The method includes: obtaining a first image of a calibration card having color blocks, wherein each of the color block corresponds to a standard value; obtaining first sensing values according to the first image, wherein each of the first sensing values corresponds to one of the standard values; generating a calibration table according to the first sensing values and the standard values; and determining if a recursive condition is satisfied. The method also includes: if the recursive condition is not satisfied, obtaining a second image of the calibration card, obtaining second sensing values according to the second image, adjusting the second sensing values according to the calibration table to generate third sensing values, and updating the calibration table according to the third sensing values and the standard values until the recursive condition is satisfied. Therefore, the method generates the calibration table automatically.

Description

顏色校正方法與影像處理裝置 Color correction method and image processing device

本發明是有關於一種顏色校正方法與使用此方法的影像處理裝置。 The present invention relates to a color correction method and an image processing apparatus using the same.

一般來說,當一個掃瞄器對於一個物體擷取一張影像時,物體實際的亮度並不一定等於所擷取的影像中的亮度。物體的亮度與影像的亮度之間會存在著非線性的失真(distortion)。此失真可以用以下的方程式(1)來表示。 In general, when a scanner captures an image of an object, the actual brightness of the object does not necessarily equal the brightness of the captured image. There is a nonlinear distortion between the brightness of the object and the brightness of the image. This distortion can be expressed by the following equation (1).

其中X為物體的亮度值,Y為影像的亮度值,γ為一個參數。因為在擷取影像時存在著上述的非線性關係,因此掃瞄器在取得影像以後會對此影像中的亮度(luminance)或是色度(chrominance)做伽瑪校正(gamma correction)來去除這樣的失真。伽瑪校正是以非線性的方式來補償影像中的誤差,使得物體的亮度值與影像校正後的亮度值呈線性關係。伽瑪校正可以用以下的方程式(2)來表示。 Where X is the brightness value of the object, Y is the brightness value of the image, and γ is a parameter. Because the above nonlinear relationship exists when capturing an image, the scanner removes the luminance or chrominance of the image after acquiring the image to remove the gamma correction. Distortion. The gamma correction compensates for errors in the image in a nonlinear manner, so that the brightness value of the object is linear with the brightness value corrected by the image. The gamma correction can be expressed by the following equation (2).

其中Y’是經過伽瑪校正的亮度值。γ是伽瑪校正使用的參數。因此,經過方程式(2)的運算以後,Y’與X之間便會成為線性的關係。 Where Y' is the gamma corrected brightness value. γ is a parameter used for gamma correction. Therefore, after the operation of equation (2), a relationship between Y' and X becomes linear.

為了達到上述伽瑪校正的效果,常見的作法有類比式與數位式。類比式的作法是利用非線性的電子電路產生近 似上述方程式(2)的運算結果。 In order to achieve the above gamma correction effect, common methods are analogous and digital. Analogy is the use of nonlinear electronic circuits to generate near The result of the operation of equation (2) above.

數位式的作法是直接計算上述方程式(2)的指數運算。然而,在一些裝置上並不能即時做指數運算,因此會將預先計算好的輸入與輸出儲存在一個查找表(lookup table)中。當要執行伽瑪校正時,便可以透過查詢此查找表來取得調整後的亮度值。 The digital method is to directly calculate the exponential operation of equation (2) above. However, on some devices it is not possible to do exponential operations on the fly, so the pre-computed inputs and outputs are stored in a lookup table. When gamma correction is to be performed, the adjusted brightness value can be obtained by querying the lookup table.

只利用一個γ套用在不同的掃描器上是非常有效率的。但是,一個γ的數值並不一定能適用於所有的掃描器。若要針對每一個掃瞄器用人力的方式產生對應的γ則會花費非常多的時間。因此,如何自動地產生γ為此領域研究人員所關心的議題。 It is very efficient to use only one gamma on different scanners. However, a value of γ does not necessarily apply to all scanners. It takes a lot of time to generate a corresponding γ manually for each scanner. Therefore, how to automatically generate gamma is of interest to researchers in this field.

本發明的實施例提出一種顏色校正方法與影像處理裝置,可以自動的產生一個校正表。 Embodiments of the present invention provide a color correction method and an image processing apparatus that can automatically generate a correction table.

本發明一實施例提出一種顏色校正方法,用於影像處理裝置。顏色校正方法包括:取得導表的第一影像,此導表包括多個色塊,並且每一個色塊對應一個標準值;根據第一影像取得多個第一量測值,其中每一個第一量測值對應上述標準值的其中之一;根據第一量測值與標準值產生一個校正表;以及判斷遞迴條件是否滿足。此顏色校正方法還包括:若遞迴條件不滿足,取得導表的第二影像,根據第二影像取得多個第二量測值,根據校正表調整第二量測值以產生多個第三量測值,並且根據第三量測值與標準 值更新校正表直到滿足遞迴條件。 An embodiment of the invention provides a color correction method for an image processing apparatus. The color correction method includes: obtaining a first image of the guide table, the guide table includes a plurality of color blocks, and each color block corresponds to a standard value; and obtaining a plurality of first measurement values according to the first image, wherein each of the first images The measured value corresponds to one of the above standard values; a correction table is generated according to the first measured value and the standard value; and whether the recursive condition is satisfied is satisfied. The color correction method further includes: if the recursive condition is not satisfied, obtaining the second image of the guide table, obtaining a plurality of second measurement values according to the second image, and adjusting the second measurement value according to the calibration table to generate a plurality of third Measured values and based on the third measured value and standard The value updates the correction table until the recursion condition is met.

在一實施例中,上述的校正表包括多個第一輸出值,每一個第一輸出值對應一個第一索引。上述根據第一量測值與標準值產生校正表的步驟包括:設定部份的第一索引為第一量測值;設定對應第一量測值的第一輸出值為標準值;以及,產生未對應第一量測值的第一輸出值。 In an embodiment, the correction table includes a plurality of first output values, each of the first output values corresponding to a first index. The step of generating a calibration table according to the first measured value and the standard value includes: setting a first index of the portion into a first measured value; setting a first output value corresponding to the first measured value as a standard value; and generating The first output value that does not correspond to the first measurement value.

在一實施例中,上述判斷遞迴條件是否滿足的步驟包括:判斷一個遞迴次數是否符合一個遞迴臨界值;以及,若此遞迴次數符合遞迴臨界值,判斷遞迴條件已滿足。上述根據第三量測值與標準值更新校正表的步驟還包括:更新遞迴次數。 In an embodiment, the step of determining whether the recursive condition is satisfied comprises: determining whether a number of recursive times meets a recursive threshold; and if the number of recursive times meets a recursive threshold, determining that the recursive condition is satisfied. The step of updating the correction table according to the third measured value and the standard value further includes: updating the number of recursive times.

在一實施例中,上述判斷遞迴條件是否滿足的步驟包括:根據第一量測值與標準值計算一個誤差值,或者根據第三量測值與標準值計算此誤差值;判斷此誤差值是否小於一個誤差臨界值;以及,若誤差值小於誤差臨界值,判斷遞迴條件已滿足。 In an embodiment, the step of determining whether the recursive condition is satisfied comprises: calculating an error value according to the first measured value and the standard value, or calculating the error value according to the third measured value and the standard value; determining the error value Whether it is less than an error threshold; and if the error value is less than the error threshold, it is judged that the recursion condition has been satisfied.

在一實施例中,上述的第一量測值包括一個最小量測值與一個最大量測值。上述產生未對應第一量測值的第一輸出值的步驟包括:設定小於最小量測值的第一索引所對應的第一輸出值為第一預設值;設定大於最大量測值的第一索引所對應的第一輸出值為第二預設值;以及以一個內插演算法產生其餘的第一輸出值。 In an embodiment, the first measured value includes a minimum measured value and a maximum measured value. The step of generating the first output value that does not correspond to the first measurement value includes: setting a first output value corresponding to the first index smaller than the minimum measurement value as a first preset value; setting a number greater than the maximum measurement value The first output value corresponding to an index is a second preset value; and the remaining first output value is generated by an interpolation algorithm.

在一實施例中,上述的第一索引包括一個第二索引,並且第二索引對應至第一輸出值中的一個第二輸出值。上 述根據第三量測值與標準值更新校正表的步驟包括:建立一個暫時校正表,此暫時校正表包括多個第三輸出值,並且每一個第三輸出值對應一個第三索引;設定部份的第三索引為所述的第三量測值;設定對應第三量測值的第三輸出值為標準值;產生未對應至第三量測值的第三輸出值;將第二輸出值作為第三索引的其中之一以取得第三輸出值中的一個第四輸出值;以及設定第二輸出值為第四輸出值。因此,透過第二索引與第二輸出值,可產生更新後的校正表。 In an embodiment, the first index includes a second index, and the second index corresponds to a second output value of the first output value. on The step of updating the correction table according to the third measured value and the standard value includes: establishing a temporary correction table, the temporary correction table including a plurality of third output values, and each of the third output values corresponding to a third index; setting part The third index of the share is the third measured value; setting a third output value corresponding to the third measured value as a standard value; generating a third output value not corresponding to the third measured value; and outputting the second output The value is one of the third indices to obtain a fourth output value of the third output value; and the second output value is set to the fourth output value. Therefore, the updated correction table can be generated by the second index and the second output value.

在一實施例中,上述根據第一量測值與標準值計算一誤差值的步驟包括:計算第一量測值與標準值之間的殘差平方和以取得此誤差值。上述根據第三量測值與標準值計算誤差值的步驟包括:計算第三量測值與標準值之間的殘差平方和以取得誤差值。 In an embodiment, the step of calculating an error value according to the first measured value and the standard value comprises: calculating a sum of squared residuals between the first measured value and the standard value to obtain the error value. The step of calculating the error value according to the third measured value and the standard value includes calculating a sum of squared residuals between the third measured value and the standard value to obtain the error value.

以另外一個角度來說,本發明一實施例提出一種影像處理裝置,包括影像擷取單元與處理器。影像擷取單元是用以取得導表的第一影像。此導表包括多個色塊,並且每一個色塊對應一個標準值。處理器是耦接至影像擷取單元,用以根據第一影像取得多個第一量測值,其中每一個第一量測值對應上述標準值的其中之一。處理器用以根據第一量測值與標準值產生一個校正表,並且判斷一個遞迴條件是否滿足。若遞迴條件不滿足,處理器也用以取得導表的第二影像,根據第二影像取得多個第二量測值,根據校正表調整第二量測值以產生多個第三量測值,並且根據 第三量測值與標準值更新校正表直到滿足遞迴條件。 In another aspect, an embodiment of the present invention provides an image processing apparatus, including an image capturing unit and a processor. The image capturing unit is used to obtain a first image of the guide. This guide table includes a plurality of color patches, and each color patch corresponds to a standard value. The processor is coupled to the image capturing unit for obtaining a plurality of first measurement values according to the first image, wherein each of the first measurement values corresponds to one of the standard values. The processor is configured to generate a correction table according to the first measured value and the standard value, and determine whether a recursive condition is satisfied. If the recursive condition is not satisfied, the processor is further configured to obtain a second image of the guide table, obtain a plurality of second measurement values according to the second image, and adjust the second measurement value according to the calibration table to generate a plurality of third measurement values. Value, and according to The third measurement value and the standard value update the correction table until the recursion condition is satisfied.

在一實施例中,上述的校正表包括多個第一輸出值,並且每一個第一輸出值對應一個第一索引。處理器還用以設定部份的第一索引為第一量測值,設定對應第一量測值的第一輸出值為標準值,以及產生未對應至第一量測值的第一輸出值。 In an embodiment, the correction table includes a plurality of first output values, and each of the first output values corresponds to a first index. The processor is further configured to set a first index of the portion to a first measured value, set a first output value corresponding to the first measured value to a standard value, and generate a first output value that does not correspond to the first measured value. .

在一實施例中,上述的處理器還用以判斷一個遞迴次數是否符合一個遞迴臨界值。若遞迴次數符合遞迴臨界值,處理器還用以判斷遞迴條件已滿足。處理器還用以在根據第三量測值與標準值更新校正表時,更新遞迴次數。 In an embodiment, the processor is further configured to determine whether a number of recursive times meets a recursive threshold. If the number of recursions meets the recursive threshold, the processor is also used to determine that the recursive condition has been met. The processor is further configured to update the number of recursive times when the calibration table is updated according to the third measured value and the standard value.

在一實施例中,上述的處理器還用以根據第一量測值與標準值計算一個誤差值,或者根據第三量測值與標準值計算此誤差值。處理器還用以判斷此誤差值是否小於一個誤差臨界值。若誤差值小於誤差臨界值,處理器還用以判斷遞迴條件已滿足。 In an embodiment, the processor is further configured to calculate an error value according to the first measured value and the standard value, or calculate the error value according to the third measured value and the standard value. The processor is further configured to determine whether the error value is less than an error threshold. If the error value is less than the error threshold, the processor is further configured to determine that the recursive condition has been met.

在一實施例中,上述的第一量測值包括一個最小量測值與一個最大量測值。處理器還用以設定小於最小量測值的第一索引所對應的第一輸出值為一個第一預設值,設定大於最大量測值的第一索引所對應的第一輸出值為一個第二預測值,並且以內插演算法產生其餘的第一輸出值。 In an embodiment, the first measured value includes a minimum measured value and a maximum measured value. The processor is further configured to set a first output value corresponding to the first index that is less than the minimum measured value as a first preset value, and set a first output value corresponding to the first index that is greater than the maximum measured value as a first Two predicted values, and the remaining first output values are generated by an interpolation algorithm.

在一實施例中,上述的第一索引包括一個第二索引,並且此第二索引對應至上述第一輸出值中的一個第二輸出值。處理器還用以建立一個暫時校正表,此暫時校正表包括多個第三輸出值,並且每一個第三輸出值對應一個第三 索引。處理器還用以設定部份的第三索引為第三量測值,設定對應第三量測值的第三輸出值為標準值,產生未對應至第三量測值的第三輸出值,將第二輸出值作為第三索引的其中之一以取得第三輸出值中的一個第四輸出值,並且設定第二輸出值為此第四輸出值。因此,透過第二索引與第二輸出值,可產生更新後的校正表。 In an embodiment, the first index includes a second index, and the second index corresponds to a second output value of the first output value. The processor is further configured to establish a temporary correction table, the temporary correction table includes a plurality of third output values, and each of the third output values corresponds to a third index. The processor is further configured to set a third index of the part to a third measurement value, set a third output value corresponding to the third measurement value as a standard value, and generate a third output value that does not correspond to the third measurement value, The second output value is taken as one of the third indexes to obtain a fourth output value of the third output value, and the second output value is set to the fourth output value. Therefore, the updated correction table can be generated by the second index and the second output value.

在一實施例中,上述的處理器還用以計算第一量測值與標準值之間的殘差平方和以取得上述的誤差值。或者,處理器計算第三量測值與標準值之間的殘差平方和以取得此誤差值。 In an embodiment, the processor is further configured to calculate a sum of squared residuals between the first measured value and the standard value to obtain the error value. Alternatively, the processor calculates a sum of squared residuals between the third measured value and the standard value to obtain the error value.

基於上述,本發明實施例所提出的顏色校正方法與影像處理裝置,可以自動的產生校正表並且以遞迴的方式來更新此校正表。 Based on the above, the color correction method and the image processing apparatus proposed by the embodiments of the present invention can automatically generate a correction table and update the correction table in a recursive manner.

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

[第一實施例] [First Embodiment]

圖1是根據一實施例說明影像處理裝置的方塊圖。 1 is a block diagram illustrating an image processing apparatus in accordance with an embodiment.

請參照圖1,影像處理裝置100包括影像擷取單元110、處理器120與記憶體130。例如,影像處理裝置100可以被實作為掃瞄器、數位相機、數位攝影機、電腦或者是伺服器。 Referring to FIG. 1 , the image processing apparatus 100 includes an image capturing unit 110 , a processor 120 , and a memory 130 . For example, the image processing apparatus 100 can be implemented as a scanner, a digital camera, a digital camera, a computer, or a server.

影像擷取單元110是用以取得一或多張影像。舉例來 說,影像擷取單元110包括鏡頭與多個感光元件。一個感光元件上的電荷會形成一個顏色值,而一或多個顏色值可以組成一個像素。然而,在另一實施例中,影像擷取單元110可以被實作為一個通訊介面,用以從其他的裝置上取得影像,本發明並不在此限。 The image capturing unit 110 is configured to acquire one or more images. For example The image capturing unit 110 includes a lens and a plurality of photosensitive elements. The charge on one photosensitive element forms a color value, and one or more color values can form one pixel. However, in another embodiment, the image capturing unit 110 can be implemented as a communication interface for acquiring images from other devices, and the present invention is not limited thereto.

處理器120是用以執行一或多段程式碼以校正一張影像中的顏色值。舉例來說,處理器120可以為中央處理器(central processing unit,CPU)或嵌入式的微控制器(embedded microcontroller)。 The processor 120 is configured to execute one or more pieces of code to correct color values in an image. For example, the processor 120 can be a central processing unit (CPU) or an embedded microcontroller.

記憶體130用以儲存程式碼或者是影像。在本實施例中,記憶體130中儲存了顏色校正系統132。顏色校正系統132中包括多個模組,每個模組會提供特定的功能。處理器120會執行顏色校正系統132中的各個模組。 The memory 130 is used to store code or images. In the present embodiment, the color correction system 132 is stored in the memory 130. The color correction system 132 includes a plurality of modules, each of which provides a particular function. The processor 120 executes the various modules in the color correction system 132.

圖2是根據一實施例說明顏色校正系統的示意圖。 2 is a schematic diagram illustrating a color correction system in accordance with an embodiment.

請參照圖2,顏色校正系統132包括擷取模組210、校正模組220以及遞迴模組230。 Referring to FIG. 2 , the color correction system 132 includes a capture module 210 , a calibration module 220 , and a recursive module 230 .

處理器120執行擷取模組210以控制影像擷取單元110並取得一或多張影像。處理器120執行校正模組220以根據取得的影像產生一個校正表。處理器120執行遞迴模組以判斷一個遞迴條件是否滿足。若遞迴條件並沒有滿足,處理器120會持續的執行擷取模組210以取得另一張影像,並且會根據此另一張影像執行校正模組220來更新校正表。在此,說明擷取模組210、校正模組220以及遞迴模組230的操作時,是表示處理器120執行這些模組所 做的操作,以下便不再重複贅述。 The processor 120 executes the capture module 210 to control the image capture unit 110 and obtain one or more images. The processor 120 executes the correction module 220 to generate a correction table based on the acquired image. The processor 120 executes the recursive module to determine if a recursive condition is satisfied. If the recursive condition is not met, the processor 120 continues to execute the capture module 210 to obtain another image, and the correction module 220 is executed according to the other image to update the calibration table. Here, when the operations of the capture module 210, the correction module 220, and the recursive module 230 are described, it is indicated that the processor 120 executes these modules. The operation is not repeated here.

圖3A與圖3B是根據一實施例說明導表的範例示意圖。 3A and 3B are schematic diagrams illustrating an example of a guide table according to an embodiment.

請參照圖3A與圖3B,導表300包括了色塊310(1)~310(A)。一個色塊中的顏色都相同,並且一個色塊會對應至一個標準值。舉例來說,色塊310(1)是對應至標準值”0”,色塊310(2)是對應至標準值”11”,以此類推。導表300是用以提供標準的色塊310(1)~310(A),讓影像處理裝置100可以根據這些色塊310(1)~310(A)與所對應的標準值來產生校正表。 Referring to FIG. 3A and FIG. 3B, the guide table 300 includes color blocks 310(1) to 310(A). The colors in one patch are the same, and one patch corresponds to a standard value. For example, color block 310(1) corresponds to a standard value of "0", color block 310(2) corresponds to a standard value of "11", and so on. The guide table 300 is used to provide standard color blocks 310(1)-310(A), so that the image processing apparatus 100 can generate a correction table according to the color blocks 310(1)-310(A) and the corresponding standard values. .

在此實施例中,每個標準值是表示亮度的數值。然而,在其他實施例中,每個標準值也可以是表示彩度(例如,紅、綠、藍)的數值。或者,每個方塊也可以對應其他的標準值,本發明不在此限。 In this embodiment, each standard value is a numerical value indicating brightness. However, in other embodiments, each standard value may also be a value representing chroma (eg, red, green, blue). Alternatively, each block may correspond to other standard values, and the present invention is not limited thereto.

為了產生校正表,擷取模組210會取得導表300的一張影像,並且會根據此影像取得多個量測值(亦稱第一量測值)。舉例來說,擷取模組210會取得影像中對應色塊310(1)的區域內的多個像素的顏色值。擷取模組210會計算這些顏色值的平均,以作為對應色塊310(1)的量測值”2”。類似地,擷取模組210也會取得影像中對應色塊310(2)的區域內的多個像素的顏色值,並且計算這些顏色值的平均以作為對應色塊310(2)的量測值”4”,以此類推。 In order to generate the calibration table, the capture module 210 obtains an image of the guide 300 and obtains a plurality of measurements (also referred to as first measurements) based on the image. For example, the capture module 210 obtains color values of a plurality of pixels in the region of the corresponding color block 310(1) in the image. The capture module 210 calculates an average of these color values as the measured value "2" of the corresponding color block 310(1). Similarly, the capture module 210 also obtains color values of a plurality of pixels in the region of the corresponding color block 310(2) in the image, and calculates an average of the color values as a measure of the corresponding color block 310(2). The value is "4", and so on.

然而,由於一些硬體上的誤差或是雜訊,對應到同一個色塊的量測值與標準值並不一定會相同。例如,量測 值”2”與標準值”0”皆是對應到色塊310(1),但之間的誤差為2;量測值”4”與標準值”11”都是對應到色塊310(2),但之間的誤差為7。校正模組220會根據圖3B所示的這些量測值與標準值來產生校正表。 However, due to some hardware errors or noise, the measured values corresponding to the same color block are not necessarily the same as the standard values. For example, measurement The value "2" and the standard value "0" are all corresponding to the color block 310 (1), but the error between them is 2; the measured value "4" and the standard value "11" correspond to the color block 310 (2) ), but the error is 7. The calibration module 220 generates a calibration table based on the measured values and standard values shown in FIG. 3B.

圖4與圖5是根據一實施例說明建立一個校正表的示意圖。 4 and 5 are schematic diagrams illustrating the creation of a correction table in accordance with an embodiment.

請參照圖4,校正表400包括了輸出值410(0)~410(255),而這些輸出值410(0)~410(255)分別對應至索引420(0)~420(255)。校正表400的運作為:當輸入一個數值時,校正模組220會把此數值當做校正表400的索引並且輸出對應的輸出值。舉例來說,若輸入的數值為”2”,則此數值會被當作索引420(2),並且輸出所對應的輸出值410(2)。 Referring to FIG. 4, the calibration table 400 includes output values 410(0)-410(255), and the output values 410(0)-410(255) correspond to indices 420(0)-420(255), respectively. The operation of the correction table 400 is such that when a value is input, the correction module 220 will use this value as an index of the correction table 400 and output a corresponding output value. For example, if the value entered is "2", then this value is treated as index 420(2) and the corresponding output value 410(2) is output.

當建立查找表400時,校正模組會設定部份的索引420(0)~420(255)為圖3B所示的量測值,並且設定對應這些量測值的輸出值為上述的標準值。舉例來說,標準值”0”是對應至量測值”2”,因此校正模組220會設定索引420(2)為量測值”2”,並且設定輸出值410(2)為標準值”0”。標準值”11”是對應至量側值”4”,因此校正模組220設定索引420(4)為量測值”4”,而對應此量測值的輸出值410(4)便會被設定為標準值”11”。標準值”22”是對應至量測值”5”,因此校正模組220會設定索引420(5)為量測值”5”,並且設定輸出值410(5)為標準值”22”。在本實施例中,標準值的數目是24個,因此只有24個輸出值(例如,輸出值410(2)、 410(4)、410(5)與410(204))會被設定為對應的標準值。校正模組220還會產生未對應至量測值的輸出值。具體來說,校正模組220會先取得量測值中最小的一個(亦稱最小量測值,即量測值”2”),並且取得其中最大的一個(亦稱最大量測值,即量測值”204”)。校正模組220會設定小於最小量測值的索引420(0)~420(1)所對應的輸出值410(0)與410(1)為一個第一預設值。校正模組220也會設定大於最大量測值的索引420(205)~420(255)所對應的輸出值410(205)~410(255)為一個第二預設值。並且,校正模組220會以一個內插演算法產生其餘的輸出值(例如,輸出值410(3))。 When the lookup table 400 is created, the calibration module sets the partial index 420(0)~420(255) to the measured value shown in FIG. 3B, and sets the output value corresponding to the measured values to the above-mentioned standard value. . For example, the standard value “0” corresponds to the measured value “2”, so the correction module 220 sets the index 420(2) to the measured value “2” and sets the output value 410(2) to the standard value. "0". The standard value "11" corresponds to the amount side value "4", so the correction module 220 sets the index 420(4) to the measured value "4", and the output value 410(4) corresponding to the measured value is Set to the standard value "11". The standard value "22" corresponds to the measured value "5", so the correction module 220 sets the index 420(5) to the measured value "5" and sets the output value 410(5) to the standard value "22". In this embodiment, the number of standard values is 24, so there are only 24 output values (for example, the output value 410(2), 410(4), 410(5), and 410(204)) will be set to the corresponding standard values. The correction module 220 also produces an output value that does not correspond to the measured value. Specifically, the calibration module 220 first obtains the smallest one of the measured values (also known as the minimum measured value, that is, the measured value 2"), and obtains the largest one (also known as the maximum measured value, ie, Measurement value "204"). The correction module 220 sets the output values 410(0) and 410(1) corresponding to the indexes 420(0)~420(1) that are smaller than the minimum measurement value to be a first preset value. The correction module 220 also sets the output values 410(205)~410(255) corresponding to the indexes 420(205)~420(255) that are greater than the maximum measurement value to a second preset value. Moreover, the correction module 220 generates the remaining output values (eg, the output value 410(3)) with an interpolation algorithm.

請參照圖5,在此實施例中,校正模組220設定第一預設值為0,並且設定第二預設值為255。換言之,輸出值410(0)與410(1)會被設定為”0”;而輸出值410(205)~410(255)會被設定為”255”。校正模組220會根據輸出值410(2)與410(4)執行一個內插演算法來產生輸出值410(3)。例如,校正模組220會計算輸出值410(2)與410(4)的平均以產生輸出值410(3)。 Referring to FIG. 5, in this embodiment, the correction module 220 sets the first preset value to 0, and sets the second preset value to 255. In other words, the output values 410(0) and 410(1) will be set to "0"; and the output values 410(205)~410(255) will be set to "255". The correction module 220 performs an interpolation algorithm based on the output values 410(2) and 410(4) to generate an output value 410(3). For example, correction module 220 calculates an average of output values 410(2) and 410(4) to produce output value 410(3).

然而,在其他實施例中,校正模組220也可以用一個低通濾波器來執行內插演算法。或者,校正模組220可以根據輸出值410(2)、410(4)、410(5)與410(204)等來產生一個指數函數或者是多項式函數。校正模組220可以根據產生出的函數來計算出輸出值410(3),本發明並不在此限。此外,當一個像素的顏色值是用更多位元(即,大於8個位 元)來表示時,校正表400會包括更多的索引與輸出值。並且,第一預設值與第二預設值可被設定為不同的數值,本發明並不在此限。 However, in other embodiments, the correction module 220 can also perform an interpolation algorithm using a low pass filter. Alternatively, the correction module 220 may generate an exponential function or a polynomial function based on the output values 410(2), 410(4), 410(5), 410(204), and the like. The correction module 220 can calculate the output value 410(3) according to the generated function, and the present invention is not limited thereto. In addition, when a pixel's color value is more bits (ie, greater than 8 bits) The correction table 400 will include more indices and output values when represented. Moreover, the first preset value and the second preset value may be set to different values, and the present invention is not limited thereto.

計算出校正表400以後,遞迴模組230會判斷一個遞回條件是否已經滿足。若此遞迴條件已經滿足,則校正模組220會輸出校正表400。此後,當擷取模組210取得一張影像以後,校正模組220便可以根據校正表400來調整此影像中的顏色值。然而,當遞迴條件並沒有被滿足時,校正模組220會持續的更新校正表400,直到遞迴條件已被滿足。 After calculating the correction table 400, the recursive module 230 determines whether a recursive condition has been met. If the recursion condition has been met, the correction module 220 outputs a correction table 400. Thereafter, after the capture module 210 obtains an image, the calibration module 220 can adjust the color value in the image according to the calibration table 400. However, when the recursive condition is not satisfied, the correction module 220 will continuously update the correction table 400 until the recursive condition has been met.

在更新校正表400的過程中,擷取模組210會取得導表300的另一張影像(亦稱第二影像)並且根據此影像取得多個量測值(亦稱第二量測值)。校正模組220會根據目前的校正表400來調整這些第二量測值以產生多個量測值(亦稱第三量測值)。校正模組220會根據標準值與這些第三量測值來更新校正表400,直到遞迴模組230判斷遞迴條件已被滿足。 In the process of updating the calibration table 400, the capture module 210 obtains another image (also referred to as a second image) of the guide table 300 and obtains a plurality of measured values (also referred to as second measured values) according to the image. . The calibration module 220 adjusts the second measurements according to the current calibration table 400 to generate a plurality of measurements (also referred to as third measurements). The calibration module 220 updates the calibration table 400 based on the standard values and the third measurements until the recursive module 230 determines that the recursive condition has been met.

圖6至圖9是根據一實施例說明更新校正表的示意圖。 6 through 9 are schematic diagrams illustrating an update correction table in accordance with an embodiment.

請參照圖6,對應於色塊310(1)~310(3)、與310(A),擷取模組210取得的第二量測值分別為”0”、”3”、”5”...”204”。校正模組220會根據校正表400來調整這些第二量測值以產生第三量測值”0”、”6”、”22”...”255”。舉例來說,校正模組220將”3” 作為校正表400的索引,可得到輸出值”6”;校正模組220將”5”作為校正表400的索引,可以得到輸出值”22”。值得注意的是,擷取模組210對於同一個色塊,兩次所取得的量測值並不一定會相同。舉例來說,對於色塊310(2),擷取模組210第一次取得的量測值為”4”(如圖3B所示),但是第二次取得的量測值為”3”。 Referring to FIG. 6 , corresponding to the color blocks 310(1) to 310(3) and 310(A), the second measurement values obtained by the capture module 210 are “0”, “3”, “5”, respectively. ..."204". The calibration module 220 adjusts the second measurements according to the calibration table 400 to generate third measurements "0", "6", "22" ... "255". For example, the correction module 220 will be "3" As an index of the correction table 400, an output value "6" is obtained; the correction module 220 uses "5" as an index of the correction table 400, and an output value "22" can be obtained. It should be noted that the capture module 210 does not necessarily have the same measurement value for the same color patch twice. For example, for the color block 310(2), the first measurement obtained by the capture module 210 is "4" (as shown in FIG. 3B), but the measured value obtained for the second time is "3". .

校正模組220會根據上述建立校正表400的方式建立一個暫時校正表。具體來說,校正模組220會將此暫時校正表中部份的索引設定為第三量測值,設定對應這些第三量測值的輸出值為標準值,並且產生未對應第三量測值的輸出值。 The correction module 220 creates a temporary correction table in accordance with the manner in which the calibration table 400 is established as described above. Specifically, the calibration module 220 sets the index of the portion of the temporary correction table to the third measurement value, sets the output value corresponding to the third measurement values as a standard value, and generates a third measurement that does not correspond to the third measurement. The output value of the value.

請參照圖7,暫時校正表700包括輸出值710(0)~710(255),並且輸出值710(0)~710(255)分別對應至索引720(0)~720(255)。校正模組220會設定索引720(0)、720(6)、720(22)與720(255)分別為第三量測值”0”、”6”、”22”與”255”。而輸出值710(0)、710(6)、710(22)、與710(255)為對應的標準值”0”、”11”、”22”與”255”。 Referring to FIG. 7, the temporary correction table 700 includes output values 710(0)~710(255), and the output values 710(0)~710(255) correspond to indexes 720(0)~720(255), respectively. The correction module 220 sets the indexes 720(0), 720(6), 720(22), and 720(255) to the third measurement values "0", "6", "22", and "255", respectively. The output values 710 (0), 710 (6), 710 (22), and 710 (255) are the corresponding standard values "0", "11", "22", and "255".

請參照圖8,校正模組220會依據一個內插演算法計算出未對應至第三量測值的輸出值710(1)~710(5)、與710(11)。例如,校正模組220以線性內插的方式產生輸出值710(11),其值為”14”。 Referring to FIG. 8 , the calibration module 220 calculates output values 710(1) to 710(5) and 710(11) that are not corresponding to the third measurement value according to an interpolation algorithm. For example, the correction module 220 produces an output value 710(11) with a value of "14" in a linear interpolation manner.

校正模組220會將暫時校正表700與校正表400結合,藉此更新校正表400。具體來說,若校正表400中包括一個第二索引,且此第二索引對應至校正表400中的一 個第二輸出值。校正模組220會將此第二輸出值作為暫時校正表700的索引,以取得暫時校正表中的一個第四輸出值。校正模組220會用此第四輸出值來取代第二輸出值。舉例來說,請參照圖4與圖8,索引420(4)是對應至輸出值410(4),其值為”11”。校正模組220會將”11”作為暫時校正表700的索引720(11),並且取得輸出值710(11),其值為”14”。接著,校正模組220會將輸出值410(4)設定為輸出值710(11)(如圖9所示)。 The correction module 220 combines the temporary correction table 700 with the correction table 400, thereby updating the correction table 400. Specifically, if the correction table 400 includes a second index, and the second index corresponds to one of the correction tables 400 Second output value. The correction module 220 will use this second output value as an index of the temporary correction table 700 to obtain a fourth output value in the temporary correction table. The correction module 220 replaces the second output value with the fourth output value. For example, referring to FIG. 4 and FIG. 8, index 420(4) corresponds to output value 410(4), which has a value of "11". The correction module 220 will use "11" as the index 720 (11) of the temporary correction table 700, and obtain an output value 710 (11) having a value of "14". Next, the correction module 220 sets the output value 410(4) to the output value 710(11) (as shown in FIG. 9).

以另外一個角度來說,校正表400與暫時校正表700可以用以下方程式(3)與(4)來表示。 From another perspective, the correction table 400 and the temporary correction table 700 can be represented by the following programs (3) and (4).

M n ={m n,0,m n,1,...,g n,255}………(3) M n ={ m n, 0 , m n ,1 ,..., g n ,255 }.........(3)

G n ={g n,0,g n,1,...,g n,255}………(4) G n ={ g n ,0 , g n ,1 ,..., g n ,255 }.........(4)

其中,Mn表示第n次更新時的校正表400,n為正整數。mn,0表示在第n次更新時,校正表400中第0個輸出值410(0),以此類推。Gn表示第n次更新時所產生的暫時校正表700,並且gn,0表示在第n次更新時,暫時校正表700中第0個輸出值710(0),以此類推。將校正表400與暫時校正表700合成的步驟可以用以下方程式(5)~(7)來表示。 Wherein, M n represents the n-th correction table update time 400, n is a positive integer. m n,0 represents the 0th output value 410(0) in the correction table 400 at the nth update, and so on. G n denotes the temporary correction table 700 is generated by the n-th update and G n, 0 represents the n-th update of the temporary correction value table 700 outputs 0 710 (0), and so on. The steps of synthesizing the correction table 400 and the temporary correction table 700 can be expressed by the following programs (5) to (7).

M n+1={m n+1,0,m n+1,1,...,m n+1,255}………(5) M n +1 ={ m n +1,0 , m n +1,1 ,..., m n +1,255 }...(5)

m n+1,j =g n,t ………(6) m n +1, j = g n , t .........(6)

t=m n,j ………(7) t = m n , j .........(7)

換句話說,第n次更新的校正表400中第j個輸出值 mn,j會被當作索引值t。校正模組220會根據此索引值t找到暫時校正表700的輸出值gn,t。輸出值gn,t則會被當作第n+1次更新時的校正表400中第j個輸出值mn+1,jIn other words, the jth output value m n,j in the nth updated correction table 400 is treated as the index value t. The correction module 220 finds the output value g n,t of the temporary correction table 700 based on the index value t . The output value g n,t is taken as the jth output value m n+1,j in the correction table 400 at the time of the n+1th update.

上述更新校正表400的步驟會被重複,直到遞迴模組230判斷遞迴條件已被滿足。在一實施例中,遞迴模組230會判斷一個遞迴次數是否符合一個遞迴臨界值,若是,則判斷遞迴條件已滿足。每次校正表400被更新時,遞迴次數都會被更新。舉例來說,遞迴次數的初始值是0,每次校正表400被更新時遞迴次數會被增加1,並且遞迴臨界值為3。當遞迴次數大於等於3時,遞迴模組230會判斷遞迴次數已符合遞迴臨界值。換句話說,若校正表400被更新3次以後,遞迴條件便已滿足。然而,在其他實施例中,遞迴次數的初始值是3,每次校正表400被更新時遞迴次數會被減少1,遞迴臨界值是0,並且當遞迴次數小於等於0時遞迴模組230會判斷遞迴次數符合遞迴臨界值。然而,遞迴臨界值也可以被設定為5、10或其他數值,本發明並不在此限。 The steps of updating the calibration table 400 described above are repeated until the recursive module 230 determines that the recursive condition has been met. In an embodiment, the recursive module 230 determines whether a number of recursive times meets a recursive threshold, and if so, determines that the recursive condition has been met. Each time the correction table 400 is updated, the number of recursions is updated. For example, the initial value of the number of recursive times is 0, and the number of recursions is incremented by one each time the correction table 400 is updated, and the recursion threshold is 3. When the number of recursive times is greater than or equal to 3, the recursive module 230 determines that the number of recursive times has met the recursion threshold. In other words, if the correction table 400 is updated three times, the recursive condition is satisfied. However, in other embodiments, the initial value of the number of recursive times is three, and the number of recursive times is reduced by one each time the correction table 400 is updated, the recursion threshold is 0, and when the number of recursive times is less than or equal to 0, The return module 230 determines that the number of recursions meets the recursion threshold. However, the recursive threshold may also be set to 5, 10 or other values, and the invention is not limited thereto.

在一實施例中,在產生或更新校正表400以後,遞迴模組230會計算量測值與標準值之間的一個誤差值。若此誤差值小於一個誤差臨界值,則遞迴模組230會判斷遞迴條件已被滿足。舉例來說,遞迴模組230會根據以下方程式(8)來計算誤差值。 In one embodiment, after generating or updating the calibration table 400, the recursive module 230 calculates an error value between the measured value and the standard value. If the error value is less than an error threshold, the recursive module 230 determines that the recursive condition has been met. For example, the recursive module 230 calculates an error value according to the following equation (8).

其中,為Rn為第n次更新校正表400時的誤差值。j 與k為整數。k表示導表300中色塊的數目。in,j表示在第n次更新校正表400時,第j個色塊所對應的量測值。Sj表示第j個色塊所對應的標準值。值得注意的是,在計算R1時,i1,j並沒有經過校正表的調整(即,i1,j為第一量測值)。在計算R2時,i2,j則會經過校正表M1的調整(即,i2,j為第三量測值,而不是第二量測值)。每次產生出校正表Mn以後,遞迴模組230才會計算並判斷誤差值Rn是否小於一個誤差臨界值。若誤差值Rn小於此誤差臨界值,則遞迴模組230會判斷遞迴條件已滿足,並且輸出校正表MnHere, R n is an error value when the correction table 400 is updated for the nth time. j and k are integers. k represents the number of color patches in the guide table 300. i n,j represents the measured value corresponding to the jth color patch when the correction table 400 is updated for the nth time. S j represents the standard value corresponding to the jth color patch. It is worth noting that when calculating R 1 , i 1,j is not adjusted by the correction table (ie, i 1,j is the first measurement). When calculating R 2 , i 2,j will be adjusted by the correction table M 1 (ie, i 2,j is the third measurement value, not the second measurement value). Each time the correction table M n is generated, the recursive module 230 calculates and determines whether the error value R n is less than an error threshold. If the error is smaller than this threshold error value R n, the recursive determination module 230 will be handed back condition is met, and outputs a correction table M n.

以上方程式(8)所計算的是殘差平方和(sum of squared error)。然而,在其他實施例中,遞迴模組230也可以使用均方差(mean squared error)、或者是絕對殘差和(sum of absolute error)來計算誤差值,本發明並不在此限。 What is calculated by the above equation (8) is the sum of squared error. However, in other embodiments, the recursive module 230 may also calculate the error value using a mean squared error, or a sum of absolute error, which is not limited herein.

在本實施例中,當誤差值小於誤差臨界值或者是遞迴次數符合遞迴臨界值時,遞迴模組230會判斷遞迴條件已被滿足。然而,在其他實施例中,遞迴模組230也可以在誤差值小於誤差臨界值以及遞迴次數符合遞迴臨界值時,才判斷遞迴條件已被滿足。 In this embodiment, when the error value is less than the error threshold or the number of recursive times meets the recursion threshold, the recursive module 230 determines that the recursion condition has been satisfied. However, in other embodiments, the recursive module 230 may also determine that the recursion condition has been satisfied when the error value is less than the error threshold and the number of recursive times meets the recursion threshold.

圖10是根據一實施例說明顏色校正方法的流程圖。 FIG. 10 is a flow chart illustrating a color correction method in accordance with an embodiment.

請參照圖10,在步驟S1002中,擷取模組210會取得導表的第一影像。此導表包括多個色塊,並且每一個色塊對應一個標準值。 Referring to FIG. 10, in step S1002, the capture module 210 obtains the first image of the guide. This guide table includes a plurality of color patches, and each color patch corresponds to a standard value.

在步驟S1004中,擷取模組210會根據第一影像取得多個第一量測值,其中每一個第一量測值對應一個標準值。 In step S1004, the capture module 210 obtains a plurality of first measurement values according to the first image, wherein each of the first measurement values corresponds to a standard value.

在步驟S1006中,校正模組220會根據第一量測值與標準值產生校正表。 In step S1006, the correction module 220 generates a correction table according to the first measurement value and the standard value.

在步驟S1008中,遞迴模組230會判斷遞迴條件是否已滿足。若遞迴條件已滿足,則會結束此流程。 In step S1008, the recursive module 230 determines whether the recursive condition has been met. This process ends if the recursive condition is met.

若遞迴條件尚未滿足,在步驟S1010中,擷取模組210會取得導表的第二影像,並且根據第二影像取得多個第二量測值。在步驟S1012中,校正模組220會根據校正表調整第二量測值以產生多個第三量測值。在步驟S1014中,校正模組220會根據第三量測值與標準值來更新校正表。 If the recursive condition is not satisfied, in step S1010, the capture module 210 obtains the second image of the guide table, and obtains a plurality of second measurement values according to the second image. In step S1012, the correction module 220 adjusts the second measurement value according to the calibration table to generate a plurality of third measurement values. In step S1014, the correction module 220 updates the correction table according to the third measurement value and the standard value.

然而,圖10中各步驟已詳細說明如上,在此便不在重複贅述。 However, the steps in FIG. 10 have been described in detail above, and the detailed description thereof will not be repeated here.

[第二實施例] [Second embodiment]

第二實施例與第一實施例類似,在此僅說明不同之處。在第一實施例中,當擷取模組210第一次取得量測值時,校正模組220並不會利用校正表來調整這些第一量測值。然而,在第二實施例中,每一次擷取模組210取得量測值以後,校正模組220都會根據校正表來調整這些量測值。 The second embodiment is similar to the first embodiment, and only the differences will be described herein. In the first embodiment, when the capture module 210 first obtains the measured value, the calibration module 220 does not use the correction table to adjust the first measurement values. However, in the second embodiment, after each capture module 210 obtains the measured value, the calibration module 220 adjusts the measured values according to the calibration table.

圖11是根據第二實施例說明顏色校正方法的流程圖。 Figure 11 is a flow chart illustrating a color correction method according to a second embodiment.

請參照圖11,在步驟S1102中,校正模組220與遞迴模組230會執行一個初使化程序。校正模組220會設定一個初始的校正表,其中的每一個輸出值會等於所對應的索引。亦即,在第二實施例中,上述方程式(3)中的m1,i會等 於i。遞迴模組230會設定遞迴臨界值與誤差臨界值。 Referring to FIG. 11, in step S1102, the correction module 220 and the recursive module 230 execute an initialization process. The correction module 220 sets an initial correction table, each of which will be equal to the corresponding index. That is, in the second embodiment, m 1,i in the above equation (3) will be equal to i. The recursive module 230 sets the recursive threshold and the error threshold.

在步驟S1104中,擷取模組210會取得導表300的一張影像,並且取得此影像的多個量測值。 In step S1104, the capture module 210 obtains an image of the guide table 300 and obtains a plurality of measured values of the image.

在步驟S1106中,校正模組220會根據校正表來調整這些量測值。值得注意的是,當步驟S1106第一次被執行時,由於校正表中的輸出值等於所對應的索引,因此調整後的量測值與調整前的量測值相同。 In step S1106, the correction module 220 adjusts the measured values according to the correction table. It should be noted that when the step S1106 is executed for the first time, since the output value in the correction table is equal to the corresponding index, the adjusted measured value is the same as the measured value before the adjustment.

在步驟S1108中,遞迴模組230會根據標準值與調整後的量測值來計算誤差值。亦即,在第二實施例中,上述方程式(8)中每一個量測值in,j都被校正模組220根據校正表調整過。 In step S1108, the recursive module 230 calculates an error value based on the standard value and the adjusted measured value. That is, in the second embodiment, each of the measured values i n,j in the above equation (8) is adjusted by the correction module 220 according to the correction table.

在步驟S1110中,遞迴模組230會判斷遞迴條件是否滿足。在第二實施例中,當誤差值小於誤差臨界值或者是遞迴次數符合遞迴臨界值時,遞迴模組230會判斷遞迴條件已滿足。若遞迴條件已被滿足,則圖11的流程會被結束。 In step S1110, the recursive module 230 determines whether the recursive condition is satisfied. In the second embodiment, when the error value is less than the error threshold or the number of recursive times meets the recursion threshold, the recursive module 230 determines that the recursion condition has been satisfied. If the recursive condition has been met, the flow of Figure 11 will be ended.

若遞迴條件尚未被滿足,在步驟S1112中,校正模組220會根據標準值與調整後的量測值來產生暫時校正表。值得注意的是,當步驟S1112第一次被執行時,由於調整後的量測值與調整前的量測值相同,因此所產生的暫時校正表會等同第一實施例中第一次產生的校正表(如圖5所示)。 If the recursive condition has not been met, in step S1112, the correction module 220 generates a temporary correction table based on the standard value and the adjusted measurement value. It should be noted that, when the step S1112 is performed for the first time, since the adjusted measured value is the same as the measured value before the adjustment, the generated temporary correction table is equivalent to the first generated in the first embodiment. Calibration table (shown in Figure 5).

在步驟S1114中,校正模組220會合併暫時校正表與校正表,並且回到步驟S1104。值得注意的是,當步驟S1114第一次被執行時,合併出的校正表會與暫時校正表相同。 具體來說,上述的方程式(6)與(7)可以被改寫為以下方程式(9)與(10)。 In step S1114, the correction module 220 merges the temporary correction table and the correction table, and returns to step S1104. It is worth noting that when step S1114 is executed for the first time, the combined correction table will be the same as the temporary correction table. Specifically, the above equations (6) and (7) can be rewritten as the following equations (9) and (10).

t=m 1,j =j………(9) t = m 1, j = j .........(9)

m 2,j =g 1,t =g 1,j ………(10) m 2, j = g 1, t = g 1, j .........(10)

綜上所述,本發明提出的顏色校正方法與影像處理裝置,可以用遞迴的方式來產生校正表。因此,量測值與標準值之間的誤差會逐漸的減少並收斂。 In summary, the color correction method and the image processing apparatus proposed by the present invention can generate a correction table in a recursive manner. Therefore, the error between the measured value and the standard value will gradually decrease and converge.

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

100‧‧‧影像處理裝置 100‧‧‧Image processing device

110‧‧‧影像擷取單元 110‧‧‧Image capture unit

120‧‧‧處理器 120‧‧‧ processor

130‧‧‧記憶體 130‧‧‧ memory

132‧‧‧顏色校正系統 132‧‧‧Color Correction System

210‧‧‧擷取模組 210‧‧‧Capture module

220‧‧‧校正模組 220‧‧‧ calibration module

230‧‧‧遞迴模組 230‧‧‧Return module

300‧‧‧導表 300‧‧‧Guide

310(1)~310(A)‧‧‧色塊 310(1)~310(A)‧‧‧Color blocks

400‧‧‧校正表 400‧‧‧ calibration table

410(0)~410(255)‧‧‧輸出值 410(0)~410(255)‧‧‧ Output value

420(0)~420(255)‧‧‧索引 420 (0) ~ 420 (255) ‧ ‧ index

700‧‧‧暫時校正表 700‧‧‧Interim correction table

710(0)~710(255)‧‧‧輸出值 710(0)~710(255)‧‧‧ output value

720(0)~720(255)‧‧‧索引 720 (0) ~ 720 (255) ‧ ‧ index

S1002、S1004、S1006、S1008、S1010、S1012、S1014、S1102、S1104、S1106、S1108、S1110、S1112、S1114‧‧‧顏色校正方法的步驟 S1002, S1004, S1006, S1008, S1010, S1012, S1014, S1102, S1104, S1106, S1108, S1110, S1112, S1114‧‧ ‧ steps of color correction method

圖1是根據一實施例說明影像處理裝置的方塊圖。 1 is a block diagram illustrating an image processing apparatus in accordance with an embodiment.

圖2是根據一實施例說明顏色校正系統的示意圖。 2 is a schematic diagram illustrating a color correction system in accordance with an embodiment.

圖3A與圖3B是根據一實施例說明導表的範例示意圖。 3A and 3B are schematic diagrams illustrating an example of a guide table according to an embodiment.

圖4與圖5是根據一實施例說明建立一個校正表的示意圖。 4 and 5 are schematic diagrams illustrating the creation of a correction table in accordance with an embodiment.

圖6至圖9是根據一實施例說明更新校正表的示意圖。 6 through 9 are schematic diagrams illustrating an update correction table in accordance with an embodiment.

圖10是根據一實施例說明顏色校正方法的流程圖。 FIG. 10 is a flow chart illustrating a color correction method in accordance with an embodiment.

圖11是根據第二實施例說明顏色校正方法的流程圖。 Figure 11 is a flow chart illustrating a color correction method according to a second embodiment.

S1002、S1004、S1006、S1008、S1010、S1012、S1014‧‧‧顏色校正方法的步驟 S1002, S1004, S1006, S1008, S1010, S1012, S1014‧‧‧ steps of color correction method

Claims (14)

一種顏色校正方法,用於一影像處理裝置,該顏色校正方法包括:取得一導表的一第一影像,其中該導表包括多個色塊,並且每一該些色塊對應一標準值;根據該第一影像取得多個第一量測值,其中每一該些第一量測值對應該些標準值的其中之一;根據該些第一量測值與該些標準值產生一校正表;判斷一遞迴條件是否滿足;以及若該遞迴條件不滿足,取得該導表的一第二影像,根據該第二影像取得多個第二量測值,根據該校正表調整該些第二量測值以產生多個第三量測值,並且根據該些第三量測值與該些標準值更新該校正表直到滿足該遞迴條件。 A color correction method for an image processing device, the color correction method comprising: obtaining a first image of a guide table, wherein the guide table comprises a plurality of color blocks, and each of the color blocks corresponds to a standard value; Obtaining, according to the first image, a plurality of first measurement values, wherein each of the first measurement values corresponds to one of the standard values; and generating a correction according to the first measurement values and the standard values Determining whether a recursive condition is satisfied; and if the recursive condition is not satisfied, obtaining a second image of the navigation table, obtaining a plurality of second measurement values according to the second image, and adjusting the plurality of measurements according to the calibration table The second measured value is used to generate a plurality of third measured values, and the calibration table is updated according to the third measured values and the standard values until the recursive condition is satisfied. 如申請專利範圍第1項所述之顏色校正方法,其中該校正表包括多個第一輸出值,每一該些第一輸出值對應一第一索引,其中根據該些第一量測值與該些標準值產生該校正表的步驟包括:設定部份的該些第一索引為該些第一量測值;設定對應該些第一量測值的該些第一輸出值為該些標準值;以及產生未對應該些第一量測值的該些第一輸出值。 The color correction method of claim 1, wherein the correction table includes a plurality of first output values, each of the first output values corresponding to a first index, wherein the first measurement value is based on the first measurement value The step of generating the calibration table includes: setting the first index of the portion to the first measurement values; and setting the first output values corresponding to the first measurement values to the criteria a value; and generating the first output values that do not correspond to the first measurements. 如申請專利範圍第1項所述之顏色校正方法,其中判斷該遞迴條件是否滿足的步驟包括:判斷一遞迴次數是否符合一遞迴臨界值;以及 若該遞迴次數符合該遞迴臨界值,判斷該遞迴條件已滿足,其中根據該些第三量測值與該些標準值更新該校正表的步驟還包括:更新該遞迴次數。 The color correction method of claim 1, wherein the determining whether the recursive condition is satisfied comprises: determining whether a number of recursions meets a recursion threshold; If the number of recursive times meets the recursive threshold, it is determined that the recursive condition is satisfied, and the step of updating the correction table according to the third measured values and the standard values further comprises: updating the number of recursive times. 如申請專利範圍第1項所述之顏色校正方法,其中判斷該遞迴條件是否滿足的步驟包括:根據該些第一量測值與該些標準值計算一誤差值,或者根據該些第三量測值與該些標準值計算該誤差值;判斷該誤差值是否小於一誤差臨界值;以及若該誤差值小於該誤差臨界值,判斷該遞迴條件已滿足。 The color correction method of claim 1, wherein the step of determining whether the recursive condition is satisfied comprises: calculating an error value according to the first measurement value and the standard value, or according to the third The measured value and the standard value are used to calculate the error value; determining whether the error value is less than an error threshold; and if the error value is less than the error threshold, determining that the recursion condition is satisfied. 如申請專利範圍第2項所述之顏色校正方法,其中該些第一量測值包括一最小量測值與一最大量測值,其中產生未對應該些第一量測值的該些第一輸出值的步驟包括:設定小於該最小量測值的該些第一索引所對應的該些第一輸出值為一第一預設值;設定大於該最大量測值的該些第一索引所對應的該些第一輸出值為一第二預設值;以及以一內插演算法產生其餘的該些第一輸出值。 The color correction method of claim 2, wherein the first measurement values comprise a minimum measurement value and a maximum measurement value, wherein the first measurement values are generated corresponding to the first measurement values. The step of outputting the value includes: setting the first output values corresponding to the first indexes that are smaller than the minimum measurement value to a first preset value; setting the first indexes that are greater than the maximum measurement value The corresponding first output values are a second preset value; and the remaining first output values are generated by an interpolation algorithm. 如申請專利範圍第2項所述之顏色校正方法,其中該些第一索引包括一第二索引,並且該第二索引對應至該些第一輸出值中的一第二輸出值,其中根據該些第三量測 值與該些標準值更新該校正表的步驟包括:建立一暫時校正表,其中該暫時校正表包括多個第三輸出值,並且每一該些第三輸出值對應一第三索引;設定部份的該些第三索引為該些第三量測值;設定對應該些第三量測值的該些第三輸出值為該些標準值;產生未對應至該些第三量測值的該些第三輸出值;將該第二輸出值作為該些第三索引的其中之一以取得該些第三輸出值中的一第四輸出值;以及設定該第二輸出值為該第四輸出值。 The color correction method of claim 2, wherein the first index comprises a second index, and the second index corresponds to a second output value of the first output values, wherein Third measurement The step of updating the correction table with the value and the standard value includes: establishing a temporary correction table, wherein the temporary correction table includes a plurality of third output values, and each of the third output values corresponds to a third index; The third index of the portion is the third measurement value; setting the third output values corresponding to the third measurement values to the standard values; generating the third measurement values not corresponding to the third measurement values The third output value; the second output value being one of the third indexes to obtain a fourth output value of the third output values; and setting the second output value to the fourth output value. 如申請專利範圍第4項所述之顏色校正方法,其中根據該些第一量測值與該些標準值計算一誤差值的步驟包括:計算該些第一量測值與該些標準值之間的一殘差平方和以取得該誤差值,其中根據該些第三量測值與該些標準值計算該誤差值的步驟包括:計算該些第三量測值與該些標準值之間的一殘差平方和以取得該誤差值。 The color correction method of claim 4, wherein the step of calculating an error value according to the first measurement values and the standard values comprises: calculating the first measurement values and the standard values. The sum of the residuals is obtained by the sum of the residuals, and the step of calculating the error value according to the third measured values and the standard values includes: calculating between the third measured values and the standard values The sum of the residuals is squared to obtain the error value. 一種影像處理裝置,包括:一影像擷取單元,用以取得一導表的一第一影像,其中該導表包括多個色塊,並且每一該些色塊對應一標準值;以及一處理器,耦接至該影像擷取單元,用以根據該第一 影像取得多個第一量測值,其中每一該些第一量測值對應該些標準值的其中之一,其中,該處理器用以根據該些第一量測值與該些標準值產生一校正表,並且判斷一遞迴條件是否滿足,其中,若該遞迴條件不滿足,該處理器用以取得該導表的一第二影像,根據該第二影像取得多個第二量測值,根據該校正表調整該些第二量測值以產生多個第三量測值,並且根據該些第三量測值與該些標準值更新該校正表直到滿足該遞迴條件。 An image processing device includes: an image capturing unit, configured to obtain a first image of a guide table, wherein the guide table includes a plurality of color blocks, and each of the color blocks corresponds to a standard value; and a process And coupled to the image capturing unit, according to the first Obtaining a plurality of first measurement values, wherein each of the first measurement values corresponds to one of the standard values, wherein the processor is configured to generate the standard measurement values according to the first measurement values and the standard values. a calibration table, and determining whether a recursion condition is satisfied, wherein if the recursive condition is not satisfied, the processor is configured to obtain a second image of the navigation table, and obtain a plurality of second measurement values according to the second image And adjusting the second measurement values according to the calibration table to generate a plurality of third measurement values, and updating the correction table according to the third measurement values and the standard values until the recursion condition is satisfied. 如申請專利範圍第8項所述之影像處理裝置,其中該校正表包括多個第一輸出值,並且每一該些第一輸出值對應一第一索引,其中,該處理器還用以設定部份的該些第一索引為該些第一量測值,設定對應該些第一量測值的該些第一輸出值為該些標準值,以及產生未對應至該些第一量測值的該些第一輸出值。 The image processing device of claim 8, wherein the correction table includes a plurality of first output values, and each of the first output values corresponds to a first index, wherein the processor is further configured to set The first index of the part is the first measurement value, the first output values corresponding to the first measurement values are set to the standard values, and the first measurement is not corresponding to the first measurement The first output values of the values. 如申請專利範圍第8項所述之影像處理裝置,其中該處理器還用以判斷一遞迴次數是否符合一遞迴臨界值,若該遞迴次數符合該遞迴臨界值,該處理器還用以判斷該遞迴條件已滿足,其中該處理器還用以在根據該些第三量測值與該些標準值更新該校正表時,更新該遞迴次數。 The image processing device of claim 8, wherein the processor is further configured to determine whether a number of recursive times meets a recursive threshold, and if the number of recursive times meets the recursive threshold, the processor further The processor is further configured to: when the update table is updated according to the third measurement values and the standard values, the number of recursive times is updated. 如申請專利範圍第8項所述之影像處理裝置,其 中該處理器還用以根據該些第一量測值與該些標準值計算一誤差值,或者根據該些第三量測值與該些標準值計算該誤差值,其中,該處理器還用以判斷該誤差值是否小於一誤差臨界值,若該誤差值小於該誤差臨界值,該處理器還用以判斷該遞迴條件已滿足。 An image processing apparatus according to claim 8, wherein The processor is further configured to calculate an error value according to the first measured values and the standard values, or calculate the error value according to the third measured values and the standard values, wherein the processor further The processor is further configured to determine whether the error value is less than an error threshold, and if the error value is less than the error threshold, the processor is further configured to determine that the recursion condition is satisfied. 如申請專利範圍第9項所述之影像處理裝置,其中該些第一量測值包括一最小量測值與一最大量測值,該處理器還用以設定小於該最小量測值的該些第一索引所對應的該些第一輸出值為一第一預設值,設定大於該最大量測值的該些第一索引所對應的該些第一輸出值為一第二預測值,並且以一內插演算法產生其餘的該些第一輸出值。 The image processing device of claim 9, wherein the first measurement value comprises a minimum measurement value and a maximum measurement value, and the processor is further configured to set the smaller than the minimum measurement value. The first output values corresponding to the first indexes are a first preset value, and the first output values corresponding to the first indexes greater than the maximum measured value are set to a second predicted value. And the remaining first output values are generated by an interpolation algorithm. 如申請專利範圍第9項所述之影像處理裝置,其中該些第一索引包括一第二索引,並且該第二索引對應至該些第一輸出值中的一第二輸出值,其中該處理器還用以建立一暫時校正表,其中該暫時校正表包括多個第三輸出值,並且每一該些第三輸出值對應一第三索引,其中,該處理器還用以設定部份的該些第三索引為該些第三量測值,設定對應該些第三量測值的該些第三輸出值為該些標準值,產生未對應至該些第三量測值的該些第三輸出值,將該第二輸出值作為該些第三索引的其中之一以取得該些第三輸出值中的一第四輸出值,並且設定該第二輸出值為該第四輸出值。 The image processing device of claim 9, wherein the first index comprises a second index, and the second index corresponds to a second output value of the first output values, wherein the processing The processor is further configured to establish a temporary correction table, wherein the temporary correction table includes a plurality of third output values, and each of the third output values corresponds to a third index, wherein the processor is further configured to set a portion The third index is the third measurement value, and the third output values corresponding to the third measurement values are set to the standard values, and the third measurement values are not corresponding to the third measurement values. a third output value, the second output value being one of the third indexes to obtain a fourth output value of the third output values, and setting the second output value to the fourth output value . 如申請專利範圍第11項所述之影像處理裝置,其中該處理器還用以計算該些第一量測值與該些標準值之間的一殘差平方和以取得該誤差值,或者是計算該些第三量測值與該些標準值之間的一殘差平方和以取得該誤差值。 The image processing device of claim 11, wherein the processor is further configured to calculate a sum of squared residuals between the first measured values and the standard values to obtain the error value, or Calculating a sum of squared residuals between the third measured values and the standard values to obtain the error value.
TW101129559A 2011-06-16 2012-08-15 Color calibration method and image processing device using the same TWI527428B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
TW101129559A TWI527428B (en) 2012-08-15 2012-08-15 Color calibration method and image processing device using the same
US13/615,605 US8824029B2 (en) 2011-06-16 2012-09-14 Color calibration method and image processing device using the same
CN201210349245.6A CN103595895A (en) 2012-08-15 2012-09-19 Color correction method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101129559A TWI527428B (en) 2012-08-15 2012-08-15 Color calibration method and image processing device using the same

Publications (2)

Publication Number Publication Date
TW201408038A true TW201408038A (en) 2014-02-16
TWI527428B TWI527428B (en) 2016-03-21

Family

ID=50085866

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101129559A TWI527428B (en) 2011-06-16 2012-08-15 Color calibration method and image processing device using the same

Country Status (2)

Country Link
CN (1) CN103595895A (en)
TW (1) TWI527428B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104132897B (en) * 2014-08-16 2018-11-06 西北农林科技大学 A kind of nitrogenous measuring method of plant leaf blade based on handheld device and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6809837B1 (en) * 1999-11-29 2004-10-26 Xerox Corporation On-line model prediction and calibration system for a dynamically varying color reproduction device
US6755498B2 (en) * 2001-03-27 2004-06-29 Global Graphics Software Limited Establishing a reference printer state using a recursive tone scale matching
US6938977B2 (en) * 2003-07-25 2005-09-06 Xerox Corporation Method for improved characterization of single-pass bi-directional printers

Also Published As

Publication number Publication date
TWI527428B (en) 2016-03-21
CN103595895A (en) 2014-02-19

Similar Documents

Publication Publication Date Title
CN108600725B (en) White balance correction device and method based on RGB-IR image data
JP5674925B2 (en) Adaptive lens shading correction
JP5980294B2 (en) Data processing apparatus, imaging apparatus, and data processing method
KR100886099B1 (en) Apparatus for automatically computing image correction curve and Method thereof
KR100938522B1 (en) Lens roll-off correction method and apparatus
EP3308534A1 (en) Color filter array scaler
TW201601538A (en) Image capture apparatus and image compensating method thereof
US8620102B2 (en) Methods, apparatuses and systems for piecewise generation of pixel correction values for image processing
TWI528813B (en) Lens shading correction method and image signal processor for performing the same
JP2008092565A (en) Color matching method and image capturing device
TWI524760B (en) Camera array correction method
TWI527428B (en) Color calibration method and image processing device using the same
CN108810509A (en) A kind of image color correction method and device
JP2004056680A (en) Image processing apparatus and image processing method
JP2016191773A (en) Projection system, projector device, imaging apparatus and program
JP2017130836A (en) Image processing apparatus, image processing method, and program
US8824029B2 (en) Color calibration method and image processing device using the same
TWI768282B (en) Method and system for establishing light source information prediction model
KR100753195B1 (en) Method and device for detecting color temperature
TWI698010B (en) Circuit for controlling image capturing device and associated control method
WO2016200480A1 (en) Color filter array scaler
CN111770283A (en) Gain adjustment method and device for image exposure
KR101005625B1 (en) A method for color compensation based on color characteristic curve of a camera
JP2017034385A (en) Shading correction device for camera
CN116993608A (en) Curve generating method for image correction and image color correction method

Legal Events

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