TW202316852A - Image color adjustment method and image color adjustment device - Google Patents
Image color adjustment method and image color adjustment device Download PDFInfo
- Publication number
- TW202316852A TW202316852A TW110136455A TW110136455A TW202316852A TW 202316852 A TW202316852 A TW 202316852A TW 110136455 A TW110136455 A TW 110136455A TW 110136455 A TW110136455 A TW 110136455A TW 202316852 A TW202316852 A TW 202316852A
- Authority
- TW
- Taiwan
- Prior art keywords
- image
- color
- neutral point
- adjustment
- target image
- Prior art date
Links
Images
Abstract
Description
本發明是有關於一種影像色彩調整技術,且特別是有關於一種影像色彩調整方法與影像色彩調整裝置。The present invention relates to an image color adjustment technology, and in particular to an image color adjustment method and an image color adjustment device.
目前大多數具有拍照功能的電子裝置(例如智慧型手機)普偏支援自動白平衡的影像調整功能,以對所拍攝的影像進行顏色補償,例如調整影像的色溫。然而,這種自動白平衡機制在使用上往往出現問題。例如,在所拍攝的影像中同時存在人臉與背景時,若以背景的影像色調去調整整張影像,則可能會讓影像中的人臉產生色偏。因此,實務上較為理想的方式是在調整影像之前,先去偵測影像中的人臉,然後再根據人臉顏色去調整整張影像。但是,在某些情況下(例如當影像中僅存在單一環境光源時),由於人臉可能僅占整張影像的一小部分,因此,若單純根據影像中的人臉顏色來對整張影像進行顏色調整,可能會導致整張影像產生色偏。At present, most electronic devices with a camera function (such as smart phones) generally support the image adjustment function of automatic white balance, so as to perform color compensation on the captured image, such as adjusting the color temperature of the image. However, this automatic white balance mechanism often has problems in use. For example, when there are human faces and the background in the captured image, if the entire image is adjusted with the image tone of the background, the human face in the image may have a color cast. Therefore, in practice, a more ideal way is to detect faces in the image before adjusting the image, and then adjust the entire image according to the color of the face. However, in some cases (for example, when there is only a single ambient light source in the image), since the face may only occupy a small part of the entire image, if the entire image is only based on the color of the face in the image Making color adjustments may cause color casts in the entire image.
有鑑於此,本發明的實施例提供一種影像色彩調整方法與影像色彩調整裝置,可改善上述問題。In view of this, the embodiments of the present invention provide an image color adjustment method and an image color adjustment device, which can improve the above problems.
本發明的實施例提供一種影像色彩調整方法,其包括:獲得目標影像;對所述目標影像的色彩分布執行中性點(neutral point)檢測;根據所述中性點檢測的檢測結果進入第一調整模式或第二調整模式;在所述第一調整模式中,對所述目標影像執行臉部辨識,並根據所述臉部辨識的辨識結果對所述目標影像執行影像色彩調整;以及在所述第二調整模式中,在未執行所述臉部辨識的狀態下,根據所述目標影像的所述色彩分布對所述目標影像執行所述影像色彩調整。An embodiment of the present invention provides an image color adjustment method, which includes: obtaining a target image; performing neutral point (neutral point) detection on the color distribution of the target image; an adjustment mode or a second adjustment mode; in the first adjustment mode, face recognition is performed on the target image, and image color adjustment is performed on the target image according to a recognition result of the face recognition; and in the first adjustment mode, In the second adjustment mode, when the face recognition is not performed, the image color adjustment is performed on the target image according to the color distribution of the target image.
本發明的實施例另提供一種影像色彩調整裝置,其包括儲存電路與處理器。所述儲存電路用以儲存目標影像。所述處理器耦接至所述儲存電路並用以:獲得所述目標影像;對所述目標影像的色彩分布執行中性點檢測;根據所述中性點檢測的檢測結果進入第一調整模式或第二調整模式;在所述第一調整模式中,對所述目標影像執行臉部辨識,並根據所述臉部辨識的辨識結果對所述目標影像執行影像色彩調整;以及在所述第二調整模式中,在未執行所述臉部辨識的狀態下,根據所述目標影像的所述色彩分布對所述目標影像執行所述影像色彩調整。An embodiment of the invention further provides an image color adjustment device, which includes a storage circuit and a processor. The storage circuit is used for storing the target image. The processor is coupled to the storage circuit and is used to: obtain the target image; perform neutral point detection on the color distribution of the target image; enter a first adjustment mode according to the detection result of the neutral point detection; or The second adjustment mode; in the first adjustment mode, perform face recognition on the target image, and perform image color adjustment on the target image according to the recognition result of the face recognition; and in the second adjustment mode, In the adjustment mode, the image color adjustment is performed on the target image according to the color distribution of the target image when the face recognition is not performed.
基於上述,在獲得目標影像後,可對所述目標影像的色彩分布執行中性點檢測。根據所述中性點檢測的檢測結果,第一調整模式與第二調整模式的其中之一可被選擇性地啟動。在所述第一調整模式中,可對所述目標影像執行臉部辨識,並根據所述臉部辨識的辨識結果對所述目標影像執行影像色彩調整。另一方面,在所述第二調整模式中,所述臉部辨識將不被啟動,並且在未執行所述臉部辨識的狀態下,對所述目標影像執行的影像色彩調整可根據所述目標影像的所述色彩分布而執行。藉此,可針對不同類型的影像選擇性地啟動臉部辨識,從而有效提升對整張影像的色彩調整效率。Based on the above, after the target image is obtained, neutral point detection may be performed on the color distribution of the target image. According to the detection result of the neutral point detection, one of the first adjustment mode and the second adjustment mode can be selectively activated. In the first adjustment mode, face recognition may be performed on the target image, and image color adjustment may be performed on the target image according to a recognition result of the face recognition. On the other hand, in the second adjustment mode, the face recognition will not be activated, and in the state where the face recognition is not performed, the image color adjustment performed on the target image can be performed according to the The color distribution of the target image is performed. In this way, face recognition can be selectively activated for different types of images, thereby effectively improving the efficiency of color adjustment for the entire image.
圖1是根據本發明的實施例所繪示的影像色彩調整裝置的示意圖。請參照圖1,裝置(亦稱為影像色彩調整裝置)10可為智慧型手機、平板電腦、筆記型電腦、攝影機、照相機、遊戲機、桌上型電腦、工業電腦或伺服器等各式具有資料處理以及影像處理功能的電子裝置。在一實施例中,裝置10亦可具有影像擷取功能。FIG. 1 is a schematic diagram of an image color adjustment device according to an embodiment of the present invention. Please refer to FIG. 1, the device (also called image color adjustment device) 10 can be a smart phone, a tablet computer, a notebook computer, a video camera, a camera, a game machine, a desktop computer, an industrial computer or a server, etc. An electronic device with data processing and image processing functions. In an embodiment, the
裝置10包括處理器11、儲存電路12及輸入/輸出(I/O)介面13。處理器11耦接至儲存電路12與輸入/輸出裝置13。處理器11用以負責裝置10的整體或部分運作。例如,處理器11可包括中央處理單元(Central Processing Unit, CPU)、圖形處理器(graphics processing unit, GPU)、或是其他可程式化之一般用途或特殊用途的微處理器、數位訊號處理器(Digital Signal Processor, DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits, ASIC)、可程式化邏輯裝置(Programmable Logic Device, PLD)或其他類似裝置或這些裝置的組合。The
儲存電路12用以儲存資料。例如,儲存電路12可包括揮發性儲存電路與非揮發性儲存電路。揮發性儲存電路用以揮發性地儲存資料。例如,揮發性儲存電路可包括隨機存取記憶體(Random Access Memory, RAM)或類似的揮發性儲存媒體。非揮發性儲存電路用以非揮發性地儲存資料。例如,非揮發性儲存電路可包括唯讀記憶體(Read Only Memory, ROM)、固態硬碟(solid state disk, SSD)、傳統硬碟(Hard disk drive, HDD)或類似的非揮發性儲存媒體。The
輸入/輸出裝置13可包括攝影鏡頭、通訊介面、滑鼠、鍵盤、螢幕、觸控螢幕、揚聲器及/或麥克風等各式訊號的輸入/輸出裝置。本發明不限制輸入/輸出裝置13的裝置類型。The input/
在一實施例中,處理器11可經由輸入/輸出(I/O)裝置13中的攝影鏡頭對環境影像進行影像擷取以獲得影像(亦稱為目標影像)101。或者,在一實施例中,處理器11可經由輸入/輸出(I/O)裝置13中的通訊介面從其他電子裝置接收影像101。影像101可被儲存於儲存電路12中。在一實施例中,影像101中可包括人的臉部影像。或者,在一實施例中,影像101中可不包括人的臉部影像。In one embodiment, the
在一實施例中,處理器11可獲得影像101。例如,處理器11可從儲存電路12中讀取影像101。處理器11可對影像101執行色彩分析以獲得影像101的色彩分布。例如,影像101中可包括多個像素點。影像101中的每一個像素點可對應一個色碼組合,且一個色碼組合可對應一種視覺上的顏色。例如,一個色碼組合可由紅(R)、綠(G)及藍(B)三原色的色碼組成。以某一個像素點所對應的色碼組合(198, 164, 162)為例,色碼組合(198, 164, 162)表示在此像素點上,原色R的色碼為198,原色G的色碼為164,且原色B的色碼為162。處理器11可根據影像101中至少部分的像素點所對應的色碼組合來獲得影像101的色彩分布。In one embodiment, the
在獲得影像101的色彩分布後,處理器11可對影像101的色彩分布執行中性點(neutral point)檢測。所述中性點檢測可用以檢測影像101的色彩分布中的中性點(亦稱為中性色參考點)。一個中性點可對應一種色彩分布。一種色彩分布可對應一種色溫。根據所述中性點檢測的檢測結果,處理器11可選擇性地進入第一調整模式或第二調整模式。After obtaining the color distribution of the
在第一調整模式中,處理器11可對影像101執行臉部辨識。然後,處理器11可根據臉部辨識的辨識結果對影像101執行影像色彩調整。例如,所述影像色彩調整包括調整影像101的白平衡。另一方面,在第二調整模式中,處理器11可在未執行所述臉部辨識的狀態下,根據影像101的色彩分布對影像101執行所述影像色彩調整。In the first adjustment mode, the
在一實施例中,若影像101的色彩分布中僅存在單一種色彩分布(或色溫),則所述中性點檢測的檢測結果可反映影像101的色彩分布中存在單一個中性點。所述單一個中性點可反映或用以描述所述單一種色彩分布(或色溫)的統計特性或分布特性。例如,所述單一個中性點可反映影像101整體的色彩分布(或色溫)是偏冷或偏暖。In one embodiment, if there is only a single color distribution (or color temperature) in the color distribution of the
在一實施例中,若影像101的色彩分布中同時存在多種色彩分布(或色溫),則所述中性點檢測的檢測結果可反映影像101的色彩分布中存在多個中性點。所述多個中性點可分別反映或用以描述所述多種色彩分布(或色溫)各別的統計特性或分布特性。例如,所述多個中性點的其中之一可反映影像101中一部分區域的色彩分布(或色溫)是偏冷,而所述多個中性點的其中之另一則可反映影像101中另一部分區域的色彩分布(或色溫)是偏暖。In one embodiment, if multiple color distributions (or color temperatures) exist in the color distribution of the
在一實施例中,若影像101的色彩分布無法被明確識別、分組或定義,則所述中性點檢測的檢測結果可反映影像101的色彩分布中不存在任何中性點。In one embodiment, if the color distribution of the
在一實施例中,所述中性點檢測的檢測結果可反映影像101的色彩分布中是否存在任何中性點及/或影像101的色彩分布中的中性點的總數。響應於所述中性點檢測的檢測結果反映影像101的色彩分布中存在多個中性點或不存在任何中性點,處理器11可進入所述第一調整模式。然後,處理器11可在第一調整模式中對影像101進行影像色彩調整。或者,響應於所述中性點檢測的檢測結果反映影像101的色彩分布中僅存在單一個中性點,則處理器11可進入所述第二調整模式。然後,處理器11可在第二調整模式中對影像101進行影像色彩調整。In one embodiment, the detection result of the neutral point detection may reflect whether there is any neutral point in the color distribution of the
在一實施例中,在第一調整模式中,處理器11可根據臉部辨識的辨識結果判斷影像101中是否存在人的臉部圖案(即人臉)。在第一調整模式中,若臉部辨識的辨識結果反映影像101中存在人的臉部圖案,處理器11可根據所述臉部圖案的色彩分布來對影像101執行影像色彩調整。例如,處理器11可根據所述臉部圖案的色彩分布(例如膚色),來調整影像101整體(包含影像101中人臉所在的區域以及人臉以外的區域)的白平衡。其中,影像101中的人的臉部圖案所涵蓋的區域的色溫可能會與影像101中的人的臉部圖案以外的區域的色溫相同或不同。In one embodiment, in the first adjustment mode, the
從另一角度而言,在第一調整模式中,若影像101中存在人的臉部圖案,則處理器11可忽略影像101中的人的臉部圖案以外的區域的色彩分布,而僅是根據所述臉部圖案的色彩分布,來調整影像101整體的白平衡。另一方面,在第一調整模式中,若臉部辨識的辨識結果反映影像101中不存在人的臉部圖案,則處理器11可根據影像101整體的色彩分布,來調整影像101整體的白平衡。From another point of view, in the first adjustment mode, if there is a human facial pattern in the
在一實施例中,在第二調整模式中,處理器11可不對影像101執行臉部辨識。藉此,可提高處理器11在第二調整模式中執行影像色彩調整的效率。特別是,在第二調整模式中,即便影像101中存在人的臉部圖案,處理器11仍是根據影像101整體的色彩分布,來調整影像101整體的白平衡。亦即,在第二調整模式中,即便影像101中存在人的臉部圖案,處理器11仍是同時考慮影像101中人臉所在的區域以及人臉以外的區域的色彩分布,來調整影像101整體的白平衡。In an embodiment, in the second adjustment mode, the
在一實施例中,若影像101的色彩分布中同時存在多個中性點或不存在任何中性點,表示影像101中的多個區域可能具有不同的色彩分布(或色溫)。在此狀況下,在第一調整模式中,處理器11可優先以人的臉部圖案的色彩分布(或人臉所在的環境光源下的色溫)為基準來調整影像101整體的白平衡。藉此,在影像101的拍攝環境中同時存在多種光源(即存在混和光源)或光源條件不明確的狀況下,可有效減少執行色彩調整後的影像101中可能呈現於人臉的色偏,進而提高影像的色彩調整品質。In one embodiment, if there are multiple neutral points or no neutral point in the color distribution of the
另一方面,若影像101的色彩分布中僅存在單一個中性點,表示影像101的拍攝環境中僅存在單一光源且影像101整體的色彩分布(或色溫)趨於一致。在此狀況下,在第二調整模式中,處理器11可略過臉部辨識程序而直接以影像101整體的色彩分布為基準來調整影像101整體的白平衡。藉此,可在幾乎不影響影像101的色彩調整品質的前提下,提高對影像101執行色彩調整的效率。On the other hand, if there is only a single neutral point in the color distribution of the
圖2是根據本發明的實施例所繪示的影像色彩調整方法的流程圖。請參照圖2,在步驟S201中,獲得目標影像。在步驟S202中,對所述目標影像的色彩分布執行中性點(neutral point)檢測。在步驟S203中,根據所述中性點檢測的檢測結果進入第一調整模式或第二調整模式。在步驟S204中,在所述第一調整模式中,對所述目標影像執行臉部辨識,並根據所述臉部辨識的辨識結果對所述目標影像執行影像色彩調整。在步驟S205中,在所述第二調整模式中,在未執行所述臉部辨識的狀態下,根據所述目標影像的所述色彩分布對所述目標影像執行所述影像色彩調整。FIG. 2 is a flowchart of an image color adjustment method according to an embodiment of the invention. Please refer to FIG. 2 , in step S201 , a target image is obtained. In step S202, a neutral point detection is performed on the color distribution of the target image. In step S203, enter the first adjustment mode or the second adjustment mode according to the detection result of the neutral point detection. In step S204 , in the first adjustment mode, face recognition is performed on the target image, and image color adjustment is performed on the target image according to a recognition result of the face recognition. In step S205 , in the second adjustment mode, the image color adjustment is performed on the target image according to the color distribution of the target image when the face recognition is not performed.
圖3是根據本發明的實施例所繪示的影像色彩調整方法的流程圖。請參照圖3,在步驟S301中,獲得目標影像。在步驟S302中,對所述目標影像的色彩分布執行中性點檢測。在步驟S303中,判斷所述目標影像的色彩分布中是否存在中性點。若所述目標影像的色彩分布中不存在任何中性點,在步驟S304中,進入第一調整模式。若所述目標影像的色彩分布中存在至少一中性點,在步驟S305中,判斷所述中性點的數目是否大於一。若所述中性點的數目大於一,在步驟S304中,進入第一調整模式。或者,若所述中性點的數目不大於一,在步驟S306中,進入第二調整模式。FIG. 3 is a flowchart of an image color adjustment method according to an embodiment of the invention. Referring to FIG. 3 , in step S301 , a target image is obtained. In step S302, a neutral point detection is performed on the color distribution of the target image. In step S303, it is determined whether there is a neutral point in the color distribution of the target image. If there is no neutral point in the color distribution of the target image, in step S304, enter the first adjustment mode. If there is at least one neutral point in the color distribution of the target image, in step S305, it is determined whether the number of the neutral points is greater than one. If the number of neutral points is greater than one, in step S304, enter the first adjustment mode. Or, if the number of neutral points is not greater than one, in step S306, enter the second adjustment mode.
然而,圖2與圖3中各步驟已詳細說明如上,在此便不再贅述。值得注意的是,圖2與圖3中各步驟可以實作為多個程式碼或是電路,本發明不加以限制。此外,圖2與圖3的方法可以搭配以上範例實施例使用,也可以單獨使用,本發明不加以限制。However, each step in FIG. 2 and FIG. 3 has been described in detail above, and will not be repeated here. It should be noted that each step in FIG. 2 and FIG. 3 can be implemented as a plurality of program codes or circuits, which is not limited by the present invention. In addition, the methods shown in FIG. 2 and FIG. 3 can be used together with the above exemplary embodiments, or can be used alone, which is not limited by the present invention.
綜上所述,本發明所提出的實施例可對當下所欲處理之影像的色彩分布執行中性點檢測並根據檢測結果決定是否在後續的影像色彩調整操作中對所述影像執行臉部辨識。藉此,可在影像的色彩調整品質與色彩調整效率之間取得較佳平衡。To sum up, the embodiment of the present invention can perform neutral point detection on the color distribution of the image to be processed at the moment and decide whether to perform face recognition on the image in the subsequent image color adjustment operation according to the detection result . Thereby, a better balance can be achieved between the color adjustment quality and the color adjustment efficiency of the image.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention should be defined by the scope of the appended patent application.
10:影像色彩調整裝置 11:處理器 12:儲存電路 13:輸入/輸出(I/O)介面 101:影像 S201~S205,S301~S306:步驟 10: Image color adjustment device 11: Processor 12: storage circuit 13: Input/output (I/O) interface 101: Image S201~S205, S301~S306: steps
圖1是根據本發明的實施例所繪示的影像色彩調整裝置的示意圖。 圖2是根據本發明的實施例所繪示的影像色彩調整方法的流程圖。 圖3是根據本發明的實施例所繪示的影像色彩調整方法的流程圖。 FIG. 1 is a schematic diagram of an image color adjustment device according to an embodiment of the present invention. FIG. 2 is a flowchart of an image color adjustment method according to an embodiment of the invention. FIG. 3 is a flowchart of an image color adjustment method according to an embodiment of the invention.
S201~S205:步驟 S201~S205: steps
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110136455A TWI800934B (en) | 2021-09-30 | 2021-09-30 | Image color adjustment method and image color adjustment device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110136455A TWI800934B (en) | 2021-09-30 | 2021-09-30 | Image color adjustment method and image color adjustment device |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202316852A true TW202316852A (en) | 2023-04-16 |
TWI800934B TWI800934B (en) | 2023-05-01 |
Family
ID=86943232
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW110136455A TWI800934B (en) | 2021-09-30 | 2021-09-30 | Image color adjustment method and image color adjustment device |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI800934B (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107396079B (en) * | 2017-08-31 | 2019-06-07 | Oppo广东移动通信有限公司 | White balance adjustment method and device |
CN111836029B (en) * | 2019-04-18 | 2022-03-15 | 福州瑞芯微电子股份有限公司 | White balance adjusting method and system based on color gamut mapping and white balance terminal |
-
2021
- 2021-09-30 TW TW110136455A patent/TWI800934B/en active
Also Published As
Publication number | Publication date |
---|---|
TWI800934B (en) | 2023-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3614335B1 (en) | Method for image processing and electronic device | |
CN107810505B (en) | Machine learning of real-time image capture parameters | |
WO2017084255A1 (en) | Real-time video enhancement method, terminal, and nonvolatile computer readable storage medium | |
US11763470B2 (en) | Method and apparatus for aligning image frames, electronic device and storage medium | |
WO2017215527A1 (en) | Hdr scenario detection method, device, and computer storage medium | |
WO2023065523A1 (en) | Isp-based image processing method and apparatus, storage medium, and camera device | |
US8995784B2 (en) | Structure descriptors for image processing | |
CN112218065B (en) | Image white balance method, system, terminal device and storage medium | |
CN115496668A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
WO2019128539A1 (en) | Image definition obtaining method and apparatus, storage medium, and electronic device | |
CN110618852B (en) | View processing method, view processing device and terminal equipment | |
US20220329729A1 (en) | Photographing method, storage medium and electronic device | |
US10769416B2 (en) | Image processing method, electronic device and storage medium | |
WO2018161568A1 (en) | Photographing method and device based on two cameras | |
CN108932703B (en) | Picture processing method, picture processing device and terminal equipment | |
US20180322676A1 (en) | Simplified lighting compositing | |
WO2021258300A1 (en) | In-screen photography control method, terminal device and storage medium | |
TW202316852A (en) | Image color adjustment method and image color adjustment device | |
CN115660997B (en) | Image data processing method and device and electronic equipment | |
WO2023077981A1 (en) | Display parameter adjusting method and apparatus, storage medium, and display device | |
TWI727780B (en) | Image noise reduction device and method thereof | |
CN114416089A (en) | Page display method and device, mobile terminal and storage medium | |
US20090073464A1 (en) | Selective Color Replacement | |
US10742862B2 (en) | Information processing device, information processing method, and information processing system | |
CN112291548B (en) | White balance statistical method, device, mobile terminal and storage medium |