[go: up one dir, main page]

TWI864390B - Image processing apparatus for video adjustment and video enhancement method - Google Patents

Image processing apparatus for video adjustment and video enhancement method Download PDF

Info

Publication number
TWI864390B
TWI864390B TW111115705A TW111115705A TWI864390B TW I864390 B TWI864390 B TW I864390B TW 111115705 A TW111115705 A TW 111115705A TW 111115705 A TW111115705 A TW 111115705A TW I864390 B TWI864390 B TW I864390B
Authority
TW
Taiwan
Prior art keywords
value
color
pixel
face
block
Prior art date
Application number
TW111115705A
Other languages
Chinese (zh)
Other versions
TW202344035A (en
Inventor
吳政澤
廖彥盛
陳俊良
李安正
洪英士
Original Assignee
宏碁股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW111115705A priority Critical patent/TWI864390B/en
Publication of TW202344035A publication Critical patent/TW202344035A/en
Application granted granted Critical
Publication of TWI864390B publication Critical patent/TWI864390B/en

Links

Images

Landscapes

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

Abstract

An image processing apparatus for video adjustment and a video enhancement method are provided. In the method, an image frame of a video is divided into one or more facial blocks. The facial blocks are corresponding to a face portion captured in the image frame. The brightness of one or more pixels in each facial block is adjusted according to a converted curve. The initial brightness of one pixel has a corresponding adjusted brightness in the converted curve. The converted curve is related to a polynomial, which is formed according to the initial brightness and the adjusted brightness. The adjusted level of a pixel is adjusted according to the primary color ratio of the pixel in the facial block. The primary color ratio is the ratio of the adjusted level of one primary color in the facial block. The adjusted level is the level of the primary color to form the adjusted brightness. Accordingly, a lighting effect is provided.

Description

用於調整視訊的影像處理裝置及視訊增進方法Image processing device for adjusting video and video enhancement method

本發明是有關於一種影像處理技術,且特別是有關於一種用於調整視訊的影像處理裝置及視訊增進方法。 The present invention relates to an image processing technology, and in particular to an image processing device and a video enhancement method for adjusting video.

遠端視訊會議可讓不同位置或空間中的人進行對話,且會議相關設備、協定及/應用程式也發展相當成熟。此外,近年來視訊直播也是相當熱門的產業,且視訊直播可讓觀眾、粉絲或客戶即時觀賞直播主的談話內容或分享畫面。 Remote video conferencing allows people in different locations or spaces to have conversations, and conference-related equipment, protocols and/or applications have also developed quite maturely. In addition, live video broadcasting has also been a very popular industry in recent years, and live video broadcasting allows viewers, fans or customers to watch the live broadcaster's conversation content or shared screens in real time.

無可避免地,使用者或直播主的所處環境可能有光線不足的問題,從而降低另一端觀賞者的視覺體驗。部分使用者或錄影設備會設置發光元件,以對臉部、其他身體部位或所處環境額外打光。然而,額外的發光元件會增加硬體成本,甚至有亮度分布不均、色溫偏差等問題。 Inevitably, the user or live streamer may be in an environment with insufficient light, which reduces the visual experience of the viewer on the other end. Some users or recording devices will set up light-emitting elements to provide additional light to the face, other body parts or the environment. However, additional light-emitting elements will increase hardware costs and even cause problems such as uneven brightness distribution and color temperature deviation.

有鑑於此,本發明實施例提供一種用於調整視訊的影像 處理裝置及視訊增進方法,直接調整視訊中的影像的亮度,以達到打光的效果。 In view of this, the present invention provides an image processing device and a video enhancement method for adjusting the video, which directly adjusts the brightness of the image in the video to achieve a lighting effect.

本發明實施例的視訊增進方法包括(但不僅限於)下列步驟:分割視訊的影像訊框成為一個或更多個臉部區塊。臉部區塊對應於影像訊框所擷取到的臉部。依據轉換曲線調整各臉部區塊中的一個或更多個像素的亮度值。某一像素的初始亮度值在轉換曲線中對應有調整亮度值,且轉換曲線相關於依據初始亮度值及調整亮度值所形成的多項式。依據臉部區塊中的像素的原色比值調整像素的調整色階值。原色比值為一個原色的調整色階值在一個臉部區塊中的所占比例。調整色階值為形成調整亮度值中的原色的色階值。 The video enhancement method of the embodiment of the present invention includes (but is not limited to) the following steps: segmenting the video image frame into one or more face blocks. The face block corresponds to the face captured by the image frame. Adjusting the brightness value of one or more pixels in each face block according to the conversion curve. The initial brightness value of a pixel corresponds to an adjusted brightness value in the conversion curve, and the conversion curve is related to a polynomial formed according to the initial brightness value and the adjusted brightness value. Adjusting the adjusted color value of the pixel according to the primary color ratio of the pixel in the face block. The primary color ratio is the proportion of the adjusted color value of a primary color in a face block. The adjusted color value is the color value of the primary color that forms the adjusted brightness value.

本發明實施例的影像處理裝置包括(但不僅限於)儲存器及處理器。儲存器用以儲存程式碼。處理器耦接儲存器。處理器經配置用以載入且執行程式碼以分割視訊的影像訊框成為一個或更多個臉部區塊,依據轉換曲線調整各臉部區塊中的一個或更多個像素的亮度值,並依據臉部區塊中的像素的原色比值調整像素的調整色階值。臉部區塊對應於影像訊框所擷取到的臉部。某一像素的初始亮度值在轉換曲線中對應有調整亮度值,且轉換曲線相關於依據初始亮度值及調整亮度值所形成的多項式。原色比值為一個原色的色階值在一個臉部區塊中的所占比例。調整色階值為形成調整亮度值中的原色的色階值。 The image processing device of the embodiment of the present invention includes (but is not limited to) a memory and a processor. The memory is used to store program code. The processor is coupled to the memory. The processor is configured to load and execute the program code to divide the image frame of the video into one or more face blocks, adjust the brightness value of one or more pixels in each face block according to the transformation curve, and adjust the adjusted color level value of the pixel according to the primary color ratio of the pixel in the face block. The face block corresponds to the face captured by the image frame. The initial brightness value of a pixel corresponds to the adjusted brightness value in the transformation curve, and the transformation curve is related to a polynomial formed according to the initial brightness value and the adjusted brightness value. The primary color ratio is the proportion of the color level value of a primary color in a face block. The adjusted chromaticity value is the chromaticity value of the primary color that forms the adjusted brightness value.

基於上述,依據本發明實施例的用於調整視訊的影像處 理裝置及視訊增進方法,針對影像訊框中的一個或更多個臉部區塊,利用調整曲線平滑地調整亮度,並依據原色比例微調色階值。藉此,可提供自然且分布平均的亮度,進而提升觀賞體驗。此外,本發明實施例可免除額外增設發光元件。 Based on the above, according to the image processing device and video enhancement method for adjusting video according to the embodiment of the present invention, the brightness of one or more face blocks in the image frame is smoothly adjusted using an adjustment curve, and the color scale value is fine-tuned according to the primary color ratio. In this way, a natural and evenly distributed brightness can be provided, thereby improving the viewing experience. In addition, the embodiment of the present invention can avoid the need for additional light-emitting elements.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 In order to make the above features and advantages of the present invention more clearly understood, the following is a detailed description of the embodiments with the accompanying drawings.

100:電子裝置 100: Electronic devices

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

110:儲存器 110: Storage

111:初始化模組 111: Initialize module

113:亮度調整模組 113: Brightness adjustment module

115:比值調整模組 115: Ratio adjustment module

117:差異調整模組 117: Differential adjustment module

130:處理器 130: Processor

S210~S250:步驟 S210~S250: Steps

FP:臉部特徵點 FP: Facial feature points

IF1、IF2:影像訊框 IF1, IF2: Image frame

RB1~RB4:區域區塊 RB1~RB4: Regional block

PB1~PB3:個人化區塊 PB1~PB3: Personalized area

Lbrt:經調整色階值 L brt : adjusted color gradation value

Lin:初始色階值 Lin : Initial color level value

TL、LL、BL、P:位置 TL, LL, BL, P: Position

SF:S函數 SF:S function

圖1是依據本發明一實施例的影像處理裝置的元件方塊圖。 FIG1 is a block diagram of components of an image processing device according to an embodiment of the present invention.

圖2是依據本發明一實施例的視訊增進方法的流程圖。 Figure 2 is a flow chart of a video enhancement method according to an embodiment of the present invention.

圖3是依據本發明一實施例的臉部特徵點的示意圖。 Figure 3 is a schematic diagram of facial feature points according to an embodiment of the present invention.

圖4是依據本發明一實施例的臉部區塊-區域區塊的示意圖。 FIG4 is a schematic diagram of a facial block-regional block according to an embodiment of the present invention.

圖5是依據本發明一實施例的臉部區塊-個人化區塊的示意圖。 Figure 5 is a schematic diagram of a facial block-personalized block according to an embodiment of the present invention.

圖6是依據本發明一實施例的調整曲線的示意圖。 Figure 6 is a schematic diagram of an adjustment curve according to an embodiment of the present invention.

圖7是依據本發明一實施例的S函數(Sigmoid)的示意圖。 Figure 7 is a schematic diagram of the S function (Sigmoid) according to an embodiment of the present invention.

圖1是依據本發明一實施例的影像處理裝置100的元件方塊圖。請參照圖1,影像處理裝置100包括(但不僅限於)儲存器 110及處理器130。影像處理裝置100可以是桌上型電腦、筆記型電腦、智慧型手機、平板電腦、伺服器或其他運算裝置。 FIG1 is a block diagram of components of an image processing device 100 according to an embodiment of the present invention. Referring to FIG1 , the image processing device 100 includes (but is not limited to) a memory 110 and a processor 130. The image processing device 100 may be a desktop computer, a laptop computer, a smart phone, a tablet computer, a server or other computing devices.

儲存器110可以是任何型態的固定或可移動隨機存取記憶體(Radom Access Memory,RAM)、唯讀記憶體(Read Only Memory,ROM)、快閃記憶體(flash memory)、傳統硬碟(Hard Disk Drive,HDD)、固態硬碟(Solid-State Drive,SSD)或類似元件。在一實施例中,儲存器110用以記錄程式碼、軟體模組(例如,初始化模組111、亮度調整模組113、比值調整模組115及差異調整模組117)、組態配置、資料(例如,影像、數值、特徵點、曲線、區塊等)或檔案,並待後文詳述其實施例。 The memory 110 can be any type of fixed or removable random access memory (RAM), read only memory (ROM), flash memory, traditional hard disk drive (HDD), solid-state drive (SSD) or similar components. In one embodiment, the memory 110 is used to record program code, software modules (e.g., initialization module 111, brightness adjustment module 113, ratio adjustment module 115 and difference adjustment module 117), configuration, data (e.g., images, values, feature points, curves, blocks, etc.) or files, and its embodiments will be described in detail later.

處理器130耦接儲存器110,處理器130並可以是中央處理單元(Central Processing Unit,CPU)、圖形處理單元(Graphic Processing unit,GPU),或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位信號處理器(Digital Signal Processor,DSP)、可程式化控制器、現場可程式化邏輯閘陣列(Field Programmable Gate Array,FPGA)、特殊應用積體電路(Application-Specific Integrated Circuit,ASIC)、神經網路加速器或其他類似元件或上述元件的組合。在一實施例中,處理器130用以執行影像處理裝置100的所有或部份作業。處理器130可載入並執行儲存器110所儲存的各程式碼、軟體模組、檔案及資料。 The processor 130 is coupled to the memory 110, and the processor 130 may be a central processing unit (CPU), a graphic processing unit (GPU), or other programmable general-purpose or special-purpose microprocessor, digital signal processor (DSP), programmable controller, field programmable gate array (FPGA), application-specific integrated circuit (ASIC), neural network accelerator or other similar components or a combination of the above components. In one embodiment, the processor 130 is used to execute all or part of the operations of the image processing device 100. The processor 130 can load and execute various program codes, software modules, files and data stored in the memory 110.

下文中,將搭配影像處理裝置100中的各項裝置、元件及模組說明本發明實施例所述之方法。本方法的各個流程可依照 實施情形而隨之調整,且並不僅限於此。 In the following, the method described in the embodiment of the present invention will be described with various devices, components and modules in the image processing device 100. The various processes of the method can be adjusted according to the implementation situation, but are not limited to this.

圖2是依據本發明一實施例的視訊增進方法的流程圖。請參照圖2,處理器130透過初始化模組111分割視訊的影像訊框(frame)成為一個或更多個臉部區塊(步驟S210)。具體而言,視訊是針對人、特定目標物或場景進行錄影所取得的多媒體串流。一張或更多張影像訊框的集合可稱為視訊。在一實施例中,處理器130可透過內建或外接的影像擷取裝置(例如,攝影機、相機或監視器)取得視訊。在另一實施例中,處理器130可自伺服器、電腦或儲存媒體下載視訊。 FIG2 is a flow chart of a video enhancement method according to an embodiment of the present invention. Referring to FIG2, the processor 130 divides the video image frame into one or more face blocks through the initialization module 111 (step S210). Specifically, the video is a multimedia stream obtained by recording a person, a specific target object or a scene. A collection of one or more image frames can be referred to as a video. In one embodiment, the processor 130 can obtain the video through a built-in or external image capture device (e.g., a camera, a camera or a monitor). In another embodiment, the processor 130 can download the video from a server, a computer or a storage medium.

一般而言,視訊會議或直播的拍攝主體是人臉。即,影像擷取裝置朝向人臉拍攝。而臉部區塊對應於影像訊框所擷取到的臉部。換句而言,初始化模組111將臉部分割成一個或更多個臉部區域。這些臉部區域是用於後續亮度或色階調整的分區處理。 Generally speaking, the subject of a video conference or live broadcast is a human face. That is, the image capture device faces the human face. The face block corresponds to the face captured by the image frame. In other words, the initialization module 111 divides the face into one or more face regions. These face regions are used for subsequent zoning processing of brightness or color level adjustment.

而分割影像訊框的方法有很多種。在一實施例中,初始化模組111可依據影像訊框中的一個或更多個臉部特徵點分割影像訊框。而一個或更多個臉部區塊包括一個或更多個臉部特徵點。臉部特徵點可能是臉部上的器官、輪廓、邊緣或特定位置。例如,眼角、嘴角、鼻頭等。換句而言,臉部區塊的分割相關於臉部特徵點的所處位置。 There are many ways to segment the image frame. In one embodiment, the initialization module 111 can segment the image frame according to one or more facial feature points in the image frame. One or more facial blocks include one or more facial feature points. Facial feature points may be organs, contours, edges or specific locations on the face. For example, the corners of the eyes, the corners of the mouth, the tip of the nose, etc. In other words, the segmentation of the facial block is related to the location of the facial feature points.

針對臉部特徵點的辨識,在一實施例中,初始化模組111可利用基於機器學習(machine learning)演算法(例如,卷積神經網 絡(Convolutional Neural Network,CNN)、遞迴神經網路(Recurrent Neural Network,RNN)、多層感知器(Multi-Layer Perceptron,MLP)或支持向量機(Support Vector Machine,SVM))所訓練的辨識模組辨識這些臉部特徵點。機器學習演算法可分析訓練樣本以自中獲得規律,從而透過規律對未知資料預測。而辨識模組是經學習後所建構出的機器學習模型,並據以辨識或分類影像訊框中臉部特徵點。 For the recognition of facial feature points, in one embodiment, the initialization module 111 can use a recognition module trained based on a machine learning algorithm (e.g., Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), Multi-Layer Perceptron (MLP) or Support Vector Machine (SVM)) to recognize these facial feature points. The machine learning algorithm can analyze the training samples to obtain rules from them, thereby predicting unknown data through the rules. The recognition module is a machine learning model constructed after learning, and is used to recognize or classify facial feature points in the image frame.

例如,圖3是依據本發明一實施例的臉部特徵點FP的示意圖。請參照圖3,透過基於機器學習的臉部定位(Facial landmark)模型可標記68的臉部特徵點FP。數個臉部特徵點FP連接可形成諸如眼睛、眉毛、鼻子、嘴巴、下巴或額頭區域的輪廓。 For example, FIG3 is a schematic diagram of facial feature points FP according to an embodiment of the present invention. Referring to FIG3, facial landmark points FP of 68 can be marked by a facial landmark model based on machine learning. Several facial landmark points FP can be connected to form contours of areas such as eyes, eyebrows, nose, mouth, chin or forehead.

在另一實施例中,初始化模組111可使用諸如Harr特徵、加速穩健特徵(Speeded Up Robust Features,SURF)、尺度不變特徵轉換(scale-invariant feature transform,SIFT)、Adaboost或其他影像辨識及/或特徵比對技術來辨識臉部關鍵點。 In another embodiment, the initialization module 111 may use techniques such as Harr features, Speeded Up Robust Features (SURF), scale-invariant feature transform (SIFT), Adaboost or other image recognition and/or feature matching techniques to identify facial key points.

在一實施例中,臉部區塊包括數個臉部區塊,且這些臉部區塊中的一者的一邊界相鄰於這些臉部區塊中的另一者的邊界。舉例而言,臉部區塊包括區域區塊。圖4是依據本發明一實施例的臉部區塊-區域區塊RB1~RB4的示意圖。請參照圖4,初始化模組111將影像訊框IF1等分成四個區域區塊RB1~RB4,並據以將臉部F等分成左上、右上、左下及右下區塊。其中,區域區塊RB1的右邊界相鄰於區域區塊RB2的左邊界,且區域區塊RB1的下邊 界相鄰於區域區塊RB3的上邊界,其餘依此類推。臉部F的外輪廓上所標記的數個臉部特徵點FP將被分配到所處位置對應的區域區塊。 In one embodiment, the face block includes a plurality of face blocks, and a boundary of one of the face blocks is adjacent to a boundary of another of the face blocks. For example, the face block includes a region block. FIG. 4 is a schematic diagram of a face block-region block RB1-RB4 according to an embodiment of the present invention. Referring to FIG. 4, the initialization module 111 divides the image frame IF1 into four region blocks RB1-RB4, and divides the face F into upper left, upper right, lower left and lower right blocks accordingly. Among them, the right boundary of the regional block RB1 is adjacent to the left boundary of the regional block RB2, and the lower boundary of the regional block RB1 is adjacent to the upper boundary of the regional block RB3, and so on. The several facial feature points FP marked on the outer contour of the face F will be assigned to the regional blocks corresponding to their positions.

須說明的是,圖4所示分割大小、數量及位置僅是用於範例說明,並可依據設計需求而改變。此外,不同臉部區塊的大小也可能不同。 It should be noted that the segmentation size, number and position shown in Figure 4 are only for illustrative purposes and can be changed according to design requirements. In addition, the sizes of different facial blocks may also be different.

在一實施例中,一個或更多個臉部區塊中的一個或更多個臉部特徵點對應於臉部中的器官(例如,眼睛、鼻子、或嘴巴)。換句而言,這些臉部區域是針對特定的臉部器官。舉例而言,臉部區塊包括個人化區塊。圖5是依據本發明一實施例的臉部區塊-個人化區塊PB1~PB3的示意圖。請參照圖5,初始化模組111將影像訊框IF2分割成三個個人化區塊PB1~PB3。其中,個人化區塊PB1框選眼睛的臉部特徵點FP。個人化區塊PB2框選鼻子的臉部特徵點FP。個人化區塊PB3框選嘴巴的臉部特徵點FP。 In one embodiment, one or more facial feature points in one or more facial blocks correspond to organs in the face (e.g., eyes, nose, or mouth). In other words, these facial regions are targeted at specific facial organs. For example, the facial block includes a personalized block. FIG5 is a schematic diagram of a facial block-personalized block PB1~PB3 according to an embodiment of the present invention. Referring to FIG5, the initialization module 111 divides the image frame IF2 into three personalized blocks PB1~PB3. Among them, the personalized block PB1 frames the facial feature points FP of the eyes. The personalized block PB2 frames the facial feature points FP of the nose. The personalized block PB3 frames the facial feature points FP of the mouth.

須說明的是,圖5所示分割大小、數量及位置僅是用於範例說明,並可依據設計需求而改變。此外,任二個人化區塊可能部分重疊、相鄰或遠離。 It should be noted that the size, number and location of the partitions shown in Figure 5 are only for illustrative purposes and can be changed according to design requirements. In addition, any two personalized blocks may partially overlap, be adjacent or distant.

在一些實施例中,初始化模組111可對影像訊框分割出區域區塊及個人化區塊兩者。此外,在其他實施例中,影像訊框的分割不限於參考臉部特徵點的位置。例如,初始化模組111依據臉部的幾何中心、輪廓等分割影像訊框。 In some embodiments, the initialization module 111 can segment the image frame into two regions and personalized regions. In addition, in other embodiments, the segmentation of the image frame is not limited to the position of the reference facial feature points. For example, the initialization module 111 segments the image frame according to the geometric center and contour of the face.

請參照圖2,處理器130透過亮度調整模組113依據轉換 曲線調整各臉部區塊中的一個或更多個像素的亮度值(步驟S230)。具體而言,轉換曲線相關於依據初始亮度值及調整亮度值所形成的多項式。初始亮度值代表影像訊框中的一個像素的原始亮度值,且調整亮度值代表這像素的亮度值已被調整(可能相同或不同於原始亮度值)。這多項式的定義域例如是初始亮度值的最低值至最高值,且其值域例如是調整亮度值的最低值至最高值。而這像素的初始亮度值在轉換曲線中對應有調整亮度值。 Referring to FIG. 2 , the processor 130 adjusts the brightness value of one or more pixels in each face block according to the conversion curve through the brightness adjustment module 113 (step S230). Specifically, the conversion curve is related to a polynomial formed according to the initial brightness value and the adjusted brightness value. The initial brightness value represents the original brightness value of a pixel in the image frame, and the adjusted brightness value represents that the brightness value of the pixel has been adjusted (may be the same or different from the original brightness value). The domain of the polynomial is, for example, the lowest value to the highest value of the initial brightness value, and its range is, for example, the lowest value to the highest value of the adjusted brightness value. The initial brightness value of the pixel corresponds to the adjusted brightness value in the conversion curve.

在一實施例中,多項式是二次曲線方程式。初始化模組111可取得臉部區塊中的一個或更多個像素的亮度代表值。亮度代表值相關於這些像素的亮度值的統計指標(例如,平均值、中位數、或眾數)。例如,針對某一臉部區塊,初始化模組111計算所有像素的三原色(即,紅、綠及藍)的色階值的算術平均值:

Figure 111115705-A0305-02-0010-1
Tbj為第j臉部區塊的亮度代表值,Ri為第j臉部區塊中的第i像素的紅色色階值,Gi為第i像素的綠色色階值,Bi為第i像素的藍色色階值,且P為第j臉部區塊中的像素總數。初始化模組111可定義目標亮度值。這目標亮度值可能是所有臉部區塊的亮度值的統計指標或其他合適於觀賞的亮度值。 In one embodiment, the polynomial is a quadratic curve equation. The initialization module 111 may obtain a brightness representative value of one or more pixels in the face block. The brightness representative value is related to a statistical index (e.g., mean, median, or mode) of the brightness values of these pixels. For example, for a certain face block, the initialization module 111 calculates the arithmetic mean of the color values of the three primary colors (i.e., red, green, and blue) of all pixels:
Figure 111115705-A0305-02-0010-1
T bj is the brightness representative value of the j-th facial block, Ri is the red color value of the i-th pixel in the j-th facial block, Gi is the green color value of the i-th pixel, Bi is the blue color value of the i-th pixel, and P is the total number of pixels in the j-th facial block. The initialization module 111 can define a target brightness value. This target brightness value may be a statistical indicator of the brightness values of all facial blocks or other brightness values suitable for viewing.

值得注意的是,亮度代表值及目標亮度值可通過那二次曲線方程式。圖6是依據本發明一實施例的調整曲線的示意圖。請參照圖6,以二維直角座標系而言,這二次曲線方程式所形成的調整曲線可通過座標(亮度代表值,目標亮度值)的位置TL。此外, 調整曲線更通過座標(亮度最低值,亮度最低值)的位置LL及座標(亮度最高值,亮度最高值)的位置BL。例如,亮度最低值為零,且亮度最高值為255。初始化模組111可將這些座標輸入至尚未決定係數的二次方程式,並據以決定其係數。例如,二次曲線方程式的數學表示式為:Lbrt=((Tbj-Taj)/(Taj 2-k * Taj)) * Lin 2+((1-k * (Tbj-Taj)/(Taj-k * Taj)) * Lin...(2)Lbrt為第j臉部區塊中的某一像素的某一原色的經調整色階值,Lin為這像素的這原色的初始色階值,Tbj為第j臉部區塊的目標亮度值,Taj為第j臉部區塊的代表亮度值,k為色階最高值(例如,255)。 It is worth noting that the brightness representative value and the target brightness value can pass through the quadratic curve equation. FIG. 6 is a schematic diagram of an adjustment curve according to an embodiment of the present invention. Referring to FIG. 6, in terms of a two-dimensional rectangular coordinate system, the adjustment curve formed by the quadratic curve equation can pass through the position TL of the coordinate (brightness representative value, target brightness value). In addition, the adjustment curve further passes through the position LL of the coordinate (brightness minimum value, brightness minimum value) and the position BL of the coordinate (brightness maximum value, brightness maximum value). For example, the brightness minimum value is zero, and the brightness maximum value is 255. The initialization module 111 can input these coordinates into the quadratic equation whose coefficients have not yet been determined, and determine its coefficients accordingly. For example, the mathematical expression of the quadratic curve equation is: L brt =((T bj -T aj )/(T aj 2 -k * T aj )) * Lin 2 +((1-k * (T bj -T aj )/(T aj -k * T aj )) * Lin ...(2)L brt is the adjusted color level value of a primary color of a pixel in the j-th facial block, Lin is the initial color level value of the primary color of the pixel, T bj is the target brightness value of the j-th facial block, T aj is the representative brightness value of the j-th facial block, and k is the highest color level value (e.g., 255).

亮度調整模組113可依據各臉部區塊中的一個或更多個像素的色階值及二次曲線方程式,得出這些臉部區塊中的像素的經調整亮度值。例如,亮度調整模組113將某一像素的某一原色的色階值帶入前述方程式(2),並據以得出這原色的經調整色階值。亮度調整模組113依據這像素的三原色的經調整色階值決定這像素的經調整亮度值。例如,RGB(紅、綠、藍)色彩空間與HSV(色相、飽和度、明度)色彩空間的轉換中,明度(即,亮度值)為三原色中色階值的最高者與最低者的平均值。即,調整色階值為形成調整亮度值中的原色的色階值。而其他臉部區塊及/或像素的經調整亮度值可依此類推。 The brightness adjustment module 113 can obtain the adjusted brightness values of the pixels in these face blocks according to the color scale values of one or more pixels in each face block and the quadratic curve equation. For example, the brightness adjustment module 113 substitutes the color scale value of a primary color of a certain pixel into the aforementioned equation (2) and obtains the adjusted color scale value of the primary color accordingly. The brightness adjustment module 113 determines the adjusted brightness value of the pixel according to the adjusted color scale values of the three primary colors of the pixel. For example, in the conversion between the RGB (red, green, blue) color space and the HSV (hue, saturation, brightness) color space, the brightness (i.e., the brightness value) is the average value of the highest and lowest color scale values of the three primary colors. That is, the adjusted color scale value is the color scale value of the primary color that forms the adjusted brightness value. The adjusted brightness values of other facial blocks and/or pixels can be deduced in the same way.

在另一實施例中,多項式不限於二次曲線方程式並可通過其他指定座標點。例如,亮度調整模組113更將臉部區塊的亮 度值的中位數或眾數調整至另一目標亮度值。 In another embodiment, the polynomial is not limited to the quadratic equation and can be passed through other specified coordinate points. For example, the brightness adjustment module 113 further adjusts the median or mode of the brightness value of the facial area to another target brightness value.

請參照圖2,處理器130透過比值調整模組115依據經亮度調整區塊中的像素的原色比值調整像素的調整色階值(步驟S250)。具體而言,原色比值為一個原色(例如,紅色、綠色或藍色)的調整色階值在一個臉部區塊中的所占比例。原色比值的數學表示式為:

Figure 111115705-A0305-02-0012-2
2, the processor 130 adjusts the adjusted color value of the pixel according to the primary color ratio of the pixel in the brightness adjusted block through the ratio adjustment module 115 (step S250). Specifically, the primary color ratio is the proportion of the adjusted color value of a primary color (e.g., red, green or blue) in a face block. The mathematical expression of the primary color ratio is:
Figure 111115705-A0305-02-0012-2

Figure 111115705-A0305-02-0012-3
Figure 111115705-A0305-02-0012-3

Figure 111115705-A0305-02-0012-4
Rai為第j臉部區塊中的第i像素的紅色的經調整色階值(例如,經調整色階值Lbrt),Gai為第i像素的綠色的經調整色階值,Bai為第i像素的藍色的經調整色階值。Rbj為第j臉部區塊的紅色的原色比值,Gbj為綠色的原色比值,Bbj為藍色的原色比值。
Figure 111115705-A0305-02-0012-4
Rai is the adjusted color gradation value of red of the i-th pixel in the j-th face block (e.g., the adjusted color gradation value Lbrt ), Gai is the adjusted color gradation value of green of the i-th pixel, and Bi is the adjusted color gradation value of blue of the i-th pixel. Rbj is the primary color ratio of red of the j-th face block, Gbj is the primary color ratio of green, and Bbj is the primary color ratio of blue.

比值調整模組115定義目標比值。這目標比值可能是所有臉部區塊的比值的統計指標或其他合適於觀賞的比值。例如,提高黃皮膚的原色比值Rbj與Gbj可使皮膚偏黃、提高原色比值Bbj可使皮膚變白。在一些實施例中,處理器130可進一步優化個人化區塊對應的器官。例如,針對嘴巴,處理器130可提高原色比值Rbj使嘴唇變紅;針對眼部,處理器130可同時提高原色比值Rbj、Gbj、Bbj,以減少黑眼圈。 The ratio adjustment module 115 defines a target ratio. This target ratio may be a statistical indicator of the ratio of all facial blocks or other ratios suitable for viewing. For example, increasing the primary color ratios R bj and G bj of yellow skin can make the skin yellower, and increasing the primary color ratio B bj can make the skin whiter. In some embodiments, the processor 130 can further optimize the organs corresponding to the personalized blocks. For example, for the mouth, the processor 130 can increase the primary color ratio R bj to make the lips redder; for the eyes, the processor 130 can simultaneously increase the primary color ratios R bj , G bj , and B bj to reduce dark circles.

比值調整模組115是將各臉部區塊的原色比值調整至目標比值作為目標調整各臉部區塊中的像素。在一實施例中,比值 調整模組115可依據S函數(Sigmoid)特性將原色比值調整至目標比值。值得注意的是,S函數特性在於,當定義域中的值越接近負無窮時,其在值域對應的值趨近於零;當定義域中的值越接近正無窮時,其在值域對應的值趨近於一。基於這特性,比值調整模組115設定原色比值相關於S函數的定義域,且設定目標比值相關於S函數的值域。例如,S函數的數學表示式為:

Figure 111115705-A0305-02-0013-5
Lrgb為第j臉部區塊中的某一像素的某一原色的原色比值經調整後的微調色階值,Lbrt為經調整色階值,Vbj為第j臉部區塊的相同原色的目標比值,Vaj為第j臉部區塊的相同原色的原色比值,k為色階最大值(例如,255),Cb為S函數輸入調整係數(假設輸出飽和區約為輸入為+-5,則輸入調整系數為0.2(1/5=0.2),但不以此為限),Ca為正規化增益的位移量(用以抵銷S函數的輸出偏移,但可視情況省略)。 The ratio adjustment module 115 adjusts the primary color ratio of each facial block to a target ratio as a target to adjust the pixels in each facial block. In one embodiment, the ratio adjustment module 115 can adjust the primary color ratio to the target ratio according to the characteristics of the S function (Sigmoid). It is worth noting that the characteristic of the S function is that when the value in the definition domain is closer to negative infinity, the corresponding value in the value range tends to zero; when the value in the definition domain is closer to positive infinity, the corresponding value in the value range tends to one. Based on this characteristic, the ratio adjustment module 115 sets the primary color ratio to the definition domain of the S function, and sets the target ratio to the value range of the S function. For example, the mathematical expression of the S function is:
Figure 111115705-A0305-02-0013-5
L rgb is the fine-tuned color gradation value after adjustment of the primary color ratio of a certain primary color of a certain pixel in the j-th facial block, L brt is the adjusted color gradation value, V bj is the target ratio of the same primary color of the j-th facial block, V aj is the primary color ratio of the same primary color of the j-th facial block, k is the maximum color gradation value (for example, 255), C b is the S function input adjustment coefficient (assuming that the output saturation zone is approximately +-5 when the input is +-5, the input adjustment coefficient is 0.2 (1/5=0.2), but not limited to this), and Ca is the displacement of the normalized gain (used to offset the output offset of the S function, but can be omitted as needed).

此外,圖7是依據本發明一實施例的S函數SF的示意圖。請參照圖7,S函數SF的輸入輸出關係如圖7所示。例如,位置P表示輸入的經調整色階值接近最大值(例如,經調整色階值為4.25),則輸出的微調色階值接近1(例如,微調色階值為0.9859)。藉此,可避免轉換曲線造成輸出顏色過深或過淺。 In addition, FIG. 7 is a schematic diagram of an S function SF according to an embodiment of the present invention. Referring to FIG. 7, the input-output relationship of the S function SF is shown in FIG. 7. For example, position P indicates that the input adjusted color scale value is close to the maximum value (for example, the adjusted color scale value is 4.25), and the output fine-tuning color scale value is close to 1 (for example, the fine-tuning color scale value is 0.9859). In this way, the conversion curve can be prevented from causing the output color to be too dark or too light.

須說明的是,原色比值的調整不限於S函數特性,其他 限制極大值或極小值的函數也可應用。 It should be noted that the adjustment of the primary color ratio is not limited to the S function characteristics, and other functions that limit the maximum or minimum values can also be applied.

在一實施例中,不同臉部區塊之間的交界處的顏色可能差異較大。處理器130透過差異調整模組117調整兩個臉部區塊之間的交界處的數個相鄰像素的色階值,以減少那些相鄰像素的色階值之間的差異。交界處代表兩臉部區塊的重疊或連接部分。相鄰像素代表與交界處相距特定範圍內的一個或更多個像素。由於前述亮度及比值的調整都是針對各臉部區塊個別進行,因此不同臉部區塊所用的轉換曲線及/或原色比值可能不同,並使得區塊交界處的部分像素有明顯色階差異。差異調整模組117對這些相鄰像素進行模糊/平滑處理,以減少色階差異。 In one embodiment, the colors of the borders between different facial blocks may differ greatly. The processor 130 adjusts the color values of a plurality of adjacent pixels at the borders between two facial blocks through the difference adjustment module 117 to reduce the difference between the color values of those adjacent pixels. The border represents the overlapping or connected portion of the two facial blocks. The adjacent pixels represent one or more pixels within a specific range from the border. Since the aforementioned brightness and ratio adjustments are performed for each facial block individually, the conversion curves and/or primary color ratios used for different facial blocks may be different, and some pixels at the borders of the blocks may have obvious color difference. The difference adjustment module 117 performs blurring/smoothing on these adjacent pixels to reduce the color level difference.

降低差異的方法有很多種。在一實施例中,差異調整模組117可對那些相鄰像素分別賦予距離權重及區塊權重。距離權重與相距交界處的距離成反比,且區塊權重相關於所屬臉部區塊的器官的重要性。例如,表(1)是距離權重與相距交界處的距離的對應關係:

Figure 111115705-A0305-02-0014-6
由此可知,相距交界處越近,則距離權重越高;相距交界處越遠, 則距離權重越低。 There are many ways to reduce the difference. In one embodiment, the difference adjustment module 117 can assign distance weights and block weights to those neighboring pixels. The distance weight is inversely proportional to the distance from the junction, and the block weight is related to the importance of the organ in the facial block. For example, Table (1) shows the correspondence between the distance weight and the distance from the junction:
Figure 111115705-A0305-02-0014-6
From this we can see that the closer the distance is to the junction, the higher the distance weight is; the farther the distance is to the junction, the lower the distance weight is.

表(2)是區塊權重與臉部區塊的對應關係:

Figure 111115705-A0305-02-0015-7
由此可知,嘴巴的重要性較高,但不以此為限。 Table (2) shows the correspondence between block weights and facial blocks:
Figure 111115705-A0305-02-0015-7
From this we can see that the mouth is more important, but it is not limited to this.

差異調整模組117可依據那些相鄰像素的距離權重及區塊權重決定那些相鄰像素的色階值。例如,差異調整模組117依據距離權重及區塊權重對某一像素及其特定方向上的一個或更多個相鄰像素計算加權平均數,並以這加權平均數決定差異調整後的色階值:Lout=(ΣWdul * Wtul * Lul+ΣWdur * Wtur * Lur+ΣWddl * Wtdl * Ldl+ΣWddr * Wtdr * Ldr+Wtin * Lin)/(ΣWdul * Wtul+ΣWdur * Wtur+ΣWtdl * Wddl+ΣWddr * Wtdr+Wtin)...(7)Lout為某一像素的某一原色經差異調整後的色階值,Lin為這像素的微調色階值(即,經比值調整後的色階值),Lul、Lur、Ldl、Ldr為這像素在左上方、右上方、左下方及右下方的相鄰像素的微調色階值,Wd為這像素與交界處的距離權重(如表(1)所示),Wtin為這像素所處臉部區塊的區塊權重(如表(2)所示),Wtul、Wtur、Wtdl、 Wtdr為這像素所處臉部區塊的相鄰臉部區塊的區塊權重(如表(2)所示)。 The difference adjustment module 117 may determine the color values of the neighboring pixels according to the distance weights and block weights of the neighboring pixels. For example, the difference adjustment module 117 calculates a weighted average for a certain pixel and one or more neighboring pixels in a specific direction according to the distance weight and the block weight, and uses the weighted average to determine the color level value after difference adjustment: L out =(ΣW dul * W tul * L ul +ΣW dur * W tur * L ur +ΣW ddl * W tdl * L dl +ΣW ddr * W tdr * L dr +W tin * L in )/(ΣW dul * W tul +ΣW dur * W tur +ΣW tdl * W ddl +ΣW ddr * W tdr +W tin )...(7) L out is the color level value of a certain primary color of a certain pixel after difference adjustment, L in is the fine-tuned color value of the pixel (i.e., the color value after ratio adjustment), Lu1 , Lu2 , Ldl , Ldr are the fine-tuned color values of the neighboring pixels at the upper left, upper right, lower left, and lower right of the pixel, Wd is the distance weight between the pixel and the boundary (as shown in Table (1)), Wtin is the block weight of the face block where the pixel is located (as shown in Table (2)), Wtul , Wtur , Wtdl , Wtdr are the block weights of the neighboring face blocks of the face block where the pixel is located (as shown in Table (2)).

須說明的是,前述特定方向不以左上方、右上方、左下方及右下方為限,上方、左方、右方、下方或其他方向也可應用。 It should be noted that the aforementioned specific directions are not limited to the upper left, upper right, lower left and lower right, and the upper, left, right, lower or other directions may also be applied.

這些臉部區塊經亮度、比值及/或差異調整後所形成的影像訊框即可輸出。例如,影像訊框經由網路封包輸出,或透過顯示器顯示。此外,一張或更多張影像訊框所形成的視訊經播放後,可改善顯示器所顯示的影像訊框中的亮度。 The image frames formed by adjusting the brightness, ratio and/or difference of the face blocks can be output. For example, the image frames are output via network packets or displayed on a monitor. In addition, the video formed by one or more image frames can be played back to improve the brightness of the image frames displayed on the monitor.

綜上所述,在本發明實施例的用於調整視訊的影像處理裝置及視訊增進方法中,分區優化亮度、比值及/或差異,以達成打光效果。即便頭部擺動或光源移動,影像訊框中的亮度仍可均勻分布且自然。此外,透過軟體打光,可免去設置發光元件的硬體成本。 In summary, in the image processing device and video enhancement method for adjusting video of the embodiment of the present invention, the brightness, ratio and/or difference are optimized in different regions to achieve the lighting effect. Even if the head moves or the light source moves, the brightness in the image frame can still be evenly distributed and natural. In addition, by using software lighting, the hardware cost of setting up light-emitting elements can be avoided.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed as above by the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the relevant technical field can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of the attached patent application.

S210~S250:步驟 S210~S250: Steps

Claims (14)

一種視訊增進方法,包括:分割一視訊的一影像訊框成為至少一臉部區塊,其中該至少一臉部區塊對應於該影像訊框所擷取到的一臉部;依據一轉換曲線調整每一該臉部區塊中的至少一像素的亮度值,其中一該像素的一初始亮度值在該轉換曲線中對應有一調整亮度值,該轉換曲線相關於依據該初始亮度值及該調整亮度值所形成的一多項式,且依據該轉換曲線調整每一該臉部區塊中的該至少一像素的亮度值的步驟包括:將每一該臉部區塊中的該至少一像素中的一者的三原色中的每一者的一初始色階值帶入該多項式,以得出該三原色的經調整色階值;以及依據該三原色的該經調整色階值決定一經調整亮度值,其中每一該原色的該經調整色階值為形成該經調整亮度值中的一該原色的色階值;以及將該至少一臉部區塊中的該至少一像素的一原色比值調整至一目標比值,以決定該至少一像素的一微調色階值,其中該至少一像素的該原色比值為一該原色的該經調整色階值在一該臉部區塊中的該三原色的該經調整色階值的總和所占比例,且將該至少一臉部區塊中的該至少一像素的該原色比例調整至該目標比值的步驟包括:依據一S函數(Sigmoid)特性將該原色比值調整至該目標 比值,其中一該原色的該經調整色階值與一第一比值相關於一S函數的定義域,該第一比值為該目標比值與該原色比值的比值,一該原色的該微調色階值相關於該S函數的值域,且該S函數特性包括:當該S函數的定義域中的值越接近負無窮時,其在該S函數的值域對應的值趨近於零;以及當該S函數的定義域中的值越接近正無窮時,其在該S函數的值域對應的值趨近於一,且當一該原色的該經調整色階值越接近一最大值時,該原色的該微調色階值越接近一。 A video enhancement method includes: dividing an image frame of a video into at least one face block, wherein the at least one face block corresponds to a face captured by the image frame; adjusting the brightness value of at least one pixel in each of the face blocks according to a conversion curve, wherein an initial brightness value of the pixel corresponds to an adjusted brightness value in the conversion curve, the conversion curve is related to a polynomial formed according to the initial brightness value and the adjusted brightness value, and adjusting the brightness value of at least one pixel in each of the face blocks according to the conversion curve. The step of adjusting the brightness value of at least one pixel in the at least one face block comprises: substituting an initial color scale value of each of the three primary colors of one of the at least one pixel in each of the face blocks into the polynomial to obtain adjusted color scale values of the three primary colors; and determining an adjusted brightness value according to the adjusted color scale values of the three primary colors, wherein the adjusted color scale value of each of the primary colors is a color scale value of one of the primary colors forming the adjusted brightness value; and adjusting a primary color ratio of the at least one pixel in the at least one face block to a target ratio to determine A fine-tuned color scale value of the at least one pixel, wherein the primary color ratio of the at least one pixel is the ratio of the adjusted color scale value of the primary color to the sum of the adjusted color scale values of the three primary colors in the face block, and the step of adjusting the primary color ratio of the at least one pixel in the at least one face block to the target ratio includes: adjusting the primary color ratio to the target ratio according to a Sigmoid function characteristic, wherein the adjusted color scale value of the primary color and a first ratio are related to the definition of a Sigmoid function domain, the first ratio is the ratio of the target ratio to the primary color ratio, the fine-tuning color scale value of the primary color is related to the value range of the S function, and the S function characteristics include: when the value in the definition domain of the S function is closer to negative infinity, the corresponding value in the value range of the S function tends to zero; and when the value in the definition domain of the S function is closer to positive infinity, the corresponding value in the value range of the S function tends to one, and when the adjusted color scale value of the primary color is closer to a maximum value, the fine-tuning color scale value of the primary color is closer to one. 如請求項1所述的視訊增進方法,其中該多項式是一二次曲線方程式,且依據該轉換曲線調整每一該臉部區塊中的該至少一像素的亮度值的步驟包括:取得一該臉部區塊中的該至少一像素的一亮度代表值,其中該亮度代表值相關於該至少一像素的亮度值的統計指標,且該二次曲線方程式在一二維直角座標系中所形成的調整曲線通過該亮度代表值及一目標亮度值在該二維直角座標系中的座標;以及依據每一該臉部區塊中的該至少一像素的色階值及該二次曲線方程式,得出該至少一臉部區塊中的該至少一像素的經調整亮度值。 The video enhancement method as described in claim 1, wherein the polynomial is a quadratic curve equation, and the step of adjusting the brightness value of the at least one pixel in each of the face blocks according to the conversion curve includes: obtaining a brightness representative value of the at least one pixel in the face block, wherein the brightness representative value is related to a statistical indicator of the brightness value of the at least one pixel, and the adjustment curve formed by the quadratic curve equation in a two-dimensional rectangular coordinate system passes through the coordinates of the brightness representative value and a target brightness value in the two-dimensional rectangular coordinate system; and obtaining the adjusted brightness value of the at least one pixel in the at least one face block according to the color value of the at least one pixel in each of the face blocks and the quadratic curve equation. 如請求項1所述的視訊增進方法,其中分割該視訊的該影像訊框成為該至少一臉部區塊的步驟包括:依據該影像訊框中的至少一臉部特徵點分割該影像訊框,其 中一該臉部區塊包括至少一該臉部特徵點。 The video enhancement method as described in claim 1, wherein the step of segmenting the video frame into the at least one facial block comprises: segmenting the video frame according to at least one facial feature point in the video frame, wherein the facial block includes at least one facial feature point. 如請求項3所述的視訊增進方法,其中該至少一臉部區塊包括多個臉部區塊,且該些臉部區塊中的一者的一邊界相鄰於該些臉部區塊中的另一者的邊界。 The video enhancement method as described in claim 3, wherein the at least one face block includes multiple face blocks, and a boundary of one of the face blocks is adjacent to a boundary of another of the face blocks. 如請求項3所述的視訊增進方法,其中一該臉部區塊中的至少一臉部特徵點對應於該臉部中的一器官。 The video enhancement method as described in claim 3, wherein at least one facial feature point in the facial block corresponds to an organ in the face. 如請求項1所述的視訊增進方法,其中調整該至少一像素的該調整色階值的步驟之後,更包括:調整二該臉部區塊之間的交界處的多個相鄰像素的色階值,以減少該些相鄰像素的色階值之間的差異。 The video enhancement method as described in claim 1, wherein after the step of adjusting the adjusted color level value of the at least one pixel, further comprises: adjusting the color level values of a plurality of adjacent pixels at the boundary between the two face blocks to reduce the difference between the color level values of the adjacent pixels. 如請求項6所述的視訊增進方法,其中調整二該臉部區塊之間的交界處的該些相鄰像素的色階值的步驟包括:對該些相鄰像素分別賦予一距離權重及一區塊權重,其中該距離權重與相距該交界處的距離成反比,且該區塊權重相關於所屬臉部區塊的器官的重要性;以及依據該些相鄰像素的該距離權重及該區塊權重決定該些相鄰像素的色階值。 The video enhancement method as described in claim 6, wherein the step of adjusting the color scale values of the adjacent pixels at the junction between the two facial blocks includes: assigning a distance weight and a block weight to the adjacent pixels respectively, wherein the distance weight is inversely proportional to the distance from the junction, and the block weight is related to the importance of the organ of the facial block to which it belongs; and determining the color scale values of the adjacent pixels according to the distance weight and the block weight of the adjacent pixels. 一種影像處理裝置,包括:一儲存器,用以儲存一程式碼;以及一處理器,耦接該儲存器,經配置用以載入且執行該程式碼以:分割一視訊的一影像訊框成為至少一臉部區塊,其中該 至少一臉部區塊對應於該影像訊框所擷取到的一臉部;依據一轉換曲線調整每一該臉部區塊中的至少一像素的亮度值,其中一該像素的一初始亮度值在該轉換曲線中對應有一調整亮度值,該轉換曲線相關於依據該初始亮度值及該調整亮度值所形成的一多項式,且依據該轉換曲線調整每一該臉部區塊中的該至少一像素的亮度值包括:將每一該臉部區塊中的該至少一像素中的一者的三原色中的每一者的一初始色階值帶入該多項式,以得出該三原色的經調整色階值;以及依據該三原色的該經調整色階值決定一經調整亮度值,其中每一該原色的該經調整色階值為形成該經調整亮度值中的一該原色的色階值;以及將該至少一臉部區塊中的該至少一像素的一原色比值調整至一目標比值,以決定該至少一像素的該微調色階值,其中該至少一像素的該原色比值為一該原色的該經調整色階值在一該臉部區塊中的該三原色的該經調整色階值的總和所占比例,且該處理器更經配置用以:依據一S函數特性將該原色比值調整至一目標比值,其中該原色比值相關於一S函數的定義域,且該目標比值相關於該S函數的值域,且該S函數特性包括:當該S函數的定義域中的值越接近負無窮時,其在該S函數的值域對應的值趨近於零;以及 當該S函數的定義域中的值越接近正無窮時,其在該S函數的值域對應的值趨近於一,且當一該原色的該經調整色階值越接近一最大值時,該原色的該微調色階值越接近一。 An image processing device includes: a memory for storing a program code; and a processor, coupled to the memory, configured to load and execute the program code to: segment an image frame of a video into at least one face block, wherein the at least one face block corresponds to a face captured by the image frame; adjust the brightness value of at least one pixel in each face block according to a conversion curve, wherein an initial brightness value of the pixel corresponds to an adjusted brightness value in the conversion curve, The conversion curve is related to a polynomial formed according to the initial brightness value and the adjusted brightness value, and adjusting the brightness value of the at least one pixel in each of the face blocks according to the conversion curve includes: substituting an initial color scale value of each of the three primary colors of one of the at least one pixel in each of the face blocks into the polynomial to obtain the adjusted color scale values of the three primary colors; and determining an adjusted brightness value according to the adjusted color scale values of the three primary colors, wherein the adjusted color scale value of each of the primary colors to form a color gradation value of the primary color in the adjusted brightness value; and to adjust a primary color ratio of the at least one pixel in the at least one face block to a target ratio to determine the fine-tuned color gradation value of the at least one pixel, wherein the primary color ratio of the at least one pixel is the proportion of the adjusted color gradation value of the primary color to the sum of the adjusted color gradation values of the three primary colors in the face block, and the processor is further configured to: adjust the primary color ratio to a target ratio according to an S function characteristic, The primary color ratio is related to a definition domain of an S function, and the target ratio is related to a value range of the S function, and the S function characteristics include: when the value in the definition domain of the S function is closer to negative infinity, the corresponding value in the value range of the S function tends to zero; and When the value in the definition domain of the S function is closer to positive infinity, the corresponding value in the value range of the S function tends to one, and when the adjusted color scale value of the primary color is closer to a maximum value, the fine-tuned color scale value of the primary color is closer to one. 如請求項8所述的影像處理裝置,其中該多項式是一二次曲線方程式,且該處理器更經配置用以:取得一該臉部區塊中的該至少一像素的一亮度代表值,其中該亮度代表值相關於該至少一像素的亮度值的統計指標,且該二次曲線方程式在一二維直角座標系中所形成的調整曲線通過該亮度代表值及一目標亮度值在該二維直角座標系中的座標;以及依據每一該臉部區塊中的該至少一像素的色階值及該二次曲線方程式,得出該至少一臉部區塊中的該至少一像素的經調整亮度值。 An image processing device as described in claim 8, wherein the polynomial is a quadratic curve equation, and the processor is further configured to: obtain a brightness representative value of the at least one pixel in the face block, wherein the brightness representative value is related to a statistical indicator of the brightness value of the at least one pixel, and an adjustment curve formed by the quadratic curve equation in a two-dimensional rectangular coordinate system passes through the coordinates of the brightness representative value and a target brightness value in the two-dimensional rectangular coordinate system; and obtain the adjusted brightness value of the at least one pixel in each face block according to the color value of the at least one pixel in the face block and the quadratic curve equation. 如請求項8所述的影像處理裝置,其中該處理器更經配置用以:依據該影像訊框中的至少一臉部特徵點分割該影像訊框,其中一該臉部區塊包括至少一該臉部特徵點。 An image processing device as described in claim 8, wherein the processor is further configured to: segment the image frame according to at least one facial feature point in the image frame, wherein one of the facial blocks includes at least one of the facial feature points. 如請求項10所述的影像處理裝置,其中該至少一臉部區塊包括多個臉部區塊,且該些臉部區塊中的一者的二邊界相鄰於該些臉部區塊中的另二者的邊界。 An image processing device as described in claim 10, wherein the at least one face block includes multiple face blocks, and two boundaries of one of the face blocks are adjacent to the boundaries of the other two of the face blocks. 如請求項10所述的影像處理裝置,其中一該臉部區塊中的至少一臉部特徵點對應於該臉部中的一器官。 An image processing device as described in claim 10, wherein at least one facial feature point in the facial block corresponds to an organ in the face. 如請求項8所述的影像處理裝置,其中該處理器更經配置用以:調整二該臉部區塊之間的交界處的多個相鄰像素的色階值,以減少該些相鄰像素的色階值之間的差異。 An image processing device as described in claim 8, wherein the processor is further configured to: adjust the color level values of multiple adjacent pixels at the boundary between the two facial blocks to reduce the difference between the color level values of the adjacent pixels. 如請求項13所述的影像處理裝置,其中該處理器更經配置用以:對該些相鄰像素分別賦予一距離權重及一區塊權重,其中該距離權重與相距該交界處的距離成反比,且該區塊權重相關於所屬臉部區塊的器官的重要性;以及依據該些相鄰像素的該距離權重及該區塊權重決定該些相鄰像素的色階值。 An image processing device as described in claim 13, wherein the processor is further configured to: assign a distance weight and a block weight to the adjacent pixels respectively, wherein the distance weight is inversely proportional to the distance from the boundary, and the block weight is related to the importance of the organ of the facial block to which it belongs; and determine the color value of the adjacent pixels according to the distance weight and the block weight of the adjacent pixels.
TW111115705A 2022-04-25 2022-04-25 Image processing apparatus for video adjustment and video enhancement method TWI864390B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111115705A TWI864390B (en) 2022-04-25 2022-04-25 Image processing apparatus for video adjustment and video enhancement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111115705A TWI864390B (en) 2022-04-25 2022-04-25 Image processing apparatus for video adjustment and video enhancement method

Publications (2)

Publication Number Publication Date
TW202344035A TW202344035A (en) 2023-11-01
TWI864390B true TWI864390B (en) 2024-12-01

Family

ID=89720223

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111115705A TWI864390B (en) 2022-04-25 2022-04-25 Image processing apparatus for video adjustment and video enhancement method

Country Status (1)

Country Link
TW (1) TWI864390B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI401963B (en) * 2009-06-25 2013-07-11 Pixart Imaging Inc Dynamic image compression method for face detection
TWI444041B (en) * 2009-07-23 2014-07-01 Casio Computer Co Ltd Image processing device, image processing method, and recording medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI401963B (en) * 2009-06-25 2013-07-11 Pixart Imaging Inc Dynamic image compression method for face detection
TWI444041B (en) * 2009-07-23 2014-07-01 Casio Computer Co Ltd Image processing device, image processing method, and recording medium

Also Published As

Publication number Publication date
TW202344035A (en) 2023-11-01

Similar Documents

Publication Publication Date Title
Li et al. Learning to enhance low-light image via zero-reference deep curve estimation
CN113034358B (en) A super-resolution image processing method and related device
CN104978710B (en) A kind of method and apparatus that face brightness is adjusted based on identification of taking pictures
CN112381743B (en) Image processing methods, apparatus, devices and storage media
CN112614060A (en) Method and device for rendering human face image hair, electronic equipment and medium
CN108537749A (en) Image processing method, device, mobile terminal and computer readable storage medium
CN108537155A (en) Image processing method, device, electronic equipment and computer readable storage medium
WO2014187223A1 (en) Method and apparatus for identifying facial features
CN110827204B (en) Image processing method and device and electronic equipment
US20240296531A1 (en) System and methods for depth-aware video processing and depth perception enhancement
CN105096267B (en) A kind of method and apparatus that eye brightness is adjusted based on identification of taking pictures
CN107800966A (en) Method, apparatus, computer-readable recording medium and the electronic equipment of image procossing
CN115496668A (en) Image processing method, image processing device, electronic equipment and storage medium
CN108846807A (en) Light efficiency processing method, device, terminal and computer readable storage medium
Li et al. An adaptive enhancement method for low illumination color images
CN115587948B (en) Image dark field correction method and device
CN108198155A (en) A kind of self application tone mapping method and system
WO2023000868A1 (en) Image processing method and apparatus, device, and storage medium
Yuan et al. Adaptive histogram equalization with visual perception consistency
CN115100240A (en) Object tracking method and device in video, electronic device, storage medium
WO2020107646A1 (en) Image processing method
WO2022135579A1 (en) Skin color detection method and device, mobile terminal, and storage medium
TWI864390B (en) Image processing apparatus for video adjustment and video enhancement method
US20230206592A1 (en) Method and electronic device for digital image enhancement on display
CN110033412A (en) A kind of image processing method and device