JP2016213596A - Color correction device, color correction method and color correction program - Google Patents

Color correction device, color correction method and color correction program Download PDF

Info

Publication number
JP2016213596A
JP2016213596A JP2015094079A JP2015094079A JP2016213596A JP 2016213596 A JP2016213596 A JP 2016213596A JP 2015094079 A JP2015094079 A JP 2015094079A JP 2015094079 A JP2015094079 A JP 2015094079A JP 2016213596 A JP2016213596 A JP 2016213596A
Authority
JP
Japan
Prior art keywords
subject
color
pixel
color correction
luminance
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
JP2015094079A
Other languages
Japanese (ja)
Other versions
JP6398860B2 (en
Inventor
由樹雄 平井
Yukio Hirai
由樹雄 平井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2015094079A priority Critical patent/JP6398860B2/en
Publication of JP2016213596A publication Critical patent/JP2016213596A/en
Application granted granted Critical
Publication of JP6398860B2 publication Critical patent/JP6398860B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a color correction device capable of separating infrared light into a part of high spectral reflectance and a part of low spectral reflectance.SOLUTION: A color correction device 100 includes: an acquisition section that acquires an image; a conversion section that converts the image into color space components including brightness and chromaticity; and a determination section that determines, with respect to each of pixels included in the image converted into a component of color space, whether the pixel corresponds to a first subject which has a high spectral reflectance of infrared light or to another subject other than the first subject depending on whether or not the pixel satisfies a separation conditions relevant to the chromaticity component and the brightness component.SELECTED DRAWING: Figure 1

Description

本発明は、色補正装置、色補正方法及び色補正プログラムに関する。   The present invention relates to a color correction apparatus, a color correction method, and a color correction program.

カメラは、多種多様な用途に利用される。例えば、カメラは、監視カメラや車載カメラとして実装されたり、各種の生体認証や角膜反射を利用する視線検出などに使用される画像の撮像装置として実装されたりする。   Cameras are used in a wide variety of applications. For example, the camera may be implemented as a surveillance camera or an in-vehicle camera, or may be implemented as an image capturing device used for various types of biometric authentication or gaze detection using corneal reflection.

例えば、監視カメラや車載カメラの場合、昼夜兼用で用いられる場合がある。この場合、昼間には、赤外光を除去する赤外線カットフィルタを装着することにより、人が眼で認識できる可視光を受光素子に結像させる一方で、夜間や暗闇では、赤外線カットフィルタを除去することにより、近赤外を始めとする赤外光を照明として活用することがある。また、生体認証や視線検出などの機能が搭載される情報処理端末の場合、生体認証や視線検出に用いる画像と、それ以外の用途に用いる画像とを1つのカメラに撮像させることにより、装置の規模やコストの低減を目指す動向も見られる。   For example, in the case of a surveillance camera or an in-vehicle camera, it may be used both day and night. In this case, by installing an infrared cut filter that removes infrared light in the daytime, visible light that can be recognized by the human eye is imaged on the light receiving element, while the infrared cut filter is removed at night and in the dark. As a result, infrared light such as near infrared may be used as illumination. Further, in the case of an information processing terminal equipped with functions such as biometric authentication and line-of-sight detection, an image used for biometric authentication and line-of-sight detection and an image used for other purposes are captured by one camera, thereby There are also trends aimed at reducing scale and costs.

このように撮像素子が可視光及び赤外光を受光する場合、カメラにより撮像される画像は、可視光の下で人が眼で認識する色合いとは異なる。このことから、可視光及び赤外光を受光する撮像素子により撮像された画像の色味を補正することにより、可視光が受光される場合、言い換えれば赤外光が受光されない場合と同等の色味を再現する技術が提案されている。   When the imaging device receives visible light and infrared light in this way, the image captured by the camera is different from the color that a person recognizes with eyes under visible light. From this, by correcting the color of an image captured by an image sensor that receives visible light and infrared light, visible light is received, in other words, the same color as when infrared light is not received. Techniques for reproducing the taste have been proposed.

一例として、マトリクス演算により入力画像を補正する方法がある。この方法では、複数の色、例えば24色を含むカラーチャートが異なる画像入力系で撮影された2つの画像から色補正に用いるマトリクス係数が算出される。すなわち、光路上に赤外線カットフィルタが組み込まれた状態で撮影が行われた画像と、光路上に赤外線カットフィルタが組み込まれない状態で撮影が行われた画像との2つの画像から、撮像素子の分光感度特性を等色関数に近似させるマトリクス係数が最小自乗法により求められる。かかるマトリクス係数を用いる演算により、入力画像の色補正が行われる。   As an example, there is a method of correcting an input image by matrix calculation. In this method, matrix coefficients used for color correction are calculated from two images taken by different image input systems of a plurality of colors, for example, a color chart including 24 colors. That is, from two images of an image taken with an infrared cut filter incorporated on the optical path and an image taken with no infrared cut filter incorporated on the optical path, A matrix coefficient that approximates the spectral sensitivity characteristic to the color matching function is obtained by the method of least squares. The color correction of the input image is performed by the calculation using the matrix coefficient.

ところが、上記のマトリクス演算により色補正を行う場合、赤外光の分光反射率が高い特定の被写体、例えば植物の葉や化学繊維の布などには、色の再現性を十分に発揮することができない場合がある。例えば、植物の葉の場合、葉に含まれるクロロフィルの影響により、可視光の上限を超える近赤外光に対応する波長で分光反射率が高くなる。このため、自然光や照明などの環境光が含む赤外光が画像に与える色味の影響が植物の葉以外の他の被写体よりも大きい。それ故、上記のマトリクス演算により色補正を行ったとしても、他の被写体に比べて植物の葉の色を十分に再現することはできない。この結果、可視光の下では緑色と認識されている葉の色が、同じく可視光で緑に認識されているカラーチャートの緑とは異なる色で認識されてしまうことになる。   However, when color correction is performed by the above matrix calculation, color reproducibility can be sufficiently exerted on a specific subject having a high spectral reflectance of infrared light, such as a plant leaf or a chemical fiber cloth. There are cases where it is not possible. For example, in the case of plant leaves, the spectral reflectance increases at a wavelength corresponding to near-infrared light exceeding the upper limit of visible light due to the influence of chlorophyll contained in the leaves. For this reason, the influence of the color which infrared light included in environmental light such as natural light or illumination has on the image is greater than that of other subjects other than the leaves of plants. Therefore, even if color correction is performed by the above matrix calculation, the leaf color of the plant cannot be sufficiently reproduced as compared with other subjects. As a result, the color of the leaf, which is recognized as green under visible light, is recognized as a color different from the green color of the color chart that is also recognized as green with visible light.

このような色再現性の低下を抑制するために、次のような補正データ生成装置も提案されている。この補正データ生成装置では、赤外線カットフィルタが装着されない状態で上記の特定の被写体が撮像された第1のサンプル画像と、赤外線カットフィルタが装着された状態で上記の特定の被写体が撮像された第2のサンプル画像とを用いて、上記の特定の被写体の色を補正する補正データが生成される。   In order to suppress such a decrease in color reproducibility, the following correction data generation apparatus has also been proposed. In the correction data generation device, the first sample image in which the specific subject is imaged without the infrared cut filter and the first sample image in which the specific subject is imaged with the infrared cut filter attached. Correction data for correcting the color of the specific subject is generated using the two sample images.

かかる補正データ生成装置では、特定の被写体に含まれる色が色度空間上で無彩色に近い局所的な領域に集中するとの知見が利用される。このような知見の下、補正データ生成装置は、第1のサンプル画像上で特定の被写体が映る範囲を指定させることにより、当該特定の被写体に含まれる色が色度空間上で分布する楕円領域を設定する。そして、補正データ生成装置では、第1のサンプル画像を用いて設定された楕円領域を第2のサンプル画像に含まれる特定の被写体の色が分布する楕円領域へシフトさせるシフト量を補正量として算出する。その上で、入力される画像に含まれる画素の色が第1のサンプル画像を用いて設定された色度空間上の楕円領域に含まれるか否かにより、赤外光の分光反射率が高い部分とそれ以外の部分へ分離される。すなわち、赤外光の分光反射率が高い部分には、上記の補正データを用いて色をシフトさせる補正が行われる一方で、それ以外の部分には、上記のマトリクス演算により色補正が行われる。   In such a correction data generation device, the knowledge that colors included in a specific subject are concentrated in a local region close to an achromatic color in the chromaticity space is used. Based on such knowledge, the correction data generation device allows an ellipse region in which the color included in the specific subject is distributed in the chromaticity space by designating a range in which the specific subject appears on the first sample image. Set. Then, the correction data generation device calculates, as a correction amount, a shift amount that shifts the elliptical region set using the first sample image to the elliptical region in which the color of a specific subject included in the second sample image is distributed. To do. In addition, the spectral reflectance of infrared light is high depending on whether or not the color of the pixel included in the input image is included in the elliptical region on the chromaticity space set using the first sample image. Separated into parts and other parts. That is, correction for shifting the color using the above correction data is performed on the portion where the spectral reflectance of infrared light is high, while color correction is performed on the other portions by the above matrix calculation. .

特開2005−303702号公報JP 2005-303702 A 特開2008−288851号公報JP 2008-288851 A 特開2011−015086号公報JP 2011-015086 A

豊田 善隆,久野 徹也,石田 晃三,杉浦 博明「カラー撮像可能な近赤外撮像装置の研究」映像情報メディア学会誌 Vol.64,No.1,pp.101〜110 2010年Yoshitaka Toyoda, Tetsuya Kuno, Shinzo Ishida, Hiroaki Sugiura “Study on Near-Infrared Imaging Device Capable of Color Imaging”, Journal of the Institute of Image Information and Television Engineers, Vol. 64, no. 1, pp. 101-110 2010

しかしながら、上記の技術では、赤外光の分光反射率が高い部分とそれ以外の部分を十分に分離することができない場合がある。   However, with the above technique, there may be a case where a portion having a high spectral reflectance of infrared light and a portion other than that cannot be sufficiently separated.

すなわち、上記の補正データ生成装置で第1のサンプル画像に設定される楕円領域には、赤外光の分光反射率が高い植物の葉や化学繊維の布などの特定の被写体が持つ色以外にも、一例として、カラーチャートに含まれる茶色などの色も含まれる。それ故、上記の補正データ生成装置では、特定の被写体の色とカラーチャートの茶色を分離することはできず、カラーチャートの茶色に対応する色を持つ部分まで緑色に補正されてしまう。   In other words, the elliptical region set in the first sample image by the correction data generation device described above has a color other than a specific object such as a plant leaf or a chemical fiber cloth having a high spectral reflectance of infrared light. However, as an example, colors such as brown included in the color chart are also included. Therefore, in the above correction data generation device, the color of the specific subject and the brown color chart cannot be separated, and the color chart corresponding to the brown color is corrected to green.

1つの側面では、本発明は、赤外光の分光反射率が高い部分とそれ以外の部分を分離できる色補正装置、色補正方法及び色補正プログラムを提供することを目的とする。   In one aspect, an object of the present invention is to provide a color correction device, a color correction method, and a color correction program that can separate a portion having a high spectral reflectance of infrared light from other portions.

一態様の色補正装置は、画像を取得する取得部と、画像を輝度及び色度を含む色空間の成分へ変換する変換部と、前記色空間の成分へ変換された画像に含まれる画素ごとに、当該画素が色度成分及び輝度成分に関する分離条件を満たすか否かにより、当該画素が赤外光の分光反射率が高い第1の被写体または前記第1の被写体以外の他の被写体のいずれに対応するかを判定する判定部とを有する。   A color correction apparatus according to an aspect includes an acquisition unit that acquires an image, a conversion unit that converts the image into a component of a color space including luminance and chromaticity, and each pixel included in the image converted into the component of the color space In addition, depending on whether or not the pixel satisfies the separation condition regarding the chromaticity component and the luminance component, either the first subject having a high spectral reflectance of infrared light or the other subject other than the first subject is selected. And a determination unit for determining whether or not it corresponds.

赤外光の分光反射率が高い部分とそれ以外の部分を分離できる。   A portion having a high spectral reflectance of infrared light can be separated from other portions.

図1は、実施例1に係る色補正システムに含まれる各装置の機能的構成を示すブロック図である。FIG. 1 is a block diagram illustrating a functional configuration of each device included in the color correction system according to the first embodiment. 図2Aは、サンプル画像の一例を示す図である。FIG. 2A is a diagram illustrating an example of a sample image. 図2Bは、サンプル画像の一例を示す図である。FIG. 2B is a diagram illustrating an example of a sample image. 図3は、UV平面上における色の分布の一例を示す図である。FIG. 3 is a diagram illustrating an example of a color distribution on the UV plane. 図4は、YU平面上における色の分布の一例を示す図である。FIG. 4 is a diagram illustrating an example of a color distribution on the YU plane. 図5は、輝度Yのヒストグラムの一例を示す図である。FIG. 5 is a diagram illustrating an example of a histogram of luminance Y. 図6は、実施例1に係る設定処理の手順を示すフローチャートである。FIG. 6 is a flowchart illustrating the procedure of the setting process according to the first embodiment. 図7は、実施例1に係る色補正処理の手順を示すフローチャートである。FIG. 7 is a flowchart illustrating the procedure of the color correction process according to the first embodiment. 図8Aは、色成分Uのヒストグラムの一例を示す図である。FIG. 8A is a diagram illustrating an example of a histogram of the color component U. FIG. 図8Bは、色成分Vのヒストグラムの一例を示す図である。FIG. 8B is a diagram illustrating an example of a histogram of the color component V. 図9は、色度空間に関する確率密度の計算例を示す図である。FIG. 9 is a diagram illustrating a calculation example of the probability density regarding the chromaticity space. 図10は、第3の分離条件の一例を示す図である。FIG. 10 is a diagram illustrating an example of the third separation condition. 図11は、実施例1及び実施例2に係る色補正プログラムを実行するコンピュータのハードウェア構成例を示す図である。FIG. 11 is a diagram illustrating a hardware configuration example of a computer that executes a color correction program according to the first and second embodiments.

以下に添付図面を参照して本願に係る色補正装置、色補正方法及び色補正プログラムについて説明する。なお、この実施例は開示の技術を限定するものではない。そして、各実施例は、処理内容を矛盾させない範囲で適宜組み合わせることが可能である。   A color correction device, a color correction method, and a color correction program according to the present application will be described below with reference to the accompanying drawings. Note that this embodiment does not limit the disclosed technology. Each embodiment can be appropriately combined within a range in which processing contents are not contradictory.

[色補正システムの構成]
図1は、実施例1に係る色補正システムに含まれる各装置の機能的構成を示すブロック図である。図1に示す色補正システム1は、可視光及び赤外光の波長に対応する光を含んで撮像された画像の色を人の色覚特性に合わせて補正する色補正処理を実現するものである。なお、ここでは、一例として、赤外線を除去するフィルタ、いわゆる赤外線(Infrared)カットフィルタが装着されない状態で撮影される場合を例示するが、後述のように、赤外光に対応する波長のうち一部の波長域の光を透過する光学フィルタが装着された状態で撮影される画像が入力される場合も適用範囲に含まれることは言うまでもない。
[Configuration of color correction system]
FIG. 1 is a block diagram illustrating a functional configuration of each device included in the color correction system according to the first embodiment. A color correction system 1 shown in FIG. 1 realizes a color correction process for correcting the color of an image captured including light corresponding to wavelengths of visible light and infrared light in accordance with human color vision characteristics. . Here, as an example, a case where the image is taken without a filter that removes infrared rays, that is, a so-called infrared cut filter, is exemplified. However, as described later, one of the wavelengths corresponding to infrared light is used. Needless to say, the scope of application includes a case where an image photographed in a state where an optical filter that transmits light in a certain wavelength region is attached is input.

かかる色補正処理の一環として、赤外線カットフィルタが装着されない状態で撮影された画像に含まれる、赤外光の分光反射率が高い第1の被写体と色空間上で第1の被写体に色の分布が類似する第2の被写体とを輝度が高いか否かにより分離する分離処理も実現する。すなわち、第1の被写体に対応する箇所は、第2の被写体に比べて反射光の光量そのものが大きいので、輝度も高くなる傾向がある。このような知見の下、赤外光の分光反射率が高い植物の葉などに代表される第1の被写体の箇所と、色空間上で第1の被写体に色の分布が類似する第2の被写体、例えばカラーチャートの茶色の箇所とを輝度の分離条件にしたがって分離する。これによって、赤外光の分光反射率が高い部分とそれ以外の部分を十分に分離することができる。   As part of such color correction processing, the color distribution of the first subject in the color space and the first subject having a high spectral reflectance of infrared light included in the image photographed without the infrared cut filter attached. Separation processing for separating a second subject with similar brightness depending on whether the luminance is high is also realized. That is, the brightness corresponding to the first subject tends to be high because the amount of reflected light itself is larger than that of the second subject. Based on such knowledge, the second subject whose color distribution is similar to that of the first subject in the color space is similar to the location of the first subject represented by the leaves of a plant having high spectral reflectance of infrared light. An object, for example, a brown portion of a color chart is separated according to a luminance separation condition. As a result, it is possible to sufficiently separate the portion where the spectral reflectance of infrared light is high and the other portions.

図1に示すように、色補正システム1には、設定装置10と、色補正装置100とが含まれる。これら設定装置10及び色補正装置100は、所定のネットワークを介して通信可能に接続される。かかるネットワークには、一例として、有線または無線を問わず、インターネット(Internet)を始め、LAN(Local Area Network)やVPN(Virtual Private Network)などの任意の種類の通信網を採用できる。   As shown in FIG. 1, the color correction system 1 includes a setting device 10 and a color correction device 100. The setting device 10 and the color correction device 100 are connected to be communicable via a predetermined network. As an example, any type of communication network such as the Internet (Internet), LAN (Local Area Network), and VPN (Virtual Private Network) can be adopted as such a network, regardless of whether it is wired or wireless.

設定装置10は、色補正に関する各種パラメータの設定を行う装置である。   The setting device 10 is a device that sets various parameters relating to color correction.

一実施形態として、設定装置10は、色補正装置100に対し、色補正に関する補正データを設定すると共に、上記の第1の被写体とそれ以外の他の被写体とを分離する分離条件を設定する。   As an embodiment, the setting device 10 sets correction data related to color correction to the color correction device 100 and sets separation conditions for separating the first subject from other subjects.

なお、図1には、色補正に関する各種パラメータが設定装置10を通じて設定される例を示すが、色補正装置100の出荷前等に色補正装置100に予め設定されることとしてもよい。また、設定装置10及び色補正装置100は、必ずしも別体として構築されずともよく、色補正装置100に設定装置10の機能を併せ持たせることもできる。   Although FIG. 1 shows an example in which various parameters relating to color correction are set through the setting device 10, they may be set in advance in the color correction device 100 before the color correction device 100 is shipped. Further, the setting device 10 and the color correction device 100 do not necessarily need to be constructed separately, and the color correction device 100 can also have the function of the setting device 10.

色補正装置100は、上記の色補正処理を実現するコンピュータである。   The color correction apparatus 100 is a computer that realizes the color correction process.

一実施形態として、色補正装置100は、パッケージソフトウェアやオンラインソフトウェアとして上記の色補正処理を実行する色補正プログラムを所望のコンピュータにインストールさせることによって実装できる。例えば、上記の色補正プログラムを情報処理装置に実行させることにより、情報処理装置を色補正装置100として機能させることができる。ここで言う情報処理装置には、デスクトップ型またはノート型のパーソナルコンピュータの他、スマートフォン、携帯電話機やPHS(Personal Handyphone System)などの移動体通信端末、さらには、PDA(Personal Digital Assistants)などのスレート端末などがその範疇に含まれる。また、ユーザが使用する端末装置をクライアントとし、当該クライアントに上記の色補正処理に関するサービスを提供するサーバ装置として実装することもできる。例えば、色補正装置100は、画像、または、画像をネットワークもしくは記憶メディアを介して呼び出すことができる識別情報を入力とし、当該画像に対する上記の色補正処理の実行結果を出力する色補正サービスを提供するサーバ装置として実装される。この場合、色補正装置100は、Webサーバとして実装することとしてもよいし、アウトソーシングによって上記の色補正処理に関するサービスを提供するクラウドとして実装することとしてもかまわない。   As one embodiment, the color correction apparatus 100 can be implemented by installing a color correction program for executing the above color correction processing as package software or online software on a desired computer. For example, the information processing apparatus can function as the color correction apparatus 100 by causing the information processing apparatus to execute the color correction program. The information processing apparatus mentioned here includes a desktop or notebook personal computer, a mobile communication terminal such as a smartphone, a mobile phone or a personal handyphone system (PHS), or a slate such as a PDA (Personal Digital Assistants). Terminals are included in the category. Further, the terminal device used by the user can be used as a client, and the client can be implemented as a server device that provides the client with services related to the color correction processing. For example, the color correction apparatus 100 provides a color correction service that receives an image or identification information that can call the image via a network or a storage medium, and outputs the execution result of the color correction processing for the image. It is implemented as a server device. In this case, the color correction apparatus 100 may be implemented as a Web server, or may be implemented as a cloud that provides a service related to the color correction processing described above by outsourcing.

[設定装置10の構成]
続いて、本実施例に係る設定装置10の機能的構成について説明する。図1に示すように、設定装置10は、第1取得部11と、第2取得部12と、特定部13と、変換部14と、補正データ設定部15と、分離条件設定部16とを有する。なお、設定装置10は、図1に示した機能部以外にも既知のコンピュータが有する各種の機能部、例えば各種の入力デバイスや音声出力デバイスなどの機能部を有することとしてもかまわない。
[Configuration of Setting Device 10]
Subsequently, a functional configuration of the setting apparatus 10 according to the present embodiment will be described. As illustrated in FIG. 1, the setting device 10 includes a first acquisition unit 11, a second acquisition unit 12, a specification unit 13, a conversion unit 14, a correction data setting unit 15, and a separation condition setting unit 16. Have. Note that the setting device 10 may include various functional units included in known computers, for example, functional units such as various input devices and audio output devices, in addition to the functional units illustrated in FIG.

このうち、第1取得部11及び第2取得部12は、いずれも色補正に関する各種パラメータを生成する素材とするサンプル画像を取得する処理部である。以下では、第1取得部11により取得されるサンプル画像のことを「第1のサンプル画像」と記載すると共に、第2取得部12により取得されるサンプル画像のことを「第2のサンプル画像」と記載する場合がある。   Among these, the first acquisition unit 11 and the second acquisition unit 12 are both processing units that acquire sample images as materials for generating various parameters relating to color correction. Hereinafter, the sample image acquired by the first acquisition unit 11 is referred to as a “first sample image”, and the sample image acquired by the second acquisition unit 12 is referred to as a “second sample image”. May be described.

一実施形態として、第1取得部11及び第2取得部12は、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)などの撮像素子を搭載するカメラにより撮像されたサンプル画像を取得することができる。また、第1取得部11及び第2取得部12は、ハードディスクや光ディスクなどの補助記憶装置またはメモリカードやUSB(Universal Serial Bus)メモリなどのリムーバブルメディアに保存されたサンプル画像を読み出すことにより取得することもできる。この他、第1取得部11及び第2取得部12は、外部装置からネットワークを介して受信することによってサンプル画像を取得することもできる。   As one embodiment, the first acquisition unit 11 and the second acquisition unit 12 acquire a sample image captured by a camera equipped with an image sensor such as a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS). Can do. The first acquisition unit 11 and the second acquisition unit 12 acquire the sample image by reading a sample image stored in an auxiliary storage device such as a hard disk or an optical disk or a removable medium such as a memory card or a USB (Universal Serial Bus) memory. You can also In addition, the 1st acquisition part 11 and the 2nd acquisition part 12 can also acquire a sample image by receiving via a network from an external device.

図2A及び図2Bは、サンプル画像の一例を示す図である。ここでは、一例として、RGBの3つの受光素子を有する撮像素子により、各画素がRGBの輝度値を持つ画像が撮像される場合を想定して以下の説明を行うこととする。このうち、赤の成分Rは、可視光の波長のうち赤の波長域と赤外光の波長域を受光し、緑の成分Gは、可視光の波長のうち緑の波長域と赤外光の波長域を受光し、青の成分Bは、可視光の波長のうち青の波長域と赤外光の波長域を受光する。   2A and 2B are diagrams illustrating examples of sample images. Here, as an example, the following description will be made on the assumption that an image having three RGB light receiving elements is used to capture an image in which each pixel has RGB luminance values. Among these, the red component R receives the red wavelength range and the infrared wavelength range among the visible light wavelengths, and the green component G includes the green wavelength range and the infrared light among the visible light wavelengths. The blue component B receives the blue wavelength range and the infrared wavelength range among the visible light wavelengths.

図2Aに示す第1のサンプル画像20A及び図2Bに示す第2のサンプル画像20Bは、同一のカメラにより同一の位置及び同一の画角で同一の目標が撮影された画像である点は共通するが、互いの画像が撮影される画像入力系の一部が異なる。すなわち、図2Aに示す第1のサンプル画像20Aは、赤外線カットフィルタが装着されない状態で撮影される画像である一方で、図2Bに示す第2のサンプル画像20Bは、赤外線カットフィルタが装着された状態で撮影される画像である点が異なる。このため、第1のサンプル画像20Aには、可視光の波長を持つ光に加え、赤外光の波長を持つ光の影響が含まれる一方で、第2のサンプル画像20Bには、赤外光の波長を持つ光の影響は含まれない。なお、ここでは、第1のサンプル画像の撮影形態の一例として、赤外線カットフィルタが装着されない状態で撮影される場合を例示したが、可視光領域および使用する赤外の波長領域の帯域幅、例えば近赤外光の波長の一部を透過する光学フィルタが挿入された状態で撮影される画像を第1のサンプル画像とすることもできる。   The first sample image 20A shown in FIG. 2A and the second sample image 20B shown in FIG. 2B are common in that the same target is photographed at the same position and the same angle of view by the same camera. However, a part of the image input system in which images of each other are taken is different. That is, the first sample image 20A shown in FIG. 2A is an image taken without an infrared cut filter, while the second sample image 20B shown in FIG. 2B has an infrared cut filter attached. The difference is that the image is taken in a state. Therefore, the first sample image 20A includes the influence of light having the wavelength of infrared light in addition to light having the wavelength of visible light, while the second sample image 20B includes infrared light. This does not include the influence of light having a wavelength of. In addition, although the case where it image | photographed in the state which is not mounting | wearing with an infrared cut filter was illustrated as an example of the imaging | photography form of a 1st sample image here, the bandwidth of the visible light region and the infrared wavelength region to be used, for example, An image photographed with an optical filter that transmits a part of the wavelength of near-infrared light being inserted may be used as the first sample image.

これら第1のサンプル画像20A及び第2のサンプル画像20Bを撮影する場合、一例として、上記の第1の被写体が撮像範囲に含まれる状態で撮影が行われる。かかる第1の被写体の一例として、クロロフィルなどの化学物質を葉っぱに含有する植物などが挙げられる。このように植物が撮影される場合、第1のサンプル画像20A及び第2のサンプル画像20Bの間で、植物の像21A及び植物の像21Bの形状は、同様に映る一方で、色の映り方は異なる。すなわち、植物の場合、植物の葉に含まれるクロロフィルの影響によって他の被写体よりも赤外光の分光反射率が大きくなる。それ故、植物の像21Bは人の眼で認識される色と同様に緑色で映る一方で、植物の像21Aは赤外光の反射光の影響により灰色がかった青磁色や灰色がかった淡い緑色に映る。   When the first sample image 20A and the second sample image 20B are photographed, as an example, the photographing is performed in a state where the first subject is included in the imaging range. An example of such a first subject is a plant containing a chemical substance such as chlorophyll in the leaf. When the plant is photographed in this way, the shape of the plant image 21A and the plant image 21B is reflected in the same manner between the first sample image 20A and the second sample image 20B. Is different. That is, in the case of a plant, the spectral reflectance of infrared light becomes larger than other subjects due to the influence of chlorophyll contained in the leaves of the plant. Therefore, the plant image 21B appears green like the color recognized by the human eye, while the plant image 21A is grayish celadon or grayish pale green due to the influence of reflected light of infrared light. Reflected in.

さらに、上記の植物に加え、上記の第2の被写体が撮像範囲に含まれる状態で撮影が行われる。かかる第2の被写体の一例として、図2A及び図2Bに示すように、6行4列に異なる24色が配列されたカラーチャートが挙げられる。例えば、カラーチャートには、色空間上で植物に色の分布が類似する色、例えば茶色を含めておくことができる。これによって、植物に対応する部分とカラーチャートの茶色部分を分離する輝度の分離条件を後段の処理部で設定することが可能となる。   Further, in addition to the above-described plant, shooting is performed in a state where the second subject is included in the imaging range. An example of such a second subject is a color chart in which 24 different colors are arranged in 6 rows and 4 columns, as shown in FIGS. 2A and 2B. For example, the color chart may include a color having a color distribution similar to a plant in the color space, such as brown. Accordingly, it is possible to set a luminance separation condition for separating the portion corresponding to the plant and the brown portion of the color chart in the subsequent processing unit.

なお、ここでは、上記の第1の被写体の一例として、植物を例示したが、所定の波長、例えば約700nmを境界に分光反射率が上昇する物体であれば、植物以外のものを被写体とすることとしてもかまわない。すなわち、可視光の上界付近または近赤外光の波長域で分光反射率が可視光に対応する波長域の分光反射率よりも急峻に上昇する物体であれば、如何なる物体、例えば化学繊維の布などであってもかまわない。   Here, a plant is illustrated as an example of the first subject. However, a subject other than a plant is a subject as long as the spectral reflectance increases with a predetermined wavelength, for example, about 700 nm as a boundary. It doesn't matter. That is, any object, for example, a chemical fiber, can be used as long as the spectral reflectance rises more rapidly than the spectral reflectance in the wavelength range corresponding to visible light near the upper limit of visible light or in the near infrared wavelength range. It can be cloth.

特定部13は、各サンプル画像上で第1の被写体の一部または全部を形成する第1の領域および各サンプル画像上で第2の被写体の一部または全部を形成する第2の領域を特定する処理部である。   The specifying unit 13 specifies a first region that forms part or all of the first subject on each sample image and a second region that forms part or all of the second subject on each sample image. Is a processing unit.

一実施形態として、特定部13は、設定装置10の表示部や設定装置10に接続された外部装置に第1のサンプル画像及び第2のサンプル画像のうち少なくともいずれか1つのサンプル画像を表示させる。その上で、特定部13は、図示しない入力部を通じて、サンプル画像上で第1の被写体、すなわち植物を形成する1または複数の画素を含む範囲を指定させる。例えば、特定部13は、ポインティングデバイスを介してドラッグ&ドロップの範囲指定を受け付けることによってサンプル画像上で第1の被写体に対応する第1の領域を特定することができる。また、特定部13は、上記の第1の領域を特定する場合と同様の要領で、サンプル画像上で第2の被写体の一部または全部を形成する第2の領域を特定する。なお、ここでは、第1の領域および第2の領域を操作入力により特定する場合を例示したが、必ずしも操作入力により特定せずともかまわない。例えば、サンプル画像にテンプレートマッチングなどの画像認識を適用することにより、サンプル画像上でラベリングされた領域のうち第1の被写体との間で形状が類似する領域を第1の領域として特定すると共に、第2の被写体との間で形状が類似する領域を第2の領域として特定することとしてもかまわない。   As one embodiment, the specifying unit 13 causes the display unit of the setting device 10 or an external device connected to the setting device 10 to display at least one sample image of the first sample image and the second sample image. . Then, the specifying unit 13 causes a first object, that is, a range including one or a plurality of pixels forming a plant to be designated on the sample image through an input unit (not shown). For example, the specifying unit 13 can specify the first region corresponding to the first subject on the sample image by receiving the drag and drop range specification via the pointing device. The specifying unit 13 specifies a second region that forms part or all of the second subject on the sample image in the same manner as in the case of specifying the first region. In addition, although the case where the first area and the second area are specified by an operation input is illustrated here, it does not necessarily have to be specified by an operation input. For example, by applying image recognition such as template matching to the sample image, the region similar in shape to the first subject among the regions labeled on the sample image is specified as the first region, An area having a shape similar to that of the second subject may be specified as the second area.

変換部14は、サンプル画像のデータ形式を変換する処理部である。   The conversion unit 14 is a processing unit that converts the data format of the sample image.

一実施形態として、変換部14は、第1取得部11により取得される第1のサンプル画像および第2取得部12により取得される第2のサンプル画像のデータ形式を輝度と色度を含む空間で表現されるデータ形式へ変換する。例えば、変換部14は、第1のサンプル画像および第2のサンプル画像に含まれる各画素の画素値をRGB空間で表現されていたRGBの画素値から輝度Y及び2つの色差によって表現される画素値へ変換する。なお、ここでは、各サンプル画像をYUV空間へ変換する場合を例示するが、変換先の色度空間はYUV空間に限定されず、サンプル画像を他の色空間、例えばL*a*b空間に変換することとしてもかまわない。   As an embodiment, the conversion unit 14 converts the data format of the first sample image acquired by the first acquisition unit 11 and the second sample image acquired by the second acquisition unit 12 into a space including luminance and chromaticity. Convert to the data format represented by. For example, the conversion unit 14 includes pixels represented by luminance Y and two color differences from the RGB pixel values represented in the RGB space for the pixel values of the pixels included in the first sample image and the second sample image. Convert to value. Here, the case where each sample image is converted to the YUV space is illustrated, but the chromaticity space of the conversion destination is not limited to the YUV space, and the sample image is converted to another color space, for example, the L * a * b space. It does not matter as a conversion.

補正データ設定部15は、色補正に関する補正データを色補正装置100に設定する処理部である。   The correction data setting unit 15 is a processing unit that sets correction data related to color correction in the color correction apparatus 100.

一実施形態として、補正データ設定部15は、上記の第1の被写体に関する色補正に用いる第1の補正データと、上記の第1の被写体以外の他の被写体に関する色補正に用いる第2の補正データとを算出する。   As one embodiment, the correction data setting unit 15 includes first correction data used for color correction related to the first subject and second correction used for color correction related to a subject other than the first subject. Calculate the data.

ここで、上記の第1の補正データは、あくまで一例として、特開2014−200045号公報に開示された方法を用いることにより算出することができる。すなわち、補正データ設定部15は、第1のサンプル画像に含まれる画素のうち特定部13により第1の被写体を形成する範囲として特定された第1の領域に含まれる画素が色度空間上で分布する位置と、当該第1の領域に含まれる画素に対応する第2のサンプル画像上の画素が色度空間上で分布する位置とから色度空間上におけるシフト量を第1の補正データとして算出する。   Here, the first correction data can be calculated by using a method disclosed in Japanese Unexamined Patent Application Publication No. 2014-200045 as an example. In other words, the correction data setting unit 15 includes, in the chromaticity space, pixels included in the first region specified as a range for forming the first subject by the specifying unit 13 among the pixels included in the first sample image. The shift amount in the chromaticity space is used as the first correction data from the position where the pixel is distributed and the position where the pixel on the second sample image corresponding to the pixel included in the first region is distributed in the chromaticity space. calculate.

より具体的には、補正データ設定部15は、第1のサンプル画像に含まれる画素のうち第1の領域に含まれる各画素の色が色度空間上で点在する座標の分布を定義する。例えば、補正データ設定部15は、第1の領域に含まれる各画素のUV成分がUV平面上で点在する座標の分布を楕円中心点、楕円軸長および楕円回転角度などのパラメータで定義することにより、UV平面上の楕円領域として近似することができる。このとき、特定部13は、第1のサンプル画像内で第1の領域を形成する画素が色度空間のUV平面上で集中して分布する箇所に絞って楕円領域を定義するために、画素間の距離が所定値以内である画素同士を包含の対象とし、所定値を超える画素を包含の対象から除外することもできる。このように第1のサンプル画像上で第1の被写体を形成する画素のUV成分がUV平面上で点在する分布を表す楕円領域を算出する。なお、ここでは、分布を楕円領域に近似する場合を例示したが、他の形状、例えば多角形に近似することとしてもかまわない。   More specifically, the correction data setting unit 15 defines a distribution of coordinates in which the color of each pixel included in the first region among the pixels included in the first sample image is scattered in the chromaticity space. . For example, the correction data setting unit 15 defines a distribution of coordinates in which the UV components of each pixel included in the first region are scattered on the UV plane by parameters such as the ellipse center point, the ellipse axis length, and the ellipse rotation angle. Thus, it can be approximated as an elliptical region on the UV plane. At this time, the specifying unit 13 defines the elliptical region by narrowing down to a location where the pixels forming the first region are concentrated and distributed on the UV plane of the chromaticity space in the first sample image. Pixels having a distance between them within a predetermined value can be included, and pixels exceeding a predetermined value can be excluded from the target. In this manner, an elliptical area representing a distribution in which the UV components of the pixels forming the first subject are scattered on the UV plane on the first sample image is calculated. Here, the case where the distribution is approximated to an elliptical area is illustrated, but it may be approximated to another shape, for example, a polygon.

その後、補正データ設定部15は、第1のサンプル画像上で第1の領域を形成する画素ごとに、当該画素に対応する第2のサンプル画像上の画素との間で色差、すなわちUV平面上の距離を算出する。その上で、補正データ設定部15は、第1の領域を形成する画素ごとに算出された色差に対し、所定の統計処理を実行することによって代表値を算出する。かかる統計処理の一例としては、色差の相加平均や加重平均を代表値として算出したり、また、色差の中央値を代表値として算出したりすることができる。   Thereafter, the correction data setting unit 15 determines, for each pixel forming the first region on the first sample image, a color difference between the pixel on the second sample image corresponding to the pixel, that is, on the UV plane. The distance is calculated. Then, the correction data setting unit 15 calculates a representative value by executing predetermined statistical processing on the color difference calculated for each pixel forming the first region. As an example of such statistical processing, an arithmetic average or a weighted average of color differences can be calculated as a representative value, or a median value of color differences can be calculated as a representative value.

このようにして算出された色差の代表値、すなわちUV平面上におけるシフト量Smが第1の補正データとして色補正装置100の補正データ記憶部160へ登録されることにより、第1の補正データが色補正装置100に設定される。なお、ここでは、UV平面上のシフト量Smを算出する場合を例示したが、L*a*b空間上のab平面上のシフト量を算出することとしてもかまわない。   The representative value of the color difference calculated in this way, that is, the shift amount Sm on the UV plane is registered in the correction data storage unit 160 of the color correction apparatus 100 as the first correction data, whereby the first correction data is stored. The color correction apparatus 100 is set. Here, the case where the shift amount Sm on the UV plane is calculated is exemplified, but the shift amount on the ab plane in the L * a * b space may be calculated.

また、上記の第2の補正データは、あくまで一例として、上記の非特許文献1「カラー撮像可能な近赤外撮像装置の研究」に開示された方法にしたがって算出することができる。すなわち、補正データ設定部15は、第1のサンプル画像および第2のサンプル画像の2つのサンプル画像に含まれる画素のうち第1の領域に含まれない画素が持つRGBの画素値から、撮像素子の分光感度特性を等色関数に近似させるマトリクス係数を最小自乗法により求めることができる。   Further, the second correction data can be calculated according to the method disclosed in Non-Patent Document 1 “Research of near-infrared imaging device capable of color imaging” as an example. That is, the correction data setting unit 15 uses the RGB pixel values of the pixels not included in the first region among the pixels included in the two sample images of the first sample image and the second sample image to calculate the image sensor. The matrix coefficient that approximates the spectral sensitivity characteristic of the image to the color matching function can be obtained by the method of least squares.

このようにして算出されたマトリクス係数が第2の補正データとして色補正装置100の補正データ記憶部160へ登録されることにより、第2の補正データが色補正装置100に設定される。   The matrix coefficient calculated in this way is registered as the second correction data in the correction data storage unit 160 of the color correction apparatus 100, whereby the second correction data is set in the color correction apparatus 100.

分離条件設定部16は、上記の第1の被写体とそれ以外の他の被写体とを分離する分離条件を色補正装置100に設定する処理部である。   The separation condition setting unit 16 is a processing unit that sets a separation condition for separating the first subject and other subjects in the color correction apparatus 100.

一実施形態として、分離条件設定部16は、上記の分離条件の一例として、UV平面上で第1の被写体及び第2の被写体とこれら第1の被写体及び第2の被写体以外の被写体とを分離する「第1の分離条件」、すなわち色度に関する分離条件と、第1の被写体および第2の被写体を分離する「第2の分離条件」、すなわち上記の輝度に関する分離条件との2段階で用いる分離条件を算出する。   As an embodiment, the separation condition setting unit 16 separates the first subject and the second subject and subjects other than the first subject and the second subject on the UV plane as an example of the separation condition. Are used in two stages: a “first separation condition”, that is, a separation condition relating to chromaticity, and a “second separation condition” for separating the first subject and the second subject, ie, the above-described separation condition relating to luminance. Calculate separation conditions.

例えば、分離条件設定部16は、上記の第1の分離条件として、補正データ設定部15により算出される第1の領域に対応する楕円領域を色補正装置100に設定することができる。   For example, the separation condition setting unit 16 can set an elliptical area corresponding to the first area calculated by the correction data setting unit 15 in the color correction apparatus 100 as the first separation condition.

図3は、UV平面上における色の分布の一例を示す図である。図3に示すグラフの縦軸は、色差Vを指し、横軸は、色差Uを指す。図3には、UV平面上に第1のサンプル画像及び第2のサンプル画像に含まれる画素の分布がプロットされたグラフが示されている。すなわち、図3には、第1のサンプル画像に含まれる画素のうち第1の領域を形成する画素の分布を円のマークでプロットすると共に第2のサンプル画像に含まれる画素のうち第1の領域を形成する画素の分布を菱形のマークでプロットし、第1のサンプル画像に含まれる画素のうち第2の領域に対応する画素の分布を三角のマークでプロットしている。   FIG. 3 is a diagram illustrating an example of a color distribution on the UV plane. The vertical axis of the graph shown in FIG. 3 indicates the color difference V, and the horizontal axis indicates the color difference U. FIG. 3 shows a graph in which the distribution of pixels included in the first sample image and the second sample image is plotted on the UV plane. That is, in FIG. 3, the distribution of the pixels forming the first region among the pixels included in the first sample image is plotted with a circle mark, and the first of the pixels included in the second sample image is plotted. The distribution of the pixels forming the region is plotted with rhombus marks, and the distribution of the pixels corresponding to the second region among the pixels included in the first sample image is plotted with triangular marks.

図3に示すように、第1のサンプル画像上の第1の領域に対応する楕円領域31には、植物の葉に対応する色、すなわち図中の円のマークの全体または大半が含まれる。それ故、楕円領域31を第1の分離条件として用いることにより、第1の被写体とそれ以外の他の被写体とをある程度の精度で分離できる。その一方で、楕円領域31には、第1の領域を形成する画素の色だけが含まれるわけではなく、第2の領域を形成する画素の色も含まれる。すなわち、楕円領域31には、植物の葉に対応する色の分布が含まれる一方で、UV平面上で植物の葉の色に分布が類似するカラーチャートの茶色部分に相当する色、すなわち図中の三角のマークの分布も含まれる。   As shown in FIG. 3, the elliptical region 31 corresponding to the first region on the first sample image includes the color corresponding to the leaf of the plant, that is, the whole or most of the circle mark in the drawing. Therefore, by using the elliptical region 31 as the first separation condition, the first subject and other subjects can be separated with a certain degree of accuracy. On the other hand, the ellipse area 31 does not include only the color of the pixel forming the first area, but also includes the color of the pixel forming the second area. That is, the oval region 31 includes a color distribution corresponding to the leaf of the plant, while the color corresponding to the brown portion of the color chart whose distribution is similar to the color of the plant leaf on the UV plane, that is, in the drawing. The distribution of triangular marks is also included.

このことから、分離条件設定部16は、上記の第1の分離条件に加えて、第1の被写体および第2の被写体を分離する第2の分離条件をさらに算出する。   Therefore, the separation condition setting unit 16 further calculates a second separation condition for separating the first subject and the second subject in addition to the first separation condition.

図4は、YU平面上における色の分布の一例を示す図である。図4に示すグラフの縦軸は、色差Uを指し、横軸は、輝度Yを指す。図4には、YU平面上に第1のサンプル画像及び第2のサンプル画像に含まれる画素の分布がプロットされたグラフが示されている。すなわち、図4には、第1のサンプル画像に含まれる画素のうち第1の領域を形成する画素の分布を円のマークでプロットすると共に第2のサンプル画像に含まれる画素のうち第1の領域を形成する画素の分布を菱形のマークでプロットし、第1のサンプル画像に含まれる画素のうち第2の領域を形成する画素の分布を三角のマークでプロットしている。   FIG. 4 is a diagram illustrating an example of a color distribution on the YU plane. The vertical axis of the graph shown in FIG. 4 indicates the color difference U, and the horizontal axis indicates the luminance Y. FIG. 4 shows a graph in which the distribution of pixels included in the first sample image and the second sample image is plotted on the YU plane. That is, in FIG. 4, the distribution of the pixels forming the first region among the pixels included in the first sample image is plotted with a circle mark, and the first of the pixels included in the second sample image is plotted. The distribution of the pixels forming the region is plotted with rhombus marks, and the distribution of the pixels forming the second region among the pixels included in the first sample image is plotted with triangular marks.

図4に示すように、分離条件設定部16は、上記のUV平面上の楕円領域を設定する場合と同様の要領で、第1のサンプル画像上の第1の領域に対応するYU平面上の楕円領域41と、第1のサンプル画像上の第2の領域に対応するYU平面上の楕円領域42とが設定される。これらのうち、楕円領域41は、第1の被写体である植物を形成する画素の色差Uが輝度Yを含むYU平面上で点在する座標の分布が楕円に近似された領域を指す。一方、楕円領域42は、第2の被写体であるカラーチャートの茶色部分を形成する画素の色差Uが輝度Yを含むYU平面上で点在する座標の分布が楕円に近似された領域を指す。   As shown in FIG. 4, the separation condition setting unit 16 is on the YU plane corresponding to the first area on the first sample image in the same manner as in the case of setting the elliptical area on the UV plane. An elliptical area 41 and an elliptical area 42 on the YU plane corresponding to the second area on the first sample image are set. Among these, the ellipse area 41 indicates an area in which the distribution of coordinates in which the color difference U of the pixels forming the plant that is the first subject is scattered on the YU plane including the luminance Y is approximated to an ellipse. On the other hand, the ellipse area 42 is an area in which the distribution of coordinates in which the color difference U of the pixels forming the brown portion of the color chart as the second subject is scattered on the YU plane including the luminance Y is approximated to an ellipse.

図4に示すように、輝度Yを含むYU平面上では、図3に示したUV平面の場合と異なり、第1の領域を形成する画素が持つ色の分布と、第2の領域を形成する画素が持つ色の分布とが同一の範囲に混在せず、楕円領域41及び楕円領域42は重複しない。これは、第1のサンプル画像上の植物の葉を形成する画素の色の分布と、第1のサンプル画像上のカラーチャートの茶色部分を形成する画素の色の分布とが輝度Yを含むYU平面で重なり合わないという事実を意味する。   As shown in FIG. 4, on the YU plane including luminance Y, unlike the case of the UV plane shown in FIG. 3, the color distribution of the pixels forming the first area and the second area are formed. The color distribution of the pixels is not mixed in the same range, and the elliptical region 41 and the elliptical region 42 do not overlap. This is because the color distribution of the pixels forming the leaves of the plant on the first sample image and the color distribution of the pixels forming the brown part of the color chart on the first sample image include luminance Y. It means the fact that they do not overlap on a plane.

これを具体的に説明すると、植物の葉は、カラーチャートと比べて赤外光の分光反射率が高いので、R、G及びBの各撮像素子で受光される赤外光の受光量が増加している。そのため、可視光を受光する場合には、緑の成分Gの受光量が相対的に多くなるが、可視光と赤外光の両方を受光する場合は、R、G及びBの各々で赤外光の受光量が増加するので、受光量の総量が増加する結果、R、G及びBの間で受光量の比が相対的に下がる。そのため、無彩色に近づいていくこととなり、色度空間でみると変化していることになる。一方、カラーチャートは、植物の葉よりも、赤外光の反射光量が少ないので、可視光と赤外光の両方を受光する場合でも、R、G及びBの受光量の比の変化量が小さい。この結果、可視光及び赤外光の両方を受光する場合、植物の葉は、色度空間で大きく変化し、例えばカラーチャートの茶色と同じ色度空間に位置することになる。   More specifically, since the plant leaves have higher infrared spectral reflectance than the color chart, the amount of received infrared light received by each of the R, G, and B image sensors increases. doing. Therefore, when receiving visible light, the amount of light received by the green component G is relatively large, but when receiving both visible light and infrared light, each of R, G, and B is infrared. Since the amount of received light increases, the total amount of received light increases, and as a result, the ratio of the amount of received light among R, G, and B decreases relatively. For this reason, it approaches an achromatic color, and changes in the chromaticity space. On the other hand, the color chart has a smaller amount of reflected infrared light than leaves of plants, so even when both visible light and infrared light are received, the amount of change in the ratio of R, G, and B received light amounts is small. small. As a result, when both visible light and infrared light are received, the leaves of the plant greatly change in the chromaticity space, and are located in the same chromaticity space as, for example, brown in the color chart.

ここで、植物の葉の場合、赤外光が受光されると受光量の総量が増えるので、色度空間の変化だけではなく、輝度も変化する。この輝度も大きく変化する事実に着目した。この事実から、輝度Yの閾値Th1、すなわちU軸に平行な境界線を設定することにより、UV平面上における色の分布が互いに類似する第1の被写体及び第2の被写体を分離できるとの知見が得られる。   Here, in the case of plant leaves, when infrared light is received, the total amount of received light increases, so that not only the chromaticity space changes but also the luminance changes. We focused on the fact that this brightness also changes greatly. From this fact, it is found that the first subject and the second subject having similar color distributions on the UV plane can be separated by setting the threshold value Th1 of the luminance Y, that is, the boundary line parallel to the U axis. Is obtained.

このような知見の下、分離条件設定部16は、一例として、輝度Yの閾値Th1を第2の分離条件として導出することができる。例えば、分離条件設定部16は、図示しない入力部を介して、楕円領域41と、楕円領域42とを分離する輝度Yの閾値Th1の入力を受け付ける。図4に示す例で言えば、輝度Yがおよそ40付近の値を閾値Th1として入力させることができる。例えば、テンキーの押下操作による数値入力により輝度Yの閾値Th1を指定させることもできるし、グラフ上の所望位置をポインティングデバイスにより入力させることにより輝度Yの閾値Th1を指定させることもできる。   Under such knowledge, the separation condition setting unit 16 can derive the threshold value Th1 of the luminance Y as the second separation condition as an example. For example, the separation condition setting unit 16 receives an input of the threshold value Th1 of the luminance Y that separates the elliptical region 41 and the elliptical region 42 via an input unit (not shown). In the example shown in FIG. 4, a value with a luminance Y of around 40 can be input as the threshold Th1. For example, the threshold value Th1 for luminance Y can be designated by numerical input by pressing a numeric keypad, or the threshold value Th1 for luminance Y can be designated by inputting a desired position on the graph with a pointing device.

かかる輝度Yの閾値Th1の他、分離条件設定部16は、第1の被写体を形成する画素が持つ輝度の上限を規定する輝度Yの閾値Th2を第2の分離条件としてさらに算出することもできる。図4に示す例で言えば、輝度Yがおよそ130付近の値を閾値Th2として入力させることができる。かかる輝度Yの閾値Th2を第2の分離条件として用いることにより、輝度が閾値Th2よりも大きい部分、すなわち輝度が高い無彩色の葉以外の被写体に、第1の被写体用の色補正が行われることを抑制できる。   In addition to the threshold value Th1 of the luminance Y, the separation condition setting unit 16 can further calculate the threshold value Th2 of the luminance Y that defines the upper limit of the luminance of the pixels forming the first subject as the second separation condition. . In the example shown in FIG. 4, a value where the luminance Y is about 130 can be input as the threshold Th2. By using the threshold value Th2 of the luminance Y as the second separation condition, color correction for the first subject is performed on a portion where the luminance is larger than the threshold value Th2, that is, a subject other than an achromatic leaf having a high luminance. This can be suppressed.

なお、ここでは、YU平面上で輝度Yの閾値Th1や閾値Th2を入力させる場合を例示したが、輝度Yを含む平面、すなわちYV平面でも同様に輝度Yの閾値Th1や閾値Th2を設定することもできる。   Here, the case where the threshold value Th1 and the threshold value Th2 of the luminance Y are input on the YU plane is exemplified, but the threshold value Th1 and the threshold value Th2 of the luminance Y are set similarly on the plane including the luminance Y, that is, the YV plane. You can also.

このように第1の分離条件及び第2の分離条件が算出された後、分離条件設定部16は、第1の分離条件及び第2の分離条件を色補正装置100の分離条件記憶部140へ登録することにより、分離条件を色補正装置100に設定する。なお、ここでは、第2の分離条件に輝度Yの閾値Th2を含める場合を例示したが、必ずしも第2の分離条件に輝度Yの閾値Th2を含めずともかまわない。   After the first separation condition and the second separation condition are calculated in this way, the separation condition setting unit 16 sends the first separation condition and the second separation condition to the separation condition storage unit 140 of the color correction apparatus 100. By registering, the separation condition is set in the color correction apparatus 100. Although the case where the threshold value Th2 for the luminance Y is included in the second separation condition is illustrated here, the threshold value Th2 for the luminance Y may not necessarily be included in the second separation condition.

ここで、図4の例では、第2の分離条件が操作入力を介して指定される場合を例示したが、第2の分離条件は必ずしも操作入力を介して指定されずともよく、第2の分離条件を自動的に設定することもできる。   Here, in the example of FIG. 4, the case where the second separation condition is designated via the operation input is illustrated, but the second separation condition may not necessarily be designated via the operation input. Separation conditions can also be set automatically.

図5は、輝度Yのヒストグラムの一例を示す図である。図5に示すグラフの縦軸は、度数を指し、横軸は、階級値である輝度Yを指す。図5に示すように、分離条件設定部16は、第1のサンプル画像上の第1の領域を形成する画素が持つ輝度値及び第1のサンプル画像上の第2の領域を形成する画素が持つ輝度値から輝度のヒストグラムを生成する。図5には、第1の領域を形成する画素に関する輝度の度数が白抜きで示されると共に、第2の領域を形成する画素に関する輝度の度数が黒地で示されている。このように、輝度のヒストグラムは、第1の領域を形成する画素が持つ輝度の分布と、第2の領域を形成する画素が持つ輝度の分布との2つの山に分かれるので、双峰性を持つことがわかる。そのため、分離条件設定部16は、モード法やPタイル法などのように、2値化の閾値を算出する手法を適用することにより、2つの分布により形成される谷の階級値を算出する。このように算出される谷の階級値は、図4に示した輝度Yの閾値Th1と等価であるので、分離条件設定部16は、当該輝度Yの閾値Th1を第2の分離条件として色補正装置100に設定する。   FIG. 5 is a diagram illustrating an example of a histogram of luminance Y. The vertical axis of the graph shown in FIG. 5 indicates the frequency, and the horizontal axis indicates the luminance Y that is a class value. As shown in FIG. 5, the separation condition setting unit 16 determines the luminance value of the pixels forming the first region on the first sample image and the pixels forming the second region on the first sample image. A brightness histogram is generated from the brightness values. In FIG. 5, the luminance frequency relating to the pixels forming the first region is shown in white, and the luminance frequency relating to the pixels forming the second region is shown in black. In this way, the luminance histogram is divided into two peaks, the luminance distribution of the pixels forming the first region and the luminance distribution of the pixels forming the second region. I understand that I have it. Therefore, the separation condition setting unit 16 calculates the rank value of the valley formed by the two distributions by applying a method for calculating a binarization threshold, such as the mode method or the P tile method. Since the valley class value calculated in this way is equivalent to the threshold value Th1 of the luminance Y shown in FIG. 4, the separation condition setting unit 16 performs color correction using the threshold value Th1 of the luminance Y as the second separation condition. Set to device 100.

なお、上記の第1取得部11、第2取得部12、特定部13、変換部14及び補正データ設定部15及び分離条件設定部16などの処理部は、次のようにして実装できる。例えば、中央処理装置、いわゆるCPU(Central Processing Unit)などに、上記の各処理部と同様の機能を発揮するプロセスを各種の半導体メモリ素子、例えばRAM(Random Access Memory)やフラッシュメモリなどに展開して実行させることにより実現できる。これらの処理部は、必ずしも中央処理装置で実行されずともよく、MPU(Micro Processing Unit)に実行させることとしてもよい。また、上記の各機能部は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などのハードワイヤードロジックによっても実現できる。   The processing units such as the first acquisition unit 11, the second acquisition unit 12, the identification unit 13, the conversion unit 14, the correction data setting unit 15, and the separation condition setting unit 16 can be implemented as follows. For example, in a central processing unit, a so-called CPU (Central Processing Unit), a process that performs the same function as each processing unit described above is developed in various semiconductor memory devices, such as RAM (Random Access Memory) and flash memory. It can be realized by executing. These processing units do not necessarily have to be executed by the central processing unit, but may be executed by an MPU (Micro Processing Unit). Each functional unit described above can also be realized by a hard wired logic such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

[色補正装置100の構成]
次に、本実施例に係る色補正装置100の機能的構成について説明する。図1に示すように、色補正装置100は、取得部110と、変換部120と、判定部130と、分離条件記憶部140と、補正部150と、補正データ記憶部160とを有する。
[Configuration of Color Correction Apparatus 100]
Next, a functional configuration of the color correction apparatus 100 according to the present embodiment will be described. As illustrated in FIG. 1, the color correction apparatus 100 includes an acquisition unit 110, a conversion unit 120, a determination unit 130, a separation condition storage unit 140, a correction unit 150, and a correction data storage unit 160.

取得部110は、画像を取得する処理部である。ここで言う「画像」は、設定装置10の第1取得部11及び第2取得部12により取得されるサンプル画像とは異なり、上記の色補正処理を適用する画像を指す。以下では、色補正が行われる元となる画像という一側面から「原画像」と記載する場合がある。なお、ここでは、原画像の撮影形態の一例として、赤外線カットフィルタが装着されない状態で撮影される場合を想定するが、可視光領域および使用する赤外の波長領域の帯域幅、例えば近赤外光の波長の一部を透過する光学フィルタが挿入された状態で撮影される画像を原画像とすることもできる。   The acquisition unit 110 is a processing unit that acquires an image. The “image” here refers to an image to which the above color correction processing is applied, unlike the sample image acquired by the first acquisition unit 11 and the second acquisition unit 12 of the setting device 10. In the following description, an “original image” may be described from one aspect of an image from which color correction is performed. Here, as an example of the form of the original image, it is assumed that the image is captured without an infrared cut filter, but the bandwidth of the visible light region and the infrared wavelength region to be used, for example, near infrared An image captured with an optical filter that transmits a part of the wavelength of light being inserted may be used as an original image.

一実施形態として、取得部110は、CCDやCMOSなどの撮像素子を搭載するカメラにより撮像された原画像を取得することができる。また、取得部110は、ハードディスクや光ディスクなどの補助記憶装置またはメモリカードやUSB(Universal Serial Bus)メモリなどのリムーバブルメディアに保存された原画像を読み出すことにより取得することもできる。この他、取得部110は、外部装置からネットワークを介して受信することによって原画像を取得することもできる。   As one embodiment, the acquisition unit 110 can acquire an original image captured by a camera equipped with an image sensor such as a CCD or a CMOS. The acquisition unit 110 can also acquire an original image stored in an auxiliary storage device such as a hard disk or an optical disk or a removable medium such as a memory card or a USB (Universal Serial Bus) memory. In addition, the acquisition unit 110 can also acquire an original image by receiving it from an external device via a network.

変換部120は、原画像を色度空間に変換する処理部である。   The conversion unit 120 is a processing unit that converts an original image into a chromaticity space.

一実施形態として、変換部120は、取得部110により取得される原画像のデータ形式を輝度と色度を含む空間で表現されるデータ形式へ変換する。例えば、変換部120は、原画像に含まれる各画素の画素値をRGB空間で表現されていたRGBの画素値から輝度Y及び2つの色差によって表現される画素値へ変換する。なお、ここでは、原画像をYUV空間へ変換する場合を例示するが、変換先の色度空間はYUV空間に限定されず、原画像を他の色空間、例えばL*a*b空間に変換することとしてもかまわない。   As one embodiment, the conversion unit 120 converts the data format of the original image acquired by the acquisition unit 110 into a data format expressed in a space including luminance and chromaticity. For example, the conversion unit 120 converts the pixel value of each pixel included in the original image from the RGB pixel value expressed in the RGB space to the pixel value expressed by the luminance Y and two color differences. Although the case where the original image is converted to the YUV space is illustrated here, the conversion destination chromaticity space is not limited to the YUV space, and the original image is converted to another color space, for example, an L * a * b space. It doesn't matter as you do.

判定部130は、分離条件記憶部140に記憶された分離条件を参照して、原画像に含まれる画素が第1の被写体に対応する画素であるか否かを判定する処理部である。   The determination unit 130 is a processing unit that refers to the separation condition stored in the separation condition storage unit 140 and determines whether or not the pixel included in the original image is a pixel corresponding to the first subject.

一実施形態として、判定部130は、変換部120により色度空間へ変換された原画像に含まれる画素のうち画素を1つ選択する。続いて、判定部130は、分離条件記憶部140に記憶された第1の分離条件、すなわち上述の第1の領域に対応するUV平面上の楕円領域を参照して、先に原画像から選択された画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれるか否かを判定する。   As one embodiment, the determination unit 130 selects one pixel from the pixels included in the original image converted into the chromaticity space by the conversion unit 120. Subsequently, the determination unit 130 selects from the original image first with reference to the first separation condition stored in the separation condition storage unit 140, that is, the elliptical region on the UV plane corresponding to the first region described above. It is determined whether the UV component of the selected pixel is included in the elliptical region corresponding to the first region on the UV plane.

このとき、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれない場合、当該画素が第1の被写体及び第2の被写体のいずれの像も形成しない画素であると推定できる。この場合、第1の被写体以外の他の被写体に適用する色補正、例えばマトリクス演算による色補正が補正部150により選択される。   At this time, if the UV component of the pixel is not included in the elliptical region corresponding to the first region on the UV plane, the pixel is a pixel that does not form any image of the first subject or the second subject. Can be estimated. In this case, the correction unit 150 selects color correction to be applied to other subjects other than the first subject, for example, color correction by matrix calculation.

一方、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれる場合、当該画素が第1の被写体または第2の被写体のいずれかの像を形成する画素であると推定できるが、第2の被写体を形成する画素である余地が残る。この場合、判定部130は、分離条件記憶部140に記憶された第2の分離条件、すなわち輝度Yの閾値Th1を参照して、先に原画像から選択された画素の輝度Yが閾値Th1を超えるか否かをさらに判定する。   On the other hand, when the UV component of a pixel is included in an elliptical region corresponding to the first region on the UV plane, the pixel is estimated to be a pixel that forms an image of either the first subject or the second subject. Although it is possible, there remains room for pixels forming the second subject. In this case, the determination unit 130 refers to the second separation condition stored in the separation condition storage unit 140, that is, the threshold value Th1 of the luminance Y, and the luminance Y of the pixel previously selected from the original image sets the threshold value Th1. It is further determined whether or not it exceeds.

ここで、画素の輝度Yが閾値Th1を超える場合、当該画素が無彩色に近い色を持ち、かつ赤外光の受光量が多い画素であると推定できるので、第1の被写体を形成する画素である公算が高まる。この場合、第1の被写体に適用する色補正、例えばUV平面上で色をシフトさせる色補正が補正部150により選択される。一方、画素の輝度Yが閾値Th1を超えない場合、当該画素が第1の被写体とみなすには受光量の総量が足りない無彩色の画素であり、第2の被写体を形成する画素である公算が高まる。この場合、第1の被写体以外の他の被写体に適用する色補正、例えばマトリクス演算による色補正が補正部150により選択される。   Here, when the luminance Y of the pixel exceeds the threshold Th1, it can be estimated that the pixel has a color close to an achromatic color and has a large amount of received infrared light, so that the pixel forming the first subject Is likely to increase. In this case, the correction unit 150 selects color correction to be applied to the first subject, for example, color correction for shifting the color on the UV plane. On the other hand, if the luminance Y of the pixel does not exceed the threshold Th1, the pixel is an achromatic pixel in which the total amount of received light is insufficient to be regarded as the first subject, and is a pixel that forms the second subject. Will increase. In this case, the correction unit 150 selects color correction to be applied to other subjects other than the first subject, for example, color correction by matrix calculation.

補正部150は、補正データ記憶部160に記憶された補正データを参照して、色補正を実行する処理部である。   The correction unit 150 is a processing unit that performs color correction with reference to the correction data stored in the correction data storage unit 160.

一実施形態として、補正部150は、画素の輝度Yが閾値Th1を超える場合、第1の被写体に適用する色補正、例えばUV平面上で色をシフトさせる色補正を実行する。すなわち、補正部150は、補正データ記憶部160に記憶された第1の補正データに定義されたシフト量にしたがって当該画素のUV成分をUV平面上でシフトさせた後に、UV平面上でシフトされた画素値をRGB空間の画素値へ逆変換する。また、補正部150は、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれない場合、または、画素の輝度Yが閾値Th1を超えない場合、第1の被写体以外の他の被写体に適用する色補正、例えばマトリクス演算による色補正を実行する。すなわち、補正部150は、補正データ記憶部160に記憶された第2の補正データ、すなわちマトリクス係数を参照して、当該画素が持つRGBの画素値に第2の補正データに定義されたマトリクス係数を乗算するマトリクス演算を実行する。なお、補正部150は、上記の色補正の他にも、上記の色補正が実行された画素値にγ補正および彩度補正などを併せて実行することもできる。   As an embodiment, when the luminance Y of the pixel exceeds the threshold Th1, the correction unit 150 performs color correction applied to the first subject, for example, color correction that shifts the color on the UV plane. That is, the correction unit 150 shifts the UV component of the pixel on the UV plane according to the shift amount defined in the first correction data stored in the correction data storage unit 160, and then shifts the UV component on the UV plane. The obtained pixel value is inversely converted to a pixel value in the RGB space. Further, the correction unit 150 does not include the first subject when the UV component of the pixel is not included in the elliptical region corresponding to the first region on the UV plane, or when the luminance Y of the pixel does not exceed the threshold Th1. Color correction to be applied to other subjects, for example, color correction by matrix calculation is executed. That is, the correction unit 150 refers to the second correction data stored in the correction data storage unit 160, that is, the matrix coefficient, and the matrix coefficient defined in the second correction data to the RGB pixel value of the pixel. A matrix operation for multiplying is executed. In addition to the color correction described above, the correction unit 150 can also execute γ correction, saturation correction, and the like on the pixel value on which the color correction has been executed.

このようにして原画像の各画素の色補正が行われた後、色補正後の画像は、任意の出力先へ出力することができる。例えば、色補正後の画像を所定のディスプレイに表示させたり、ハードディスクや光ディスクなどの補助記憶装置またはメモリカードやUSBメモリなどのリムーバブルメディアに保存したりすることもできる。この他、画像を入力として各種の処理をコンピュータに実行させるアプリケーションプログラムへ色補正後の画像を出力したり、ネットワークを介して、色補正後の画像を任意の外部装置へ送信したりすることもできる。   After color correction of each pixel of the original image is performed in this way, the image after color correction can be output to an arbitrary output destination. For example, the color-corrected image can be displayed on a predetermined display, or can be stored in an auxiliary storage device such as a hard disk or an optical disk, or a removable medium such as a memory card or a USB memory. In addition, the image after color correction may be output to an application program that causes a computer to execute various processes using the image as an input, or the image after color correction may be transmitted to an arbitrary external device via a network. it can.

なお、上記の取得部110、変換部120、判定部130及び補正部150などの機能部は、次のようにして実装できる。例えば、中央処理装置、いわゆるCPUなどに、上記の各処理部と同様の機能を発揮するプロセスをメモリ上に展開して実行させることにより実現できる。これらの処理部は、必ずしも中央処理装置で実行されずともよく、MPUに実行させることとしてもよい。また、上記の各機能部は、ASICやFPGAなどのハードワイヤードロジックによっても実現できる。   The functional units such as the acquisition unit 110, the conversion unit 120, the determination unit 130, and the correction unit 150 described above can be implemented as follows. For example, it can be realized by causing a central processing unit, a so-called CPU, or the like to develop and execute a process that exhibits the same function as each of the above processing units on a memory. These processing units are not necessarily executed by the central processing unit, and may be executed by the MPU. Each functional unit described above can also be realized by a hard-wired logic such as ASIC or FPGA.

また、上記の分離条件記憶部140及び補正データ記憶部160には、一例として、各種の半導体メモリ素子、例えばRAMやフラッシュメモリを採用できる。また、上記の分離条件記憶部140及び補正データ記憶部160は、必ずしも主記憶装置でなくともよく、補助記憶装置であってもかまわない。この場合、HDD、光ディスクやSSDなどを採用できる。   In addition, as the separation condition storage unit 140 and the correction data storage unit 160, various semiconductor memory elements such as a RAM and a flash memory can be employed as an example. Further, the separation condition storage unit 140 and the correction data storage unit 160 are not necessarily a main storage device and may be an auxiliary storage device. In this case, an HDD, an optical disk, an SSD, or the like can be employed.

[処理の流れ]
続いて、本実施例に係る色補正システムの処理の流れについて説明する。なお、ここでは、設定装置10により実行される(1)設定処理を説明した後に、色補正装置100により実行される(2)色補正処理を説明することとする。
[Process flow]
Next, the process flow of the color correction system according to the present embodiment will be described. Here, after (1) setting processing executed by the setting device 10 is described, (2) color correction processing executed by the color correction device 100 will be described.

(1)設定処理
図6は、実施例1に係る設定処理の手順を示すフローチャートである。この処理は、一例として、色補正装置100への設定指示を受け付けた場合に起動される。図6に示すように、設定処理が起動されると、第1取得部11により第1のサンプル画像が取得されると共に第2取得部12により第2のサンプル画像が取得される(ステップS101)。
(1) Setting Processing FIG. 6 is a flowchart illustrating a setting processing procedure according to the first embodiment. This process is started when a setting instruction to the color correction apparatus 100 is received as an example. As shown in FIG. 6, when the setting process is started, the first sample image is acquired by the first acquisition unit 11 and the second sample image is acquired by the second acquisition unit 12 (step S101). .

続いて、特定部13は、ステップS101で取得された第1のサンプル画像から第1の被写体の一部または全部を形成する第1の領域を特定すると共に、第1のサンプル画像から第2の被写体の一部または全部を形成する第2の領域を特定する(ステップS102)。   Subsequently, the specifying unit 13 specifies a first region that forms part or all of the first subject from the first sample image acquired in step S101, and the second region from the first sample image. A second region that forms part or all of the subject is identified (step S102).

そして、変換部14は、第1取得部11により取得される第1のサンプル画像および第2取得部12により取得される第2のサンプル画像のデータ形式を輝度と色度を含む空間で表現されるデータ形式へ変換する(ステップS103)。   The conversion unit 14 expresses the data format of the first sample image acquired by the first acquisition unit 11 and the second sample image acquired by the second acquisition unit 12 in a space including luminance and chromaticity. (Step S103).

その後、補正データ設定部15は、第1のサンプル画像に含まれる画素のうちステップS102で第1の被写体を形成する範囲として特定された第1の領域に含まれる画素の色成分が色度空間上で分布する位置と、当該第1の領域に含まれる画素に対応する第2のサンプル画像上の画素の色成分が色度空間上で分布する位置とから色度空間上におけるシフト量を第1の補正データとして算出する(ステップS104)。   Thereafter, the correction data setting unit 15 determines that the color components of the pixels included in the first region identified as the range for forming the first subject in step S102 among the pixels included in the first sample image are the chromaticity space. The shift amount in the chromaticity space is determined from the position distributed above and the position in which the color component of the pixel on the second sample image corresponding to the pixel included in the first region is distributed in the chromaticity space. 1 is calculated as correction data (step S104).

また、補正データ設定部15は、第1のサンプル画像および第2のサンプル画像の2つのサンプル画像に含まれる画素のうち第1の領域に含まれない画素が持つRGBの画素値から、撮像素子の分光感度特性を等色関数に近似させるマトリクス係数を第2の補正データとして算出する(ステップS105)。   In addition, the correction data setting unit 15 calculates the image sensor from the RGB pixel values of the pixels not included in the first region among the pixels included in the two sample images of the first sample image and the second sample image. The matrix coefficient that approximates the spectral sensitivity characteristic of the color matching function to the color matching function is calculated as second correction data (step S105).

そして、補正データ設定部15は、ステップS104で算出された第1の補正データ及びステップS105で算出された第2の補正データを色補正装置100の補正データ記憶部160へ登録することにより、複数種の色補正に用いられる各補正データを色補正装置100に設定する(ステップS106)。   Then, the correction data setting unit 15 registers the first correction data calculated in step S104 and the second correction data calculated in step S105 in the correction data storage unit 160 of the color correction apparatus 100, so that a plurality of correction data are set. Each correction data used for the color correction of the seed is set in the color correction apparatus 100 (step S106).

その後、分離条件設定部16は、第1のサンプル画像上の第1の領域に含まれる各画素の色成分が色度空間上で点在する座標の分布を楕円に近似することにより得られた色度空間上の楕円領域を第1の分離条件として算出する(ステップS107)。   Thereafter, the separation condition setting unit 16 is obtained by approximating an elliptical distribution of coordinates in which the color components of each pixel included in the first region on the first sample image are scattered in the chromaticity space. An elliptical area in the chromaticity space is calculated as the first separation condition (step S107).

また、分離条件設定部16は、第1のサンプル画像上の第1の領域に含まれる各画素の輝度成分と、第1のサンプル画像上の第2の領域に含まれる各画素の輝度成分とから、第1の被写体および第2の被写体を分離する輝度Yの閾値Th1を第2の分離条件として算出する(ステップS108)。   The separation condition setting unit 16 also includes a luminance component of each pixel included in the first area on the first sample image, and a luminance component of each pixel included in the second area on the first sample image. Therefore, the threshold value Th1 of the luminance Y that separates the first subject and the second subject is calculated as the second separation condition (step S108).

そして、分離条件設定部16は、ステップS107で算出された第1の分離条件及びステップS108で算出された第2の分離条件を色補正装置100の分離条件記憶部140へ登録することにより、分離条件を色補正装置100に設定し(ステップS109)、処理を終了する。   Then, the separation condition setting unit 16 registers the first separation condition calculated in step S107 and the second separation condition calculated in step S108 in the separation condition storage unit 140 of the color correction apparatus 100, thereby separating the separation condition setting unit 16. Conditions are set in the color correction apparatus 100 (step S109), and the process ends.

(2)色補正処理
図7は、実施例1に係る色補正処理の手順を示すフローチャートである。この色補正処理は、一例として、色補正を実行する対象とする原画像が指定された場合に起動する。図7に示すように、色補正を実行する対象とする原画像が指定されると、取得部110により原画像が取得される(ステップS301)。続いて、変換部120は、ステップS301で取得された原画像のデータ形式を輝度と色度を含む空間で表現されるデータ形式へ変換する(ステップS302)。
(2) Color Correction Processing FIG. 7 is a flowchart illustrating the procedure of color correction processing according to the first embodiment. As an example, this color correction process is started when an original image to be subjected to color correction is designated. As shown in FIG. 7, when an original image to be subjected to color correction is designated, the acquisition unit 110 acquires the original image (step S301). Subsequently, the conversion unit 120 converts the data format of the original image acquired in step S301 into a data format expressed in a space including luminance and chromaticity (step S302).

そして、判定部130は、ステップS302で色度空間へ変換された原画像に含まれる画素のうち画素を1つ選択する(ステップS303)。続いて、判定部130は、分離条件記憶部140に記憶された第1の分離条件、すなわち上述の第1の領域に対応するUV平面上の楕円領域を参照して、ステップS303で原画像から選択された画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれるか否かを判定する(ステップS304)。   Then, the determination unit 130 selects one of the pixels included in the original image converted into the chromaticity space in step S302 (step S303). Subsequently, the determination unit 130 refers to the first separation condition stored in the separation condition storage unit 140, that is, the elliptical region on the UV plane corresponding to the first region described above, and from the original image in step S303. It is determined whether or not the UV component of the selected pixel is included in an elliptical area corresponding to the first area on the UV plane (step S304).

このとき、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれる場合(ステップS304Yes)、当該画素が第1の被写体または第2の被写体のいずれかの像を形成する画素であると推定できるが、第2の被写体を形成する画素である余地が残る。この場合、判定部130は、分離条件記憶部140に記憶された第2の分離条件、すなわち輝度Yの閾値Th1を参照して、ステップS303で原画像から選択された画素の輝度Yが閾値Th1を超えるか否かをさらに判定する(ステップS305)。   At this time, if the UV component of the pixel is included in an elliptical area corresponding to the first area on the UV plane (Yes in step S304), the pixel forms an image of either the first subject or the second subject. Although it can be estimated that it is a pixel, there remains room for a pixel to form the second subject. In this case, the determination unit 130 refers to the second separation condition stored in the separation condition storage unit 140, that is, the threshold value Th1 of the luminance Y, and the luminance Y of the pixel selected from the original image in step S303 is the threshold value Th1. Is further determined (step S305).

ここで、画素の輝度Yが閾値Th1を超える場合(ステップS305Yes)、当該画素が無彩色に近い色を持ち、かつ赤外光の受光量が多い画素であると推定できるので、第1の被写体を形成する画素である公算が高まる。この場合、補正部150は、補正データ記憶部160に記憶された第1の補正データに定義されたシフト量にしたがって当該画素のUV成分をUV平面上でシフトさせた後にRGB空間の画素値へ逆変換する第1の被写体用の色補正を実行する(ステップS306)。   If the luminance Y of the pixel exceeds the threshold Th1 (step S305 Yes), it can be estimated that the pixel has a color close to an achromatic color and has a large amount of received infrared light, so the first subject The likelihood of being a pixel that forms a pixel is increased. In this case, the correction unit 150 shifts the UV component of the pixel on the UV plane according to the shift amount defined in the first correction data stored in the correction data storage unit 160, and then changes the pixel value to the RGB space. Color correction for the first subject to be inversely converted is executed (step S306).

一方、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれない場合または画素の輝度Yが閾値Th1を超えない場合(ステップS304NoまたはステップS305No)、補正部150は、次のような処理を行う。すなわち、補正部150は、補正データ記憶部160に記憶された第2の補正データ、すなわちマトリクス係数を参照して、当該画素が持つRGBの画素値に第2の補正データに定義されたマトリクス係数を乗算するマトリクス演算を実行する第1の被写体以外の他の被写体用の色補正を行う(ステップS307)。   On the other hand, when the UV component of the pixel is not included in the elliptical region corresponding to the first region on the UV plane, or when the luminance Y of the pixel does not exceed the threshold Th1 (Step S304 No or Step S305 No), the correction unit 150 The following processing is performed. That is, the correction unit 150 refers to the second correction data stored in the correction data storage unit 160, that is, the matrix coefficient, and the matrix coefficient defined in the second correction data to the RGB pixel value of the pixel. Color correction is performed for a subject other than the first subject that executes the matrix operation for multiplying by (step S307).

その後、原画像に含まれる全ての画素が選択されるまで(ステップS308No)、上記のステップS303〜ステップS307までの処理が繰り返し実行される。そして、原画像に含まれる全ての画素が選択されると(ステップS308Yes)、補正部150は、所定の出力先に対し、補正後の画像を出力し(ステップS309)、処理を終了する。   Thereafter, the processes from step S303 to step S307 are repeatedly executed until all the pixels included in the original image are selected (No in step S308). Then, when all the pixels included in the original image are selected (Yes in step S308), the correction unit 150 outputs the corrected image to a predetermined output destination (step S309), and the process ends.

[効果の一側面]
上述してきたように、本実施例に係る色補正システム1は、可視光及び赤外光の波長に対応する光を含んで撮像された画像に含まれる、赤外光の分光反射率が高い第1の被写体と色空間上で第1の被写体に色の分布が類似する第2の被写体とを輝度の多寡により分離する。したがって、本実施例に係る色補正システム1によれば、赤外光の分光反射率が高い部分とそれ以外の部分を十分に分離することができる。
[One aspect of effect]
As described above, the color correction system 1 according to the present embodiment has a high spectral reflectance of infrared light included in an image captured including light corresponding to wavelengths of visible light and infrared light. A first subject and a second subject having a color distribution similar to that of the first subject in the color space are separated based on the luminance. Therefore, according to the color correction system 1 according to the present embodiment, it is possible to sufficiently separate a portion where the spectral reflectance of infrared light is high and other portions.

さて、これまで開示の装置に関する実施例について説明したが、本発明は上述した実施例以外にも、種々の異なる形態にて実施されてよいものである。そこで、以下では、本発明に含まれる他の実施例を説明する。   Although the embodiments related to the disclosed apparatus have been described above, the present invention may be implemented in various different forms other than the above-described embodiments. Therefore, another embodiment included in the present invention will be described below.

[入力画像について]
上記の実施例1では、可視光および赤外光の波長に対応する光が撮像素子に結像される撮影形態の一例として、赤外線カットフィルタが装着されない状態で撮影される画像が入力される場合を例示したが、画像の撮影形態はこれに限定されない。例えば、可視光領域および使用する赤外の波長領域の帯域幅を透過する光学フィルタが挿入された状態で撮影される画像を第1のサンプル画像とし、図6に示した設定処理を適用することもできるし、当該画像を原画像とし、図7に示した色補正処理を適用することもできる。
[About input images]
In the first embodiment, as an example of a photographing form in which light corresponding to the wavelengths of visible light and infrared light is imaged on the image sensor, an image photographed without an infrared cut filter is input However, the image capturing mode is not limited to this. For example, an image photographed with an optical filter that transmits the visible light region and the bandwidth of the infrared wavelength region to be used is inserted as the first sample image, and the setting process shown in FIG. 6 is applied. It is also possible to use the image as an original image and apply the color correction processing shown in FIG.

[分離条件の応用例1]
上記の実施例1では、第2の分離条件として輝度Yの閾値Th1や閾値Th2を用いる場合を例示したが、必ずしも閾値を条件とせずともかまわない。例えば、設定装置10は、赤外光の分光反射率が高い第1の領域に関する輝度のヒストグラムの分布形状をそのまま確率分布として用いることもできる。例えば、設定装置10は、可視光及び赤外光の両方の波長域に関する反射光を含む第1のサンプル画像において、第1の領域を形成する画素の輝度値から輝度のヒストグラムを算出した上で輝度のヒストグラムを所定の範囲の値、例えば0から1までの値へ正規化する。かかる輝度のヒストグラムにおいて、度数が高い部分は、緑の葉の確率が高いとし、周辺になるにしたがって度数が減るので、緑の確率が低いと仮定できる。このことから、先のようにして正規化された輝度のヒストグラムを画素が第1の被写体である確率分布として用いることができる。
[Application Example 1 of Separation Conditions]
In the first embodiment, the case where the threshold value Th1 and the threshold value Th2 of the luminance Y are used as the second separation condition is illustrated, but the threshold value may not necessarily be used as the condition. For example, the setting device 10 can also directly use the distribution shape of the luminance histogram relating to the first region where the spectral reflectance of infrared light is high as the probability distribution. For example, the setting device 10 calculates a luminance histogram from the luminance values of the pixels forming the first region in the first sample image including reflected light with respect to both visible light and infrared light wavelength regions. The luminance histogram is normalized to a value in a predetermined range, for example, a value from 0 to 1. In such a luminance histogram, a portion with a high frequency is assumed to have a high probability of green leaves, and the frequency decreases as it goes to the periphery, so it can be assumed that the probability of green is low. Therefore, the luminance histogram normalized as described above can be used as a probability distribution in which the pixel is the first subject.

このように第2の分離条件として確率分布を用いる場合、色補正装置100は、画素のUV成分がUV平面上で第1の領域に対応する楕円領域に含まれる場合に、上記の確率分布のうち当該画素が持つ輝度値に対応する確率w1に応じて色のシフト補正及びマトリクス演算による色補正を混合することもできる。例えば、色補正装置100は、画素が持つ色成分が楕円領域に含まれる場合に、下記の式(1)を用いて、色のシフト補正及びマトリクス演算による色補正をブレンドできる。   As described above, when the probability distribution is used as the second separation condition, the color correction apparatus 100 determines the above probability distribution when the UV component of the pixel is included in the elliptical region corresponding to the first region on the UV plane. Among them, color shift correction and color correction by matrix calculation can be mixed according to the probability w1 corresponding to the luminance value of the pixel. For example, when the color component of a pixel is included in an elliptical area, the color correction apparatus 100 can blend color shift correction and color correction by matrix calculation using the following equation (1).

RGB=r’g’b’×w1+rgb×(1-w1)・・・(1)   RGB = r’g’b ’× w1 + rgb × (1-w1) (1)

上記の式(1)に示す「r’」、「g’」及び「b’」は、色のシフト補正後のRGBの値であり、上記の式(1)に示す「r」、「g」及び「b」は、マトリクス演算による色補正後のRGBの値である。また、上記の式(1)に示す「w1」は、画素が第1の被写体である確率を指し、例えば、0≦w1≦1の値が確率分布にしたがって設定できる。これによって、度数が高い場合は、色のシフト補正の割合を高くし、度数の分布が小さくなるにしたがって、マトリクス演算による色補正の割合を高くして色補正をブレンドできる。なお、ここでは、RGB空間でブレンド処理を実行する場合を例示したが、ブレンド処理の適用範囲はRGB空間の画像に留まらず、その他の色空間、例えばYUVあるいはL*a*b等でブレンド処理を実行した後にRGBに変換してもかまわない。   “R ′”, “g ′”, and “b ′” shown in the above equation (1) are RGB values after color shift correction, and “r”, “g” shown in the above equation (1). "And" b "are RGB values after color correction by matrix calculation. Further, “w1” shown in the above formula (1) indicates the probability that the pixel is the first subject, and for example, a value of 0 ≦ w1 ≦ 1 can be set according to the probability distribution. Thus, when the frequency is high, the color correction can be blended by increasing the color shift correction ratio and increasing the color correction ratio by matrix calculation as the frequency distribution decreases. Here, the case where the blend process is executed in the RGB space is illustrated, but the application range of the blend process is not limited to the image in the RGB space, and the blend process is performed in another color space such as YUV or L * a * b. It is also possible to convert to RGB after executing.

このように第2の分離条件として確率分布を用いる場合、閾値だけで第1の領域とそれ以外の他の被写体を分離する場合よりも、段階的に補正を行うので、色の補正の特異な変化点を抑制し、分離条件の境界が滑らかな補正となる結果、より分離の精度を高めることができる。   As described above, when the probability distribution is used as the second separation condition, since the correction is performed in a stepwise manner as compared with the case where the first region is separated from the other subject by using only the threshold value, the specific color correction is unique. As a result of suppressing the change point and smoothing the boundary of the separation condition, the accuracy of separation can be further improved.

上述のように、輝度のヒストグラムにより確率分布を定義する場合、設定装置10は、例えば、平均値と分散値(あるいは標準偏差)を算出し、正規分布の確率に近似してもかまわない。この場合、平均値と分散値(あるいは標準偏差)が第2の分離条件として色補正装置100へ設定される。あるいは、非対称として、設定装置10は、対数正規分布、三角分布やガンマ分布、これら以外の確率分布を定義することもできる。このように確率分布への近似を使うことにより、人間が閾値を設定することなく、分離条件を設定できる。   As described above, when the probability distribution is defined by the luminance histogram, the setting device 10 may calculate, for example, an average value and a variance value (or standard deviation) and approximate the probability of the normal distribution. In this case, the average value and the variance value (or standard deviation) are set in the color correction apparatus 100 as the second separation condition. Alternatively, as the asymmetry, the setting device 10 can define a lognormal distribution, a triangular distribution, a gamma distribution, and other probability distributions. In this way, by using the approximation to the probability distribution, it is possible for the human to set the separation condition without setting the threshold value.

[分離条件の応用例2]
色度空間においても、上記の分離条件の応用例1で説明した確率の考え方を援用することもできる。図8Aは、色成分Uのヒストグラムの一例を示す図であり、図8Bは、色成分Vのヒストグラムの一例を示す図である。設定装置10は、図8Aに示すように、第1のサンプル画像上の第1の領域を形成する画素が持つ色成分Uの値から色成分Uのヒストグラムを生成すると共に、図8Bに示すように、第1のサンプル画像上の第1の領域を形成する画素が持つ色成分Vの値から色成分Vのヒストグラムを生成する。そして、設定装置10は、輝度の場合と同様、これらヒストグラムの分布を正規化した確率そのものを用いて第1の分離条件として色補正装置100へ設定することとしてもよいし、確率分布に近似して第1の分離条件として設定することとしてもかまわない。
[Application example 2 of separation conditions]
Also in the chromaticity space, the idea of the probability described in the application example 1 of the separation condition can be used. FIG. 8A is a diagram illustrating an example of the histogram of the color component U, and FIG. 8B is a diagram illustrating an example of the histogram of the color component V. As shown in FIG. 8A, the setting device 10 generates a histogram of the color component U from the value of the color component U of the pixels forming the first region on the first sample image, and as shown in FIG. 8B. In addition, a histogram of the color component V is generated from the value of the color component V possessed by the pixels forming the first region on the first sample image. Then, as in the case of the luminance, the setting device 10 may set the color correction device 100 as the first separation condition using the probability itself obtained by normalizing the distribution of these histograms, or approximate the probability distribution. Thus, the first separation condition may be set.

[分離条件の応用例3]
色度空間において、確率の考え方を多次元、例えば2次元に適応することもできる。図9は、色度空間に関する確率密度の計算例を示す図である。図9の左側には、図3に示した通り、UV平面上の色の分布が示されており、図9の右側には、第1のサンプル画像上の第1の領域を形成する画素に関する確率密度の計算結果が示されている。
[Application example 3 of separation conditions]
In the chromaticity space, the concept of probability can be applied to multi-dimensions, for example, two dimensions. FIG. 9 is a diagram illustrating a calculation example of the probability density regarding the chromaticity space. As shown in FIG. 3, the left side of FIG. 9 shows the color distribution on the UV plane, and the right side of FIG. 9 relates to the pixels forming the first region on the first sample image. The calculation result of probability density is shown.

設定装置10は、多変量正規分布(2次元)の定義にしたがって、第1のサンプル画像上で第1の領域を形成する各画素のUV成分の値から各画素の色成分UVが第1の被写体である確率密度を算出することができる。すなわち、図9の左側に示す分布のうち、第1のサンプル画像上で第1の領域を形成する各画素のUV成分の値を2次元のベクトルをZとすると、Zの平均値のベクトルがμ(Uの平均とVの平均に相当)として算出できる。さらに、分散共分散行列Σを計算することにより、分布のばらつき度合いを計算できる。このように平均と分散が既知となれば、図9の右側に示す通り、確率密度が算出できる。すなわち、UとVの相関も計算できるので、主軸の方向(楕円の長軸・短軸)も計算できる。このように算出される確率密度では、分布の平均値の領域の確率が一番高く、分散値に従って周辺の確率が下がっていく。これら平均、分散、UVの相関の計算により得られる固有値と固有ベクトルを第1の分離条件として設定することができる。   In accordance with the definition of the multivariate normal distribution (two-dimensional), the setting device 10 determines that the color component UV of each pixel is the first from the value of the UV component of each pixel forming the first region on the first sample image. The probability density of the subject can be calculated. That is, in the distribution shown on the left side of FIG. 9, if the value of the UV component of each pixel forming the first region on the first sample image is Z as a two-dimensional vector, the average vector of Z is It can be calculated as μ (equivalent to the average of U and the average of V). Furthermore, by calculating the variance-covariance matrix Σ, the degree of distribution variation can be calculated. If the mean and variance are known in this way, the probability density can be calculated as shown on the right side of FIG. That is, since the correlation between U and V can also be calculated, the direction of the main axis (the major axis and the minor axis of the ellipse) can also be calculated. In the probability density calculated in this way, the probability of the area of the average value of the distribution is the highest, and the peripheral probability decreases according to the variance value. The eigenvalue and eigenvector obtained by calculating the average, variance, and UV correlation can be set as the first separation condition.

このように確率分布が第1の分離条件として設定される場合、色補正装置100は、取得部110により取得される原画像を輝度と色度を含む空間、例えばYUV空間に変換し、原画像に含まれる画素ごとに第1の分離条件により第1の領域(赤外光の分光反射率が高い例えば木の葉の領域)であるか否かの第1確率を算出する。これと共に、色補正装置100は、第2の分離条件により第1の領域であるか否かの第2確率を原画像の画素ごとに算出する。その上で、色補正装置100は、第1確率及び第2確率から原画像の画素が第1の領域であるか否かの総合的な確率、例えば第1確率及び第2確率の乗算値を算出し、その確率に応じて上記の色補正のブレンド処理を実行する。   In this way, when the probability distribution is set as the first separation condition, the color correction apparatus 100 converts the original image acquired by the acquisition unit 110 into a space including luminance and chromaticity, for example, a YUV space, and the original image The first probability of whether or not each pixel included in the first region is a first region (for example, a leaf region having a high infrared spectral reflectance) is calculated according to the first separation condition. At the same time, the color correction apparatus 100 calculates, for each pixel of the original image, a second probability as to whether or not the region is the first region based on the second separation condition. In addition, the color correction apparatus 100 calculates a total probability of whether or not the pixel of the original image is the first region from the first probability and the second probability, for example, a multiplication value of the first probability and the second probability. The color correction blending process is executed according to the probability.

[分離条件の応用例4]
上記の実施例1では、第1の分離条件、すなわち色度に関する分離条件と第2の分離条件、すなわち輝度に関する分離条件を分けて算出していたが、3次元、例えばYUVでまとめて第3の分離条件として算出することもできる。この場合、設定装置10は、第1のサンプル画像上の第1の領域を輝度と色度を含む3次元空間上の楕円体に近似することとすればよい。これによって、上記の実施例1の場合と同様に、第1の被写体と色空間上で色の分布が第1の被写体と類似する第2の被写体とを分離することができる。図10は、第3の分離条件の一例を示す図である。図10には、YUV空間上の色の分布が示されている。図3に示した通り、UV平面では、第1の被写体と第2の被写体とを分離するのは困難であるが、Yを含む3次元空間上では、図10に示す通り、第1の領域に含まれる画素の分布、すなわち図示の円のマークと、第2の領域に含まれる画素の分布、すなわち図示の三角のマークとを分離できる。このことから、設定装置10は、輝度及び色度を含む3次元空間上で第1のサンプル画像上の第1の領域に含まれる画素の平均値と分散を算出する。このとき、楕円体の中心は平均値とし、それぞれの方向の大きさを分散値から算出し、楕円体の大きさを決定する。このように、第1のサンプル画像上の第1の領域に含まれる画素に関する分布を3次元の楕円体に近似することにより、当該3次元の楕円体の内部が、緑の葉の補正領域となり、その外側が他の補正となる。このような3次元の楕円体に関する中心及び各方向の半径を第3の分離条件として設定する場合、色補正装置100は、取得部110により取得される原画像を輝度と色度を含む空間、例えばYUV空間に変換し、原画像に含まれる画素ごとに当該画素が3次元の楕円体に含まれるか否かを判定し、3次元の楕円体に含まれる場合に上記の色のシフト補正を実行し、3次元の楕円体に含まれない場合に上記のマトリクス演算による色補正を実行することとすればよい。
[Application Example 4 of Separation Conditions]
In the first embodiment, the first separation condition, that is, the separation condition related to chromaticity, and the second separation condition, that is, the separation condition related to luminance, are calculated separately. It can also be calculated as the separation condition. In this case, the setting device 10 may approximate the first region on the first sample image to an ellipsoid in a three-dimensional space including luminance and chromaticity. As a result, as in the case of the first embodiment, it is possible to separate the first subject and the second subject whose color distribution is similar to the first subject in the color space. FIG. 10 is a diagram illustrating an example of the third separation condition. FIG. 10 shows the color distribution in the YUV space. As shown in FIG. 3, it is difficult to separate the first subject and the second subject on the UV plane, but in the three-dimensional space including Y, as shown in FIG. Can be separated from the distribution of pixels included in the pixel, that is, the circle mark shown in the drawing, and the distribution of pixels included in the second region, ie, the triangular mark shown in the drawing. From this, the setting device 10 calculates the average value and variance of the pixels included in the first region on the first sample image in the three-dimensional space including luminance and chromaticity. At this time, the center of the ellipsoid is an average value, and the size in each direction is calculated from the variance value to determine the size of the ellipsoid. In this way, by approximating the distribution relating to the pixels included in the first region on the first sample image to a three-dimensional ellipsoid, the inside of the three-dimensional ellipsoid becomes a green leaf correction region. The outside is another correction. When the center and the radius in each direction regarding such a three-dimensional ellipsoid are set as the third separation condition, the color correction device 100 uses the space including luminance and chromaticity as the original image acquired by the acquisition unit 110, For example, the image is converted into a YUV space, and for each pixel included in the original image, it is determined whether or not the pixel is included in a three-dimensional ellipsoid. If the pixel is included in a three-dimensional ellipsoid, the above color shift correction is performed. When it is not included in the three-dimensional ellipsoid, the color correction by the matrix calculation may be executed.

[分離条件の応用例5]
上記の分離条件の応用例3では、色度UVに関する2次元の確率密度を算出する場合を例示したが、3次元でまとめた確率密度で分離条件を算出できる。この場合、上記の分離条件の応用例3では、2次元(U,V)の確率密度を算出していたが、多変量正規分布の確率密度を3次元(YUV)に拡張すればよい。これにより、上記の分離条件の応用例3の場合と同様に、主軸の3方向も算出できる。このようにして得られた固有値と固有ベクトルを第1の分離条件及び第2の分離条件の代わりの第3の分離条件として設定できる。かかる3次元の確率密度が分離条件として設定される場合、色補正装置100は、原画像に含まれる画素ごとに第3の分離条件により第1の領域(赤外光の分光反射率が高い例えば木の葉の領域)であるか否かの第3確率を算出する。その上で、第3確率に応じて上記の色補正のブレンド処理を実行することとすればよい。
[Application Example 5 of Separation Conditions]
In the application example 3 of the separation condition described above, the case where the two-dimensional probability density related to the chromaticity UV is calculated is exemplified, but the separation condition can be calculated with the probability density summarized in three dimensions. In this case, in the application example 3 of the above-described separation condition, the two-dimensional (U, V) probability density is calculated, but the probability density of the multivariate normal distribution may be expanded to three dimensions (YUV). As a result, the three directions of the main axis can be calculated as in the case of the application example 3 of the separation condition. The eigenvalue and eigenvector obtained in this way can be set as the third separation condition instead of the first separation condition and the second separation condition. When such a three-dimensional probability density is set as a separation condition, the color correction apparatus 100 uses the third separation condition for each pixel included in the original image according to the third separation condition (for example, the spectral reflectance of infrared light is high). A third probability of whether or not the area is a leaf area) is calculated. Then, the color correction blending process may be executed according to the third probability.

[分散および統合]
また、図示した各装置の各構成要素は、必ずしも物理的に図示の如く構成されておらずともよい。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、取得部110、変換部120、判定部130または補正部150を色補正装置100の外部装置としてネットワーク経由で接続するようにしてもよい。また、取得部110、変換部120、判定部130または補正部150を別の装置がそれぞれ有し、ネットワーク接続されて協働することで、上記の色補正装置100の機能を実現するようにしてもよい。
[Distribution and integration]
In addition, each component of each illustrated apparatus does not necessarily have to be physically configured as illustrated. In other words, the specific form of distribution / integration of each device is not limited to that shown in the figure, and all or a part thereof may be functionally or physically distributed or arbitrarily distributed in arbitrary units according to various loads or usage conditions. Can be integrated and configured. For example, the acquisition unit 110, the conversion unit 120, the determination unit 130, or the correction unit 150 may be connected as an external device of the color correction apparatus 100 via a network. In addition, another device has the acquisition unit 110, the conversion unit 120, the determination unit 130, or the correction unit 150, and the functions of the color correction device 100 described above are realized by cooperation through a network connection. Also good.

[色補正プログラム]
また、上記の実施例で説明した各種の処理は、予め用意されたプログラムをパーソナルコンピュータやワークステーションなどのコンピュータで実行することによって実現することができる。そこで、以下では、図11を用いて、上記の実施例と同様の機能を有する色補正プログラムを実行するコンピュータの一例について説明する。
[Color correction program]
The various processes described in the above embodiments can be realized by executing a prepared program on a computer such as a personal computer or a workstation. In the following, an example of a computer that executes a color correction program having the same function as that of the above-described embodiment will be described with reference to FIG.

図11は、実施例1及び実施例2に係る色補正プログラムを実行するコンピュータのハードウェア構成例を示す図である。図11に示すように、コンピュータ1000は、操作部1100aと、スピーカ1100bと、カメラ1100cと、ディスプレイ1200と、通信部1300とを有する。さらに、このコンピュータ1000は、CPU1500と、ROM1600と、HDD1700と、RAM1800とを有する。これら1100〜1800の各部はバス1400を介して接続される。   FIG. 11 is a diagram illustrating a hardware configuration example of a computer that executes a color correction program according to the first and second embodiments. As illustrated in FIG. 11, the computer 1000 includes an operation unit 1100a, a speaker 1100b, a camera 1100c, a display 1200, and a communication unit 1300. Further, the computer 1000 includes a CPU 1500, a ROM 1600, an HDD 1700, and a RAM 1800. These units 1100 to 1800 are connected via a bus 1400.

HDD1700には、図11に示すように、上記の実施例1で示した取得部110、変換部120、判定部130及び補正部150と同様の機能を発揮する色補正プログラム1700aが記憶される。この色補正プログラム1700aは、図1に示した取得部110、変換部120、判定部130及び補正部150の各構成要素と同様、統合又は分離してもかまわない。すなわち、HDD1700には、必ずしも上記の実施例1で示した全てのデータが格納されずともよく、処理に用いるデータがHDD1700に格納されればよい。   As illustrated in FIG. 11, the HDD 1700 stores a color correction program 1700 a that exhibits the same functions as the acquisition unit 110, the conversion unit 120, the determination unit 130, and the correction unit 150 described in the first embodiment. The color correction program 1700a may be integrated or separated as with the components of the acquisition unit 110, the conversion unit 120, the determination unit 130, and the correction unit 150 illustrated in FIG. In other words, the HDD 1700 does not necessarily store all the data shown in the first embodiment, and the HDD 1700 may store data used for processing.

このような環境の下、CPU1500は、HDD1700から色補正プログラム1700aを読み出した上でRAM1800へ展開する。この結果、色補正プログラム1700aは、図11に示すように、色補正プロセス1800aとして機能する。この色補正プロセス1800aは、RAM1800が有する記憶領域のうち色補正プロセス1800aに割り当てられた領域にHDD1700から読み出した各種データを展開し、この展開した各種データを用いて各種の処理を実行する。例えば、色補正プロセス1800aが実行する処理の一例として、図7に示す処理や実施例2で説明した処理などが含まれる。なお、CPU1500では、必ずしも上記の実施例1で示した全ての処理部が動作せずともよく、実行対象とする処理に対応する処理部が仮想的に実現されればよい。   Under such an environment, the CPU 1500 reads the color correction program 1700a from the HDD 1700 and develops it in the RAM 1800. As a result, the color correction program 1700a functions as a color correction process 1800a as shown in FIG. The color correction process 1800a expands various data read from the HDD 1700 in an area allocated to the color correction process 1800a in the storage area of the RAM 1800, and executes various processes using the expanded data. For example, as an example of processing executed by the color correction process 1800a, the processing shown in FIG. 7 and the processing described in the second embodiment are included. Note that the CPU 1500 does not necessarily operate all the processing units described in the first embodiment, and it is only necessary to virtually realize a processing unit corresponding to a process to be executed.

なお、上記の色補正プログラム1700aは、必ずしも最初からHDD1700やROM1600に記憶されておらずともかまわない。例えば、コンピュータ1000に挿入されるフレキシブルディスク、いわゆるFD、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させる。そして、コンピュータ1000がこれらの可搬用の物理媒体から各プログラムを取得して実行するようにしてもよい。また、公衆回線、インターネット、LAN、WANなどを介してコンピュータ1000に接続される他のコンピュータまたはサーバ装置などに各プログラムを記憶させておき、コンピュータ1000がこれらから各プログラムを取得して実行するようにしてもよい。   Note that the color correction program 1700a is not necessarily stored in the HDD 1700 or the ROM 1600 from the beginning. For example, each program is stored in a “portable physical medium” such as a flexible disk inserted into the computer 1000, so-called FD, CD-ROM, DVD disk, magneto-optical disk, or IC card. Then, the computer 1000 may acquire and execute each program from these portable physical media. Each program is stored in another computer or server device connected to the computer 1000 via a public line, the Internet, a LAN, a WAN, etc., and the computer 1000 acquires and executes each program from these. It may be.

1 色補正システム
10 設定装置
11 第1取得部
12 第2取得部
13 特定部
14 変換部
15 補正データ設定部
16 分離条件設定部
100 色補正装置
110 取得部
120 変換部
130 判定部
140 分離条件記憶部
150 補正部
160 補正データ記憶部
DESCRIPTION OF SYMBOLS 1 Color correction system 10 Setting apparatus 11 1st acquisition part 12 2nd acquisition part 13 Specification part 14 Conversion part 15 Correction data setting part 16 Separation condition setting part 100 Color correction apparatus 110 Acquisition part 120 Conversion part 130 Determination part 140 Separation condition memory | storage 150 correction unit 160 correction data storage unit

Claims (10)

画像を取得する取得部と、
画像を輝度及び色度を含む色空間の成分へ変換する変換部と、
前記色空間の成分へ変換された画像に含まれる画素ごとに、当該画素が色度成分及び輝度成分に関する分離条件を満たすか否かにより、当該画素が赤外光の分光反射率が高い第1の被写体または前記第1の被写体以外の他の被写体のいずれに対応するかを判定する判定部と
を有することを特徴とする色補正装置。
An acquisition unit for acquiring images;
A conversion unit for converting an image into a component of a color space including luminance and chromaticity;
For each pixel included in the image converted into the color space component, the pixel has a high spectral reflectance of infrared light depending on whether the pixel satisfies the separation condition regarding the chromaticity component and the luminance component. And a determination unit that determines whether the subject corresponds to the subject other than the first subject or the subject other than the first subject.
前記第1の被写体と、前記色空間上で色の分布が前記第1の被写体と類似する第2の被写体とが可視光および赤外光の波長に対応する光を含む状態で撮像されたサンプル画像上で前記第1の被写体に対応する第1の領域が色空間上で定義された第1の分離条件を記憶する第1記憶部と、
前記第1の被写体に対応する第1の領域と前記第2の被写体に対応する第2の領域とを分離する輝度成分の閾値が定義された第2の分離条件を記憶する第2記憶部とをさらに有し、
前記判定部は、前記第1記憶部に記憶された第1の分離条件を参照して、前記画素の色成分が前記色空間上の前記第1の領域に含まれるか否かを判定し、前記画素の色成分が前記色空間上の前記第1の領域に含まれる場合に、前記第2記憶部に記憶された第2の分離条件を参照して、前記画素の輝度成分が前記閾値を超えるか否かを判定することにより、当該画素が前記第1の被写体または前記他の被写体のいずれに対応するかを判定することを特徴とする請求項1に記載の色補正装置。
A sample in which the first subject and a second subject whose color distribution is similar to the first subject in the color space include light corresponding to wavelengths of visible light and infrared light A first storage unit that stores a first separation condition in which a first region corresponding to the first subject on the image is defined in a color space;
A second storage unit that stores a second separation condition in which a threshold value of a luminance component that separates the first region corresponding to the first subject and the second region corresponding to the second subject is defined; Further comprising
The determination unit refers to the first separation condition stored in the first storage unit, determines whether or not the color component of the pixel is included in the first region on the color space, When the color component of the pixel is included in the first area on the color space, the luminance component of the pixel has the threshold value with reference to the second separation condition stored in the second storage unit. The color correction apparatus according to claim 1, wherein it is determined whether the pixel corresponds to the first subject or the other subject by determining whether or not the pixel exceeds.
前記第2の分離条件は、前記第1の領域に含まれる画素が持つ輝度値から生成される輝度のヒストグラムと前記第2の領域に含まれる画素が持つ輝度値から生成される輝度のヒストグラムとを分離する輝度成分の閾値が設定されることを特徴とする請求項2に記載の色補正装置。   The second separation condition includes a luminance histogram generated from luminance values of pixels included in the first area, and a luminance histogram generated from luminance values of pixels included in the second area. The color correction apparatus according to claim 2, wherein a threshold value of a luminance component for separating the color is set. 前記判定部により前記画素の輝度成分が前記閾値を超えると判定された場合に、前記第1の被写体用の色補正を実行し、前記画素の色成分が前記色空間上の前記第1の領域に含まれない場合または前記画素の輝度成分が前記閾値を超えないと判定された場合に、前記第1の被写体用の色補正とは異なる色補正を実行する補正部をさらに有することを特徴とする請求項2または3に記載の色補正装置。   When the determination unit determines that the luminance component of the pixel exceeds the threshold, color correction for the first subject is performed, and the color component of the pixel is the first region on the color space. And a correction unit that performs color correction different from the color correction for the first subject when it is determined that the luminance component of the pixel does not exceed the threshold value. The color correction apparatus according to claim 2 or 3. 前記判定部は、前記第1の被写体が可視光および赤外光の波長に対応する光を含む状態で撮像されたサンプル画像上の第1の被写体に対応する第1の領域が持つ輝度値から生成される輝度のヒストグラムが前記第1の被写体に対応するか否かの確率として定義された確率分布を参照し、前記画素の輝度成分が前記第1の被写体に対応する確率を算出することを特徴とする請求項1に記載の色補正装置。   The determination unit determines a luminance value of a first region corresponding to the first subject on the sample image captured in a state where the first subject includes light corresponding to wavelengths of visible light and infrared light. Calculating a probability that a luminance component of the pixel corresponds to the first subject with reference to a probability distribution defined as a probability of whether or not a generated luminance histogram corresponds to the first subject. The color correction apparatus according to claim 1, wherein the color correction apparatus is a color correction apparatus. 前記画素の輝度成分が前記第1の被写体に対応する確率に応じて前記第1の被写体用の色補正と、前記第1の被写体用の色補正とは異なる色補正とを混合する比率を変えて色補正を行う補正部をさらに有することを特徴とする請求項5に記載の色補正装置。   The ratio of mixing the color correction for the first subject and the color correction different from the color correction for the first subject is changed according to the probability that the luminance component of the pixel corresponds to the first subject. The color correction apparatus according to claim 5, further comprising a correction unit that performs color correction. 前記第1の被写体が可視光および赤外光の波長に対応する光を含む状態で撮像されたサンプル画像上の第1の被写体に対応する第1の領域が輝度及び色度を含む3次元空間上で近似された楕円体を記憶する記憶部をさらに有し、
前記判定部は、前記記憶部を参照して、前記画素が前記3次元空間上の楕円体に含まれるか否かにより、当該画素が前記第1の被写体または前記他の被写体のいずれに対応するかを判定することを特徴とする請求項1に記載の色補正装置。
A three-dimensional space in which the first region corresponding to the first subject on the sample image captured in a state where the first subject includes light corresponding to wavelengths of visible light and infrared light includes luminance and chromaticity A storage unit for storing the ellipsoid approximated above;
The determination unit refers to the storage unit, and the pixel corresponds to either the first subject or the other subject depending on whether the pixel is included in the ellipsoid in the three-dimensional space. The color correction apparatus according to claim 1, wherein the color correction apparatus determines whether or not.
前記判定部は、前記第1の被写体が可視光および赤外光の波長に対応する光を含む状態で撮像されたサンプル画像上の第1の被写体に対応する第1の領域内の画素が輝度及び色度を含む3次元空間上で点在する分布の平均及び分散から算出された確率密度分布を参照して、前記画素が前記第1の被写体に対応する確率を算出することを特徴とする請求項1に記載の色補正装置。   In the determination unit, pixels in the first region corresponding to the first subject on the sample image captured in a state where the first subject includes light corresponding to wavelengths of visible light and infrared light are luminance The probability that the pixel corresponds to the first subject is calculated with reference to a probability density distribution calculated from an average and a variance of a distribution scattered in a three-dimensional space including chromaticity. The color correction apparatus according to claim 1. コンピュータが、
画像を取得し、
画像を輝度及び色度を含む色空間の成分へ変換し、
前記色空間の成分へ変換された画像に含まれる画素ごとに、当該画素が色度成分及び輝度成分に関する分離条件を満たすか否かにより、当該画素が赤外光の分光反射率が高い第1の被写体または前記第1の被写体以外の他の被写体のいずれに対応するかを判定する
処理を実行することを特徴とする色補正方法。
Computer
Get an image,
Convert the image into color space components including brightness and chromaticity,
For each pixel included in the image converted into the color space component, the pixel has a high spectral reflectance of infrared light depending on whether the pixel satisfies the separation condition regarding the chromaticity component and the luminance component. A process for determining whether to correspond to a subject other than the first subject or a subject other than the first subject is performed.
コンピュータに、
画像を取得し、
画像を輝度及び色度を含む色空間の成分へ変換し、
前記色空間の成分へ変換された画像に含まれる画素ごとに、当該画素が色度成分及び輝度成分に関する分離条件を満たすか否かにより、当該画素が赤外光の分光反射率が高い第1の被写体または前記第1の被写体以外の他の被写体のいずれに対応するかを判定する
処理を実行させることを特徴とする色補正プログラム。
On the computer,
Get an image,
Convert the image into color space components including brightness and chromaticity,
For each pixel included in the image converted into the color space component, the pixel has a high spectral reflectance of infrared light depending on whether the pixel satisfies the separation condition regarding the chromaticity component and the luminance component. A color correction program for executing a process of determining which one of the subject and the other subject other than the first subject corresponds.
JP2015094079A 2015-05-01 2015-05-01 Color correction apparatus, color correction method, and color correction program Active JP6398860B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015094079A JP6398860B2 (en) 2015-05-01 2015-05-01 Color correction apparatus, color correction method, and color correction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015094079A JP6398860B2 (en) 2015-05-01 2015-05-01 Color correction apparatus, color correction method, and color correction program

Publications (2)

Publication Number Publication Date
JP2016213596A true JP2016213596A (en) 2016-12-15
JP6398860B2 JP6398860B2 (en) 2018-10-03

Family

ID=57550127

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015094079A Active JP6398860B2 (en) 2015-05-01 2015-05-01 Color correction apparatus, color correction method, and color correction program

Country Status (1)

Country Link
JP (1) JP6398860B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112164005A (en) * 2020-09-24 2021-01-01 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium
WO2021241223A1 (en) * 2020-05-26 2021-12-02 ソニーグループ株式会社 Image processing device and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007214933A (en) * 2006-02-10 2007-08-23 Fujifilm Corp Color image pickup device and its control method
JP2014200045A (en) * 2013-03-29 2014-10-23 富士通株式会社 Correction data generation device, correction data generation program, and color correction device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007214933A (en) * 2006-02-10 2007-08-23 Fujifilm Corp Color image pickup device and its control method
JP2014200045A (en) * 2013-03-29 2014-10-23 富士通株式会社 Correction data generation device, correction data generation program, and color correction device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021241223A1 (en) * 2020-05-26 2021-12-02 ソニーグループ株式会社 Image processing device and method
CN112164005A (en) * 2020-09-24 2021-01-01 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium
CN112164005B (en) * 2020-09-24 2023-03-17 Oppo(重庆)智能科技有限公司 Image color correction method, device, equipment and storage medium

Also Published As

Publication number Publication date
JP6398860B2 (en) 2018-10-03

Similar Documents

Publication Publication Date Title
EP3477931B1 (en) Image processing method and device, readable storage medium and electronic device
US10303983B2 (en) Image recognition apparatus, image recognition method, and recording medium
US9858680B2 (en) Image processing device and imaging apparatus
JP4902562B2 (en) Imaging apparatus, image processing apparatus, control method, and program
US11321830B2 (en) Image detection method and apparatus and terminal
US10929961B2 (en) Electronic device and method for correcting images using external electronic device
CN109712177B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP6818463B2 (en) Image processing equipment, image processing methods and programs
KR102383129B1 (en) Method for correcting image based on category and recognition rate of objects included image and electronic device for the same
CN107871309B (en) Detection method, detection device, and recording medium
WO2022160895A1 (en) Image processing method, image processing apparatus, electronic system and readable storage medium
US9911060B2 (en) Image processing apparatus, image processing method, and storage medium for reducing color noise in an image
JP6398860B2 (en) Color correction apparatus, color correction method, and color correction program
US10217193B2 (en) Image processing apparatus, image capturing apparatus, and storage medium that stores image processing program
CN109729259B (en) Image processing apparatus, method thereof, system thereof, and computer readable medium
JP6531522B2 (en) Color correction program, color correction method and color correction apparatus
JP6094333B2 (en) Correction data generation apparatus, correction data generation program, and color correction apparatus
CN113781330A (en) Image processing method, device and electronic system
US11640663B1 (en) Method of determining suitability of skin analysis image and apparatus therefor
JP6326841B2 (en) Image processing apparatus, imaging apparatus, and image processing program
WO2023283855A1 (en) Super resolution based on saliency
EP3528202B1 (en) Image processing apparatus, image processing method, and program
JP2010197968A (en) Focus evaluation apparatus, camera and program
JP6405638B2 (en) Subject detection device, imaging device, and program
JP2019036972A (en) Subject detection device, imaging device and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180206

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180807

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180820

R150 Certificate of patent or registration of utility model

Ref document number: 6398860

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150