TWI533708B - Method and image processing device for image enhancement - Google Patents
Method and image processing device for image enhancement Download PDFInfo
- Publication number
- TWI533708B TWI533708B TW102133944A TW102133944A TWI533708B TW I533708 B TWI533708 B TW I533708B TW 102133944 A TW102133944 A TW 102133944A TW 102133944 A TW102133944 A TW 102133944A TW I533708 B TWI533708 B TW I533708B
- Authority
- TW
- Taiwan
- Prior art keywords
- input
- pixel
- input pixel
- image
- value
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims description 40
- 238000000034 method Methods 0.000 title claims description 11
- 238000012546 transfer Methods 0.000 claims description 27
- 238000003672 processing method Methods 0.000 claims description 20
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000000605 extraction Methods 0.000 claims description 4
- 235000019557 luminance Nutrition 0.000 description 64
- 230000006870 function Effects 0.000 description 19
- 230000006835 compression Effects 0.000 description 14
- 238000007906 compression Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 7
- 238000013461 design Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
Description
本發明是有關於一種影像處理方法及裝置,且特別是有關於一種影像增強處理方法及影像處理裝置。 The present invention relates to an image processing method and apparatus, and more particularly to an image enhancement processing method and an image processing apparatus.
像素為構成一張影像的最小基本元素,而每張影像即是由多個各種不同顏色的像素所組合而成。「動態範圍」的定義是指影像的所有像素中最高和最低亮度的比值。所謂高動態範圍場景是指明暗之間亮度差別很大的場景,例如日出、夕陽、煙火等。 A pixel is the smallest basic element that makes up an image, and each image is composed of a plurality of pixels of different colors. "Dynamic range" is defined as the ratio of the highest and lowest brightness of all pixels in an image. The so-called high dynamic range scene is a scene indicating that the brightness varies greatly between dark, such as sunrise, sunset, fireworks, and the like.
人眼所能感受景物的亮度變化非常大,而且所謂視覺適應的能力能夠使得人眼在短時間內適應外界亮度的改變,而感受分辨出變化的範圍更大。人眼的動態範圍比一般影像擷取裝置較大許多。以顯示器而言,當環境光源不平均時,顯示器所顯示的影像可能會造成明亮區域曝光過度和黑暗區曝光不足,便是顯示器的動態範圍不足所造成的。因此,當影像的動態範圍越高,影像所能呈現原始場景的細節和資訊也越多;換言之,影像也更貼近於人眼所看到的原始景物。 The human eye can feel the brightness of the scene changes very much, and the so-called visual adaptation ability can make the human eye adapt to the change of the external brightness in a short time, and the range of the change is perceived to be greater. The dynamic range of the human eye is much larger than that of a general image capturing device. In the case of a display, when the ambient light source is uneven, the image displayed on the display may cause overexposure in the bright area and underexposure in the dark area, which is caused by insufficient dynamic range of the display. Therefore, the higher the dynamic range of the image, the more detail and information the image can present in the original scene; in other words, the image is closer to the original scene seen by the human eye.
高動態範圍的場景可藉由動態範圍壓縮在顯示器上重現影像的高對比和資訊。動態範圍壓縮可以在同時保留影像亮部與暗部的細節資訊的前提下,將影像的動態範圍降低。然而,現有技術大部份需透過成本較高的硬體加速設計來實現即時處理功能或是高運算效能的處理器來執行演算法,以達到影像的動態範圍壓縮與對比度增強的目的。因此,如何讓高動態範圍的影像顯示在低成本的顯示器等電子產品,並且同時實現即時影像訊號處理的性能以及保存原始影像的色彩資訊,已成為亟欲解決的問題之一。 High dynamic range scenes can reproduce high contrast and information on the display by dynamic range compression. Dynamic range compression reduces the dynamic range of the image while preserving the details of the highlights and shadows of the image. However, most of the prior art needs to implement a real-time processing function or a high-performance processor through a cost-effective hardware acceleration design to perform an algorithm to achieve dynamic range compression and contrast enhancement of the image. Therefore, how to display high dynamic range images on electronic products such as low-cost displays, and at the same time realize the performance of instant image signal processing and preserve the color information of the original images has become one of the problems to be solved.
本發明提供一種影像增強處理方法及影像處理裝置,其利用動態範圍壓縮與局部對比增強的方式以提升影像的品質。 The invention provides an image enhancement processing method and an image processing device, which utilize dynamic range compression and local contrast enhancement to improve image quality.
本發明提出一種影像增強處理方法。此方法先接收一個影像的多個輸入像素,並且取得各所述輸入像素的輸入色彩像素資料,其中所述輸入像素包括第一輸入像素。接著,根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的輸入亮度像素值以及輸入亮度成份資料。根據所述輸入亮度像素值,進行濾波器運算,以獲得第一輸入像素的濾波器結果。根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值。根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值。之後,根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的 乘積,取得第一輸入像素的輸出色彩像素資料。 The invention provides an image enhancement processing method. The method first receives a plurality of input pixels of an image and obtains input color pixel data for each of the input pixels, wherein the input pixels comprise a first input pixel. Then, according to the input color pixel data of the input pixel, an input luminance pixel value and an input luminance component data of each of the input pixels are obtained. A filter operation is performed based on the input luminance pixel value to obtain a filter result of the first input pixel. Adjusting the gain operation according to the filter result of the first input pixel to obtain an adjusted gain value of the first input pixel. The adjustment update operation is performed according to the input luminance component data of the first input pixel to obtain an adjustment update value of the first input pixel. Then, according to the input color pixel data of the first input pixel and the adjusted gain value of the first input pixel and the adjusted update value The product is used to obtain the output color pixel data of the first input pixel.
在本發明的一實施例中,上述根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值的步驟包括根據亮度轉移函數,將第一輸入像素的濾波器結果轉換為第一輸入像素的亮度轉移輸出值;以及根據第一輸入像素的亮度轉移輸出值與濾波器結果之間的比值,獲得第一輸入像素的調整增益值。 In an embodiment of the invention, the step of adjusting the gain operation according to the filter result of the first input pixel to obtain the adjusted gain value of the first input pixel comprises filtering the first input pixel according to the brightness transfer function. The result is converted to a luminance transfer output value of the first input pixel; and an adjustment gain value of the first input pixel is obtained according to a ratio between the luminance transfer output value of the first input pixel and the filter result.
在本發明的一實施例中,上述根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值的步驟包括根據第一輸入像素的輸入色彩像素資料、第一輸入像素的輸入亮度成份資料以及色彩飽合度參數,獲得第一輸入像素的調整更新值。 In an embodiment of the invention, the step of performing an adjustment update operation according to the input luminance component data of the first input pixel to obtain an adjustment update value of the first input pixel includes: inputting color pixel data according to the first input pixel, The input luminance component data of the first input pixel and the color saturation parameter obtain an adjustment update value of the first input pixel.
在本發明的一實施例中,上述根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資訊的演算公式包括方程式(1)~(3):
在本發明的一實施例中,在上述獲得第一輸入像素的調整增益以及第一輸入像素的調整更新值的步驟後,上述方法更包括將第一輸入像素的調整增益值進行整數化運算,以獲得第一輸入像素的調整增益整數值;將第一輸入像素的調整更新值進行整數化運算,以獲得第一輸入像素的調整更新整數值;以及根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料。 In an embodiment of the invention, after the step of obtaining the adjustment gain of the first input pixel and the adjustment update value of the first input pixel, the method further comprises performing an integer operation on the adjustment gain value of the first input pixel. Obtaining an adjusted gain integer value of the first input pixel; performing an integer operation on the adjusted update value of the first input pixel to obtain an adjusted update integer value of the first input pixel; and inputting color pixel data according to the first input pixel and The product of the adjusted gain integer value of the first input pixel and the adjusted updated integer value obtains the output color pixel approximation of the first input pixel.
在本發明的一實施例中,上述根據第一輸入像素的輸入色
彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料的演算公式包括方程式(5)~(7):
在本發明的一實施例中,上述影像增強處理方法更包括根據方程式(6),建立調整增益查找表,以獲得第一輸入像素的調整增益整數值,其中調整增益查找表的輸入索引為第一輸入像素的濾波器結果。 In an embodiment of the invention, the image enhancement processing method further includes establishing an adjustment gain lookup table according to equation (6) to obtain an adjustment gain integer value of the first input pixel, wherein the input index of the adjustment gain lookup table is The filter result of an input pixel.
本發明提出一種影像處理裝置,此影像處理裝置包括:色彩擷取電路、亮度擷取電路、濾波器運算電路以及像素調整電路。色彩擷取電路用以接收影像的多個輸入像素,並且取得各所述輸入像素的輸入色彩像素資料,其中所述輸入像素包括第一輸入像素。亮度擷取電路,耦接至色彩擷取電路,用以根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的輸入亮度像素值以及輸入亮度成份資料。濾波器運算電路,耦接至亮度擷取電路,用以根據所述輸入亮度像素值,進行濾波器運算,以獲得第一輸入像素的濾波器結果。像素調整電路耦接至色彩擷取電路、亮度擷取電路以及濾波器運算電路,用以根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值,並且根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值,再根據第一輸入像素的輸入色彩像素資料以 及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資料。 The invention provides an image processing device, which comprises: a color capture circuit, a brightness capture circuit, a filter operation circuit and a pixel adjustment circuit. The color capture circuit is configured to receive a plurality of input pixels of the image and obtain input color pixel data of each of the input pixels, wherein the input pixel comprises a first input pixel. The brightness capture circuit is coupled to the color capture circuit for obtaining the input luminance pixel value and the input luminance component data of each of the input pixels according to the input color pixel data of the input pixel. The filter operation circuit is coupled to the brightness extraction circuit for performing a filter operation according to the input brightness pixel value to obtain a filter result of the first input pixel. The pixel adjustment circuit is coupled to the color capture circuit, the brightness extraction circuit, and the filter operation circuit for performing an adjustment gain operation according to the filter result of the first input pixel to obtain an adjustment gain value of the first input pixel, and Adjusting and updating the operation according to the input brightness component data of the first input pixel to obtain an adjustment update value of the first input pixel, and then according to the input color pixel data of the first input pixel And the product of the adjusted gain value of the first input pixel and the adjusted update value, and the output color pixel data of the first input pixel is obtained.
在本發明的一實施例中,上述的像素調整電路根據亮度轉移函數,將第一輸入像素的濾波器結果轉換為第一輸入像素的亮度轉移輸出值,再根據第一輸入像素的亮度轉移輸出值與第一輸入像素的濾波器結果的比值,獲得第一輸入像素的調整增益值。 In an embodiment of the invention, the pixel adjustment circuit converts the filter result of the first input pixel into a brightness transfer output value of the first input pixel according to the brightness transfer function, and then shifts the output according to the brightness of the first input pixel. The ratio of the value to the filter result of the first input pixel obtains an adjusted gain value for the first input pixel.
在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料、第一輸入像素的輸入亮度成份資料以及色彩飽合度參數,獲得第一輸入像素的調整更新值。 In an embodiment of the invention, the pixel adjustment circuit obtains an adjustment update value of the first input pixel according to the input color pixel data of the first input pixel, the input luminance component data of the first input pixel, and the color saturation parameter.
在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資訊的演算公式包括方程式(1)~(3):
在本發明的一實施例中,上述的像素調整電路更將第一輸入像素的調整增益值進行整數化運算,以獲得第一輸入像素的調整增益整數值,再將第一輸入像素的調整更新值進行整數化運算,以獲得第一輸入像素的調整更新整數值,並且根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料。 In an embodiment of the invention, the pixel adjustment circuit further performs an integer operation on the adjustment gain value of the first input pixel to obtain an adjustment gain integer value of the first input pixel, and then updates the adjustment of the first input pixel. The value is integerized to obtain an adjusted update integer value of the first input pixel, and the first is obtained according to the input color pixel data of the first input pixel and the product of the adjusted gain integer value of the first input pixel and the adjusted update integer value. The output color pixel approximation of the input pixel.
在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資訊的演算公式包括方程式(5)~(7):
在本發明的一實施例中,上述的像素調整電路更包括調整增益查找表。調整增益查找表是根據方程式(6)所建立,其中調整增益查找表的輸入索引為第一輸入像素的濾波器結果,調整增益查找表的輸出為第一輸入像素的調整增益整數值。 In an embodiment of the invention, the pixel adjustment circuit further includes an adjustment gain lookup table. The adjustment gain lookup table is established according to equation (6), wherein the input index of the adjustment gain lookup table is the filter result of the first input pixel, and the output of the adjustment gain lookup table is the adjusted gain integer value of the first input pixel.
基於上述,本發明所提出的影像增強處理方法及影像處理裝置,結合任何連續可微分的亮度轉移函數以及控制色彩飽合度的相關演算,可同時提高影像亮度、局部對比度以及保留原始得色彩資訊,以避免影像的失真。此外,藉由調整增益查找表的索引操作、整數化以及位元移動的運算方式,可大幅加快整個動態範圍壓縮與局部對比增強演算的處理程序。 Based on the above, the image enhancement processing method and the image processing apparatus proposed by the present invention, combined with any continuously differentiable luminance transfer function and related calculations for controlling color saturation, can simultaneously improve image brightness, local contrast, and preserve original color information. To avoid distortion of the image. In addition, by adjusting the index operation of the gain lookup table, the integerization, and the bit movement, the processing procedure of the entire dynamic range compression and local contrast enhancement calculation can be greatly accelerated.
為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.
100、400‧‧‧影像處理裝置 100, 400‧‧‧ image processing device
110、410‧‧‧色彩擷取電路 110,410‧‧‧Color capture circuit
120、420‧‧‧亮度擷取電路 120, 420‧‧‧ Brightness capture circuit
125‧‧‧濾波器 125‧‧‧ filter
130、430‧‧‧濾波器運算電路 130, 430‧‧‧ filter arithmetic circuit
140、440‧‧‧像素調整電路 140, 440‧‧‧ pixel adjustment circuit
442‧‧‧調整增益查找表 442‧‧‧Adjustment gain lookup table
444‧‧‧調整更新電路 444‧‧‧Adjustment update circuit
446、447a~447c、448a~448c‧‧‧乘法器 446, 447a~447c, 448a~448c‧‧‧ multiplier
447d~447f、449a~449c‧‧‧加法器 447d~447f, 449a~449c‧‧‧Adder
445‧‧‧非揮發性記憶體 445‧‧‧Non-volatile memory
450‧‧‧色彩輸出電路 450‧‧‧Color output circuit
A、A'‧‧‧輸入影像、輸出影像 A, A'‧‧‧ Input image, output image
AC‧‧‧第一輸入像素 A C ‧‧‧first input pixel
S201~S211‧‧‧動態範圍壓縮與局部對比增強方法的流程 S201~S211‧‧‧ Flow of dynamic range compression and local contrast enhancement method
圖1繪示依據本發明第一實施例的一種影像處理裝置的方塊示意圖。 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention.
圖2繪示依據本發明第一實施例的一種影像增強處理方法的流程圖。 2 is a flow chart of an image enhancement processing method according to a first embodiment of the present invention.
圖3繪示依據本發明第一實施例的影像示意圖。 3 is a schematic diagram of an image according to a first embodiment of the present invention.
圖4繪示依據本發明第二實施例的一種影像處理裝置的方塊 示意圖。 4 is a block diagram of an image processing apparatus according to a second embodiment of the present invention; schematic diagram.
本發明的部份實施例接下來將會配合附圖來詳細描述,以下的描述所引用的元件符號,當不同附圖出現相同的元件符號將視為相同或相似的元件。這些實施例只是本發明的一部份,並未揭示所有本發明的可實施方式。更確切的說,這些實施例只是本發明的專利申請範圍中的裝置與方法的範例。 The components of the present invention will be described in detail in the following description in conjunction with the accompanying drawings. These examples are only a part of the invention and do not disclose all of the embodiments of the invention. Rather, these embodiments are merely examples of devices and methods within the scope of the patent application of the present invention.
圖1繪示依據本發明第一實施例的一種影像處理裝置的方塊示意圖,但此僅是為了方便說明,並不用以限制本發明。首先圖1先介紹影像處理裝置的所有構件以及配置關係,詳細功能將配合圖2一併揭露。 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention, but is for convenience of description and is not intended to limit the present invention. First, all components and configuration relationships of the image processing apparatus will be described first in FIG. 1. The detailed functions will be disclosed in conjunction with FIG.
請參照圖1,本實施例的影像處理裝置100接收影像A,並輸出影像A'。影像處理裝置100針對影像A進行動態範圍的壓縮以及局部對比度的增強,以增強影像A的細節資訊,其輸出結果為輸出影像A'。影像處理裝置100可以為個人電腦、筆記型電腦、數位相機、數位攝影機、網路攝影機、智慧型手機、平板電腦、掃描機、行車紀錄器、投影機、車用影音系統等電子裝置,本發明不以此為限。 Referring to FIG. 1, the image processing apparatus 100 of the present embodiment receives an image A and outputs an image A'. The image processing apparatus 100 performs dynamic range compression and local contrast enhancement on the image A to enhance the detail information of the image A, and the output result is the output image A'. The image processing apparatus 100 can be an electronic device such as a personal computer, a notebook computer, a digital camera, a digital camera, a network camera, a smart phone, a tablet computer, a scanner, a driving recorder, a projector, a car audio and video system, and the like. Not limited to this.
影像處理裝置100包括色彩擷取電路110、亮度擷取電路 120、濾波器運算電路130以及像素調整電路140,其中色彩擷取電路110、亮度擷取電路120、濾波器運算電路130以及像素調整電路140可被實作為一或多個積體電路,其中各個積體電路包括多個邏輯閘(logic gate)。 The image processing device 100 includes a color capture circuit 110 and a brightness capture circuit. 120, the filter operation circuit 130 and the pixel adjustment circuit 140, wherein the color capture circuit 110, the brightness capture circuit 120, the filter operation circuit 130, and the pixel adjustment circuit 140 can be implemented as one or more integrated circuits, each of which The integrated circuit includes a plurality of logic gates.
色彩擷取電路110接收影像A中的多個輸入像素,且每一個輸入像素都包括至少一個色彩像素值。 The color capture circuit 110 receives a plurality of input pixels in the image A, and each of the input pixels includes at least one color pixel value.
亮度擷取電路120耦接至色彩擷取電路110,將每一個輸入像素的色彩像素值進行色域(color space)轉換,以取得每一個輸入像素在不同色域中的亮度像素值。 The brightness capture circuit 120 is coupled to the color capture circuit 110 to perform color space conversion on the color pixel values of each input pixel to obtain luminance pixel values of each input pixel in different color gamuts.
濾波器運算電路130耦接至亮度擷取電路120,針對亮度像素值進行濾波器運算。此濾波器運算為空間低通濾波運算(spatial low-pass filtering),但本發明不以此為限。 The filter operation circuit 130 is coupled to the brightness extraction circuit 120 for performing a filter operation on the luminance pixel values. This filter operation is spatial low-pass filtering, but the invention is not limited thereto.
像素調整電路140耦接至色彩擷取電路110、亮度擷取電路120以及濾波器運算電路130,可調整影像A中的色彩像素值,以產生影像A'。在本實施例中,像素調整電路140為多個加法器與乘法器所組成的積體電路。此外,像素調整電路140更可包括非揮發性記憶體,用以儲存多個參數。 The pixel adjustment circuit 140 is coupled to the color capture circuit 110, the brightness capture circuit 120, and the filter operation circuit 130. The color pixel values in the image A can be adjusted to generate the image A'. In the embodiment, the pixel adjustment circuit 140 is an integrated circuit composed of a plurality of adders and multipliers. In addition, the pixel adjustment circuit 140 may further include a non-volatile memory for storing a plurality of parameters.
圖2是依照本發明第一實施例所繪示之影像增強處理方法的流程圖。請參照圖2,本實施例的方法適用於圖1的影像處理裝置100,以下即搭配影像處理裝置100中的各項元件說明本發明之影像增強處理方法的詳細步驟。 FIG. 2 is a flowchart of an image enhancement processing method according to a first embodiment of the present invention. Referring to FIG. 2, the method of the present embodiment is applied to the image processing apparatus 100 of FIG. 1. Hereinafter, the detailed steps of the image enhancement processing method of the present invention will be described with reference to various elements in the image processing apparatus 100.
首先,色彩擷取電路110接收影像中的多個輸入像素,並 且取得各個輸入像素的輸入色彩像素資料,其中這些輸入像素包括第一輸入像素(步驟S201)。詳言之,請同時參照圖3所繪示之影像A的示意圖。影像A包括多個輸入像素,且這些輸入像素是以行(column)與列(row)的方式排列成一個矩陣。舉例而言,輸入像素A11為影像A中第1列第1行的輸入像素,輸入像素A12為影像A中第1列第2行的輸入像素,輸入像素A21為影像A中第2列第1行的輸入像素,以此類推。每一個輸入像素會包括至少一個像素值。在本實施例中,影像A為在RGB色域中的彩色影像,其中每一個像素會包括紅色像素值(R像素值)、綠色像素值(G像素值)以及藍色像素值(B像素值),即為前述的「輸入色彩像素資料」。然而,在其它實施例中,輸入色彩像素資料亦可以包括YCbCr色域中的Y像素值、Cb像素值以及Cr像素值,本發明不在此設限。此外,為方便說明,以下僅將針對影像A中的第一輸入像素AC說明影像增強處理的步驟流程。 First, the color capture circuit 110 receives a plurality of input pixels in the image and obtains input color pixel data of the respective input pixels, wherein the input pixels include the first input pixels (step S201). In detail, please refer to the schematic diagram of the image A shown in FIG. 3 at the same time. The image A includes a plurality of input pixels, and the input pixels are arranged in a matrix in a row and a row. For example, the input pixel A 11 is the input pixel of the first row of the first row in the image A, the input pixel A 12 is the input pixel of the second row of the first row of the image A, and the input pixel A 21 is the second of the image A. The input pixels in row 1 of the column, and so on. Each input pixel will include at least one pixel value. In this embodiment, the image A is a color image in the RGB color gamut, where each pixel includes a red pixel value (R pixel value), a green pixel value (G pixel value), and a blue pixel value (B pixel value). ), which is the aforementioned "input color pixel data". However, in other embodiments, the input color pixel data may also include Y pixel values, Cb pixel values, and Cr pixel values in the YCbCr color gamut, and the present invention is not limited thereto. In addition, for convenience of explanation, only the step flow of the image enhancement processing will be described for the first input pixel A C in the image A.
接著,亮度擷取電路120根據各個輸入像素的輸入色彩像素資料,取得各個輸入像素的輸入亮度像素值以及輸入亮度成份資料(步驟S203)。詳言之,亮度擷取電路120根據每一個輸入像素的輸入色彩像素資料,取得每一個輸入像素在不同色域的亮度像素值。在本實施例中,前述的輸入亮度像素值是在HSV(hue,saturation,value)色域中的V像素值,而前述的輸入亮度成份資料是在YCbCr色域中的Y像素值。然而在其它實施例中,亮度像素值也可以是將RGB像素值轉換為其它標準的像素值。在以下的說明中,輸入色彩
像素資料可以下列數學式表示:
濾波器運算電路130會針對這些輸入像素的輸入亮度像素值進行濾波器運算,以獲得第一輸入像素AC的濾波器結果(步驟S205)。詳言之,濾波器運算電路120是根據濾波器125來進行濾波器運算。在本實施例中,濾波器125以第一輸入像素AC為中心,利用空間低通濾波器核心函數(spatial low-pass filter kernel function),在濾波器125範圍內所有輸入像素的輸入亮度像素值進行迴旋積運算(convolution operation)。在此,第一輸入像素AC的濾波器結果可由下列方程式取得:
本發明的影像增強處理方法是以動態範圍壓縮與局部對比增強的概念,利用輸入色彩像素資料加上其像素調整資料來產生輸出色彩像素資料。在本實施例中,是採用方程式(1)來產生輸出色彩像素資料:
詳細而言,像素調整電路140根據第一輸入像素AC的濾波器結果,進行調整增益運算,以獲得第一輸入像素AC的調整增益值(步驟S207)。像素調整電路140根據一個連續可微分的亮度轉移函數,將第一輸入像素AC的濾波器結果轉換為第一輸入像素的亮度轉移輸出值,接著再根據第一輸入像素的亮度轉移輸出值與第一輸入像素AC的濾波器結果之間的比值,獲得第一輸入像素AC的調整增益值。在本實施例中,像素調整電路140可以是根據方程式(2)取得第一輸入像素AC的調整增益值:
舉例而言,為了提高影像A中低亮度的輸入像素之輸入亮度像素值,並且同時保留高亮度的輸入像素之對比度,上述的亮度轉移函數T可以為方程式(2.1):
像素調整電路140又根據第一輸入像素AC的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素AC的調整更新值(步驟S209)。詳言之,像素調整電路140根據第一輸入像素AC的輸入色彩像素資料、輸入亮度成份資料以及色彩飽合度參數,獲
得第一輸入像素AC的調整更新值。在本實施例中,像素調整電路140可以是根據方程式(3)取得第一輸入像素AC的調整更新值:
在一實施例中,上述所謂的「輸入亮度成份資料」為RGB輸入像素的NTSC亮度成份資訊,Y in (x,y)定義為方程式(4):Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)r 0、g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1],N為常數。舉例而言,在一實施例中,方程式(4)中的參數可以分別為r 0=0.257、g 0=0.5044、b 0=0.0977並且N=16,而方程式(4)可改寫為方程式(4.1):Y in (x,y)=0.257R in (x,y)+0.5044G in (x,y)+0.0977B in (x,y)+16 方程式(4.1) In one embodiment, the so-called "input luminance component data" is NTSC luminance component information of RGB input pixels, and Y in ( x , y ) is defined as equation (4): Y in ( x , y ) = r 0 R In ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) r 0 , g 0 and b 0 are the multiple input luminances of the input luminance component data Composition ratio, r 0 [0,1], g 0 [0,1] and b 0 [0,1], N is a constant. For example, in one embodiment, the parameters in equation (4) may be r 0 =0.257, g 0 =0.5044, b 0 =0.0977, and N =16, and equation (4) may be rewritten as equation (4.1). ): Y in ( x , y )=0.257 R in ( x , y )+0.5044 G in ( x , y )+0.0977 B in ( x , y )+16 Equation (4.1)
在另一實施例中,為了加快計算方程式(4)的速度,亮度擷取電路120更可包括多個位元暫存器(bit register),其可分別針對R in (x,y)、G in (x,y)以及B in (x,y)進行至少一位元移動運算(bit-shift operation)後進行累加運算,而取得方程式(4)的結果逼近值。以方程式(4.1)為例,可以由方程式(4.2)或方程式(4.3)之一近似求得:
必須特別說明的是,本實施例中的步驟S207以及步驟S209的順序可進行對調,本發明不以此為限。 It should be noted that the order of step S207 and step S209 in this embodiment can be reversed, and the present invention is not limited thereto.
像素調整電路140在取得調整增益值以及調整更新值後,即根據第一輸入像素AC的輸入色彩像素資料以及第一輸入像素AC的調整增益值與調整更新值的乘積,取得第一輸入像素AC的輸出色彩像素資料(步驟S211)。也就是說,像素調整電路140利用前述方程式(1)來產生輸出色彩像素資料:
第二實施例與第一實施例類似,在此僅描述不同之處。在第一實施例中所採取的方式涉及多種非線性運算,其較適用於具有高運算效能的影像處理裝置。在第二實施例中所採用的方法,除了可加速處理彩色影像的功效,其更適用於低成本硬體設計的影像處理裝置。 The second embodiment is similar to the first embodiment, and only the differences will be described herein. The approach taken in the first embodiment involves a variety of non-linear operations, which are more suitable for image processing devices with high computational efficiency. The method employed in the second embodiment is more suitable for an image processing apparatus of a low cost hardware design, in addition to speeding up the processing of color images.
圖4繪示依據本發明第二實施例的一種影像處理裝置的方塊示意圖。請參照圖5,影像處理裝置400包括色彩擷取電路410、亮度擷取電路420、濾波器運算電路430、像素調整電路440以及色彩輸出電路450,其中色彩擷取電路410以及濾波器運算電路430分別與第一實施例中的色彩擷取電路110以及濾波器運算電路130具有相同的功能,在此不再贅述。類似地,亮度擷取電路420耦接至色彩擷取電路410;濾波器運算電路430耦接至亮度擷取電路420;像素調整電路440耦接至色彩擷取電路410、亮度擷取電路420以及濾波器運算電路430。色彩輸出電路450耦接至像素調整電路440,用以輸出影像。 4 is a block diagram of an image processing apparatus according to a second embodiment of the present invention. Referring to FIG. 5 , the image processing apparatus 400 includes a color capture circuit 410 , a brightness capture circuit 420 , a filter operation circuit 430 , a pixel adjustment circuit 440 , and a color output circuit 450 . The color capture circuit 410 and the filter operation circuit 430 . The color capture circuit 110 and the filter operation circuit 130 in the first embodiment have the same functions, and will not be described again. Similarly, the brightness capture circuit 420 is coupled to the color capture circuit 410; the filter operation circuit 430 is coupled to the brightness capture circuit 420; the pixel adjustment circuit 440 is coupled to the color capture circuit 410, the brightness capture circuit 420, and Filter operation circuit 430. The color output circuit 450 is coupled to the pixel adjustment circuit 440 for outputting an image.
在本實施例中,亮度擷取電路420包括多個16位元暫存器以及加法器(未繪示)。像素調整電路440包括調整增益查找表442、調整更新電路444、乘法器448a~448c以及加法器449a~449c。調整更新電路444更包括非揮發性記憶體445、乘法器446、乘法器447a~447c、加法器447d~447f所組成的積體電路。 In this embodiment, the brightness capture circuit 420 includes a plurality of 16-bit registers and an adder (not shown). The pixel adjustment circuit 440 includes an adjustment gain lookup table 442, an adjustment update circuit 444, multipliers 448a to 448c, and adders 449a to 449c. The adjustment and update circuit 444 further includes an integrated circuit composed of a non-volatile memory 445, a multiplier 446, multipliers 447a to 447c, and adders 447d to 447f.
在本實施例中,影像A包括多個輸入像素,並且是在RGB色域中,其中這些輸入像素包括第一輸入像素AC。色彩擷取電路410接收影像A中的多個輸入像素,並且取得各個輸入像素的輸入色彩像素資料,亦即R像素值、G像素值以及B像素值,並且分別傳輸至亮度擷取電路420。接著,亮度擷取電路420會將輸入色彩像素資料轉換為HSV色域的V像素值,亦即輸入亮度像素值。在此,輸入色彩像素資料仍是以下列數學式表示:
亮度擷取電路420將輸入亮度像素值傳輸至濾波器運算電 路430,而濾波器運算電路430計算第一輸入像素AC的濾波器結果,並且將濾波器結果傳輸至像素調整電路440的調整增益查找表442。濾波器運算電路430產生濾波器結果的方式請參照第一實施例的相關說明,於此不再贅述。 The luminance capture circuit 420 transmits the input luminance pixel value to the filter operation circuit 430, and the filter operation circuit 430 calculates the filter result of the first input pixel A C and transmits the filter result to the adjustment gain of the pixel adjustment circuit 440. Look up table 442. For the manner in which the filter operation circuit 430 generates the filter result, refer to the related description of the first embodiment, and details are not described herein again.
本實施例之動態範圍壓縮與局部對比增強的概念亦是以輸入色彩像素資料加上其像素調整資料來產生輸出色彩像素資料。在本實施例中,是採用方程式(5)來產生輸出色彩像素資料:
在本實施例中,調整增益查找表442為一個一維調整增益查找表(1-dimensional adjustment gain lookup table,1D adjustment gain LUT),其根據濾波器結果與調整增益整數值所建立。詳言之,調整增益整數值定義為方程式(6):
另一方面,像素調整電路440的調整更新電路444可分別自色彩擷取電路410以及亮度擷取電路420取得第一輸入像素AC的輸入色彩像素資料的輸入色彩像素元素以及輸入亮度成份資料,利用乘法器446、乘法器447a~447c、加法器447d~447f以及16位元暫存器計算調整更新整數值。詳言之,調整更新整數值定義為方程式(7):
值得注意的是,在另一實施例中,輸入亮度成份資料Y in (x,y)可以直接由調整更新電路444來執行運算。在此架構下,像素調整電路420無須耦接至亮度擷取電路420,而像素調整電路440中的調整更新電路444則更包括多個位元暫存器。 It should be noted that in another embodiment, the input luminance component data Y in ( x , y ) can be directly operated by the adjustment update circuit 444. In this architecture, the pixel adjustment circuit 420 does not need to be coupled to the brightness capture circuit 420, and the adjustment update circuit 444 in the pixel adjustment circuit 440 further includes a plurality of bit registers.
像素調整電路440的調整增益查找表442以及調整更新電
路444分別產生調整增益整數值以及調整更新整數值後,便可根據前述方程式(5),利用乘法器448a~448c以及加法器449a~449c計算輸出色彩像素近似資料
在本實施例中,由於調整增益查找表442的建立,使得影像增強處理方法流程所需的運算可簡化為輸入亮度像素值的運算、濾波器運算、調整增益整數值的索引操作、調整更新整數值的運算以及像素調整資料的運算與輸出,而大幅加快整體動態範圍壓縮與局部對比增強的處理程序。 In this embodiment, due to the establishment of the adjustment gain lookup table 442, the operations required for the image enhancement processing method flow can be simplified to the operation of inputting the luminance pixel value, the filter operation, the index operation of adjusting the gain integer value, and the adjustment and update. Numerical calculations and pixel adjustment data operations and outputs greatly speed up the overall dynamic range compression and local contrast enhancement processing.
綜上所述,本發明所提出的影像增強處理方法及影像處理裝置,結合任何連續可微分的亮度轉移函數以及控制色彩飽合度的相關演算,可同時提高影像亮度、局部對比度以及保留原始得色彩資訊,以避免影像的失真。此外,藉由調整增益查找表的索引操作、整數化以及位元移動的運算方式,可大幅加快整體動態範圍壓縮與局部對比增強演算的處理程序。此影像增強處理方法及影像處理裝置不僅可達到彩色影像增強的功效,並且可達到即時影像或視訊處理的效能,以運用於低成本的消費性電子產品上,增強本發明在實 際應用中的適用性。 In summary, the image enhancement processing method and image processing apparatus provided by the present invention combines any continuously differentiable luminance transfer function and related calculations for controlling color saturation, thereby simultaneously improving image brightness, local contrast, and retaining original color. Information to avoid image distortion. In addition, by adjusting the index operation of the gain lookup table, the integerization, and the bit shifting operation, the processing procedure of the overall dynamic range compression and the local contrast enhancement calculation can be greatly accelerated. The image enhancement processing method and the image processing device can not only achieve the effect of color image enhancement, but also achieve the performance of instant image or video processing, and can be applied to low-cost consumer electronic products, and the invention is enhanced. Applicability in inter-applications.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.
S201~S211‧‧‧動態範圍壓縮與局部對比增強方法的流程 S201~S211‧‧‧ Flow of dynamic range compression and local contrast enhancement method
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW102133944A TWI533708B (en) | 2013-09-18 | 2013-09-18 | Method and image processing device for image enhancement |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW102133944A TWI533708B (en) | 2013-09-18 | 2013-09-18 | Method and image processing device for image enhancement |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201513676A TW201513676A (en) | 2015-04-01 |
| TWI533708B true TWI533708B (en) | 2016-05-11 |
Family
ID=53437322
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW102133944A TWI533708B (en) | 2013-09-18 | 2013-09-18 | Method and image processing device for image enhancement |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI533708B (en) |
-
2013
- 2013-09-18 TW TW102133944A patent/TWI533708B/en not_active IP Right Cessation
Also Published As
| Publication number | Publication date |
|---|---|
| TW201513676A (en) | 2015-04-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI473039B (en) | Image dynamic range compression and local contrast enhancement method and image processing device | |
| TWI399100B (en) | Image processing method | |
| CN113810641B (en) | Video processing method and device, electronic equipment and storage medium | |
| CN113810642B (en) | Video processing method and device, electronic equipment and storage medium | |
| CN109416831B (en) | Low-cost color expansion module for extending the color of images | |
| JP5810803B2 (en) | Method, apparatus and system for adjusting whiteboard image | |
| CN113824914B (en) | Video processing method, apparatus, electronic device and storage medium | |
| CN103826113B (en) | A kind of color rendition method and device | |
| CN115242992A (en) | Video processing method, apparatus, electronic device and storage medium | |
| CN107918928B (en) | A color restoration method | |
| CN105993170B (en) | Image processing apparatus, camera device, image processing method | |
| CN113507598A (en) | Video screen display method, device, terminal and storage medium | |
| WO2019012112A1 (en) | Method and system for color gamut mapping | |
| US9444975B2 (en) | Image sensor gamut mapping | |
| TWI523500B (en) | Image dynamic range compression method and image processing device | |
| CN119011740B (en) | Image processing method, device, electronic device and readable storage medium | |
| CN116320776B (en) | Image processing method, device, chip, electronic equipment and storage medium | |
| TWI533708B (en) | Method and image processing device for image enhancement | |
| US12106458B2 (en) | Method and device for image processing, and storage medium | |
| CN113271450B (en) | White balance adjusting method, image processing device and image processing system | |
| US20210297558A1 (en) | Cubiform method | |
| CN109146815B (en) | Image contrast adjusting method and device and computer equipment | |
| US20250203033A1 (en) | Image processing without color channel clipping | |
| CN121329836A (en) | Image processing method and device and electronic equipment | |
| TW201511522A (en) | Color conversion method and color conversion system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| MM4A | Annulment or lapse of patent due to non-payment of fees |