TWI790732B - Image correction method and image correction device - Google Patents

Image correction method and image correction device Download PDF

Info

Publication number
TWI790732B
TWI790732B TW110132293A TW110132293A TWI790732B TW I790732 B TWI790732 B TW I790732B TW 110132293 A TW110132293 A TW 110132293A TW 110132293 A TW110132293 A TW 110132293A TW I790732 B TWI790732 B TW I790732B
Authority
TW
Taiwan
Prior art keywords
image
parameter
scene
color
shooting
Prior art date
Application number
TW110132293A
Other languages
Chinese (zh)
Other versions
TW202312098A (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 TW110132293A priority Critical patent/TWI790732B/en
Application granted granted Critical
Publication of TWI790732B publication Critical patent/TWI790732B/en
Publication of TW202312098A publication Critical patent/TW202312098A/en

Links

Images

Landscapes

  • Image Processing (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

The disclosure provides an image correction method and an image correction device. The method includes: obtaining a scene image, which includes a physical color card; obtaining a shooting parameter and a scene parameter of the scene image; performing a linearization operation on the scene image to generate a first image, and recording a first linear operation parameter; generating a color correction matrix based on the first image and the physical color card; performing a non-linearization operation on the first image to generate a second image, and recording a non-linear operation parameter; and defining the shooting parametera and the scene parameter to correspond to the linear operation parameter, the color correction matrix, and the non-linear operation parameter.

Description

影像校正方法及影像校正裝置Image correction method and image correction device

本發明是有關於一種校正方法及校正裝置,且特別是有關於一種影像校正方法及影像校正裝置。The present invention relates to a calibration method and a calibration device, and in particular to an image calibration method and an image calibration device.

現今,筆記型電腦、一體式(all in one,AIO)電腦、智慧眼鏡等產品皆配有影像擷取裝置。使用者能使用此類裝置進行如儲存影像、視訊會議或擴增實境(AR)等影像擷取的相關應用。Nowadays, notebook computers, all-in-one (AIO) computers, smart glasses and other products are equipped with image capture devices. Users can use this type of device to perform related applications such as image storage, video conferencing, or augmented reality (AR) image capture.

一般而言,影像擷取裝置的色彩精準度是其效能表現的一項重要指標。多數影像擷取裝置主要透過影像訊號處理器(image signal processor,ISP)進行色彩精準度校準。然而,一般校準機制可能有部分限制。舉例而言,考量生產資源,在生產時未必會對單一影像擷取裝置進行針對性調整。另外,用於進行色彩校正的色彩校正參數生成的環境可能是燈箱或特定場景,因此校正結果可能未必完全適合每一影像擷取裝置,亦未必符合每一使用者實際常用的環境。Generally speaking, the color accuracy of an image capture device is an important indicator of its performance. Most image capture devices mainly perform color accuracy calibration through an image signal processor (ISP). However, the general calibration mechanism may have some limitations. For example, considering production resources, it is not necessary to make targeted adjustments to a single image capture device during production. In addition, the environment for generating color correction parameters used for color correction may be a light box or a specific scene, so the correction result may not be completely suitable for every image capture device, nor may it be in line with the actual commonly used environment of every user.

有鑑於此,本發明提供一種影像校正方法及影像校正裝置,其可用於解決上述技術問題。In view of this, the present invention provides an image correction method and an image correction device, which can be used to solve the above technical problems.

本發明提供一種影像校正方法,適於一影像校正裝置,所述方法包括:反應於判定影像校正裝置經切換為一校正模式,由影像校正裝置的一取像電路取得一第一場景影像,其中第一場景影像中包括一實體色卡;取得第一場景影像的一第一拍攝參數及一第一場景參數;對第一場景影像執行一第一線性化操作以產生一第一影像,並記錄第一線性化操作的一第一線性運算參數;基於第一影像及實體色卡產生一色彩校正矩陣;對第一影像執行相對於第一線性化操作的一第一非線性化操作以產生一第二影像,並記錄第一非線性化操作的一第一非線性運算參數;以及將第一拍攝參數及第一場景參數定義為對應於第一線性運算參數、色彩校正矩陣及第一非線性運算參數。The present invention provides an image correction method suitable for an image correction device. The method includes: in response to determining that the image correction device is switched to a correction mode, an image capture circuit of the image correction device obtains a first scene image, wherein The first scene image includes a physical color card; obtaining a first shooting parameter and a first scene parameter of the first scene image; performing a first linearization operation on the first scene image to generate a first image, and Recording a first linear operation parameter of the first linearization operation; generating a color correction matrix based on the first image and the physical color card; performing a first nonlinearization relative to the first linearization operation on the first image operating to generate a second image, and recording a first nonlinear operation parameter of the first nonlinearization operation; and defining first capture parameters and first scene parameters as corresponding to the first linear operation parameter, color correction matrix and the first nonlinear operation parameter.

本發明提供一種影像校正裝置,其包括取像電路及處理器。處理器耦接於取像電路,並經配置以執行:反應於判定影像校正裝置經切換為一校正模式,控制取像電路取得一第一場景影像,其中第一場景影像中包括一實體色卡;取得第一場景影像的一第一拍攝參數及一第一場景參數;對第一場景影像執行一第一線性化操作以產生一第一影像,並記錄第一線性化操作的一第一線性運算參數;基於第一影像及實體色卡產生一色彩校正矩陣;對第一影像執行相對於第一線性化操作的一第一非線性化操作以產生一第二影像,並記錄第一非線性化操作的一第一非線性運算參數;以及將第一拍攝參數及第一場景參數定義為對應於第一線性運算參數、色彩校正矩陣及第一非線性運算參數。The invention provides an image correction device, which includes an image capturing circuit and a processor. The processor is coupled to the image capturing circuit and is configured to execute: in response to determining that the image correction device is switched to a calibration mode, control the image capturing circuit to obtain a first scene image, wherein the first scene image includes a physical color card ; Obtain a first shooting parameter and a first scene parameter of the first scene image; perform a first linearization operation on the first scene image to generate a first image, and record a first linearization operation A linear operation parameter; generate a color correction matrix based on the first image and the solid color card; perform a first nonlinear operation relative to the first linear operation on the first image to generate a second image, and record A first nonlinear operation parameter of the first nonlinear operation; and defining the first shooting parameter and the first scene parameter as corresponding to the first linear operation parameter, the color correction matrix and the first nonlinear operation parameter.

請參照圖1,其是依據本發明之一實施例繪示的影像校正裝置示意圖。在不同的實施例中,影像校正裝置100例如是具有影像擷取功能的各式電腦裝置及/或智慧型裝置,但可不限於此。Please refer to FIG. 1 , which is a schematic diagram of an image calibration device according to an embodiment of the present invention. In different embodiments, the image calibration device 100 is, for example, various computer devices and/or smart devices with image capture functions, but is not limited thereto.

在圖1中,影像擷取裝置100可包括取像電路102及處理器104。在一些實施例中,取像電路102例如是電荷耦合元件(Charge coupled device,CCD)鏡頭、互補式金氧半電晶體(Complementary metal oxide semiconductor transistors,CMOS)鏡頭,或其他可用於拍攝影像的取像裝置,但可不限於此。In FIG. 1 , an image capture device 100 may include an image capture circuit 102 and a processor 104 . In some embodiments, the image capturing circuit 102 is, for example, a charge coupled device (CCD) lens, a complementary metal oxide semiconductor transistors (CMOS) lens, or other image capturing devices that can be used to capture images. like devices, but not limited thereto.

處理器104耦接於取像電路102,並可為一般用途處理器、特殊用途處理器、傳統的處理器、數位訊號處理器、多個微處理器(microprocessor)、一個或多個結合數位訊號處理器核心的微處理器、控制器、微控制器、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式閘陣列電路(Field Programmable Gate Array,FPGA)、任何其他種類的積體電路、狀態機、基於進階精簡指令集機器(Advanced RISC Machine,ARM)的處理器以及類似品。The processor 104 is coupled to the imaging circuit 102, and can be a general-purpose processor, a special-purpose processor, a conventional processor, a digital signal processor, a plurality of microprocessors (microprocessor), one or more combined digital signal Microprocessors, controllers, microcontrollers, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (Field Programmable Gate Arrays, FPGAs), any other kind of IC Circuits, state machines, Advanced RISC Machine (ARM) based processors, and the like.

在一些實施例中,影像校正裝置100還可包括耦接於處理器104的儲存電路,其例如是任意型式的固定式或可移動式隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash memory)、硬碟或其他類似裝置或這些裝置的組合,而可用以記錄多個程式碼或模組。In some embodiments, the image correction device 100 may further include a storage circuit coupled to the processor 104, such as any type of fixed or removable random access memory (Random Access Memory, RAM), read-only Memory (Read-Only Memory, ROM), flash memory (Flash memory), hard disk or other similar devices or a combination of these devices can be used to record multiple program codes or modules.

在本發明的實施例中,處理器104可存取儲存電路中記錄的模組、程式碼來實現本發明提出的影像校正方法,其細節詳述如下。In an embodiment of the present invention, the processor 104 can access the modules and program codes recorded in the storage circuit to implement the image correction method proposed by the present invention, the details of which are described below.

請參照圖2,其是依據本發明之一實施例繪示的影像校正方法流程圖。本實施例的方法可由圖1的影像校正裝置100執行,以下即搭配圖1所示的元件說明圖2各步驟的細節。此外,為使本發明的概念更易於理解,以下將另輔以圖3作說明,其中圖3是依據本發明之一實施例繪示的應用情境圖。Please refer to FIG. 2 , which is a flowchart of an image correction method according to an embodiment of the present invention. The method of this embodiment can be executed by the image calibration device 100 shown in FIG. 1 , and the details of each step in FIG. 2 will be described below with the components shown in FIG. 1 . In addition, in order to make the concept of the present invention easier to understand, the following description will be supplemented with FIG. 3 , wherein FIG. 3 is an application scenario diagram according to an embodiment of the present invention.

概略而言,本發明的影像校正裝置100可運作於取像模式及校正模式中。當影像校正裝置100被切換為校正模式時,影像校正裝置100可基於當下場景的特性而取得適當的各式色彩校正參數,並在被切換為取像模式之後,基於這些色彩校正參數校正所拍攝到的影像。以下將作進一步說明。In a nutshell, the image calibration device 100 of the present invention can operate in an imaging mode and a calibration mode. When the image correction device 100 is switched to the correction mode, the image correction device 100 can obtain various appropriate color correction parameters based on the characteristics of the current scene, and after being switched to the image capture mode, correct the captured images based on these color correction parameters. to the image. This will be further explained below.

首先,在步驟S210中,反應於判定影像校正裝置100經切換為校正模式,處理器104可控制取像電路102取得第一場景影像S1。在一實施例中,第一場景影像S1中例如可包括實體色卡C1。在一實施例中,在影像校正裝置100被切換為校正模式之後,處理器104例如可提供一提示訊息,以提示使用者199將實體色卡C1置於取像電路102的取像範圍中,以讓取像電路102可拍攝到包括實體色卡的影像作為第一場景影像C1,但可不限於此。在一些實施例中,上述提示訊息還可要求使用者199將實體色卡C1置於取像電路102的取像範圍中的某個指定區域,但可不限於此。First, in step S210 , in response to determining that the image calibration device 100 is switched to the calibration mode, the processor 104 may control the image capturing circuit 102 to acquire the first scene image S1 . In an embodiment, the first scene image S1 may include, for example, a solid color card C1. In one embodiment, after the image calibration device 100 is switched to the calibration mode, the processor 104 may, for example, provide a prompt message to prompt the user 199 to place the solid color card C1 in the imaging range of the imaging circuit 102, The image capturing circuit 102 can capture an image including a solid color card as the first scene image C1, but it is not limited thereto. In some embodiments, the above prompt message may also require the user 199 to place the physical color card C1 in a designated area within the imaging range of the imaging circuit 102 , but it is not limited thereto.

在一些實施例中,第一場景影像S1例如是已經由影像訊號處理器(ISP)處理的影像。進一步而言,在取像電路102經拍攝而取得一原始場景影像之後,ISP可對此原始場景影像進行某些初步的校正(例如執行某些非線性化操作),以將此原始場景影像校正為第一場景影像S1,但可不限於此。In some embodiments, the first scene image S1 is, for example, an image that has been processed by an image signal processor (ISP). Furthermore, after the imaging circuit 102 obtains an original scene image, the ISP can perform some preliminary corrections on the original scene image (for example, perform some non-linearization operations), so as to correct the original scene image is the first scene image S1, but is not limited thereto.

之後,在步驟S220中,處理器104可取得第一場景影像S1的第一拍攝參數P11及第一場景參數P12。在不同的實施例中,第一拍攝參數P11可包括取像電路102拍攝第一場景影像S1時的白平衡參數及曝光值的至少其中之一。為便於說明,以下假設第一拍攝參數包括取像電路102拍攝第一場景影像S1時的白平衡參數及曝光值,但可不限於此。After that, in step S220 , the processor 104 can obtain the first shooting parameter P11 and the first scene parameter P12 of the first scene image S1 . In different embodiments, the first shooting parameter P11 may include at least one of a white balance parameter and an exposure value when the imaging circuit 102 is shooting the first scene image S1. For the convenience of description, the following assumes that the first shooting parameters include the white balance parameter and the exposure value when the imaging circuit 102 shoots the first scene image S1, but it is not limited thereto.

在一些實施例中,第一場景參數P12例如是第一場景影像S1的暗像素比率。具體而言,第一場景影像S1可包括多個影像像素,這些影像像素包括多個暗像素,而各暗像素的灰階值皆小於一亮度門限值。在此情況下,所述暗像素比率可表徵為:

Figure 02_image001
,其中
Figure 02_image003
為第一場景影像S1中暗像素的數量,
Figure 02_image005
為第一場景影像S1中影像像素的數量,但可不限於此。 In some embodiments, the first scene parameter P12 is, for example, the dark pixel ratio of the first scene image S1. Specifically, the first scene image S1 may include a plurality of image pixels, and the image pixels include a plurality of dark pixels, and the grayscale values of each dark pixel are smaller than a brightness threshold. In this case, the dark pixel ratio can be characterized as:
Figure 02_image001
,in
Figure 02_image003
is the number of dark pixels in the first scene image S1,
Figure 02_image005
is the number of image pixels in the first scene image S1, but is not limited thereto.

之後,在步驟S230中,處理器104可對第一場景影像S1執行第一線性化操作以產生第一影像IM1,並記錄第一線性化操作的第一線性運算參數PL1。在一實施例中,假設該第一線性化操作為Gamma 2.2,則對應的第一線性運算參數可包括此Gamma 2.2的參數。在另一實施例中,假設該第一線性化操作為Gamma 2.4,則對應的第一線性運算參數可包括此Gamma 2.4的參數,但可不限於此。Afterwards, in step S230 , the processor 104 may perform a first linearization operation on the first scene image S1 to generate a first image IM1 , and record a first linear operation parameter PL1 of the first linearization operation. In an embodiment, assuming that the first linearization operation is Gamma 2.2, the corresponding first linear operation parameters may include parameters of the Gamma 2.2. In another embodiment, assuming that the first linearization operation is Gamma 2.4, the corresponding first linear operation parameter may include the Gamma 2.4 parameter, but is not limited thereto.

之後,在步驟S240中,處理器104可基於第一影像IM1及實體色卡C1產生色彩校正矩陣M1。在一實施例中,實體色卡C1可包括一或多個單色塊,且各單色塊的實際顏色可為已知。Afterwards, in step S240 , the processor 104 can generate a color correction matrix M1 based on the first image IM1 and the solid color card C1 . In an embodiment, the physical color card C1 may include one or more single color blocks, and the actual color of each single color block may be known.

在此情況下,處理器104可在第一影像IM1中找出對應於上述單色塊中的某一者(下稱特定單色塊)的單色影像區域。之後,處理器104可基於此特定單色塊的實際顏色及此單色影像區域的區域顏色估計色彩校正矩陣M1。In this case, the processor 104 may find a monochrome image area corresponding to one of the above-mentioned monochrome blocks (hereinafter referred to as a specific monochrome block) in the first image IM1 . Afterwards, the processor 104 can estimate the color correction matrix M1 based on the actual color of the specific monochrome block and the region color of the monochrome image region.

在一實施例中,所述特定單色塊的實際顏色可表徵為(

Figure 02_image007
),而上述單色影像區域的區域顏色可表徵為(
Figure 02_image009
)。在此情況下,所述特定單色塊的實際顏色與上述單色影像區域的區域顏色之間的關係可表徵為下式(1)。
Figure 02_image011
(1) In one embodiment, the actual color of the specific single color block can be characterized as (
Figure 02_image007
), and the region color of the above monochrome image region can be characterized as (
Figure 02_image009
). In this case, the relationship between the actual color of the specific monochrome block and the regional color of the monochrome image region can be expressed as the following formula (1).
Figure 02_image011
(1)

因此,處理器104可基於式(1)而反推色彩校正矩陣M1的內容,而其具體作法可參照現有技術中的相關矩陣運算手段,於此不另贅述。Therefore, the processor 104 can deduce the content of the color correction matrix M1 based on the formula (1), and its specific method can refer to the correlation matrix calculation method in the prior art, and will not be repeated here.

在一實施例中,透過上述手段所得到的色彩校正矩陣M1可理解為基於使用者199當下所在的場景所得到,因此當影像校正裝置100日後在同樣的場景拍攝影像時,影像校正裝置100即可基於色彩校正矩陣M1來進行此影像的色彩校正,進而讓校正後的影像可在上述場景中提供較佳的色彩表現。In one embodiment, the color correction matrix M1 obtained through the above means can be understood as being obtained based on the current scene of the user 199, so when the image correction device 100 captures an image in the same scene in the future, the image correction device 100 will be The color correction of the image can be performed based on the color correction matrix M1, so that the corrected image can provide better color performance in the above scene.

接著,在步驟S250中,處理器104可對第一影像IM1執行相對於第一線性化操作的第一非線性化操作以產生第二影像IM2,並記錄第一非線性化操作的第一非線性運算參數NPL1。Next, in step S250, the processor 104 may perform the first nonlinearization operation relative to the first linearization operation on the first image IM1 to generate the second image IM2, and record the first nonlinearization operation of the first nonlinearization operation. Non-linear operation parameter NPL1.

在一實施例中,假設第一線性化操作為Gamma 2.2,則相對於第一線性化操作的第一非線性化操作例如是Gamma 1/2.2,而其對應的第一非線性運算參數NPL1例如是Gamma 1/2.2的參數。在另一實施例中,假設第一線性化操作為Gamma 2.4,則相對於第一線性化操作的第一非線性化操作例如是Gamma 1/2.4,而其對應的第一非線性運算參數NPL1例如是Gamma 1/2.4的參數,但可不限於此。In one embodiment, assuming that the first linearization operation is Gamma 2.2, the first nonlinearization operation relative to the first linearization operation is, for example, Gamma 1/2.2, and its corresponding first nonlinear operation parameter NPL1 is, for example, a parameter of Gamma 1/2.2. In another embodiment, assuming that the first linearization operation is Gamma 2.4, the first nonlinear operation relative to the first linearization operation is, for example, Gamma 1/2.4, and its corresponding first nonlinear operation The parameter NPL1 is, for example, a parameter of Gamma 1/2.4, but is not limited thereto.

之後,在步驟S260中,處理器104可將第一拍攝參數P11及第一場景參數P12定義為對應於第一線性運算參數PL1、色彩校正矩陣M1及第一非線性運算參數NPL1。亦即,處理器104可建立「第一拍攝參數P11+第一場景參數P12」與「第一線性運算參數PL1、色彩校正矩陣M1及第一非線性運算參數NPL1」之間的對應關係,但可不限於此。Afterwards, in step S260 , the processor 104 may define the first shooting parameter P11 and the first scene parameter P12 to correspond to the first linear operation parameter PL1 , the color correction matrix M1 and the first nonlinear operation parameter NPL1 . That is, the processor 104 can establish the corresponding relationship between "the first shooting parameter P11+the first scene parameter P12" and "the first linear operation parameter PL1, the color correction matrix M1, and the first nonlinear operation parameter NPL1", but It is not limited to this.

在一實施例中,處理器104可在一查找表中將第一拍攝參數P11及第一場景參數P12定義為對應於第一線性運算參數PL1、色彩校正矩陣M1及第一非線性運算參數NPL1,但可不限於此。In one embodiment, the processor 104 may define the first shooting parameter P11 and the first scene parameter P12 in a lookup table to correspond to the first linear operation parameter PL1, the color correction matrix M1 and the first nonlinear operation parameter NPL1, but may not be limited to this.

基此,在影像校正裝置100被切換為取像模式之後,處理器104即可基於上述查找表來對所拍攝的影像進行校正,而其相關細節將輔以圖4作進一步說明。Based on this, after the image correction device 100 is switched to the image capture mode, the processor 104 can correct the captured image based on the above look-up table, and the related details will be further described with reference to FIG. 4 .

請參照圖4,其是依據本發明之一實施例繪示的應用情境圖。在圖4中,反應於判定影像校正裝置100經切換為取像模式,處理器104可控制取像電路102取得第二場景影像S2。之後,處理器104可取得第二場景影像的第二拍攝參數P21及第二場景參數P22。在不同的實施例中,第二拍攝參數P21可對應於第一拍攝參數P11的屬性,並可包括取像電路102拍攝第二場景影像S2時的白平衡參數及曝光值的至少其中之一。Please refer to FIG. 4 , which is an application scenario diagram according to an embodiment of the present invention. In FIG. 4 , in response to determining that the image correction device 100 is switched to the image capturing mode, the processor 104 may control the image capturing circuit 102 to obtain the second scene image S2 . After that, the processor 104 can obtain the second shooting parameter P21 and the second scene parameter P22 of the second scene image. In different embodiments, the second shooting parameter P21 may correspond to the attribute of the first shooting parameter P11 and may include at least one of a white balance parameter and an exposure value when the image capturing circuit 102 shoots the second scene image S2.

在一實施例中,由於第一拍攝參數P11係假設為取像電路102拍攝第一場景影像S1時的白平衡參數及曝光值,因此第二拍攝參數P21可為取像電路102拍攝第二場景影像S2時的白平衡參數及曝光值。In one embodiment, since the first shooting parameter P11 is assumed to be the white balance parameter and exposure value when the image capturing circuit 102 captures the first scene image S1, the second shooting parameter P21 can be the image capturing circuit 102 shooting the second scene. The white balance parameter and exposure value of image S2.

在一實施例中,處理器104可基於取得第一場景影像S1的第一場景參數P12的方式取得第二場景影像S2的第二場景參數P22(例如是第二場景影像S2中的暗像素比率)。In one embodiment, the processor 104 may obtain the second scene parameter P22 of the second scene image S2 (for example, the dark pixel ratio in the second scene image S2) based on the method of obtaining the first scene parameter P12 of the first scene image S1 ).

之後,處理器104可判斷第二拍攝參數P21及第二場景參數P22是否分別對應於第一拍攝參數P11及第一場景參數P12。Afterwards, the processor 104 can determine whether the second shooting parameter P21 and the second scene parameter P22 correspond to the first shooting parameter P11 and the first scene parameter P12 respectively.

在一實施例中,處理器104可判斷第二拍攝參數P21與第一拍攝參數P11之間的第一誤差是否小於一第一門限值,且第二場景參數P22與第一場景參數P12之間的第二誤差是否小於一第二門限值。在一實施例中,反應於判定第二拍攝參數P21與第一拍攝參數P11之間的第一誤差小於第一門限值,且第二場景參數P22與第一場景參數P12之間的第二誤差小於第二門限值,處理器104可判定第二拍攝參數P21及第二場景參數P22分別對應於第一拍攝參數P11及第一場景參數P12,反之亦反。In one embodiment, the processor 104 can determine whether the first error between the second shooting parameter P21 and the first shooting parameter P11 is smaller than a first threshold value, and the difference between the second scene parameter P22 and the first scene parameter P12 Whether the second error between them is smaller than a second threshold value. In one embodiment, in response to determining that the first error between the second shooting parameter P21 and the first shooting parameter P11 is smaller than the first threshold value, and the second error between the second scene parameter P22 and the first scene parameter P12 If the error is smaller than the second threshold value, the processor 104 can determine that the second shooting parameter P21 and the second scene parameter P22 correspond to the first shooting parameter P11 and the first scene parameter P12 respectively, and vice versa.

在一實施例中,反應於判定第二拍攝參數P21及第二場景參數P22分別對應於第一拍攝參數P11及第一場景參數P12,此即代表第二場景影像S2的拍攝環境係對應於第一場景影像S1的拍攝環境。在此情況下,處理器104可基於先前取得的色彩校正矩陣M1來對第二場景影像S2進行色彩校正。In one embodiment, in response to determining that the second shooting parameter P21 and the second scene parameter P22 correspond to the first shooting parameter P11 and the first scene parameter P12 respectively, it means that the shooting environment of the second scene image S2 corresponds to the first shooting environment. The shooting environment of a scene image S1. In this case, the processor 104 may perform color correction on the second scene image S2 based on the previously acquired color correction matrix M1.

在一實施例中,處理器104可在上述查找表中取得對應於第一拍攝參數P11及第一場景參數P12的第一線性運算參數PL1、色彩校正矩陣M1及第一非線性運算參數NPL1,並基於第一線性運算參數PL1、色彩校正矩陣M1及第一非線性運算參數NPL1將第二場景影像S2校正為第三場景影像S3。In one embodiment, the processor 104 can obtain the first linear operation parameter PL1, the color correction matrix M1 and the first nonlinear operation parameter NPL1 corresponding to the first shooting parameter P11 and the first scene parameter P12 from the above lookup table , and correct the second scene image S2 into a third scene image S3 based on the first linear operation parameter PL1 , the color correction matrix M1 and the first nonlinear operation parameter NPL1 .

如圖4所示,處理器104可基於第一線性運算參數PL1對第二場景影像S2執行上述第一線性化操作以產生第三影像IM3,並基於色彩校正矩陣M1將第三影像IM3校正為第四影像IM4。As shown in FIG. 4 , the processor 104 may perform the first linearization operation on the second scene image S2 based on the first linear operation parameter PL1 to generate the third image IM3, and convert the third image IM3 based on the color correction matrix M1 Corrected to the fourth image IM4.

在一實施例中,處理器104可對第三影像IM3中的各像素皆乘以色彩校正矩陣M1,以將第三影像IM3校正為第四影像IM4,但可不限於此。In one embodiment, the processor 104 may multiply each pixel in the third image IM3 by the color correction matrix M1 to correct the third image IM3 into the fourth image IM4 , but it is not limited thereto.

之後,處理器104可基該第一非線性運算參數NPL1對第四影像IM4執行上述第一非線性化操作以產生第三場景影像S3。在一實施例中,處理器104可將第三場景影像S3顯示予使用者199觀看。藉此,使用者199即可觀看到能夠在當下場景中提供較佳色彩表現的第三場景影像S3,從而得到更佳的觀看體驗。Afterwards, the processor 104 may perform the first nonlinear operation on the fourth image IM4 based on the first nonlinear operation parameter NPL1 to generate the third scene image S3. In one embodiment, the processor 104 may display the third scene image S3 for the user 199 to watch. In this way, the user 199 can watch the third scene image S3 that can provide better color performance in the current scene, so as to obtain a better viewing experience.

綜上所述,在校正模式下,本發明的影像校正裝置可在取得包括實體色卡的場景影像之後,依據實體色卡中單色塊的實際顏色與所拍到影像中對應影像區域的顏色之間的差異估計適用當下場景的色彩校正矩陣。之後,在取像模式下,當影像校正裝置在同樣場景下拍攝影像時,影像校正裝置即可基於上述色彩校正矩陣來進行此影像的色彩校正,進而讓校正後的影像可在上述場景中提供較佳的色彩表現。To sum up, in the correction mode, the image correction device of the present invention can obtain the scene image including the physical color card, according to the actual color of the single color block in the physical color card and the color of the corresponding image area in the captured image. The difference between estimates applies the color correction matrix for the current scene. Afterwards, in the imaging mode, when the image correction device shoots an image in the same scene, the image correction device can perform color correction of the image based on the above color correction matrix, so that the corrected image can be provided in the above scene Better color performance.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。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.

100:影像擷取裝置 102:取像電路 104:處理器 199:使用者 C1:實體色卡 IM1:第一影像 M1:色彩校正矩陣 NPL1:第一非線性運算參數 PL1:第一線性運算參數 S1:第一場景影像 S2:第二場景影像 S3:第三場景影像 S210~S260:步驟 100: image capture device 102: Image acquisition circuit 104: Processor 199: user C1: solid color card IM1: first image M1: Color Correction Matrix NPL1: The first nonlinear operation parameter PL1: first linear operation parameter S1: First scene image S2: Second scene image S3: The third scene image S210~S260: Steps

圖1是依據本發明之一實施例繪示的影像校正裝置示意圖。 圖2是依據本發明之一實施例繪示的影像校正方法流程圖。 圖3是依據本發明之一實施例繪示的應用情境圖。 圖4是依據本發明之一實施例繪示的應用情境圖。 FIG. 1 is a schematic diagram of an image correction device according to an embodiment of the present invention. FIG. 2 is a flowchart of an image correction method according to an embodiment of the present invention. Fig. 3 is an application scenario diagram according to an embodiment of the present invention. Fig. 4 is an application scenario diagram according to an embodiment of the present invention.

S210~S260:步驟 S210~S260: Steps

Claims (11)

一種影像校正方法,適於一影像校正裝置,所述方法包括:反應於該影像校正裝置判定該影像校正裝置經切換為一校正模式,由該影像校正裝置的一取像電路取得一第一場景影像,其中該第一場景影像中包括一實體色卡,該實體色卡包括一特定單色塊;由該影像校正裝置取得該第一場景影像的一第一拍攝參數及一第一場景參數;由該影像校正裝置對該第一場景影像執行一第一線性化操作以產生一第一影像,並記錄該第一線性化操作的一第一線性運算參數;由該影像校正裝置基於該第一影像及該實體色卡產生一色彩校正矩陣,包括:在該第一影像中找出對應於該特定單色塊的一單色影像區域,並基於該特定單色塊的實際顏色及該單色影像區域的一區域顏色估計該色彩校正矩陣;由該影像校正裝置對該第一影像執行相對於該第一線性化操作的一第一非線性化操作以產生一第二影像,並記錄該第一非線性化操作的一第一非線性運算參數;以及由該影像校正裝置在一查找表中將該第一拍攝參數及該第一場景參數定義為對應於該第一線性運算參數、該色彩校正矩陣及 該第一非線性運算參數。 An image correction method suitable for an image correction device, the method comprising: in response to the image correction device determining that the image correction device has switched to a correction mode, obtaining a first scene by an image pickup circuit of the image correction device An image, wherein the first scene image includes a physical color card, and the physical color card includes a specific single color block; a first shooting parameter and a first scene parameter of the first scene image are obtained by the image correction device; performing a first linearization operation on the first scene image by the image correction device to generate a first image, and recording a first linear operation parameter of the first linearization operation; by the image correction device based on The first image and the physical color card generate a color correction matrix, including: finding a monochrome image area corresponding to the specific monochrome block in the first image, and based on the actual color and the specific monochrome block. estimating the color correction matrix for a region color of the monochrome image region; performing a first nonlinearization operation on the first image relative to the first linearization operation by the image correction device to generate a second image, and recording a first nonlinear operation parameter of the first nonlinear operation; and defining the first shooting parameter and the first scene parameter in a look-up table by the image correction device as corresponding to the first linear operation parameters, the color correction matrix and The first nonlinear operation parameter. 如請求項1所述的方法,更包括:反應於判定該影像校正裝置經切換為一取像模式,由該取像電路取得一第二場景影像;取得該第二場景影像的一第二拍攝參數及一第二場景參數;反應於判定該第二拍攝參數及該第二場景參數分別對應於該第一拍攝參數及該第一場景參數,在該查找表中取得對應於該第一拍攝參數及該第一場景參數的該第一線性運算參數、該色彩校正矩陣及該第一非線性運算參數;基於該第一線性運算參數、該色彩校正矩陣及該第一非線性運算參數將該第二場景影像校正為一第三場景影像。 The method as described in Claim 1, further comprising: acquiring a second scene image by the imaging circuit in response to determining that the image correction device is switched to an imaging mode; acquiring a second shot of the second scene image parameter and a second scene parameter; in response to determining that the second shooting parameter and the second scene parameter correspond to the first shooting parameter and the first scene parameter respectively, obtaining the corresponding first shooting parameter in the lookup table and the first linear operation parameter, the color correction matrix, and the first nonlinear operation parameter of the first scene parameter; based on the first linear operation parameter, the color correction matrix and the first nonlinear operation parameter, the The second scene image is corrected into a third scene image. 如請求項2所述的方法,包括:反應於判定該第二拍攝參數與該第一拍攝參數之間的一第一誤差小於一第一門限值,且該第二場景參數與該第一場景參數之間的一第二誤差小於一第二門限值,判定該第二拍攝參數及該第二場景參數分別對應於該第一拍攝參數及該第一場景參數。 The method as described in claim 2, comprising: in response to determining that a first error between the second shooting parameter and the first shooting parameter is smaller than a first threshold value, and the second scene parameter and the first A second error between the scene parameters is smaller than a second threshold value, and it is determined that the second shooting parameter and the second scene parameter correspond to the first shooting parameter and the first scene parameter respectively. 如請求項2所述的方法,其中基於該第一線性運算參數、該色彩校正矩陣及該第一非線性運算參數校正該第二場景影像的步驟包括:基於該第一線性運算參數對該第二場景影像執行該第一線性化操作以產生一第三影像;基於該色彩校正矩陣將該第三影像校正為一第四影像; 基於該第一非線性運算參數對該第四影像執行該第一非線性化操作以產生該第三場景影像。 The method as described in claim 2, wherein the step of correcting the second scene image based on the first linear operation parameter, the color correction matrix and the first nonlinear operation parameter comprises: based on the first linear operation parameter to performing the first linearization operation on the second scene image to generate a third image; correcting the third image to a fourth image based on the color correction matrix; The first nonlinear operation is performed on the fourth image based on the first nonlinear operation parameter to generate the third scene image. 如請求項1所述的方法,其中該第一場景影像為已經由一影像訊號處理器處理的影像。 The method as claimed in claim 1, wherein the first scene image is an image processed by an image signal processor. 如請求項1所述的方法,其中該第一拍攝參數包括該取像電路拍攝該第一場景影像時的一白平衡參數及一曝光值的至少其中之一。 The method according to claim 1, wherein the first shooting parameter includes at least one of a white balance parameter and an exposure value when the imaging circuit captures the first scene image. 如請求項1所述的方法,其中該第一場景影像包括多個影像像素,該些影像像素包括多個暗像素,該第一場景影像的該第一場景參數包括該第一場景影像的一暗像素比率,其中該暗像素比率表徵為:
Figure 110132293-A0305-02-0016-1
,其中N DarkPixel 為該些暗像素的數量,N GlobalImage 為該些影像像素的數量,且各該暗像素的灰階值小於一亮度門限值。
The method according to claim 1, wherein the first scene image includes a plurality of image pixels, the image pixels include a plurality of dark pixels, and the first scene parameter of the first scene image includes a parameter of the first scene image Dark pixel ratio, where the dark pixel ratio is characterized by:
Figure 110132293-A0305-02-0016-1
, wherein N DarkPixel is the number of these dark pixels, N GlobalImage is the number of these image pixels, and the grayscale value of each dark pixel is smaller than a brightness threshold.
如請求項1所述的方法,其中該第一線性化操作包括Gamma 2.2,該第一線性運算參數包括該Gamma 2.2的參數,該第一非線性化操作包括Gamma 1/2.2,該第一非線性運算參數包括該Gamma 1/2.2的參數。 The method according to claim 1, wherein the first linearization operation includes Gamma 2.2, the first linear operation parameters include parameters of the Gamma 2.2, the first non-linear operation includes Gamma 1/2.2, the first A nonlinear operation parameter includes the Gamma 1/2.2 parameter. 如請求項1所述的方法,其中該第一線性化操作包括Gamma 2.4,該第一線性運算參數包括該Gamma 2.4的參數,該第 一非線性化操作包括Gamma 1/2.4,該第一非線性運算參數包括該Gamma 1/2.4的參數。 The method according to claim 1, wherein the first linearization operation includes Gamma 2.4, the first linear operation parameters include parameters of the Gamma 2.4, the first A non-linear operation includes Gamma 1/2.4, and the first non-linear operation parameter includes parameters of the Gamma 1/2.4. 如請求項1所述的方法,其中該特定單色塊的實際顏色表徵為(R TG ,G TG ,B TG ),該單色影像區域的區域顏色表徵為(R SRC ,G SRC ,B SRC ),其中:
Figure 110132293-A0305-02-0017-2
,其中M1為該色彩校正矩陣。
The method as described in claim 1, wherein the actual color of the specific monochrome block is represented by ( R TG , G TG , B TG ), and the regional color of the monochrome image area is represented by ( R SRC , G SRC , B SRC ),in:
Figure 110132293-A0305-02-0017-2
, where M1 is the color correction matrix.
一種影像校正裝置,包括:一取像電路;一處理器,其耦接於該取像電路,並經配置以執行:反應於判定該影像校正裝置經切換為一校正模式,控制該取像電路取得一第一場景影像,其中該第一場景影像中包括一實體色卡,該實體色卡包括一特定單色塊;取得該第一場景影像的一第一拍攝參數及一第一場景參數;對該第一場景影像執行一第一線性化操作以產生一第一影像,並記錄該第一線性化操作的一第一線性運算參數;基於該第一影像及一實體色卡產生一色彩校正矩陣,包括:在該第一影像中找出對應於該特定單色塊的一單色影像區域,並基於該特定單色塊的實際顏色及該單色影像區域的一區域顏色估計該色彩校正矩陣;對該第一影像執行相對於該第一線性化操作的一第一非線性 化操作以產生一第二影像,並記錄該第一非線性化操作的一第一非線性運算參數;以及在一查找表中將該第一拍攝參數及該第一場景參數定義為對應於該第一線性運算參數、該色彩校正矩陣及該第一非線性運算參數。 An image correction device, comprising: an image capturing circuit; a processor coupled to the image capturing circuit and configured to execute: responding to determining that the image correction device is switched to a calibration mode, controlling the image capturing circuit Obtain a first scene image, wherein the first scene image includes a physical color card, and the physical color card includes a specific single color block; obtain a first shooting parameter and a first scene parameter of the first scene image; Execute a first linearization operation on the first scene image to generate a first image, and record a first linear operation parameter of the first linearization operation; generate based on the first image and a physical color card A color correction matrix, comprising: finding a monochrome image region corresponding to the specific monochrome patch in the first image, and estimating a region color based on the actual color of the specific monochrome patch and the monochrome image region the color correction matrix; performing a first nonlinearity on the first image relative to the first linearization operation transform operation to generate a second image, and record a first nonlinear operation parameter of the first nonlinear operation; and define the first shooting parameter and the first scene parameter in a lookup table as corresponding to the The first linear operation parameter, the color correction matrix and the first nonlinear operation parameter.
TW110132293A 2021-08-31 2021-08-31 Image correction method and image correction device TWI790732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110132293A TWI790732B (en) 2021-08-31 2021-08-31 Image correction method and image correction device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110132293A TWI790732B (en) 2021-08-31 2021-08-31 Image correction method and image correction device

Publications (2)

Publication Number Publication Date
TWI790732B true TWI790732B (en) 2023-01-21
TW202312098A TW202312098A (en) 2023-03-16

Family

ID=86670127

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110132293A TWI790732B (en) 2021-08-31 2021-08-31 Image correction method and image correction device

Country Status (1)

Country Link
TW (1) TWI790732B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103226830A (en) * 2013-04-25 2013-07-31 北京大学 Automatic matching correction method of video texture projection in three-dimensional virtual-real fusion environment
US20160098971A1 (en) * 2011-11-16 2016-04-07 Renesas Electronics Corporation Image processing apparatus, image processing method, and program product
CN108458665A (en) * 2018-02-11 2018-08-28 中铁八局集团第二工程有限公司 The method for carrying out the quick distortion measurement in tunnel using up short

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160098971A1 (en) * 2011-11-16 2016-04-07 Renesas Electronics Corporation Image processing apparatus, image processing method, and program product
CN103226830A (en) * 2013-04-25 2013-07-31 北京大学 Automatic matching correction method of video texture projection in three-dimensional virtual-real fusion environment
CN108458665A (en) * 2018-02-11 2018-08-28 中铁八局集团第二工程有限公司 The method for carrying out the quick distortion measurement in tunnel using up short

Also Published As

Publication number Publication date
TW202312098A (en) 2023-03-16

Similar Documents

Publication Publication Date Title
US9288392B2 (en) Image capturing device capable of blending images and image processing method for blending images thereof
US9749551B2 (en) Noise models for image processing
US9558543B2 (en) Image fusion method and image processing apparatus
JP5933105B2 (en) Image processing apparatus, imaging apparatus, filter generation apparatus, image restoration method, and program
JP5709911B2 (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
US8576295B2 (en) Image processing apparatus and image processing method
US20150365612A1 (en) Image capture apparatus and image compensating method thereof
KR101639664B1 (en) Photographing apparatus and photographing method
US11574390B2 (en) Apparatus and method for image processing
WO2019013217A1 (en) Correction device, imaging device, control method for correction device, and control program
JP2018207413A (en) Imaging apparatus
TWI790732B (en) Image correction method and image correction device
JP5631769B2 (en) Image processing device
KR101612853B1 (en) Photographing apparatus, controlling method of photographing apparatus, and recording medium storing program to implement the controlling method
JP5482427B2 (en) Imaging apparatus, camera shake correction method, and program
JP2015109681A (en) Image processing method, image processing apparatus, image processing program, and imaging apparatus
US20200314349A1 (en) Image processing device, image processing method, and program
US20240070826A1 (en) Image processing method, image processing apparatus, and storage medium
JP2009159404A (en) Image processing method, image processing device, and image formation device
JP2008054200A (en) Imaging apparatus and image processing program
CN117376539A (en) White balance coefficient correction method and electronic device
JP5775413B2 (en) Image processing apparatus, image processing method, and program
CN114257764A (en) Black level correction method, apparatus, computer device, and medium
KR20120067283A (en) Image processing apparatus, image processing method and program recording medium
JP2019106215A (en) Data processor, imaging device, and data processing method