JP6252014B2 - Gamma characteristic estimation apparatus, method and program - Google Patents
Gamma characteristic estimation apparatus, method and program Download PDFInfo
- Publication number
- JP6252014B2 JP6252014B2 JP2013157882A JP2013157882A JP6252014B2 JP 6252014 B2 JP6252014 B2 JP 6252014B2 JP 2013157882 A JP2013157882 A JP 2013157882A JP 2013157882 A JP2013157882 A JP 2013157882A JP 6252014 B2 JP6252014 B2 JP 6252014B2
- Authority
- JP
- Japan
- Prior art keywords
- function
- light source
- light
- gamma characteristic
- camera
- 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.)
- Expired - Fee Related
Links
Landscapes
- Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
- Studio Devices (AREA)
Description
本発明は、ガンマ特性推定装置、方法及びプログラムに関する。 The present invention relates to a gamma characteristic estimation apparatus, method, and program.
デジタルカメラを用いた計測が各種分野で行われている。フォトメトリックステレオ法(Photometric Stereo Technique)は、対象物に3方向以上の方向から光を照射し、対象物の陰影状態から法線ベクトルを求め、対象物の形状を再現する。このため、デジタルカメラを用いて例えばフォトメトリックステレオ法などの計測を行う場合、デジタルカメラへの入射光量に対するデジタルカメラの出力値(例えば、撮影画像のデジタルRGB値)の関係が既知でないと、高精度な計測を行うことは難しい。 Measurements using digital cameras are performed in various fields. In the photometric stereo technique, the object is irradiated with light from three or more directions, a normal vector is obtained from the shadow state of the object, and the shape of the object is reproduced. For this reason, when performing a measurement such as a photometric stereo method using a digital camera, the relationship between the output value of the digital camera (for example, the digital RGB value of the photographed image) with respect to the amount of light incident on the digital camera is not known. It is difficult to measure accurately.
一般的に、デジタルカメラへの入射光量とデジタルカメラの出力値は非線形の関係にあり、この非線形な関係をガンマ特性とも言う。デジタルカメラを計測に用いる場合、このガンマ特性を取得しておき、入射光量と出力値が線形な関係となるようにガンマ特性を用いた補正(所謂ガンマ補正)を行わないと、計測精度が低下してしまう。しかし、一般的には、デジタルカメラがどのような画像補正を行っているのかは操作マニュアルなどに書かれていないため、デジタルカメラのユーザが操作マニュアルなどから画像補正の詳細を知ることはできない。 In general, the amount of light incident on a digital camera and the output value of the digital camera have a non-linear relationship, and this non-linear relationship is also referred to as a gamma characteristic. When using a digital camera for measurement, if this gamma characteristic is acquired and correction using the gamma characteristic (so-called gamma correction) is not performed so that the incident light quantity and the output value have a linear relationship, the measurement accuracy is reduced. Resulting in. However, in general, what kind of image correction the digital camera is performing is not written in the operation manual or the like, so the user of the digital camera cannot know the details of the image correction from the operation manual or the like.
また、デジタルカメラのガンマ特性は、生産ロットの違い、カメラアプリケーションのバージョンの違いなどにより、個々のデジタルカメラで異なることが多い。このため、例えばデジタルカメラを用いてフォトメトリックステレオ法などの計測を行う場合、計測システム毎にガンマ特性を取得する必要がある。 In addition, the gamma characteristics of digital cameras often differ from one digital camera to another due to differences in production lots and camera application versions. For this reason, for example, when a measurement such as a photometric stereo method is performed using a digital camera, it is necessary to acquire a gamma characteristic for each measurement system.
ガンマ特性の取得方法には、デジタルカメラの絞りまたは露光時間を調整して入力光量を変化させた場合の出力値の変化からガンマ特性を取得する方法、反射率が既知であるマクベスチャートなどのカラーチャートを撮影した際の出力値の変化からガンマ特性を取得する方法、正確な出射光量が既知である光源の出射光量を変化させた場合の出力値の変化からガンマ特性を取得する方法などがある。これらの方法のように、デジタルカメラへの入射光量を特定することで、ガンマ特性を取得することができる。 Gamma characteristics can be acquired by acquiring the gamma characteristics from changes in the output value when the input light quantity is changed by adjusting the aperture or exposure time of a digital camera, or by using a color such as a Macbeth chart with a known reflectance. There are a method for obtaining gamma characteristics from changes in output values when a chart is photographed, a method for obtaining gamma characteristics from changes in output values when changing the amount of emitted light from a light source whose accurate amount of emitted light is known, etc. . The gamma characteristic can be acquired by specifying the amount of light incident on the digital camera as in these methods.
しかし、コンパクトデジタルカメラ、スマートフォンに搭載されているデジタルカメラなどのデジタルカメラは、絞りまたは露光時間を調整する機能を備えていない場合が多く、調整機能を新たに設けるのではコストがかかる。また、反射率をあらかじめ測定したマクベスチャートなどのカラーチャートを用いる場合、カラーチャートを準備しておくコストがかかる(例えば、非特許文献1)。さらに、正確な出射光量が既知である光源を用いる場合、光源自体が比較的高価である。これは、印加する電圧に応じて出射光量を調整する光源の場合、電圧と出射光量は必ずしも比例しないので、電圧と出射光量の関係は出射光量の変化を照度計などを用いて計測しないと特定できないため、その分コストがかかるからである。つまり、照度計などで計測した出射光量の変化を光源にフィードバックして印加する電圧を調整することで正確な出射光量が既知となるが、構成が複雑化する分コストがかかる。このように、上記の如きガンマ特性の推定方法では、デジタルカメラへの正確な入射光量に対する出力値のプロットからガンマ特性を求めるため、コストがかかり、較正が難しい場合もある。 However, in many cases, a digital camera such as a compact digital camera or a digital camera mounted on a smartphone does not have a function of adjusting an aperture or exposure time, and it is expensive to newly provide an adjustment function. Further, when a color chart such as a Macbeth chart whose reflectance is measured in advance is used, a cost for preparing the color chart is required (for example, Non-Patent Document 1). Furthermore, when using a light source with a known accurate amount of emitted light, the light source itself is relatively expensive. This is because in the case of a light source that adjusts the amount of emitted light according to the voltage to be applied, the voltage and the amount of emitted light are not necessarily proportional, so the relationship between the voltage and the amount of emitted light is specified unless the change in the amount of emitted light is measured using an illuminometer or the like. This is because it cannot be done, and the cost increases accordingly. In other words, the exact amount of emitted light is known by adjusting the voltage applied by feeding back the change in the amount of emitted light measured by an illuminometer or the like to the light source. However, the cost increases because the configuration is complicated. As described above, in the gamma characteristic estimation method as described above, since the gamma characteristic is obtained from the plot of the output value with respect to the accurate incident light quantity to the digital camera, the cost is high and the calibration may be difficult.
従来のガンマ特性の取得方法では、カメラへの入射光量を特定することでガンマ特性を取得するため、コストがかかる。 In the conventional method for obtaining gamma characteristics, since the gamma characteristics are obtained by specifying the amount of light incident on the camera, the cost is high.
そこで、本発明は、比較的低コストでガンマ特性を推定可能なガンマ特性推定装置、方法及びプログラムを提供することを目的とする。 Therefore, an object of the present invention is to provide a gamma characteristic estimation apparatus, method, and program capable of estimating a gamma characteristic at a relatively low cost.
本発明の一観点によれば、第1及び第2の光源からの光を照射される対象物を撮影するカメラと、前記第1及び第2の光源のオン・オフを制御する制御部と、前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定するデータ処理部を備えたガンマ特性推定装置が提供される。 According to one aspect of the present invention, a camera that captures an object irradiated with light from the first and second light sources, a control unit that controls on / off of the first and second light sources, When the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are on A data processing unit that applies an output value of the camera when the object is photographed to an expected function, and estimates a gamma characteristic from a function in which the amount of light obtained from the inverse function of the expected function is most likely An apparatus for estimating gamma characteristics is provided.
開示のガンマ特性推定装置、方法及びプログラムによれば、比較的低コストでガンマ特性を推定することができる。 According to the disclosed gamma characteristic estimation apparatus, method, and program, the gamma characteristic can be estimated at a relatively low cost.
開示のガンマ特性推定装置、方法及びプログラムでは、第1の光源がオンで第2の光源がオフの状態、第1の光源がオフで第2の光源がオンの状態、及び第1及び第2の光源がオンの状態で対象物を撮影した時のデジタルカメラの出力値を予想される関数に当てはめ、この予想される関数の逆関数から求めた光量が最も尤もらしくなる関数(以下、「最尤関数」とも言う)からガンマ特性を推定する。 In the disclosed gamma characteristic estimation apparatus, method, and program, the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second By applying the output value of the digital camera when the object is photographed with the light source on to an expected function, the light quantity obtained from the inverse function of this expected function is the most likely Gamma characteristics are estimated from the “likelihood function”.
以下に、開示のガンマ特性推定装置、方法及びプログラムの各実施例を図面と共に説明する。 Embodiments of the disclosed gamma characteristic estimation apparatus, method, and program will be described below with reference to the drawings.
図1は、一実施例におけるガンマ特性推定方法を説明する図である。図1において、ガンマ特性推定装置1は、電源2、スイッチ3,4、第1の光源5−1、第2の光源5−2、カメラの一例であるデジタルカメラ6、及びデータ処理部7を有する。第1及び第2の光源5−1,5−2は、少なくとも2つの光源の一例であり、3以上の光源を設けても良い。後述するように、デジタルカメラ6及びデータ処理部7は、別体の装置で形成しても、これらが一体的に設けられた装置で形成しても良い。後述するように、スマートフォン、タブレット型コンピュータ、パーソナルコンピュータなどの電子装置は、ガンマ特性推定装置1の一部または全部を有しても良い。さらに、例えばデータ処理部7への負荷を軽減するために、データ処理部7の少なくとも一部の機能をクラウドコンピューティングシステムなどの外部装置で実現するようにしても良い。 FIG. 1 is a diagram for explaining a gamma characteristic estimation method in one embodiment. In FIG. 1, a gamma characteristic estimation apparatus 1 includes a power source 2, switches 3 and 4, a first light source 5-1, a second light source 5-2, a digital camera 6 that is an example of a camera, and a data processing unit 7. Have. The first and second light sources 5-1 and 5-2 are examples of at least two light sources, and three or more light sources may be provided. As will be described later, the digital camera 6 and the data processing unit 7 may be formed by separate devices or may be formed by a device in which these are integrally provided. As will be described later, an electronic device such as a smartphone, a tablet computer, or a personal computer may include a part or all of the gamma characteristic estimation device 1. Furthermore, for example, in order to reduce the load on the data processing unit 7, at least a part of the functions of the data processing unit 7 may be realized by an external device such as a cloud computing system.
第1の光源5−1は、スイッチ4を介してオン・オフ可能である。一方、第2の光源5−2は、スイッチ3を介してオン・オフ可能である。スイッチ3,4のオン・オフは、例えばデジタルカメラ6により制御しても、データ処理部7により制御しても、デジタルカメラ6及びデータ処理部7の組み合わせにより制御しても、手動で制御しても良い。つまり、データ処理部7またはデジタルカメラ6は、スイッチ3,4のオン・オフを制御する制御部の一例を形成しても良い。デジタルカメラ6は、光源5−1,5−2が出射する光を照射された対象物9からの反射光を受光することで対象物9を撮影する。デジタルカメラ6は、撮影した対象物9を表すデジタル出力値をデータ処理部7に出力する。データ処理部7は、汎用のプロセッサなどで形成可能であり、デジタル出力値に基づき、ガンマ特性推定処理を含む各種演算、計測などを含むデータ処理を行う。推定したガンマ特性は、デジタルカメラ6のデジタル出力値を補正するのに利用でき、補正されたデジタル出力値は、例えば対象物9の立体形状の認識などに使用しても良い。 The first light source 5-1 can be turned on / off via the switch 4. On the other hand, the second light source 5-2 can be turned on / off via the switch 3. The on / off of the switches 3 and 4 is manually controlled, for example, controlled by the digital camera 6, controlled by the data processing unit 7, or controlled by the combination of the digital camera 6 and the data processing unit 7. May be. That is, the data processing unit 7 or the digital camera 6 may form an example of a control unit that controls on / off of the switches 3 and 4. The digital camera 6 captures the object 9 by receiving the reflected light from the object 9 irradiated with the light emitted from the light sources 5-1 and 5-2. The digital camera 6 outputs a digital output value representing the photographed object 9 to the data processing unit 7. The data processing unit 7 can be formed by a general-purpose processor or the like, and performs data processing including various calculations including gamma characteristic estimation processing and measurement based on the digital output value. The estimated gamma characteristic can be used to correct the digital output value of the digital camera 6, and the corrected digital output value may be used for, for example, recognition of the three-dimensional shape of the object 9.
本実施例では、第1及び第2の光源5−1,5−2の出力特性(または、出射光量)は未知で良い。また、対象物9の反射率も未知で良い。 In the present embodiment, the output characteristics (or emitted light amounts) of the first and second light sources 5-1 and 5-2 may be unknown. Further, the reflectance of the object 9 may be unknown.
まず、ガンマ特性について説明する。デジタルカメラ6への入射光量をx、定数をα、デジタルカメラ6の出力値の一例であるデジタル出力RGB値(以下、単に「出力RGB値」とも言う)をy、ガンマ特性をγで表すと、ガンマ特性γは、一般的には入射光量xに対してy=αxγの関係にあり、例えば図2の関係が成り立つ。図2は、ガンマ特性を説明する図であり、縦軸はデジタルカメラ6から出力される出力RGB値、横軸はデジタルカメラ6への入射光量を夫々任意単位で示す。ガンマ特性は、図2の如き関数に限定されるものではないが、未知であることが多い。以下に説明する例では、デジタルカメラ6の出力RGB値は例えば8ビットであり、デジタルカメラ6から出力される出力RGB値は例えば「0」〜「255」までの値を取り得るものとする。 First, the gamma characteristic will be described. The incident light quantity to the digital camera 6 is represented by x, the constant is represented by α, the digital output RGB value (hereinafter simply referred to as “output RGB value”) as an example of the output value of the digital camera 6 is represented by y, and the gamma characteristic is represented by γ. The gamma characteristic γ is generally in a relationship of y = αx γ with respect to the incident light quantity x, for example, the relationship of FIG. FIG. 2 is a diagram for explaining the gamma characteristic, where the vertical axis indicates the output RGB values output from the digital camera 6, and the horizontal axis indicates the amount of light incident on the digital camera 6 in arbitrary units. The gamma characteristic is not limited to a function as shown in FIG. 2, but is often unknown. In the example described below, the output RGB value of the digital camera 6 is, for example, 8 bits, and the output RGB value output from the digital camera 6 can take values from “0” to “255”, for example.
図3は、光源の出力特性の一例を説明する図である。図3中、縦軸(例えば、y軸)は光源の出射光量、横軸(例えば、x軸)は光源への印加電圧を夫々任意単位で示す。第1及び第2の光源5−1,5−2は、夫々例えば図3に示す如き出力特性を有するが、固体バラツキがあり、実際の出力特性は未知であることが多い。本実施例では、このように各光源5−1,5−2の出力特性が未知であっても、ガンマ特性を演算(または、計算)により推定可能とするものである。 FIG. 3 is a diagram illustrating an example of output characteristics of the light source. In FIG. 3, the vertical axis (for example, the y axis) represents the amount of light emitted from the light source, and the horizontal axis (for example, the x axis) represents the voltage applied to the light source in arbitrary units. Each of the first and second light sources 5-1 and 5-2 has output characteristics as shown in FIG. 3, for example, but there are variations in solids, and the actual output characteristics are often unknown. In this embodiment, the gamma characteristics can be estimated by calculation (or calculation) even if the output characteristics of the light sources 5-1 and 5-2 are unknown.
図4は、ガンマ特性推定処理の手順の一例を説明する図である。図4において、ステップST1では、スイッチ4,3が第1及び第2の光源5−1,5−2をオフにし、デジタルカメラ6が対象物9を撮影する。ステップST2では、第2の光源5−2がオフの状態で、スイッチ4が第1の光源5−1をオンにして一定の第1の出射光量で発光させ、デジタルカメラ6が対象物9を撮影する。ステップST3では、スイッチ4が第1の光源5−1はオフにすると共に、スイッチ3が第2の光源5−2をオンにして一定の第2の出射光量で発光させ、デジタルカメラ6が対象物9を撮影する。ステップST4では、第2の光源5−2を第2の出射光量で発光させた状態で、スイッチ4が第1の光源5−1をオンにして第1の出射光量で発光させ、デジタルカメラ6が対象物9を撮影する。つまり、ステップST4では、第1及び第2の光源5−1,5−2の両方を発光させた状態で、デジタルカメラ6が対象物9を撮影する。出力RGB値の最大値は、上記の如くデジタルカメラ6の出力RGB値が例えば8ビットであれば、「255」である。デジタルカメラ6は、各ステップST1〜ST4において少なくとも1回対象物9を撮影すれば良く、例えば各ステップST1〜ST4において一定間隔で対象物9を撮影しても、連続的に撮影しても良い。 FIG. 4 is a diagram for explaining an example of the procedure of gamma characteristic estimation processing. In FIG. 4, in step ST <b> 1, the switches 4 and 3 turn off the first and second light sources 5-1 and 5-2, and the digital camera 6 captures the object 9. In step ST2, the second light source 5-2 is turned off, the switch 4 turns on the first light source 5-1, and emits light with a constant first emitted light amount. The digital camera 6 causes the object 9 to move. Take a picture. In step ST3, the switch 4 turns off the first light source 5-1, and the switch 3 turns on the second light source 5-2 to emit light with a constant second emitted light amount. Photograph the object 9. In step ST4, in a state where the second light source 5-2 emits light with the second emitted light amount, the switch 4 turns on the first light source 5-1 to emit light with the first emitted light amount. Shoots the object 9. That is, in step ST4, the digital camera 6 images the object 9 in a state where both the first and second light sources 5-1 and 5-2 emit light. The maximum value of the output RGB value is “255” if the output RGB value of the digital camera 6 is, for example, 8 bits as described above. The digital camera 6 may shoot the object 9 at least once in each step ST1 to ST4. For example, the digital camera 6 may shoot the object 9 at regular intervals or continuously shoot in each step ST1 to ST4. .
ステップST1〜ST4におけるスイッチ3,4及びカメラ6の制御は、後述するようにプロセッサなどが行うようにしても良く、プロセッサなどはさらにデータ処理部7のガンマ特性推定処理を行うようにしても良い。 Control of the switches 3 and 4 and the camera 6 in steps ST1 to ST4 may be performed by a processor or the like as will be described later, and the processor or the like may further perform gamma characteristic estimation processing of the data processing unit 7. .
なお、第1の出射光量は、第2の出射光量と同じであっても、第2の出射光量と異なっても良い。後者の場合、第1の出射光量は第2の出射光量より高くても、第2の出射光量より低くても良い。 The first emitted light amount may be the same as the second emitted light amount or may be different from the second emitted light amount. In the latter case, the first emitted light amount may be higher than the second emitted light amount or lower than the second emitted light amount.
図5は、上記のガンマ特性推定処理を説明する図である。図5中、縦軸は対象物9が照射される光量、横軸は時間(各ステップST2〜ST4の推移)を夫々任意単位で示す。図5において、左下がりのハッチングで示される光量は、各ステップST2,ST4において対象物9に照射される第1の光源5−1による第1の出射光量を示し、右下がりのハッチングで示される光量は、各ステップST3,ST4において対象物9に照射される第2の光源5−2による第2の出射光量を示す。 FIG. 5 is a diagram for explaining the above gamma characteristic estimation processing. In FIG. 5, the vertical axis indicates the amount of light irradiated on the object 9, and the horizontal axis indicates time (transition of steps ST <b> 2 to ST <b> 4) in arbitrary units. In FIG. 5, the light amount indicated by the left-down hatching indicates the first emitted light amount by the first light source 5-1 irradiated on the object 9 in each of steps ST2 and ST4, and is indicated by the right-down hatching. The amount of light indicates the second amount of light emitted from the second light source 5-2 irradiated on the object 9 in each of steps ST3 and ST4.
なお、図5では、ステップST1において第1及び第2の光源5−1,5−2の両方がオフであると対象物9が照射される光量がゼロ(0)であるものと仮定しているが、第1及び第2の光源5−1,5−2以外の光源(図示せず)により光量がゼロではなくても良い。 In FIG. 5, it is assumed that the amount of light emitted to the object 9 is zero (0) when both the first and second light sources 5-1 and 5-2 are off in step ST 1. However, the amount of light may not be zero by a light source (not shown) other than the first and second light sources 5-1 and 5-2.
図5の右端には、ガンマ特性がy=αxγなる関数で表され、且つ、γ=1である場合にステップST4において対象物9に照射される合計出射光量を、比較のため破線STLで示す。γ=1でありデジタルカメラ6への入射光量xと出力RGB値yとが線形関係にある場合、第1の光源5−1がオンであり第2の光源5−2がオフである時の出力RGB値y(ST2)と、第2の光源5−2がオンであり第1の光源5−1がオフである時の出力RGB値y(ST3)とを足し合せた値(STL)は、第1及び第2の光源5−1,5−2の両方がオンある時の出力RGB値yと同じになる。 At the right end of FIG. 5, is represented by a function gamma characteristics becomes y = .alpha.x gamma, and the total emission amount of light radiated in the case of gamma = 1 to the object 9 in step ST4, by the broken line STL for comparison Show. When γ = 1 and the incident light amount x to the digital camera 6 and the output RGB value y are in a linear relationship, the first light source 5-1 is on and the second light source 5-2 is off. A value (STL) obtained by adding the output RGB value y (ST2) and the output RGB value y (ST3) when the second light source 5-2 is on and the first light source 5-1 is off is The output RGB value y is the same when both the first and second light sources 5-1 and 5-2 are on.
しかし、例えばγ<1の場合には、図5に示すように、第1の光源5−1がオンであり第2の光源5−2がオフである時の出力RGB値y(ST2)と、第2の光源5−2がオンであり第1の光源5−1がオフである時の出力RGB値y(ST3)とを足し合せた値(STL)の方が、第1及び第2の光源5−1,5−2の両方がオンである時の出力RGB値y(ST4)より大きくなる。本実施例では、上記の如く足し合わせた値(STL)が第1及び第2の光源5−1,5−2の両方がオンである時の出力RGB値y(ST4)より大きくなる度合いから、γの値を撮影画像の一部または全部を用いて推定する。例えば、推定したγの値から、第1の光源5−1のみがオンである時の出力RGB値y(ST2)と第2の光源5−2のみがオンである時の出力RGB値y(ST3)の光量を推定する。そして、これらの出力RGB値y(ST2,ST3)の推定された光量を足し合せた光量から計算できる第1及び第2の光源6−1,5−2の両方がオンである時の出力RGB値yの計算値と、第1及び第2の光源5−1,5−2の両方がオンである時にデジタルカメラ6による実際の撮影で得られた出力RGB値yの実測値とを比較し、計算値と実測値の差の二乗(即ち、二乗誤差)を計算する。全ての二乗誤差を足し合せる処理を評価関数で表すことで、計算モデルと実測モデルとを比較する最小二乗法により評価関数を求めることができる。 However, for example, when γ <1, the output RGB value y (ST2) when the first light source 5-1 is on and the second light source 5-2 is off as shown in FIG. The value (STL) obtained by adding the output RGB value y (ST3) when the second light source 5-2 is on and the first light source 5-1 is off is the first and second values. Output RGB value y (ST4) when both of the light sources 5-1 and 5-2 are on. In this embodiment, the value (STL) added as described above is greater than the output RGB value y (ST4) when both the first and second light sources 5-1 and 5-2 are on. , Γ values are estimated using part or all of the captured image. For example, from the estimated value of γ, the output RGB value y (ST2) when only the first light source 5-1 is on and the output RGB value y (ST2) when only the second light source 5-2 is on. ST3) is estimated. The output RGB when both the first and second light sources 6-1 and 5-2 that can be calculated from the light amount obtained by adding the estimated light amounts of these output RGB values y (ST 2 and ST 3) are on. The calculated value y is compared with the actual measured value of the output RGB value y obtained by actual shooting by the digital camera 6 when both the first and second light sources 5-1 and 5-2 are on. The square of the difference between the calculated value and the actually measured value (that is, the square error) is calculated. By expressing the process of adding all the square errors as an evaluation function, the evaluation function can be obtained by the least square method for comparing the calculation model and the actual measurement model.
上記の評価関数を最小にすることで、計算モデルを実測モデルに近づけることができる。実測モデルの関数がy=αxγであれば、変数が1つ(γ)なので、理論的には1画素でもγの値を計算により推定することができる。しかし、実際にはノイズ、量子化誤差などのため1画素ではγの値を正確に推定することは難しい。また、デジタルカメラ6では、補正計算を簡単にするためにガンマ特性は折れ線状、二次関数などであることもある。さらに、計算モデルの関数が折れ線状、二次関数などである場合には、パラメータの数が比較的多く、1画素ではγの値を計算により正確に推定することは難しい。従って、γの値の計算には、複数画素を用いることが望ましく、例えば、複数画素の平均値を用いれば、個々の画素のノイズの影響を低減できる。 By minimizing the above evaluation function, the calculation model can be brought close to the actual measurement model. If a function of the measured model y = αx γ, variable one because (gamma), theoretically can be estimated by calculating the value of gamma in 1 pixel. However, in practice, it is difficult to accurately estimate the value of γ with one pixel due to noise, quantization error, and the like. In the digital camera 6, the gamma characteristic may be a polygonal line, a quadratic function or the like in order to simplify the correction calculation. Furthermore, when the function of the calculation model is a polygonal line, a quadratic function, etc., the number of parameters is relatively large, and it is difficult to accurately estimate the value of γ by calculation with one pixel. Therefore, it is desirable to use a plurality of pixels for the calculation of the value of γ. For example, if an average value of a plurality of pixels is used, the influence of noise of each pixel can be reduced.
上記の実施例は、ある関数を予想し、少なくとも3枚の撮影画像からこのある関数の最も尤もらしい係数を繰り返し計算と実験計画法から推定してガンマ特性を推定するものである。扱う情報が例えば8ビットの出力RGB値であれば、出力RGB値が取り得る値の範囲が0〜255と決まっており、且つ、光量増加に対して出力RGB値が連続的に単調増加の関係にあるため可能となる手法である。 In the above-described embodiment, a certain function is predicted, and the most likely coefficient of the certain function is estimated from iterative calculation and experimental design from at least three photographed images, and the gamma characteristic is estimated. For example, if the information to be handled is an 8-bit output RGB value, the range of values that the output RGB value can take is determined to be 0 to 255, and the output RGB value is continuously monotonically increased as the light quantity increases. This is possible because of
これに対し、2つ光源のうち一方の光源をオン・オフし、他方の光源の光量を変えながらデジタルカメラによる撮影を行うことで、一方の光源のオン・オフ時の光量変化が一定であるが出力RGB値の差分が変化することを利用して、ガンマ特性を求める手法が考えられる。この場合、計算モデルの関数は、どのような関数であっても、ガンマ特性を推定する計算が可能である。しかし、この場合、一方の光源をオン・オフし、他方の光源の光量を変えながら、ある程度の枚数の撮影画像を撮影するので、撮影の手間と時間がかかるためコストの削減は難しい。ここで、ある程度の枚数の撮影画像とは、3枚の撮影画像と比較して大きな枚数である。 On the other hand, when one of the two light sources is turned on / off and the digital camera is used to take a picture while changing the light quantity of the other light source, the change in the light quantity when one light source is turned on / off is constant. However, a method for obtaining the gamma characteristic using the change in the difference between the output RGB values is conceivable. In this case, any function of the calculation model can be used to calculate the gamma characteristic. However, in this case, since a certain number of photographed images are photographed while turning on / off one light source and changing the light quantity of the other light source, it is difficult to reduce costs because it takes time and effort for photographing. Here, a certain number of photographed images is a larger number than the three photographed images.
そこで、本発明者らは、一般的にカメラのガンマ特性に相当する関数がある程度限定されており、全く未知の関数形状と考えるよりは予想される関数のいくつかに当てはめて、残差誤差を見ることで関数を特定できることを見出した。つまり、一実施例では、ある関数を予想し、少なくとも3枚の撮影画像からこのある関数の最も尤もらしい係数を繰り返し計算と実験計画法から推定してガンマ特性を推定する。このように、第1の照明と、第2の照明と、第1及び第2の照明という少なくとも3つの照明状態の画像を撮影するだけで、ガンマ特性の推定が可能になる。また、第1及び第2の照明は第1及び第2の光源をオン・オフすることで制御できるので、第1の光源または第2の光源の光量を正確に変化させることはなく、上記の考えられる手法と比較すると第1及び第2の光源の制御が簡単であり、撮影の手間と時間を削減できるためコスト削減も可能となる。 Therefore, the present inventors generally limited the function corresponding to the gamma characteristic of the camera to some extent, and applied the residual error to some of the expected functions rather than considering it as an entirely unknown function shape. I found that the function can be specified by looking. That is, in one embodiment, a gamma characteristic is estimated by predicting a certain function and estimating the most likely coefficient of the certain function from iterative calculation and experimental design from at least three captured images. As described above, the gamma characteristic can be estimated only by taking images of at least three illumination states of the first illumination, the second illumination, and the first and second illuminations. In addition, since the first and second illuminations can be controlled by turning on and off the first and second light sources, the light quantity of the first light source or the second light source is not changed accurately, Compared with a conceivable method, the control of the first and second light sources is simpler, and it is possible to reduce the labor and time of photographing, thereby reducing the cost.
図6は、ガンマ特性推定処理の一例を説明するフローチャートである。図6は、予想される計算モデルの関数がy=αxγである場合の処理を示す。この例では、図6の処理はデータ処理部7により実行される。ガンマ特性推定処理が開始されると、ステップS1では、データ処理部7がγの初期値を0.5に設定する。ステップS2では、データ処理部7がスイッチ4をオン、スイッチ3をオフに制御することで、第1の光源5−1のみをオンにして、デジタルカメラ6により対象物9を撮影する。ステップS3では、データ処理部7がスイッチ4をオフ、スイッチ3をオンに制御することで、第2の光源5−2のみをオンにして、デジタルカメラ6により対象物9を撮影する。ステップS4では、データ処理部7がスイッチ3,4を共にオンに制御することで、第1及び第2の光源5−1,5−2の両方をオンにして、デジタルカメラ6により対象物9を撮影する。ステップS5では、データ処理部7がγの初期値0.5からスタートして、最小二乗誤差が最小になるようにシンプレックス法(Simplex Method)を用いて、第1及び第2の光源5−1,5−2の両方がオンの時に最も尤もらしくなるγの値を推定し、処理は終了する。データ処理部7は、ステップS5の処理を例えば数値解析ソフトウェア(例えば、MATLAB(登録商標))を用いて実行しても良く、この場合、評価関数として最小二乗誤差を用いて、γの初期値0.5で最小化を行うfminsearch関数により誤差が最小となるγの値を推定しても良い。 FIG. 6 is a flowchart for explaining an example of the gamma characteristic estimation process. Figure 6 is a flowchart showing processing executed when a function of computational models that are expected to be y = αx γ. In this example, the process of FIG. 6 is executed by the data processing unit 7. When the gamma characteristic estimation process is started, in step S1, the data processing unit 7 sets the initial value of γ to 0.5. In step S <b> 2, the data processing unit 7 controls the switch 4 to be turned on and the switch 3 to be turned off, so that only the first light source 5-1 is turned on and the object 9 is photographed by the digital camera 6. In step S <b> 3, the data processor 7 controls the switch 4 to be turned off and the switch 3 to be turned on, so that only the second light source 5-2 is turned on and the object 9 is photographed by the digital camera 6. In step S4, the data processor 7 controls both the switches 3 and 4 to be turned on, so that both the first and second light sources 5-1 and 5-2 are turned on. Shoot. In step S5, the data processing unit 7 starts from the initial value 0.5 of γ and uses the simplex method so that the least square error is minimized, and the first and second light sources 5-1 are used. , 5-2 is estimated when the value of γ that is most likely to be on when both are on, and the process ends. The data processing unit 7 may execute the process of step S5 using, for example, numerical analysis software (for example, MATLAB (registered trademark)). In this case, the least square error is used as the evaluation function, and the initial value of γ The value of γ that minimizes the error may be estimated by the fminsearch function that minimizes the value by 0.5.
このように、先ず第1の光源5−1がオンであり第2の光源5−2がオフである時の出力RGB値yと、第2の光源5−2がオンであり第1の光源5−1がオフである時の出力RGB値yとを足し合せた値が、第1及び第2の光源5−1,5−2の両方がオンある時の出力RGB値yより大きくなる度合いからγの値を推定し、第1の光源5−1のみがオンの時にデジタルカメラ6から出力されるRGB値と第2の光源5−2のみがオンの時にデジタルカメラ6から出力されるRGB値の光量を推定する。そして、これらの推定されたRGB値の光量を足し合せた光量から計算した、第1及び第2の光源5−1,5−2の両方がオンの時にデジタルカメラ6から出力されるRGB値の計算値と、第1及び第2の光源5−1,5−2の両方がオンの時にデジタルカメラ6により実際に撮影された対象物9の撮影画像のRGB値の実測値とを比較する。さらに、RGB値の計算値と実測値との差を二乗し、全ての二乗誤差を足し合せる処理を評価関数で表すことで、計算モデルと実測モデルとを比較する最小二乗法を用いて評価関数を求めることができる。このようにして求めた評価関数を最小にすることで、計算モデルを正しい実測モデルに近づけることができる。 Thus, first, the output RGB value y when the first light source 5-1 is on and the second light source 5-2 is off, and the second light source 5-2 is on and the first light source is on. The degree to which the sum of the output RGB value y when 5-1 is off is greater than the output RGB value y when both the first and second light sources 5-1 and 5-2 are on From the digital camera 6 when only the first light source 5-1 is on and RGB output from the digital camera 6 when only the second light source 5-2 is on. Estimate the amount of value. Then, the RGB value output from the digital camera 6 when both the first and second light sources 5-1 and 5-2 are turned on, calculated from the light amount obtained by adding the light amounts of these estimated RGB values. The calculated value is compared with the measured RGB values of the captured image of the object 9 actually captured by the digital camera 6 when both the first and second light sources 5-1 and 5-2 are on. Furthermore, the evaluation function using the least square method that compares the calculation model with the actual measurement model is represented by an evaluation function that squares the difference between the calculated value of the RGB value and the actual measurement value and adds all the square errors. Can be requested. By minimizing the evaluation function obtained in this way, the calculation model can be brought close to the correct actual measurement model.
図7は、γ=0.46であると予想した場合の光源の光量分布の一例のシミュレーション結果を示す図である。図7中、縦軸は光源の出射光量、横軸はxy平面におけるx座標値及びy座標値を夫々任意単位で示す。図7において、(a)は第1の光源5−1の光量分布、(b)は第2の光源の5−2の光量分布、(c)は第1及び第2の光源5−1,5−2を合わせた光量分布を示す。 FIG. 7 is a diagram illustrating a simulation result of an example of the light amount distribution of the light source when it is predicted that γ = 0.46. In FIG. 7, the vertical axis represents the amount of light emitted from the light source, and the horizontal axis represents the x coordinate value and the y coordinate value on the xy plane in arbitrary units. 7, (a) is a light amount distribution of the first light source 5-1, (b) is a light amount distribution of 5-2 of the second light source, and (c) is the first and second light sources 5-1,. The light quantity distribution combining 5-2 is shown.
図8は、γ=0.46であると予想した場合の出力RGB値の一例のシミュレーション結果を示す図である。図8中、縦軸はデジタルカメラ6から出力されるRGB値、横軸はxy平面におけるx座標値及びy座標値を夫々任意単位で示す。図8において、(a)は第1の光源5−1のみがオンの時の出力RGB値、(b)は第2の光源5−2のみがオンの時の出力RGB値、(c)は第1及び第2の光源5−1,5−2の両方がオンの時の出力RGB値を示す。 FIG. 8 is a diagram illustrating a simulation result of an example of the output RGB value when it is predicted that γ = 0.46. In FIG. 8, the vertical axis represents RGB values output from the digital camera 6, and the horizontal axis represents x-coordinate values and y-coordinate values on the xy plane in arbitrary units. 8, (a) is an output RGB value when only the first light source 5-1 is on, (b) is an output RGB value when only the second light source 5-2 is on, and (c) is The output RGB values when both the first and second light sources 5-1 and 5-2 are on are shown.
上記のステップS5では、データ処理部7が図8において(a),(b),(c)に示す3つのRGB値(8a),(8b),(8c)の各画素の値に対して、逆ガンマ補正を行うことでγの値を計算する。例えば、Σ[(8c)−{(8a)+(8b)}]2で表される各画素の値の総和が最小になる関数をデータ処理部7がシンプレックス法で求めたところ、γの値は0.46であることが推定され、ガンマ特性を正確に推定できることが確認された。また、データ処理部7がαの値が異なる他の計算モデルについてγを0.46以外の値であると予想した場合も、γの値が予想した値であることが推定され、ガンマ特性を正確に推定できることが確認された。 In step S5 described above, the data processing unit 7 applies the values of the three RGB values (8a), (8b), and (8c) shown in (a), (b), and (c) in FIG. The value of γ is calculated by performing inverse gamma correction. For example, when the data processing unit 7 obtains a function that minimizes the sum of the values of the pixels represented by Σ [(8c) − {(8a) + (8b)}] 2 by the simplex method, the value of γ Was estimated to be 0.46, and it was confirmed that the gamma characteristic could be accurately estimated. Further, when the data processing unit 7 predicts that γ is a value other than 0.46 for other calculation models having different values of α, it is estimated that the value of γ is an expected value, and the gamma characteristic is It was confirmed that it can be estimated accurately.
上記の例では、データ処理部7がy=αxγについて最尤関数を推定しているが、ガンマ特性はy=αxγに限定されず、折れ線状の関数、二次関数などであっても良い。つまり、最尤関数は、y=αxγで表される関数、折れ線状の関数、及び二次関数のうち少なくとも1つを用いても良い。さらに、最尤関数は、y=αxγで表される関数、折れ線状の関数、及び二次関数のうち2以上を用い、評価関数である二乗誤差が最小になる関数を計算モデルの関数として選択しても良い。 In the above example, the data processing unit 7 estimates the maximum likelihood function for y = αx γ . However, the gamma characteristic is not limited to y = αx γ, and a linear function or a quadratic function may be used. good. In other words, the maximum likelihood function, function expressed by y = .alpha.x gamma, polygonal line function, and may be used at least one of quadratic function. Furthermore, the maximum likelihood function, function expressed by y = .alpha.x gamma, polygonal line function, and using two or more of the quadratic function, the function is evaluation function squared error is minimized as a function of the calculation model You may choose.
図9は、折れ線状の関数の一例を示す図である。図9中、縦軸はデジタルカメラ6から出力されるRGB値、横軸はデジタルカメラ6への入射光量を夫々任意単位で示す。なお、折れ線状の関数は、多段の折れ線を含んでも良い。 FIG. 9 is a diagram illustrating an example of a polygonal line function. In FIG. 9, the vertical axis indicates the RGB values output from the digital camera 6, and the horizontal axis indicates the amount of light incident on the digital camera 6 in arbitrary units. The broken line function may include a multi-stage broken line.
図10は、二次関数の一例を示す図である。図10中、縦軸はデジタルカメラ6から出力されるRGB値、横軸はデジタルカメラ6への入射光量を夫々任意単位で示す。 FIG. 10 is a diagram illustrating an example of a quadratic function. In FIG. 10, the vertical axis represents the RGB values output from the digital camera 6, and the horizontal axis represents the amount of light incident on the digital camera 6 in arbitrary units.
ガンマ特性が例えば図9または図10のようにy=αxγ以外の関数である場合、この関数を定義できれば最尤関数を求めることができる。また、予め使用されそうな計算モデルの関数が複数予想できる場合には、予想できる複数の関数をテーブルに格納しておき、例えば評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性として選択すれば良い。 If the gamma characteristic is a function other than y = .alpha.x gamma as shown in Figure 9 or Figure 10 for example, it is possible to obtain the ML function if define this function. In addition, when a plurality of functions of a calculation model that are likely to be used in advance can be predicted, a plurality of functions that can be predicted are stored in a table, and for example, the function of the calculation model that minimizes the square error that is an evaluation function is estimated. What is necessary is just to select as a gamma characteristic.
上記の例では、評価関数として最小二乗誤差を用いているが、評価関数は最小二乗誤差に限定されるものではなく、ユークリッド距離などの、最尤関数を推定可能な評価関数であれば特に限定されない。また、最小二乗誤差が最小になるようにγの値を求める方法は、シンプレックス法に限定されず、例えば黄金分割法などを用いても良い。つまり、最小二乗誤差が最小になるようにγの値を求める方法は、最小二乗法、ユークリッド距離、シンプレックス、及び黄金分割法のうち少なくとも1つを用いれば良い。さらに、最小二乗誤差が最小になるようにγの値を求める方法は、最小二乗法、ユークリッド距離、シンプレックス、及び黄金分割法のうち2以上を用い、最小二乗誤差が最小となる方法を採用しても良い。 In the above example, the least square error is used as the evaluation function. However, the evaluation function is not limited to the least square error, and is not particularly limited as long as it is an evaluation function that can estimate the maximum likelihood function such as Euclidean distance. Not. Further, the method for obtaining the value of γ so that the least square error is minimized is not limited to the simplex method, and for example, the golden section method may be used. That is, as a method for obtaining the value of γ so that the least square error is minimized, at least one of the least square method, the Euclidean distance, the simplex, and the golden section method may be used. Furthermore, as a method for obtaining the value of γ so that the least square error is minimized, a method that uses two or more of the least square method, the Euclidean distance, the simplex, and the golden section method and adopts the method that minimizes the least square error. May be.
図11は、ガンマ特性推定処理の他の例を説明するフローチャートである。図11は、予想される計算モデルの関数が図9に示すように折れ線状である場合の処理を示す。この例では、図11の処理はデータ処理部7により実行される。ガンマ特性推定処理が開始されると、ステップS11では、データ処理部7がデジタルカメラ6から出力されるRGB値の変曲点の初期値を150、折れ曲がり後の傾き比を0.5に設定する。ステップS12では、データ処理部7がスイッチ4をオン、スイッチ3をオフに制御することで、第1の光源5−1のみをオンにして、デジタルカメラ6により対象物9を撮影する。ステップS13では、データ処理部7がスイッチ4をオフ、スイッチ3をオンに制御することで、第2の光源5−2のみをオンにして、デジタルカメラ6により対象物9を撮影する。ステップS14では、データ処理部7がスイッチ3,4を共にオンに制御することで、第1及び第2の光源5−1,5−2の両方をオンにして、デジタルカメラ6により対象物9を撮影する。ステップS15では、データ処理部7がRGB値の変曲点の初期値150及び折れ曲がり後の傾き比0.5からスタートして、最小二乗誤差が最小になるようにシンプレックス法(Simplex Method)を用いて、第1及び第2の光源5−1,5−2の両方がオンの時に最も尤もらしくなる折れ線を推定し、処理は終了する。 FIG. 11 is a flowchart for explaining another example of gamma characteristic estimation processing. FIG. 11 shows a process when the expected function of the calculation model is a polygonal line as shown in FIG. In this example, the processing in FIG. 11 is executed by the data processing unit 7. When the gamma characteristic estimation process is started, in step S11, the data processing unit 7 sets the initial value of the inflection point of the RGB value output from the digital camera 6 to 150 and the slope ratio after bending to 0.5. . In step S <b> 12, the data processing unit 7 controls the switch 4 to be turned on and the switch 3 to be turned off, so that only the first light source 5-1 is turned on and the object 9 is photographed by the digital camera 6. In step S <b> 13, the data processing unit 7 controls the switch 4 to be turned off and the switch 3 to be turned on, so that only the second light source 5-2 is turned on and the object 9 is photographed by the digital camera 6. In step S <b> 14, the data processing unit 7 controls both the switches 3 and 4 to be turned on, thereby turning on both the first and second light sources 5-1 and 5-2. Shoot. In step S15, the data processor 7 starts from the initial value 150 of the inflection point of the RGB value and the slope ratio 0.5 after bending, and uses the simplex method so that the least square error is minimized. Thus, a polygonal line that is most likely when both the first and second light sources 5-1 and 5-2 are on is estimated, and the process ends.
図12は、折れ線状の関数の一例を示す図である。図12中、縦軸はデジタルカメラ6から出力されるRGB値、横軸はデジタルカメラ6への入射光量を夫々任意単位で示す。図12において、P1はRGB値の変曲点を示し、例えば100である。また、P2は折れ曲がり後(即ち、RGB値の変曲点P1の後)の傾き比を求める部分を示し、この部分P2での傾きは例えばRGB値の変曲点P1までの傾きの半分である。 FIG. 12 is a diagram illustrating an example of a polygonal line function. In FIG. 12, the vertical axis represents RGB values output from the digital camera 6, and the horizontal axis represents the amount of light incident on the digital camera 6 in arbitrary units. In FIG. 12, P1 indicates the inflection point of the RGB value, and is 100, for example. P2 represents a portion for obtaining the inclination ratio after bending (that is, after the inflection point P1 of the RGB value), and the inclination at the portion P2 is, for example, half of the inclination to the inflection point P1 of the RGB value. .
図13は、図7と同様の光源の光量分布について、ガンマ特性が図12に示す折れ線状の関数であると予想した場合の出力RGB値の一例のシミュレーション結果を示す図である。図12中、縦軸はデジタルカメラ6から出力されるRGB値、横軸はxy平面におけるx座標値及びy座標値を夫々任意単位で示す。図13において、(a)は第1の光源5−1のみがオンの時の出力RGB値、(b)は第2の光源5−2のみがオンの時の出力RGB値、(c)は第1及び第2の光源5−1,5−2の両方がオンの時の出力RGB値を示す。 FIG. 13 is a diagram showing a simulation result of an example of output RGB values when the gamma characteristic is predicted to be the function of the polygonal line shown in FIG. 12 for the light amount distribution of the light source similar to FIG. In FIG. 12, the vertical axis represents RGB values output from the digital camera 6, and the horizontal axis represents x-coordinate values and y-coordinate values on the xy plane in arbitrary units. In FIG. 13, (a) is an output RGB value when only the first light source 5-1 is on, (b) is an output RGB value when only the second light source 5-2 is on, and (c) is The output RGB values when both the first and second light sources 5-1 and 5-2 are on are shown.
上記のステップS15では、データ処理部7が図13において(a),(b),(c)に示す3つのRGB値(13a),(13b),(13c)の各画素の値に対して、逆ガンマ補正を行うことでγの値を計算する。例えば、Σ[(13c)−{(13a)+(13b)}]2で表される各画素の値の総和が最小になる関数をデータ処理部7がシンプレックス法で求めたところ、RGB値の変曲点P1は100であり、折れ曲がり後の部分P2での傾きはRGB値の変曲点P1までの傾きの半分(=0.5)であることが推定され、ガンマ特性を正確に推定できることが確認された。また、データ処理部7がRGB値の変曲点P1及び折れ曲がり後の部分P2での傾きを上記以外の値であると予想した場合も、RGB値の変曲点P1及び折れ曲がり後の部分P2での傾きの値が予想した値であることが推定され、ガンマ特性を正確に推定できることが確認された。 In step S15 described above, the data processing unit 7 applies the values of the three RGB values (13a), (13b), and (13c) shown in (a), (b), and (c) in FIG. The value of γ is calculated by performing inverse gamma correction. For example, when the data processing unit 7 obtains a function that minimizes the sum of the values of each pixel represented by Σ [(13c) − {(13a) + (13b)}] 2 by the simplex method, The inflection point P1 is 100, and the slope at the portion P2 after bending is estimated to be half (= 0.5) of the slope of the RGB value up to the inflection point P1, and the gamma characteristic can be accurately estimated. Was confirmed. Further, when the data processing unit 7 predicts that the gradient at the inflection point P1 of the RGB value and the portion P2 after the bending is a value other than the above, the inflection point P1 of the RGB value and the portion P2 after the bending are performed. It was estimated that the value of the slope was an expected value, and it was confirmed that the gamma characteristic could be estimated accurately.
ガンマ特性が折れ線状の関数である場合を図11〜図13と共に説明したが、ガンマ特性が二次関数などであっても同様にガンマ特性を推定することができる。つまり、計算モデルの関数は、どのような関数を予想しても、ガンマ特性を推定する計算が可能である。予め使用されそうな計算モデルの関数が複数予想できる場合には、例えば評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性として選択すれば良い。つまり、予想できる複数の計算モデルの関数がテーブルに格納されている場合には、データ処理部7が例えば図6の処理で推定したガンマ特性、図11の処理で推定したガンマ特性、その他の処理で推定したガンマ特性のうち、例えば評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性をガンマ特性推定処理により推定された最終結果として選択すれば良い。例えば図6の処理の場合、ステップS5ではデータ処理部7が第1及び第2の光源5−1,5−2の両方がオンの時に最も尤もらしくなるγの値を複数の計算モデルの関数について推定し、例えば評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性として選択する。同様に、例えば図11の処理の場合、ステップS15ではデータ処理部7が第1及び第2の光源5−1,5−2の両方がオンの時に最も尤もらしくなる折れ線を複数の計算モデルの関数について推定し、例えば評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性として選択する。 Although the case where the gamma characteristic is a polygonal line function has been described with reference to FIGS. 11 to 13, the gamma characteristic can be similarly estimated even if the gamma characteristic is a quadratic function or the like. That is, the function of the calculation model can be calculated to estimate the gamma characteristic no matter what function is expected. When a plurality of functions of a calculation model that are likely to be used in advance can be predicted, for example, a function of a calculation model that minimizes a square error as an evaluation function may be selected as an estimated gamma characteristic. That is, when a plurality of predictable calculation model functions are stored in the table, for example, the gamma characteristic estimated by the data processing unit 7 in the process of FIG. 6, the gamma characteristic estimated in the process of FIG. For example, the gamma characteristic obtained by estimating the function of the calculation model that minimizes the square error, which is the evaluation function, may be selected as the final result estimated by the gamma characteristic estimation process. For example, in the case of the process of FIG. 6, in step S5, the value of γ that the data processing unit 7 makes most likely when both the first and second light sources 5-1 and 5-2 are turned on is a function of a plurality of calculation models. For example, a function of a calculation model that minimizes a square error as an evaluation function is selected as an estimated gamma characteristic. Similarly, in the case of the process of FIG. 11, for example, in step S15, the data processing unit 7 sets a polygonal line that becomes most likely when both the first and second light sources 5-1 and 5-2 are turned on to a plurality of calculation models. For example, a function of a calculation model that minimizes a square error as an evaluation function is selected as an estimated gamma characteristic.
以上に説明したように、計算モデルが予想できれば、デジタルカメラ6のガンマ特性は少なくとも3枚の撮影画像に基づいて推定可能であることが確認された。 As described above, it was confirmed that if the calculation model can be predicted, the gamma characteristic of the digital camera 6 can be estimated based on at least three captured images.
図7に示す例では、光量分布がある場合を想定しているが、光量分布がなくても測定対象物の反射率が一様でなければRGB値と光量が加算されたRGB値のずれからγの値を推定することができる。また、たとえ積分球のように光量が一様である場合でも、複数の光源の組合せで光量が複数の段階で加算できればγの値、即ち、ガンマ特性の推定は可能である。 In the example shown in FIG. 7, it is assumed that there is a light quantity distribution. However, even if there is no light quantity distribution, if the reflectance of the measurement object is not uniform, the RGB value and the RGB value obtained by adding the light quantity are offset. The value of γ can be estimated. Even if the amount of light is uniform as in an integrating sphere, the value of γ, that is, the gamma characteristic can be estimated if the amount of light can be added in a plurality of stages by combining a plurality of light sources.
図14は、変形例におけるガンマ特性推定方法を説明する図である。図14中、図1と同一部分には同一符号を付し、その説明は省略する。図14に示すガンマ特性推定装置1には、調整部303が設けられている。第2の光源5−2の出射光量は、調整部303及びスイッチ3を介して段階的に可変である。調整部303は、例えばデジタルカメラ6またはデータ処理部7により制御しても良い。 FIG. 14 is a diagram illustrating a gamma characteristic estimation method according to a modification. In FIG. 14, the same parts as those in FIG. An adjustment unit 303 is provided in the gamma characteristic estimation apparatus 1 shown in FIG. The amount of light emitted from the second light source 5-2 is variable stepwise via the adjustment unit 303 and the switch 3. The adjustment unit 303 may be controlled by the digital camera 6 or the data processing unit 7, for example.
本変形例の場合、図6または図11の処理を1回実行した後に、調整部303により第2の光源5−2の出射光量を一定量増加或いは減少させ、同じ図6または図11の処理を再実行する。これにより、第2の光源5−2の出射光量の一定量の変化に応じて生じるデジタルカメラ6の出力RGB値の変化量に基づいて、ガンマ特性を推定することができる。なお、図6または図11の処理を再実行する回数は、特に限定されない。 In the case of this modification, after executing the processing of FIG. 6 or FIG. 11 once, the adjustment unit 303 increases or decreases the amount of light emitted from the second light source 5-2 by a certain amount, and the same processing of FIG. Try again. As a result, the gamma characteristic can be estimated based on the amount of change in the output RGB value of the digital camera 6 that occurs in response to a certain amount of change in the amount of light emitted from the second light source 5-2. Note that the number of times to re-execute the processing of FIG. 6 or FIG. 11 is not particularly limited.
図15は、ガンマ特性推定装置の第1の例を示すブロック図である。図15において、スマートフォン31−1は、有線または無線のインタフェースを介してパーソナルコンピュータ(PC:Personal Computer)41と通信可能に接続されている。第1の光源の一例である発光ダイオード(LED:Light Emitting Diode)5−1のオン・オフ制御は例えばユーザの操作により行われ、第2の光源の一例であるLED5−2のオン・オフ制御は、例えばユーザの操作により行われる。スマートフォン31−1のカメラ6は、LED5−1,5−2からの光を照射された対象物9(図示せず)からの反射光を受光することで対象物9を撮影する。カメラ6の撮影タイミングは、例えばユーザの操作により決定できる。カメラ6の出力データは、PC41内のデータ処理部7に出力される。この例では、例えばユーザがLED5−1,5−2の制御及びスマートフォン31−1のカメラ6による撮影を手動で行うことで、PC41内のデータ処理部7が例えば図6または図11のガンマ特性推定処理を行う。 FIG. 15 is a block diagram illustrating a first example of a gamma characteristic estimation apparatus. In FIG. 15, the smartphone 31-1 is communicably connected to a personal computer (PC) 41 via a wired or wireless interface. On / off control of a light emitting diode (LED: Light Emitting Diode) 5-1 that is an example of a first light source is performed by a user operation, for example, and on / off control of an LED 5-2 that is an example of a second light source. Is performed, for example, by a user operation. The camera 6 of the smartphone 31-1 captures the object 9 by receiving reflected light from the object 9 (not shown) irradiated with the light from the LEDs 5-1 and 5-2. The shooting timing of the camera 6 can be determined by a user operation, for example. The output data of the camera 6 is output to the data processing unit 7 in the PC 41. In this example, for example, when the user manually controls the LEDs 5-1 and 5-2 and captures with the camera 6 of the smartphone 31-1, the data processing unit 7 in the PC 41 has the gamma characteristic shown in FIG. 6 or FIG. Perform estimation processing.
図16は、スマートフォンの一例を示すブロック図である。図16において、第1の電子装置の一例であるスマートフォン31は、CPU(Central Processing Unit)311、記憶部312、通信部313、入力部314、表示部315、及びカメラ6がバス320により接続された構成を有する。電池316は図1に示す電源2の一例であり、スマートフォン31内の各部に電源電圧を供給する。記憶部312は、CPU311が実行するプログラム、CPU311が実行する演算で使用する各種データ、CPU311が実行する演算の中間結果、予想できる複数の計算モデルの関数を格納したテーブルなどを格納しても良い。通信部313は、有線または無線のインタフェース330を介してPCなどの外部装置との通信を可能とする。入力部314は、例えばキーボードなどを含んでも良い。表示部315は、ユーザに対するメッセージ、ガンマ特性推定処理で推定したガンマ特性などを表示しても良い。入力部314及び表示部315は、タッチパネルのような一体型であっても良い。なお、CPU311とスマートフォン31内の各部との接続は、バス320による接続に限定されない。 FIG. 16 is a block diagram illustrating an example of a smartphone. In FIG. 16, a smartphone 31 that is an example of a first electronic device includes a CPU (Central Processing Unit) 311, a storage unit 312, a communication unit 313, an input unit 314, a display unit 315, and a camera 6 connected via a bus 320. Have a configuration. The battery 316 is an example of the power supply 2 shown in FIG. 1 and supplies a power supply voltage to each part in the smartphone 31. The storage unit 312 may store a program executed by the CPU 311, various data used in the calculation executed by the CPU 311, intermediate results of the calculation executed by the CPU 311, a table storing functions of a plurality of predictable calculation models, and the like. . The communication unit 313 enables communication with an external device such as a PC via a wired or wireless interface 330. The input unit 314 may include a keyboard, for example. The display unit 315 may display a message for the user, a gamma characteristic estimated by the gamma characteristic estimation process, and the like. The input unit 314 and the display unit 315 may be integrated as a touch panel. The connection between the CPU 311 and each unit in the smartphone 31 is not limited to the connection via the bus 320.
図17は、パーソナルコンピュータ(PC)の一例を示すブロック図である。図17において、第2の電子装置の一例であるPC41は、CPU411、記憶部412、通信部413、入力部414、及び表示部415がバス420により接続された構成を有する。PC41は、カメラ6を更に有しても良く、電池(図示せず)を更に有しても良い。記憶部412は、CPU411が実行するプログラム、CPU411が実行する演算で使用する各種データ、CPU411が実行する演算の中間結果、予想できる複数の計算モデルの関数を格納したテーブルなどを格納しても良い。通信部413は、有線または無線のインタフェース430を介してスマートフォンなどの外部装置との通信を可能とする。入力部414は、例えばキーボードなどを含んでも良い。表示部415は、ユーザに対するメッセージ、ガンマ特性推定処理で推定したガンマ特性などを表示しても良い。入力部414及び表示部415は、タッチパネルのような一体型であっても良い。なお、CPU411とPC41内の各部との接続は、バス420による接続に限定されない。 FIG. 17 is a block diagram illustrating an example of a personal computer (PC). In FIG. 17, a PC 41 that is an example of a second electronic device has a configuration in which a CPU 411, a storage unit 412, a communication unit 413, an input unit 414, and a display unit 415 are connected by a bus 420. The PC 41 may further include a camera 6 and may further include a battery (not shown). The storage unit 412 may store a program executed by the CPU 411, various data used in the calculation executed by the CPU 411, an intermediate result of the calculation executed by the CPU 411, a table storing a plurality of predictable calculation model functions, and the like. . The communication unit 413 enables communication with an external device such as a smartphone via a wired or wireless interface 430. The input unit 414 may include a keyboard, for example. The display unit 415 may display a message for the user, a gamma characteristic estimated by the gamma characteristic estimation process, and the like. The input unit 414 and the display unit 415 may be integrated as a touch panel. The connection between the CPU 411 and each unit in the PC 41 is not limited to the connection via the bus 420.
図15に示すPC41の場合、データ処理部7の機能は、図16に示すCPU411により実現できる。また、データ処理部7の一部の機能を、図15に示すスマートフォン31内のCPU311により実現しても良い。図15に示す例の場合、上記ガンマ特性推定処理は、PC41内のCPU411がコンピュータ読取可能な記憶媒体の一例である記憶部412に格納されたプログラムを実行することで実行できる。 In the case of the PC 41 shown in FIG. 15, the function of the data processing unit 7 can be realized by the CPU 411 shown in FIG. Moreover, you may implement | achieve some functions of the data processing part 7 by CPU311 in the smart phone 31 shown in FIG. In the example shown in FIG. 15, the gamma characteristic estimation process can be executed by executing a program stored in the storage unit 412, which is an example of a computer-readable storage medium, by the CPU 411 in the PC 41.
図18は、ガンマ特性推定装置の第2の例を示すブロック図である。図18中、図15と同一部分には同一符号を付し、その説明は省略する。図18において、スマートフォン31−2は、スイッチ3,4、及びカメラ6を有する。従って、スイッチ3,4の制御と、カメラ6の撮影タイミングの制御は、図15に示すCPU311により実行できる。データ処理部7の機能は、図16に示すPC41内のCPU411により実現できる。また、データ処理部7の一部の機能を、図15に示すCPU311により実現しても良い。図18に示す例の場合、上記ガンマ特性推定処理は、PC41内のCPU411がコンピュータ読取可能な記憶媒体の一例である記憶部412に格納されたプログラムを実行することで実行できる。 FIG. 18 is a block diagram illustrating a second example of the gamma characteristic estimation apparatus. In FIG. 18, the same parts as those in FIG. 15 are denoted by the same reference numerals, and the description thereof is omitted. In FIG. 18, the smartphone 31-2 includes switches 3 and 4 and a camera 6. Therefore, the control of the switches 3 and 4 and the control of the photographing timing of the camera 6 can be executed by the CPU 311 shown in FIG. The function of the data processing unit 7 can be realized by the CPU 411 in the PC 41 shown in FIG. Further, some functions of the data processing unit 7 may be realized by the CPU 311 shown in FIG. In the example shown in FIG. 18, the gamma characteristic estimation process can be executed by executing a program stored in the storage unit 412, which is an example of a computer-readable storage medium, by the CPU 411 in the PC 41.
図19は、ガンマ特性推定装置の第3の例を示すブロック図である。図19中、図18と同一部分には同一符号を付し、その説明は省略する。図19において、スマートフォン31−2はクラウドコンピューティングシステム51と有線または無線のインタフェース、例えばインターネットを介して通信可能に接続されている。データ処理部7の機能は、第2の電子装置の一例であるクラウドコンピューティングシステム51内の1以上のコンピュータにより実現できる。また、データ処理部7の一部の機能を、図15に示すCPU311により実現しても良い。図19に示す例の場合、上記ガンマ特性推定処理は、クラウドコンピューティングシステム51内の1台以上のコンピュータが、コンピュータ読取可能な記憶媒体に格納されたプログラムを実行することで実行できる。 FIG. 19 is a block diagram illustrating a third example of the gamma characteristic estimation apparatus. In FIG. 19, the same parts as those in FIG. In FIG. 19, the smartphone 31-2 is connected to the cloud computing system 51 via a wired or wireless interface such as the Internet so as to be communicable. The function of the data processing unit 7 can be realized by one or more computers in the cloud computing system 51 which is an example of the second electronic device. Further, some functions of the data processing unit 7 may be realized by the CPU 311 shown in FIG. In the case of the example shown in FIG. 19, the gamma characteristic estimation process can be executed by one or more computers in the cloud computing system 51 executing a program stored in a computer-readable storage medium.
図20は、ガンマ特性推定装置の第4の例を示すブロック図である。図20中、図15と同一部分には同一符号を付し、その説明は省略する。図20において、スマートフォン31−3は、スイッチ3,4、カメラ6、及びデータ処理部7を有する。従って、スイッチ3,4の制御、データ処理部7の機能、及びカメラ6の撮影タイミングの制御は、図15に示すCPU311により実行できる。図20に示す例の場合、上記ガンマ特性推定処理は、CPU311がコンピュータ読取可能な記憶媒体の一例である記憶部312に格納されたプログラムを実行することで実行できる。 FIG. 20 is a block diagram illustrating a fourth example of the gamma characteristic estimation apparatus. In FIG. 20, the same parts as those in FIG. 15 are denoted by the same reference numerals, and the description thereof is omitted. In FIG. 20, the smartphone 31-3 includes switches 3 and 4, a camera 6, and a data processing unit 7. Therefore, the control of the switches 3 and 4, the function of the data processing unit 7, and the control of the photographing timing of the camera 6 can be executed by the CPU 311 shown in FIG. In the case of the example shown in FIG. 20, the gamma characteristic estimation process can be executed by the CPU 311 executing a program stored in the storage unit 312 which is an example of a computer-readable storage medium.
図21は、ガンマ特性推定装置の第5の例を示すブロック図である。図21中、図20と同一部分には同一符号を付し、その説明は省略する。図21において、スマートフォン31−4は、LED5−1,5−2を更に有する。 FIG. 21 is a block diagram illustrating a fifth example of the gamma characteristic estimation apparatus. In FIG. 21, the same parts as those in FIG. In FIG. 21, the smartphone 31-4 further includes LEDs 5-1 and 5-2.
図22は、ガンマ特性推定装置の第6の例を示すブロック図である。図22中、図20と同一部分には同一符号を付し、その説明は省略する。図22において、スマートフォン31−4は、表示部315に第1の光源として機能する照明用の表示15−1と、第2の光源として機能する照明用の表示15−2を表示する。表示部315に表示される表示15−1,15−2は、図15に示すCPU311により制御することでオン・オフすることができる。表示15−1と表示15−2とは、例えば表示部315上で互いに一定の距離が離れた領域に表示されても良い。 FIG. 22 is a block diagram illustrating a sixth example of the gamma characteristic estimation apparatus. In FIG. 22, the same parts as those in FIG. In FIG. 22, the smartphone 31-4 displays an illumination display 15-1 that functions as a first light source and an illumination display 15-2 that functions as a second light source on the display unit 315. The displays 15-1 and 15-2 displayed on the display unit 315 can be turned on / off by being controlled by the CPU 311 shown in FIG. For example, the display 15-1 and the display 15-2 may be displayed in an area on the display unit 315 that is a certain distance away from each other.
図15及び図18に示す例の場合、ガンマ特性推定処理をPC41側のCPU411で実行するので、スマートフォン31−1,31−2側のCPU311への負荷を軽減できる。図19に示す例の場合、ガンマ特性推定処理をクラウドコンピューティングシステム51側のコンピュータで実行するので、スマートフォン31−2側のCPU311への負荷を軽減できる。 In the case of the example shown in FIGS. 15 and 18, since the gamma characteristic estimation process is executed by the CPU 411 on the PC 41 side, the load on the CPU 311 on the smartphone 31-1, 31-2 side can be reduced. In the case of the example shown in FIG. 19, since the gamma characteristic estimation process is executed by the computer on the cloud computing system 51 side, the load on the CPU 311 on the smartphone 31-2 side can be reduced.
図20〜図22に示す例の場合、1台のスマートフォン31−3〜31−5でスイッチ3,4の制御と、カメラ6の撮影タイミングの制御を実現し、ガンマ特性推定処理を実行することができる。また、図20〜図22に示すスマートフォン31−3〜31−5は、同様の構成を有するタブレット型コンピュータ、パーソナルコンピュータ(PC)などの電子装置に置き換えることも可能である。ただし、この場合のタブレット型コンピュータ、PCなどの電子装置は、カメラ6を備えている必要がある。さらに、図22に示す例の場合、スマートフォン31−5の表示部315を第1及び第2光源として利用するため、別途2個の光源を設ける必要がない。 In the case of the examples shown in FIGS. 20 to 22, control of switches 3 and 4 and control of shooting timing of the camera 6 are realized by one smartphone 31-3 to 31-5 and gamma characteristic estimation processing is executed. Can do. In addition, the smartphones 31-3 to 31-5 illustrated in FIGS. 20 to 22 can be replaced with electronic devices such as a tablet computer and a personal computer (PC) having the same configuration. However, an electronic apparatus such as a tablet computer or a PC in this case needs to include the camera 6. Furthermore, in the case of the example shown in FIG. 22, since the display unit 315 of the smartphone 31-5 is used as the first and second light sources, it is not necessary to provide two additional light sources.
なお、図18〜図22において、図14の調整部303を用いる場合には、スイッチ3の代わりに調整部303とスイッチ3の組み合わせを設ければ良い。 18 to 22, when the adjustment unit 303 of FIG. 14 is used, a combination of the adjustment unit 303 and the switch 3 may be provided instead of the switch 3.
ところで、対象物に3方向以上の方向から光を照射し、対象物の陰影状態から法線ベクトルを求め、対象物の形状を再現するような場合、デジタルカメラを用いて例えばフォトメトリックステレオ法などの計測を行うことがある。フォトメトリックステレオ法は、少なくとも3個の光源を使用するので、上記の実施例及び変形例におけるガンマ特性推定方法を適用するのには好適である。フォトメトリックステレオ法で使用する3個以上の光源のうち、2個の光源を上記ガンマ特性推定方法で用いることで、ガンマ特性推定用に新たに光源を用意することなく正確なガンマ特性を推定することが可能になる。 By the way, when the object is irradiated with light from three or more directions, the normal vector is obtained from the shaded state of the object, and the shape of the object is reproduced, for example, a photometric stereo method is used using a digital camera. May be measured. Since the photometric stereo method uses at least three light sources, it is suitable for applying the gamma characteristic estimation method in the above-described embodiments and modifications. By using two light sources among the three or more light sources used in the photometric stereo method in the gamma characteristic estimation method, accurate gamma characteristics are estimated without preparing a new light source for gamma characteristic estimation. It becomes possible.
上記の実施例及び変形例によれば、比較的容易にガンマ特性を推定することができる。具体的には、第1の光源のみがオンの時の撮影画像、第2の光源5−2のみがオンの時の撮影画像、及び第1及び第2の光源の両方がオンの時の撮影画像に基づいて、ガンマ特性を推定することが可能である。また、上記の実施例及び変形例によれば、正確な光量が既知である光源を用いる必要はなく、比較的容易に較正を行うことができる。 According to the embodiment and the modification described above, the gamma characteristic can be estimated relatively easily. Specifically, a photographed image when only the first light source is on, a photographed image when only the second light source 5-2 is on, and a photograph when both the first and second light sources are on. Based on the image, it is possible to estimate the gamma characteristic. In addition, according to the above-described embodiments and modifications, it is not necessary to use a light source whose accurate light amount is known, and calibration can be performed relatively easily.
以上の実施例を含む実施形態に関し、更に以下の付記を開示する。
(付記1)
第1及び第2の光源からの光を照射される対象物を撮影するカメラと、
前記第1及び第2の光源のオン・オフを制御する制御部と、
前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定するデータ処理部
を備えたことを特徴とする、ガンマ特性推定装置。
(付記2)
前記最も尤もらしくなる関数を求めるための誤差最小を推定するために、最小二乗法、ユークリッド距離、シンプレックス、及び黄金分割法のうち少なくとも1つを用いることを特徴とする、付記1記載のガンマ特性推定装置。
(付記3)
前記予想される関数として、前記カメラの入射光量x及び出力値y、定数αで示すとy=αxγで表される関数、折れ線状の関数、及び二次関数のうち少なくとも1つを用いることを特徴とする、付記1または2記載のガンマ特性推定装置。
(付記4)
前記予想される関数を複数格納した記憶部をさらに備え、
前記データ処理部は、評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性をガンマ特性推定処理により推定された最終結果として選択することを特徴とする、付記1乃至3のいずれか1項記載のガンマ特性推定装置。
(付記5)
前記制御部及び前記データ処理部として機能する単一のプロセッサを更に備えたことを特徴とする、付記1乃至4のいずれか1項記載のガンマ特性推定装置。
(付記6)
前記第1及び第2の光源を更に備えたことを特徴とする、付記1乃至5のいずれか1項記載のガンマ特性推定装置。
(付記7)
前記第1及び第2の光源として機能する表示部を更に備えたことを特徴とする、付記6記載のガンマ特性推定装置。
(付記8)
前記制御部は通信機能を有する第1の電子装置内に設けられ、
前記データ処理部は前記第1の電子装置と通信可能な第2の電子装置内に設けられていることを特徴とする、付記1乃至7のいずれか1項記載のガンマ特性推定装置。
(付記9)
前記第2の電子装置は、クラウドコンピューティングシステム内に設けられていることを特徴とする、付記8記載のガンマ特性推定装置。
(付記10)
カメラで第1及び第2の光源からの光を照射される対象物を撮影し、
制御部で前記第1及び第2の光源のオン・オフを制御し、
データ処理部で前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定する
ことを特徴とする、ガンマ特性推定方法。
(付記11)
前記最も尤もらしくなる関数を求めるための誤差最小を推定するために、最小二乗法、ユークリッド距離、シンプレックス、及び黄金分割法のうち少なくとも1つを用いることを特徴とする、付記10記載のガンマ特性推定方法。
(付記12)
前記予想される関数として、前記カメラの入射光量x及び出力値y、定数αで示すとy=αxγで表される関数、折れ線状の関数、及び二次関数のうち少なくとも1つを用いることを特徴とする、付記10または11記載のガンマ特性推定方法。
(付記13)
前記予想される関数は、複数、記憶部に格納されており、
前記データ処理部で評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性をガンマ特性推定処理により推定された最終結果として選択することを特徴とする、付記10乃至12のいずれか1項記載のガンマ特性推定方法。
(付記14)
前記制御部及び前記データ処理部の機能を単一のプロセッサで実現することを特徴とする、付記10乃至13のいずれか1項記載のガンマ特性推定方法。
(付記15)
前記第1及び第2の光源の機能を表示部で実現することを特徴とする、付記10乃至14のいずれか1項記載のガンマ特性推定方法。
(付記16)
前記制御部の機能を通信機能を有する第1の電子装置内で実現し、
前記データ処理部の機能を前記第1の電子装置と通信可能な第2の電子装置内で実現することを特徴とする、付記10乃至15のいずれか1項記載のガンマ特性推定方法。
(付記17)
前記第2の電子装置は、クラウドコンピューティングシステム内に設けられていることを特徴とする、付記16記載のガンマ特性推定方法。
(付記18)
コンピュータに、ガンマ特性推定処理を実行させるプログラムであって、
カメラで第1及び第2の光源からの光を照射される対象物を撮影する手順と、
前記第1及び第2の光源のオン・オフを制御する手順と、
前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定する手順
を前記コンピュータに実行させることを特徴とする、プログラム。
(付記19)
前記最も尤もらしくなる関数を求めるための誤差最小を推定するために、最小二乗法、ユークリッド距離、シンプレックス、及び黄金分割法のうち少なくとも1つを用いることを特徴とする、付記18記載のプログラム。
(付記20)
前記予想される関数として、前記カメラの入射光量x及び出力値y、定数αで示すとy=αxγで表される関数、折れ線状の関数、及び二次関数のうち少なくとも1つを用いることを特徴とする、付記18または19記載のプログラム。
(付記21)
前記予想される関数は、複数、記憶部に格納されており、
前記推定する手順は、評価関数である二乗誤差が最小になる計算モデルの関数を推定したガンマ特性をガンマ特性推定処理により推定された最終結果として選択することを特徴とする、付記18乃至20のいずれか1項記載のプログラム。
(付記22)
表示部を前記第1及び第2の光源として機能させる手順
をさらに前記コンピュータに実行させることを特徴とする、付記18乃至21のいずれか1項記載のプログラム。
The following additional notes are further disclosed with respect to the embodiment including the above examples.
(Appendix 1)
A camera for photographing an object irradiated with light from the first and second light sources;
A controller for controlling on / off of the first and second light sources;
When the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are on A data processing unit that applies an output value of the camera when the object is photographed to an expected function and estimates a gamma characteristic from a function in which the amount of light obtained from the inverse function of the expected function is most likely A gamma characteristic estimation device characterized by that.
(Appendix 2)
The gamma characteristic according to claim 1, wherein at least one of least square method, Euclidean distance, simplex, and golden section method is used to estimate the minimum error for obtaining the most likely function. Estimating device.
(Appendix 3)
As a function to be the expected amount of incident light x and the output value y of the camera, the function expressed by y = .alpha.x gamma when indicated by constant alpha, polygonal line function, and the use of at least one of quadratic function The gamma characteristic estimation apparatus according to appendix 1 or 2, characterized by:
(Appendix 4)
A storage unit storing a plurality of the expected functions;
The data processing unit selects a gamma characteristic obtained by estimating a function of a calculation model that minimizes a square error, which is an evaluation function, as a final result estimated by the gamma characteristic estimation process. The gamma characteristic estimation apparatus of any one of Claims.
(Appendix 5)
5. The gamma characteristic estimation apparatus according to claim 1, further comprising a single processor that functions as the control unit and the data processing unit.
(Appendix 6)
The gamma characteristic estimation apparatus according to any one of appendices 1 to 5, further comprising the first and second light sources.
(Appendix 7)
The gamma characteristic estimation apparatus according to appendix 6, further comprising a display unit that functions as the first and second light sources.
(Appendix 8)
The control unit is provided in a first electronic device having a communication function,
The gamma characteristic estimation device according to any one of appendices 1 to 7, wherein the data processing unit is provided in a second electronic device capable of communicating with the first electronic device.
(Appendix 9)
The gamma characteristic estimation device according to appendix 8, wherein the second electronic device is provided in a cloud computing system.
(Appendix 10)
Photographing an object irradiated with light from the first and second light sources with a camera,
The controller controls on / off of the first and second light sources,
In the data processor, the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are Applying the output value of the camera when the object is photographed in the ON state to an expected function, and estimating the gamma characteristic from the function that the light quantity obtained from the inverse function of the expected function is most likely A gamma characteristic estimation method characterized by
(Appendix 11)
The gamma characteristic according to appendix 10, wherein at least one of least square method, Euclidean distance, simplex, and golden section method is used to estimate a minimum error for obtaining the most likely function. Estimation method.
(Appendix 12)
As a function to be the expected amount of incident light x and the output value y of the camera, the function expressed by y = .alpha.x gamma when indicated by constant alpha, polygonal line function, and the use of at least one of quadratic function The gamma characteristic estimation method according to appendix 10 or 11, wherein
(Appendix 13)
A plurality of the expected functions are stored in the storage unit,
Any one of appendices 10 to 12, wherein a gamma characteristic obtained by estimating a function of a calculation model that minimizes a square error as an evaluation function in the data processing unit is selected as a final result estimated by the gamma characteristic estimation process. 2. The gamma characteristic estimation method according to claim 1.
(Appendix 14)
14. The gamma characteristic estimation method according to any one of appendices 10 to 13, wherein the functions of the control unit and the data processing unit are realized by a single processor.
(Appendix 15)
The gamma characteristic estimation method according to any one of appendices 10 to 14, wherein the functions of the first and second light sources are realized by a display unit.
(Appendix 16)
Realizing the function of the control unit in a first electronic device having a communication function;
The gamma characteristic estimation method according to any one of appendices 10 to 15, wherein the function of the data processing unit is realized in a second electronic device capable of communicating with the first electronic device.
(Appendix 17)
The gamma characteristic estimation method according to appendix 16, wherein the second electronic device is provided in a cloud computing system.
(Appendix 18)
A program for causing a computer to execute gamma characteristic estimation processing,
A procedure for photographing an object irradiated with light from the first and second light sources with a camera;
A procedure for controlling on / off of the first and second light sources;
When the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are on Applying the output value of the camera when the object is photographed to an expected function, and estimating the gamma characteristic from the function that makes the light quantity obtained from the inverse function of the expected function most likely A program characterized by being executed.
(Appendix 19)
The program according to appendix 18, wherein at least one of least square method, Euclidean distance, simplex, and golden section method is used to estimate the minimum error for obtaining the most likely function.
(Appendix 20)
As a function to be the expected amount of incident light x and the output value y of the camera, the function expressed by y = .alpha.x gamma when indicated by constant alpha, polygonal line function, and the use of at least one of quadratic function The program according to appendix 18 or 19, characterized by:
(Appendix 21)
A plurality of the expected functions are stored in the storage unit,
The appending steps 18 to 20 are characterized in that the estimating step selects a gamma characteristic obtained by estimating a function of a calculation model that minimizes a square error as an evaluation function as a final result estimated by the gamma characteristic estimation process. The program according to any one of the above.
(Appendix 22)
The program according to any one of appendices 18 to 21, further causing the computer to execute a procedure for causing a display unit to function as the first and second light sources.
以上、開示のガンマ特性推定装置、方法及びプログラムを実施例により説明したが、本発明は上記の実施例に限定されるものではなく、本発明の範囲内で種々の変形及び改良が可能であることは言うまでもない。 Although the disclosed gamma characteristic estimation apparatus, method, and program have been described with the embodiments, the present invention is not limited to the above-described embodiments, and various modifications and improvements can be made within the scope of the present invention. Needless to say.
1 ガンマ特性推定装置
2 電源
3,4 スイッチ
5−1 第1の光源
5−2 第2の光源
6 デジタルカメラ
7 データ処理部
15−1,15−2 表示
31 スマートフォン
41 PC
51 クラウドコンピューティングシステム
303 調整部
311,411 CPU
312,412 記憶部
315,415 表示部
DESCRIPTION OF SYMBOLS 1 Gamma characteristic estimation apparatus 2 Power supply 3, 4 Switch 5-1 1st light source 5-2 2nd light source 6 Digital camera 7 Data processing part 15-1, 15-2 Display 31 Smartphone 41 PC
51 Cloud Computing System 303 Adjustment Units 311 and 411 CPU
312 and 412 storage units 315 and 415 display units
Claims (6)
前記第1及び第2の光源のオン・オフを制御する制御部と、
前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定するデータ処理部
を備えたことを特徴とする、ガンマ特性推定装置。 A camera for photographing an object irradiated with light from the first and second light sources;
A controller for controlling on / off of the first and second light sources;
When the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are on A data processing unit that applies an output value of the camera when the object is photographed to an expected function and estimates a gamma characteristic from a function in which the amount of light obtained from the inverse function of the expected function is most likely A gamma characteristic estimation device characterized by that.
前記データ処理部は、前記カメラの出力値と前記予想される関数の値との差を二乗した二乗誤差を足し合わせる評価関数の値が最小になる計算モデルの関数を推定したガンマ特性を、ガンマ特性推定処理により推定された最終結果として選択することを特徴とする、請求項1乃至3のいずれか1項記載のガンマ特性推定装置。 A storage unit storing a plurality of the expected functions;
The data processing unit, a gamma characteristic value of the evaluation function adding the squared error to estimate the function of calculation model to minimize the difference the squared output values and the value of the expected function of the camera, gamma 4. The gamma characteristic estimation apparatus according to claim 1, wherein the gamma characteristic estimation apparatus is selected as a final result estimated by the characteristic estimation process.
制御部で前記第1及び第2の光源のオン・オフを制御し、
データ処理部で前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定する
ことを特徴とする、ガンマ特性推定方法。 Photographing an object irradiated with light from the first and second light sources with a camera,
The controller controls on / off of the first and second light sources,
In the data processor, the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are Applying the output value of the camera when the object is photographed in the ON state to an expected function, and estimating the gamma characteristic from the function that the light quantity obtained from the inverse function of the expected function is most likely A gamma characteristic estimation method characterized by
カメラで第1及び第2の光源からの光を照射される対象物を撮影する手順と、
前記第1及び第2の光源のオン・オフを制御する手順と、
前記第1の光源がオンで前記第2の光源がオフの状態、前記第1の光源がオフで前記第2の光源がオンの状態、及び前記第1及び第2の光源がオンの状態で前記対象物を撮影した時の前記カメラの出力値を予想される関数に当てはめ、前記予想される関数の逆関数から求めた光量が最も尤もらしくなる関数からガンマ特性を推定する手順
を前記コンピュータに実行させることを特徴とする、プログラム。 A program for causing a computer to execute gamma characteristic estimation processing,
A procedure for photographing an object irradiated with light from the first and second light sources with a camera;
A procedure for controlling on / off of the first and second light sources;
When the first light source is on and the second light source is off, the first light source is off and the second light source is on, and the first and second light sources are on Applying the output value of the camera when the object is photographed to an expected function, and estimating the gamma characteristic from the function that makes the light quantity obtained from the inverse function of the expected function most likely A program characterized by being executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013157882A JP6252014B2 (en) | 2013-07-30 | 2013-07-30 | Gamma characteristic estimation apparatus, method and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013157882A JP6252014B2 (en) | 2013-07-30 | 2013-07-30 | Gamma characteristic estimation apparatus, method and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2015029202A JP2015029202A (en) | 2015-02-12 |
| JP6252014B2 true JP6252014B2 (en) | 2017-12-27 |
Family
ID=52492643
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013157882A Expired - Fee Related JP6252014B2 (en) | 2013-07-30 | 2013-07-30 | Gamma characteristic estimation apparatus, method and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6252014B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102469454B1 (en) * | 2021-06-30 | 2022-11-24 | 한국생산기술연구원 | A correction method of vignette image based on 3D stereoscopic model |
| CN113804297B (en) * | 2021-08-27 | 2023-09-19 | 上海应用技术大学 | A collaborative method and collaborative device for multi-channel RGB color calibration |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS60257673A (en) * | 1984-06-04 | 1985-12-19 | Hitachi Denshi Ltd | How to set gamma value for television camera |
| JP2002199246A (en) * | 2001-11-05 | 2002-07-12 | Konica Corp | Imaging device |
| JP5792046B2 (en) * | 2011-12-07 | 2015-10-07 | オリンパス株式会社 | Image processing device |
| JP6115109B2 (en) * | 2012-12-10 | 2017-04-19 | 富士通株式会社 | Gamma characteristic acquisition apparatus, method and program |
-
2013
- 2013-07-30 JP JP2013157882A patent/JP6252014B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2015029202A (en) | 2015-02-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108668093B (en) | HDR image generation method and device | |
| TWI773808B (en) | Apparatus and method of low complexity optimization solver for path smoothing | |
| CN112304421B (en) | A method for processing grayscale intensity data, a storage medium and a terminal device | |
| JP6617432B2 (en) | Image processing apparatus and program | |
| CN113497927B (en) | White balance adjustment method, device, terminal and storage medium | |
| JP5870598B2 (en) | Image white balance processing method and apparatus | |
| WO2016200553A1 (en) | Methods and devices for correction of camera module sensitivity and flash color variation | |
| JP2016173477A5 (en) | ||
| JP2018081308A5 (en) | ||
| CN107431794B (en) | Image processing device and color balance method | |
| JP6252014B2 (en) | Gamma characteristic estimation apparatus, method and program | |
| KR20160076645A (en) | Method for vignetting correction of image and apparatus therefor | |
| US10097736B2 (en) | Image processing device and image processing method | |
| KR102735353B1 (en) | Method for providing white balance and electronic device for supporting the same | |
| CN107071282B (en) | Photo processing method and mobile terminal | |
| KR102706932B1 (en) | method for generating image and electronic device thereof | |
| US11625816B2 (en) | Learning device, image generation device, learning method, image generation method, and program | |
| CN104394330B (en) | The autocontrol method and automatic control system of brightness of image | |
| JP2019049692A (en) | Method and apparatus for adapting display visibility | |
| CN112541863A (en) | Compressing dynamic range in an image using a dark gamma transfer function | |
| CN116708756A (en) | Accuracy detection method of sensor, detection device, electronic equipment and storage medium | |
| US20140152862A1 (en) | Image processing apparatus, image pickup apparatus, image pickup system, image processing method, and non-transitory computer-readable storage medium | |
| US9633421B2 (en) | Image compensation value computation | |
| JP6115109B2 (en) | Gamma characteristic acquisition apparatus, method and program | |
| JP6745317B2 (en) | Method for compensating colorimetry in a projection system, apparatus for performing the method, computer readable storage medium, and projection system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160405 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170302 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170411 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170601 |
|
| 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: 20171031 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171113 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6252014 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |