JP2018191050A - Image processing system, image processing method, and program - Google Patents

Image processing system, image processing method, and program Download PDF

Info

Publication number
JP2018191050A
JP2018191050A JP2017089718A JP2017089718A JP2018191050A JP 2018191050 A JP2018191050 A JP 2018191050A JP 2017089718 A JP2017089718 A JP 2017089718A JP 2017089718 A JP2017089718 A JP 2017089718A JP 2018191050 A JP2018191050 A JP 2018191050A
Authority
JP
Japan
Prior art keywords
correction
image
image data
data
light source
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.)
Pending
Application number
JP2017089718A
Other languages
Japanese (ja)
Inventor
秀康 田代
Hideyasu Tashiro
秀康 田代
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2017089718A priority Critical patent/JP2018191050A/en
Publication of JP2018191050A publication Critical patent/JP2018191050A/en
Pending legal-status Critical Current

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide one method for reducing distortion of an image obtained by imaging and dividing a subject into a plurality of regions.SOLUTION: An image processing system includes: first acquisition means of acquiring a plurality of image data indicating glossiness of a subject in a plurality of regions including a duplicate region; second acquisition means of acquiring correction image data for correcting distortion of each of the plurality of image data by imaging a reference plate arranged in a predetermined region corresponded to the plurality of regions; and generation means of generating geometrical conversion data corresponded to each correction of the plurality of image data indicating a movement amount for moving a position corresponded to the light source entered into the correction image indicated by the correction image data in parallel in the correction image, and an amplification for expanding and reducing the size of the light source entered into the correction image in the correction image.SELECTED DRAWING: Figure 4

Description

本発明は、画像の歪みを低減するための画像処理技術に関する。   The present invention relates to an image processing technique for reducing image distortion.

近年、光源からの光が照射された被写体を撮像することによって、当該被写体の反射特性を取得する方法が知られている。撮像によって被写体の反射特性を取得する際に、光源の配光特性や輝度ムラによって反射特性の取得精度が低下してしまうという課題があった。上記の課題を解決する方法として特許文献1の技術がある。特許文献1の技術では、被写体と、当該被写体と同一の位置に配置した鏡面を有する基準板とを撮像する。当該被写体を撮像することによって得られた撮像画像に対して、当該基準板を撮像することによって得られた撮像画像を用いたシェーディング補正を行うことによって、被写体の反射特性を高精度に取得している。   2. Description of the Related Art In recent years, a method for acquiring a reflection characteristic of a subject by imaging a subject irradiated with light from a light source is known. When acquiring the reflection characteristic of a subject by imaging, there is a problem that the acquisition accuracy of the reflection characteristic is lowered due to the light distribution characteristic and luminance unevenness of the light source. As a method for solving the above problem, there is a technique disclosed in Patent Document 1. In the technique of Patent Document 1, an image of a subject and a reference plate having a mirror surface arranged at the same position as the subject is captured. By performing shading correction using the captured image obtained by capturing the reference plate on the captured image obtained by capturing the subject, the reflection characteristics of the subject can be obtained with high accuracy. Yes.

特開2012−002601号公報JP 2012-002601 A

一方で、被写体のサイズが大きい、又は、被写体の表面の詳細を高精度に取得したい場合には、被写体を複数の領域に分割して撮像し、撮像によって得られた分割画像にそれぞれシェーディング補正を施した後合成を行う。しかしながら、被写体と同一サイズの基準板を用意することができない場合がある。この場合、分割画像の画角と同一サイズの基準板を用いて各分割画像に対応するシェーディング補正用の画像を得る必要があるが、分割画像に対応する領域全てに正確に位置を合わせて基準板を配置することは困難である。また、被写体の一部領域に配置した基準板を撮像して得られた画像を用いて各分割画像のシェーディング補正をしようとすると、基準板の位置と分割画像に対応する領域の位置とのずれが生じる。この場合、被写体が傾いて配置されていると光源からの光が当たる位置が分割画像ごとに変わるため、各分割画像に適したシェーディング補正用の画像を得ることができないという課題がある。   On the other hand, if the size of the subject is large or if you want to acquire the details of the surface of the subject with high accuracy, the subject is divided into a plurality of areas, and the shading correction is performed on each of the divided images obtained by the imaging. After application, synthesis is performed. However, there are cases where a reference plate having the same size as the subject cannot be prepared. In this case, it is necessary to obtain a shading correction image corresponding to each divided image using a reference plate having the same size as the angle of view of the divided image. However, the reference position is accurately aligned with all the regions corresponding to the divided image. Placing the board is difficult. In addition, if the shading correction of each divided image is performed using an image obtained by imaging a reference plate arranged in a partial area of the subject, the difference between the position of the reference plate and the position of the region corresponding to the divided image Occurs. In this case, if the subject is tilted, the position where the light from the light source strikes changes for each divided image, so that there is a problem that an image for shading correction suitable for each divided image cannot be obtained.

本発明は、上記課題に鑑みてなされたものであり、被写体を複数の領域に分割して撮像することによって得られる画像の歪みを低減するための一手法を提供することを目的とする。   The present invention has been made in view of the above problems, and an object of the present invention is to provide a technique for reducing distortion of an image obtained by dividing a subject into a plurality of regions and capturing an image.

上記課題を解決するために、本発明に係る画像処理装置は、被写体を隣り合った領域に重複領域を設けて複数の領域に分割し、光源からの光が照射された前記複数の領域それぞれを撮像することによって得られた複数の画像データの歪みを補正するための画像処理装置であって、前記重複領域を含む前記複数の領域それぞれにおける前記被写体の光沢を表す前記複数の画像データを取得する第1取得手段と、前記複数の領域に対応する所定の領域に配置された基準板を撮像することによって、前記複数の画像データそれぞれの歪みを補正するための補正用画像データを取得する第2取得手段と、前記複数の画像データに基づいて、前記補正用画像データが表す補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させるための移動量と、前記補正用画像内に写り込んだ前記光源の大きさを前記補正用画像内において拡大又は縮小するための倍率とを表す、前記複数の画像データそれぞれの補正に対応する幾何変換データを生成する第1生成手段と、を有することを特徴とする。   In order to solve the above problems, an image processing apparatus according to the present invention divides a subject into a plurality of regions by providing overlapping regions in adjacent regions, and each of the plurality of regions irradiated with light from a light source is provided. An image processing apparatus for correcting distortion of a plurality of image data obtained by imaging, wherein the plurality of image data representing the gloss of the subject in each of the plurality of regions including the overlapping region is acquired. A second acquisition unit configured to acquire correction image data for correcting distortion of each of the plurality of image data by imaging a reference plate arranged in a predetermined region corresponding to the plurality of regions; Based on the acquisition means and the plurality of image data, the position corresponding to the light source reflected in the correction image represented by the correction image data is flattened in the correction image. Corresponding to the correction of each of the plurality of image data, which represents the amount of movement for movement and the magnification for enlarging or reducing the size of the light source reflected in the correction image in the correction image And first generation means for generating geometric transformation data.

被写体を複数の領域に分割して撮像することによって得られる画像の歪みを低減するための一手法を提供することができる。   It is possible to provide a method for reducing distortion of an image obtained by dividing a subject into a plurality of regions and capturing an image.

被写体101を撮像する方法を説明するための模式図Schematic diagram for explaining a method of imaging the subject 101 画像処理装置1のハードウェア構成を示すブロック図The block diagram which shows the hardware constitutions of the image processing apparatus 1 画像処理装置1の論理構成を示すブロック図The block diagram which shows the logic structure of the image processing apparatus 1 画像処理装置1が実行する処理の流れを示すフローチャートThe flowchart which shows the flow of the process which the image processing apparatus 1 performs 重複領域データ生成部309が実行する処理の流れを示すフローチャートThe flowchart which shows the flow of the process which the duplication area | region data generation part 309 performs. 移動方向データ生成部310が実行する処理の流れを示すフローチャートThe flowchart which shows the flow of the process which the movement direction data generation part 310 performs. 幾何変換データ生成部311が実行する処理の流れを示すフローチャートThe flowchart which shows the flow of the process which the geometric transformation data generation part 311 performs 補正後画像データを説明するための図Diagram for explaining the corrected image data 重複領域データを説明するための図Diagram for explaining overlapping area data 移動方向データを生成する処理を説明するための図The figure for demonstrating the process which produces | generates movement direction data 光源位置L’,L’i+jを説明するための図The figure for demonstrating light source position L' i , L' i + j 補正用画像に写り込む光源の移動方向を表す式の係数を説明するための図The figure for demonstrating the coefficient of the formula showing the moving direction of the light source reflected in the image for correction | amendment 幾何変換データを生成する処理を説明するための図The figure for demonstrating the process which produces | generates geometric transformation data 画像処理装置1が実行する処理の結果を説明するための図The figure for demonstrating the result of the process which the image processing apparatus 1 performs 画像処理装置1が実行する処理の流れを示すフローチャートThe flowchart which shows the flow of the process which the image processing apparatus 1 performs 影領域を説明するための図Illustration for explaining shadow area

以下、本発明の実施例について、図面を参照して説明する。尚、以下の実施例は本発明を限定するものではなく、また、以下の実施例で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。尚、同一の構成については、同じ符号を付して説明する。   Embodiments of the present invention will be described below with reference to the drawings. The following embodiments do not limit the present invention, and not all combinations of features described in the following embodiments are essential to the solution means of the present invention. In addition, about the same structure, the same code | symbol is attached | subjected and demonstrated.

[実施例1]
<光学ユニット102を用いて被写体101を撮像する方法>
図1(a)は、被写体101及び光学ユニット102を説明するための模式図である。被写体101は、絵の具の盛り上がりによる凹凸と塗布されたニスによる光沢とを表面に有する油彩画である。光学ユニット102は、撮像装置(カメラ)103と面光源104とが可動ステージに保持されたユニットである。光学ユニット102は、被写体101に対して略正対の位置に配置される。但し、被写体101の配置誤差により、被写体101の略平面が光学ユニット102の横方向のX軸に対して−Δθだけわずかに傾いているとする。図1(a)に示すように、光学ユニット102上には、光学ユニット102の位置Pos(i)を原点Oとして、撮像装置103がX軸上の点Cの位置に配置され、面光源104がX軸上の点Lの位置に配置されている。撮像装置103は、光軸の向きを表すベクトルnがnc=(1/√2,0,1/√2)となる向きで配置されている。面光源104は、面法線の向きを表すベクトルnがn=(0,0,1)となる向きで配置されている。尚、撮像装置103は、レンズ、絞り、シャッタ、光学ローパスフィルタ、カラーフィルタ、及び、CMOSやCCDなどのセンサから構成され、被写体101の光量を検知し、A/D変換を経てデジタルデータを出力する。尚、面光源104は、X軸方向に1、Y軸方向に1の大きさとする。また、本実施例における面光源104には、画面全体を白く表示(全白表示)させた液晶ディスプレイを用いる。また、面光源104として用いる液晶ディスプレイの輝度は画面内で均一であり、液晶ディスプレイの画面から放たれる光は等方的に拡がる拡散光である。
[Example 1]
<Method for Imaging Subject 101 Using Optical Unit 102>
FIG. 1A is a schematic diagram for explaining the subject 101 and the optical unit 102. The subject 101 is an oil painting having unevenness due to the rising of the paint and gloss due to the applied varnish on the surface. The optical unit 102 is a unit in which an imaging device (camera) 103 and a surface light source 104 are held on a movable stage. The optical unit 102 is disposed at a substantially directly facing position with respect to the subject 101. However, it is assumed that the substantially flat surface of the subject 101 is slightly tilted by −Δθ with respect to the lateral X-axis of the optical unit 102 due to the placement error of the subject 101. As illustrated in FIG. 1A, on the optical unit 102, the imaging device 103 is disposed at a position C on the X axis with the position Pos (i) of the optical unit 102 as the origin O, and the surface light source 104. Is arranged at the position of the point L on the X axis. The imaging device 103 is arranged in a direction in which a vector n C representing the direction of the optical axis is nc = (1 / √2, 0, 1 / √2). The surface light source 104 is arranged in such a direction that a vector n L representing the direction of the surface normal is n L = (0, 0, 1). The imaging device 103 includes a lens, an aperture, a shutter, an optical low-pass filter, a color filter, and sensors such as a CMOS and a CCD, detects the amount of light of the subject 101, and outputs digital data through A / D conversion. To do. The surface light source 104 has a size of 1 in the X-axis direction and 1 in the Y-axis direction. Further, as the surface light source 104 in this embodiment, a liquid crystal display in which the entire screen is displayed in white (all white display) is used. The luminance of the liquid crystal display used as the surface light source 104 is uniform within the screen, and the light emitted from the screen of the liquid crystal display is diffused light that isotropically spreads.

本実施例においては、図1(b)のように、面光源104からの光が照射された被写体101を撮像することによる撮像画像データの取得と、可動ステージによる光学ユニット102の移動とを繰り返す。これにより、撮像装置103の画角よりサイズが大きい被写体101の光沢強度を取得する。具体的には、可動ステージをX軸方向に距離Δxで4箇所、Y軸方向に距離Δyで4箇所の計16箇所に逐次移動させることにより、各光学ユニット102の位置Pos(i)における撮像画像データを取得する。尚、後述する画像処理装置1の処理において複数の画像データを重複領域で合成してつなぎ合わせるため、図1(b)のように、各撮像画像データが表す領域が隣合う領域に重複領域を設けて撮像を行うようにする。   In this embodiment, as shown in FIG. 1B, acquisition of captured image data by imaging the subject 101 irradiated with light from the surface light source 104 and movement of the optical unit 102 by the movable stage are repeated. . Thereby, the gloss intensity of the subject 101 having a size larger than the angle of view of the imaging device 103 is acquired. Specifically, the movable stage is sequentially moved to a total of 16 locations with a distance Δx in the X-axis direction and 4 locations with a distance Δy in the Y-axis direction, thereby imaging at the position Pos (i) of each optical unit 102. Get image data. Note that, in the processing of the image processing apparatus 1 to be described later, in order to combine and join a plurality of image data in the overlapping area, as shown in FIG. Provided for imaging.

<画像処理装置1のハードウェア構成>
画像処理装置1のハードウェア構成を図2を用いて説明する。画像処理装置1は、例えばコンピュータであり、CPU201、ROM202、RAM203を備える。CPU201は、RAM203をワークメモリとして、ROM202、HDD(ハードディスクドライブ)213などに格納されたOS(オペレーティングシステム)や各種プログラムを実行する。また、CPU201は、システムバス208を介して各構成を制御する。尚、後述するフローチャートによる処理は、ROM202やHDD213などに格納されたプログラムコードがRAM203に展開され、CPU201によって実行される。VC(ビデオカード)204には、ディスプレイ215が接続される。汎用I/F(インターフェース)205には、シリアルバス209を介して、マウスやキーボードなどの入力デバイス210や光学ユニット102、画像形成装置211が接続される。SATA(シリアルATA)I/F206には、シリアルバス212を介して、HDD213や各種記録メディアの読み書きを行う汎用ドライブ214が接続される。NIC(ネットワークインターフェースカード)207は、外部装置との間で情報の入出力を行う。CPU201は、HDD213や汎用ドライブ214にマウントされた各種記録メディアを各種データの格納場所として使用する。CPU201は、プログラムによって提供されるUI(ユーザインターフェース)をディスプレイ215に表示し、入力デバイス210を介して受け付けるユーザ指示などの入力を受信する。また、CPU201は、上述した方法によって被写体101の撮像を行うように光学ユニット102を制御する。
<画像処理装置1の論理構成>
図3は、本実施例における画像処理装置1の論理構成を示すブロック図である。第1取得部305は、入力端子301を介して、面光源104からの光を照射した被写体101を上述の方法で撮像することによって得られた複数の撮像画像データを取得する。取得した撮像画像データは、重複領域データ生成部309、幾何変換データ生成部311、補正後画像データ生成部312へ出力する。第2取得部306は、入力端子302を介して、面光源104からの光を照射した基準板を撮像することによって得られた、第1取得部305によって取得された撮像画像データに対してシェーディング補正を行うための補正用画像データを取得する。取得した補正用画像データは、幾何変換データ生成部311、補正後画像データ生成部312へ出力する。第3取得部307は、入力端子303を介して、被写体101を撮像する際の面光源104に関する情報を表す光源データを取得する。取得した光源データは、移動方向データ生成部310へ出力する。第4取得部308は、入力端子304を介して、被写体101を撮像する際の撮像装置103に関する情報を表す撮像データを取得する。取得した撮像データは、重複領域データ生成部309、移動方向データ生成部310、合成画像データ生成部313へ出力する。
<Hardware Configuration of Image Processing Apparatus 1>
A hardware configuration of the image processing apparatus 1 will be described with reference to FIG. The image processing apparatus 1 is a computer, for example, and includes a CPU 201, a ROM 202, and a RAM 203. The CPU 201 executes an OS (operating system) and various programs stored in the ROM 202, the HDD (hard disk drive) 213, and the like using the RAM 203 as a work memory. The CPU 201 controls each component via the system bus 208. Note that the processing according to the flowchart to be described later is executed by the CPU 201 after the program code stored in the ROM 202, the HDD 213, or the like is expanded in the RAM 203. A display 215 is connected to the VC (video card) 204. The general-purpose I / F (interface) 205 is connected to an input device 210 such as a mouse and a keyboard, the optical unit 102, and the image forming apparatus 211 via a serial bus 209. A general-purpose drive 214 that reads / writes data from / to the HDD 213 and various recording media is connected to the SATA (serial ATA) I / F 206 via the serial bus 212. A NIC (network interface card) 207 inputs and outputs information with an external device. The CPU 201 uses various recording media mounted on the HDD 213 and the general-purpose drive 214 as storage locations for various data. The CPU 201 displays a UI (user interface) provided by the program on the display 215 and receives an input such as a user instruction received through the input device 210. Further, the CPU 201 controls the optical unit 102 so that the subject 101 is imaged by the method described above.
<Logical Configuration of Image Processing Apparatus 1>
FIG. 3 is a block diagram illustrating a logical configuration of the image processing apparatus 1 in the present embodiment. The first acquisition unit 305 acquires a plurality of captured image data obtained by imaging the subject 101 irradiated with light from the surface light source 104 by the above-described method via the input terminal 301. The acquired captured image data is output to the overlapping region data generation unit 309, the geometric transformation data generation unit 311 and the corrected image data generation unit 312. The second acquisition unit 306 performs shading on the captured image data acquired by the first acquisition unit 305 obtained by imaging the reference plate irradiated with light from the surface light source 104 via the input terminal 302. Image data for correction for correction is acquired. The acquired correction image data is output to the geometric transformation data generation unit 311 and the corrected image data generation unit 312. The third acquisition unit 307 acquires light source data representing information regarding the surface light source 104 when the subject 101 is imaged via the input terminal 303. The acquired light source data is output to the movement direction data generation unit 310. The fourth acquisition unit 308 acquires imaging data representing information regarding the imaging device 103 when imaging the subject 101 via the input terminal 304. The acquired imaging data is output to the overlapping area data generation unit 309, the movement direction data generation unit 310, and the composite image data generation unit 313.

重複領域データ生成部309は、複数の撮像画像データと撮像データとに基づいて、各撮像画像データ間で重複する領域を表す重複領域データを生成する。生成した重複領域データは、幾何変換データ生成部311、合成画像データ生成部313へ出力する。移動方向データ生成部310は、光源データと撮像データとに基づいて、補正用画像データが表す補正用画像内に写りこんだ光源に対応する位置を補正用画像内において平行移動させる方向を表す移動方向データを生成する。生成した移動方向データは、幾何変換データ生成部311に出力する。幾何変換データ生成部311は、複数の撮像画像データと補正用画像データと重複領域データと移動方向データとに基づいて、補正用画像データが表す補正用画像内に写りこんだ光源を幾何変換するための幾何変換データを生成する。生成した幾何変換データは補正後画像データ生成部312へ出力する。補正後画像データ生成部312は、幾何変換データを用いて、補正用画像データが表す補正用画像内に写りこんだ光源を幾何変換する。さらに、写りこんだ光源が幾何変換された補正用画像データを用いて撮像画像データをシェーディング補正することによって補正後画像データを生成する。生成した補正後画像データは、合成画像データ生成部313へ出力する。合成画像データ生成部313は、撮像データと補正後画像データと重複領域データとに基づいて、複数の補正後画像データを重複領域で合成することによって合成画像データを生成する。生成した合成画像データは出力端子314から出力する。   The overlapping area data generation unit 309 generates overlapping area data representing an overlapping area between the respective captured image data based on the plurality of captured image data and the captured data. The generated overlapping area data is output to the geometric transformation data generation unit 311 and the composite image data generation unit 313. The movement direction data generation unit 310 moves based on the light source data and the imaging data and indicates a direction in which the position corresponding to the light source reflected in the correction image represented by the correction image data is translated in the correction image. Generate direction data. The generated movement direction data is output to the geometric transformation data generation unit 311. The geometric transformation data generation unit 311 geometrically transforms the light source reflected in the correction image represented by the correction image data based on the plurality of captured image data, correction image data, overlap area data, and movement direction data. To generate geometric transformation data. The generated geometric transformation data is output to the corrected image data generation unit 312. The corrected image data generation unit 312 geometrically converts the light source reflected in the correction image represented by the correction image data using the geometric conversion data. Further, the corrected image data is generated by performing shading correction on the captured image data using the correction image data obtained by geometric conversion of the reflected light source. The generated corrected image data is output to the composite image data generation unit 313. The composite image data generation unit 313 generates composite image data by combining a plurality of corrected image data in the overlap region based on the imaging data, the corrected image data, and the overlap region data. The generated composite image data is output from the output terminal 314.

<画像処理装置1が実行する処理の流れ>
図4は、画像処理装置1が実行する処理を示すフローチャートである。詳細には、図4のフローチャートに示す手順を記述したコンピュータで実行可能なプログラムをROM202からRAM203上に読み込んだ後に、CPU201によって当該プログラムが実行される。以下、図4に示す各処理について説明する。
<Flow of processing executed by image processing apparatus 1>
FIG. 4 is a flowchart showing processing executed by the image processing apparatus 1. Specifically, after a computer-executable program describing the procedure shown in the flowchart of FIG. 4 is read from the ROM 202 onto the RAM 203, the CPU 201 executes the program. Hereinafter, each process shown in FIG. 4 will be described.

ステップS401において、第1取得部305は、入力端子301を介して、面光源104からの光を照射した被写体101を撮像することによって得られた複数の撮像画像データを取得する。ここで取得する撮像画像データは、被写体101の光沢を表す光沢情報の2次元分布を記述したデータであり、各位置(画素)における光沢情報を8ビットの画素値に変換したグレースケール画像として扱う。本実施例においては、カラー画像が各画素に有するRGB値などの色情報を輝度値に変換することによって得られたグレースケール画像を予めHDD213等の記憶装置に記憶させておき、当該記憶装置から当該グレースケール画像を取得する。グレースケール画像の各画素が有する光沢情報としての輝度値は、カラー画像のG値であってもよいし、R値,G値,B値について所定の重みによる加重平均の値であってもよい。尚、撮像装置103から直接グレースケール画像を取得してもよいし、カラー画像をステップS401においてグレースケール画像に変換してもよい。取得した複数の撮像画像データは、重複領域データ生成部309、幾何変換データ生成部311、補正後画像データ生成部312へ出力する。   In step S <b> 401, the first acquisition unit 305 acquires a plurality of captured image data obtained by imaging the subject 101 irradiated with light from the surface light source 104 via the input terminal 301. The captured image data acquired here is data describing a two-dimensional distribution of gloss information representing the gloss of the subject 101, and is handled as a grayscale image obtained by converting the gloss information at each position (pixel) into an 8-bit pixel value. . In this embodiment, a grayscale image obtained by converting color information such as RGB values in each pixel of a color image into luminance values is stored in a storage device such as the HDD 213 in advance, and the storage device stores the grayscale image. The gray scale image is acquired. The luminance value as gloss information possessed by each pixel of the grayscale image may be the G value of the color image, or may be a weighted average value with a predetermined weight for the R value, G value, and B value. . Note that a grayscale image may be acquired directly from the imaging device 103, or a color image may be converted into a grayscale image in step S401. The acquired plurality of captured image data are output to the overlapping area data generation unit 309, the geometric transformation data generation unit 311 and the corrected image data generation unit 312.

ステップS402において、第2取得部306は、入力端子302を介して、面光源104からの光を照射した基準板を撮像することによって得られた補正用画像データを取得する。この補正用画像データは、第1取得部305によって取得された複数の撮像画像データそれぞれに対してシェーディング補正を行うための画像データである。本実施例においては、基準板を図1に示す光学ユニット102の位置Pos(1)における被写体101を撮像する画角と略同一の位置に配置し、当該基準板を撮像して得られた画像データを補正用画像データとして取得する。補正用画像データも、ステップS401で取得した複数の撮像画像データと同じような、各位置(画素)における光沢情報を8ビットの画素値に変換したグレースケール画像である。グレースケール画像の生成及び取得方法についても、ステップS401において取得した複数の撮像画像データと同様である。尚、基準板には、鏡面を有する平面鏡を用いる。また、基準板は、被写体101よりも小さく、ぞれぞれの位置における撮像の画角と略同一の大きさであるとする。取得した補正用画像データは、幾何変換データ生成部311、補正後画像データ生成部312へ出力する。   In step S <b> 402, the second acquisition unit 306 acquires correction image data obtained by imaging the reference plate irradiated with light from the surface light source 104 via the input terminal 302. The correction image data is image data for performing shading correction on each of the plurality of captured image data acquired by the first acquisition unit 305. In the present embodiment, an image obtained by arranging the reference plate at a position substantially the same as the angle of view for imaging the subject 101 at the position Pos (1) of the optical unit 102 shown in FIG. 1, and imaging the reference plate. Data is acquired as correction image data. The correction image data is also a grayscale image obtained by converting gloss information at each position (pixel) into an 8-bit pixel value, similar to the plurality of captured image data acquired in step S401. The generation and acquisition method of the gray scale image is also the same as the plurality of captured image data acquired in step S401. A flat mirror having a mirror surface is used as the reference plate. Further, it is assumed that the reference plate is smaller than the subject 101 and has substantially the same size as the angle of view for imaging at each position. The acquired correction image data is output to the geometric transformation data generation unit 311 and the corrected image data generation unit 312.

ステップS403において、第3取得部307は、入力端子303を介して、被写体101を撮像する際の面光源104に関する情報を表す光源データを取得する。面光源104に関する情報は、面光源104の位置を表す座標値及び、面光源104の面法線の方向を表すベクトルの値である。本実施例における面光源104の位置を表す座標値は、点L(1,0,0)であり、面光源104の面法線の方向を表すベクトルの値は、n=(0,0,1)である。取得した光源データは、移動方向データ生成部310へ出力する。 In step S <b> 403, the third acquisition unit 307 acquires light source data representing information regarding the surface light source 104 when the subject 101 is imaged via the input terminal 303. The information regarding the surface light source 104 is a coordinate value representing the position of the surface light source 104 and a vector value representing the direction of the surface normal of the surface light source 104. In this embodiment, the coordinate value representing the position of the surface light source 104 is a point L (1, 0, 0), and the vector value representing the direction of the surface normal of the surface light source 104 is n L = (0, 0). , 1). The acquired light source data is output to the movement direction data generation unit 310.

ステップS404において、第4取得部308は、入力端子304を介して、被写体101を撮像する際の撮像装置103に関する情報を表す撮像データを取得する。撮像装置103に関する情報は、撮像装置103の位置を表す座標値、撮像装置103の光軸の方向を表すベクトルの値及び、レンズの焦点距離である。本実施例における撮像装置103の位置を表す座標値は、点C(−1,0,0)であり、撮像装置103の光軸の方向を表すベクトルの値は、n=(1/√2,0,1/√2)である。また、35mm判換算のレンズの焦点距離は50mmである。取得した撮像データは、重複領域データ生成部309、移動方向データ生成部310、合成画像データ生成部313へ出力する。 In step S <b> 404, the fourth acquisition unit 308 acquires imaging data representing information regarding the imaging device 103 when imaging the subject 101 via the input terminal 304. The information regarding the imaging device 103 includes a coordinate value representing the position of the imaging device 103, a vector value representing the direction of the optical axis of the imaging device 103, and the focal length of the lens. In this embodiment, the coordinate value representing the position of the imaging device 103 is a point C (−1, 0, 0), and the vector value representing the direction of the optical axis of the imaging device 103 is n C = (1 / √). 2, 0, 1 / √2). In addition, the focal length of a 35 mm equivalent lens is 50 mm. The acquired imaging data is output to the overlapping area data generation unit 309, the movement direction data generation unit 310, and the composite image data generation unit 313.

ステップS405において、重複領域データ生成部309は、複数の撮像画像データと撮像データとに基づいて、各撮像画像データ間で重複する領域を表す重複領域データを生成する。本ステップにおける処理の詳細は後述する。生成した重複領域データは、幾何変換データ生成部311、合成画像データ生成部313へ出力する。ステップS406において、移動方向データ生成部310は、光源データと撮像データとに基づいて、補正用画像データが表す補正用画像内に写りこんだ光源に対応する位置を補正用画像内において平行移動させる方向を表す移動方向データを生成する。本ステップにおける処理の詳細は後述する。生成した移動方向データは、幾何変換データ生成部311に出力する。ステップS407において、幾何変換データ生成部311は、複数の撮像画像データと補正用画像データと重複領域データと移動方向データとに基づいて、補正用画像データが表す補正用画像内に写りこんだ光源を幾何変換するための幾何変換データを生成する。本ステップにおける処理の詳細は後述する。生成した幾何変換データは補正後画像データ生成部312へ出力する。   In step S405, the overlapping area data generation unit 309 generates overlapping area data representing an overlapping area between the captured image data based on the plurality of captured image data and the captured data. Details of the processing in this step will be described later. The generated overlapping area data is output to the geometric transformation data generation unit 311 and the composite image data generation unit 313. In step S406, the movement direction data generation unit 310 translates the position corresponding to the light source reflected in the correction image represented by the correction image data in the correction image based on the light source data and the imaging data. Movement direction data representing the direction is generated. Details of the processing in this step will be described later. The generated movement direction data is output to the geometric transformation data generation unit 311. In step S407, the geometric transformation data generation unit 311 includes a light source reflected in the correction image represented by the correction image data based on the plurality of captured image data, correction image data, overlap area data, and movement direction data. Geometric transformation data for geometric transformation is generated. Details of the processing in this step will be described later. The generated geometric transformation data is output to the corrected image data generation unit 312.

ステップS408において、補正後画像データ生成部312は、幾何変換データを用いて、補正用画像データが表す補正用画像内に写りこんだ光源を幾何変換する。さらに、写りこんだ光源が幾何変換された補正用画像データを用いて撮像画像データをシェーディング補正することによって補正後画像データを生成する。具体的には、まず、ステップS407において算出した拡縮量に基づいて、補正用画像データが表す補正用画像内に写りこんだ光源の大きさを拡大又は縮小する。光源の大きさの拡大又は縮小は、写り込む光源の中心に対応する画素を中心に行う。具体的には、補正用画像の重心を、写り込む光源の中心として公知の方法によって算出し、拡大又は縮小を行う。また、光源の大きさの拡大又は縮小には公知のバイリニア法を用いるが、バイキュービック法や二アレストネイバー法などを用いてもよい。次に、ステップS407において算出した移動量に基づいて、補正用画像データが表す補正用画像内に写りこんだ光源の位置を平行移動させる。例えば、画像の横方向がU軸、画像の縦方向がV軸である場合の移動量(u,v)が(10,10)であった場合、補正用画像内の各画素をU軸方向に+10、V軸方向に+10移動させる。この場合、シェーディング補正における除算によって誤った補正をしないために、平行移動によって画素値のない左下の領域の画素値は1にしておく。次に、上述のように画素値が補正された補正用画像データを用いて、ステップS401において取得した複数の撮像画像データに対して公知のシェーディング補正による除算を行う。図8(a)は、シェーディング補正を行う前の撮像画像である。補正用画像(図8(b))を移動量及び拡縮量に基づいて補正した画像が図8(c)である。図8(a)の撮像画像の画素値を、図8(c)の補正用画像の画素値で除算することによって、図8(d)の補正後画像を得ることができる。生成した補正後画像データは、合成画像データ生成部313へ出力する。   In step S408, the corrected image data generation unit 312 uses the geometric conversion data to geometrically convert the light source reflected in the correction image represented by the correction image data. Further, the corrected image data is generated by performing shading correction on the captured image data using the correction image data obtained by geometric conversion of the reflected light source. Specifically, first, based on the enlargement / reduction amount calculated in step S407, the size of the light source reflected in the correction image represented by the correction image data is enlarged or reduced. The enlargement or reduction of the size of the light source is performed around a pixel corresponding to the center of the reflected light source. Specifically, the center of gravity of the correction image is calculated as a center of the reflected light source by a known method, and enlarged or reduced. Further, a known bilinear method is used for enlarging or reducing the size of the light source, but a bicubic method or a two-arrest neighbor method may be used. Next, the position of the light source reflected in the correction image represented by the correction image data is translated based on the movement amount calculated in step S407. For example, when the movement amount (u, v) is (10, 10) when the horizontal direction of the image is the U axis and the vertical direction of the image is the V axis, each pixel in the correction image is moved in the U axis direction. To +10 and +10 in the V-axis direction. In this case, the pixel value of the lower left region where there is no pixel value by translation is set to 1 in order not to make an erroneous correction by division in the shading correction. Next, division using known shading correction is performed on the plurality of captured image data acquired in step S401 using the correction image data whose pixel values have been corrected as described above. FIG. 8A shows a captured image before shading correction. FIG. 8C shows an image obtained by correcting the correction image (FIG. 8B) based on the movement amount and the enlargement / reduction amount. By dividing the pixel value of the captured image of FIG. 8A by the pixel value of the correction image of FIG. 8C, the corrected image of FIG. 8D can be obtained. The generated corrected image data is output to the composite image data generation unit 313.

ステップS409において、合成画像データ生成部313は、撮像データと補正後画像データと重複領域データとに基づいて、複数の補正後画像データを合成することによって、1つの合成画像を表す合成画像データを生成する。具体的には、まず、補正後画像データそれぞれに対して撮像データに基づいた公知の射影変換処理を行う。   In step S409, the composite image data generation unit 313 combines composite image data representing one composite image by combining a plurality of post-correction image data based on the imaging data, the post-correction image data, and the overlapping area data. Generate. Specifically, first, a known projective transformation process based on the imaging data is performed on each of the corrected image data.

以下において射影変換処理を説明する。まず、撮像装置103を原点Oに、(0,0,1)の向きに配置し、被写体101をz=1の平面上に配置した場合の、撮像画像の画角四隅の画素位置に対応する被写体101上の三次元位置を以下の式(1)に従って算出する。   The projective transformation process will be described below. First, when the imaging device 103 is arranged at the origin O in the direction of (0, 0, 1) and the subject 101 is arranged on the plane of z = 1, it corresponds to the pixel positions of the four corners of the captured image. A three-dimensional position on the subject 101 is calculated according to the following equation (1).


(U,V)〜(U,V)は、それぞれ画角四隅の左上、右上、右下、左下の画素位置である。本実施例においては、(U,V)=(1,1)、(U,V)=(256,1)、(U,V)=(256,256)、(U,V)=(1,256)である。(X,Y,Z)〜(X,Y,Z)は、それぞれ画角四隅の画素位置(U,V)〜(U,V)に対応する被写体101上の三次元位置である。本実施例においては、Z〜Z=1である。fは撮像装置103のレンズの焦点距離である。c,cは撮像画像上の光軸中心の画素位置であり、本実施例ではc=c=128とする。次に、算出したz=1の平面上の被写体101と撮像装置103とが正対する際の画角四隅の三次元位置から、撮像装置103の光学中心Cを原点、光軸nをz軸とする座標系(カメラ座標系)に変換した三次元位置を以下の式(2)に従って算出する。

(U 1 , V 1 ) to (U 4 , V 4 ) are pixel positions at the upper left, upper right, lower right, and lower left of the four corners of the view angle, respectively. In this embodiment, (U 1 , V 1 ) = (1, 1), (U 2 , V 2 ) = (256, 1), (U 3 , V 3 ) = (256, 256), (U 4 , V 4 ) = (1,256). (X 1 , Y 1 , Z 1 ) to (X 4 , Y 4 , Z 4 ) are subjects 101 corresponding to the pixel positions (U 1 , V 1 ) to (U 4 , V 4 ) at the four corners of the angle of view, respectively. The top three-dimensional position. In the present embodiment, Z 1 to Z 4 = 1. f is the focal length of the lens of the imaging device 103. c x and c y are pixel positions in the center of the optical axis on the captured image, and in this embodiment, c x = c y = 128. Next, from the three-dimensional positions of the four corners of the angle of view when the subject 101 on the plane where z = 1 and the imaging device 103 face each other, the optical center C of the imaging device 103 is the origin, and the optical axis n C is the z axis. The three-dimensional position converted into the coordinate system (camera coordinate system) is calculated according to the following equation (2).


(X´,Y´,Z´)〜(X´,Y´,Z´)は、被写体101と撮像装置103とが正対する際の画角四隅の三次元位置(X,Y,Z)〜(X,Y,Z)をカメラ座標系に変換した三次元位置である。Rot(φ,θ)は以下の式(3)に示す、三次元位置をX軸を中心とした反時計方向にφ回転させ、光学ユニット102のY軸を中心とした反時計方向にθ回転させる回転行列である。

(X 1 ′, Y 1 ′, Z 1 ′) to (X 4 ′, Y 4 ′, Z 4 ′) are the three-dimensional positions (X of the angle of view when the subject 101 and the imaging device 103 face each other) 1 , Y 1 , Z 1 ) to (X 4 , Y 4 , Z 4 ) are three-dimensional positions converted into the camera coordinate system. Rot (φ, θ) is represented by the following formula (3): the three-dimensional position is rotated by φ counterclockwise about the X axis, and θ is rotated counterclockwise about the Y axis of the optical unit 102. This is the rotation matrix to be made.


本実施例においては、n=(1/√2,0,1/√2)なので、φ=0°,θ=45°となる。

In this embodiment, since n c = (1 / √2, 0, 1 / √2), φ = 0 ° and θ = 45 °.

更に、以下の式(4)に従い、点Cの位置にnの向きで配置した撮像装置103の撮像画像に写る三次元位置(X´,Y´,Z´)〜(X´,Y´,Z´)に対応する画素位置(u,v)〜(u,v)を算出する。 Furthermore, according to the following formula (4), the three-dimensional positions (X 1 ′, Y 1 ′, Z 1 ′) to (X 4 ) appearing in the captured image of the imaging device 103 arranged at the position of the point C in the direction of n C. Pixel positions (u 1 , v 1 ) to (u 4 , v 4 ) corresponding to ', Y 4 ', Z 4 ') are calculated.


画素位置(U,V)〜(U,V)と画素位置(u,v)〜(u,v)とから、以下の式(5)を満たす射影変換行列Projを算出する。

From the pixel positions (U 1 , V 1 ) to (U 4 , V 4 ) and the pixel positions (u 1 , v 1 ) to (u 4 , v 4 ), a projective transformation matrix P that satisfies the following expression (5) roj is calculated.


rojは、以下の式(6)に示す、撮像画像の画素位置(u,v)を被写体101と撮像装置103とが正対する際の画素位置(U,V)に変換する3×3行列である。

Proj is a 3 × 3 matrix that converts the pixel position (u, v) of the captured image into the pixel position (U, V) when the subject 101 and the imaging device 103 are facing each other , as shown in the following equation (6). It is.


射影変換行列Projは、a〜hの8個の未知パラメータで構成されており、以下の式(7)に従って各未知パラメータを算出する。

The projective transformation matrix Proj is composed of eight unknown parameters a to h, and calculates each unknown parameter according to the following equation (7).


以上の射影変換処理により、撮像装置103が被写体101に対して傾いた角度で撮像した平面を、被写体101に対して正対した状態で撮像した場合の平面に射影することができる。

Through the above-described projective conversion processing, a plane captured by the imaging apparatus 103 at an angle inclined with respect to the subject 101 can be projected onto a plane when captured in a state of facing the subject 101.

次に、射影変換処理を施した複数の補正後画像データのうち隣り合った画像データ同士を、対応する重複領域データが表す重複領域において合成する。合成には、公知のαブレンディング処理を用いる。合成によって得られた合成画像データは、出力端子314から出力する。出力先としては、HDD213等の記憶装置でもよいし、画像形成装置211など他のデバイスでもよい。尚、合成によって得られた合成画像データは、8bitのグレースケール画像データである。   Next, adjacent image data among a plurality of corrected image data subjected to the projective transformation process are combined in the overlapping area represented by the corresponding overlapping area data. A known α blending process is used for the synthesis. The synthesized image data obtained by the synthesis is output from the output terminal 314. The output destination may be a storage device such as the HDD 213 or another device such as the image forming apparatus 211. The synthesized image data obtained by the synthesis is 8-bit gray scale image data.

<重複領域データを生成する処理(S405)の流れ>
以下では、ステップS405における重複領域データを生成する処理の詳細について図5のフローチャートを用いて説明する。
<Flow of processing for generating overlapping area data (S405)>
Below, the detail of the process which produces | generates the duplication area | region data in step S405 is demonstrated using the flowchart of FIG.

ステップS501において、ステップS401において取得した撮像画像データそれぞれを識別するための番号iについて、i=1に初期化する。ステップS502において、撮像画像データiに対して撮像データに基づいた公知の射影変換処理を行う。射影変換は、上述した方法と同様の方法で行う。射影変換した撮像画像データiはROM202等に記憶する。ステップS503において、i>1を満たすか否かを判定する。i>1を満たす場合は、撮像画像データi−1と撮像画像データiとの間の重複領域を算出できると判定し、ステップS504へ移行する。i>1を満たさない場合は、ステップS505へ移行する。   In step S501, the number i for identifying each captured image data acquired in step S401 is initialized to i = 1. In step S502, a known projective transformation process is performed on the captured image data i based on the captured data. Projective transformation is performed in the same manner as described above. The captured image data i after projective conversion is stored in the ROM 202 or the like. In step S503, it is determined whether i> 1 is satisfied. When i> 1 is satisfied, it is determined that the overlapping area between the captured image data i-1 and the captured image data i can be calculated, and the process proceeds to step S504. If i> 1 is not satisfied, the process proceeds to step S505.

ステップS504において、射影変換した撮像画像データi−1と撮像画像データiとの間で重複する領域を表す重複領域データR(i)を生成する。本実施例においては図9に示すように、撮像画像のX軸方向の画角150mm、Y軸方向の画角100mmに対し、撮像画像iと撮像画像i−1との間で撮像装置103の位置がX軸方向に120mm移動している。従って、図9の斜線部に示す撮像画像iの左端から30mm、撮像画像i−1の右端から30mmの画素領域が重複領域として算出される。当該重複領域を表す重複領域データR(i)は、撮像画像データiと同じサイズの画像データであり、各画素に画素値として1又は0が記録されている。1は重複領域を表し、0は重複領域ではない領域を表す。生成した重複領域データR(i)はROM202等に記憶する。   In step S504, overlapping area data R (i) representing an overlapping area between the captured image data i-1 obtained by projective conversion and the captured image data i is generated. In the present embodiment, as shown in FIG. 9, the imaging device 103 is configured between the captured image i and the captured image i−1 with respect to the field angle 150 mm in the X-axis direction and the field angle 100 mm in the Y-axis direction. The position has moved 120 mm in the X-axis direction. Therefore, a pixel region 30 mm from the left end of the captured image i and a 30 mm from the right end of the captured image i-1 shown in the hatched portion in FIG. The overlapping area data R (i) representing the overlapping area is image data having the same size as the captured image data i, and 1 or 0 is recorded as a pixel value in each pixel. 1 represents an overlapping area, and 0 represents an area that is not an overlapping area. The generated overlapping area data R (i) is stored in the ROM 202 or the like.

ステップS505において、i=i+1に更新する。ステップS506において、i>Nを満たすか否かを判定する。Nは撮像画像データの総数である。i>Nを満たす場合は、全ての重複領域について重複領域データを生成したと判定し、ステップS406に移行する。i>Nを満たさない場合は、ステップS502に戻る。   In step S505, i = i + 1 is updated. In step S506, it is determined whether i> N is satisfied. N is the total number of captured image data. If i> N is satisfied, it is determined that overlapping area data has been generated for all overlapping areas, and the process proceeds to step S406. If i> N is not satisfied, the process returns to step S502.

<移動方向データを生成する処理(S406)の流れ>
以下では、ステップS406における移動方向データを生成する処理の詳細について図6のフローチャートを用いて説明する。本実施例においては、光学ユニットの位置Pos(i)において撮像を行った場合の撮像画像に写り込む光源の中心位置と、Pos(i+j)において撮像を行った場合の撮像画像の写り込む光源の中心位置とのずれの方向を移動方向として算出する。このずれは、上述したように、光学ユニット102に対する被写体101の略平面の傾きにより生じる。
<Flow of processing for generating moving direction data (S406)>
Below, the detail of the process which produces | generates the moving direction data in step S406 is demonstrated using the flowchart of FIG. In this embodiment, the center position of the light source reflected in the captured image when the image is captured at the position Pos (i) of the optical unit and the light source reflected in the captured image when the image is captured at Pos (i + j). The direction of deviation from the center position is calculated as the movement direction. As described above, this shift is caused by the inclination of the substantially plane of the subject 101 with respect to the optical unit 102.

ステップS601において、光学ユニット102の位置Pos(i),Pos(i+j)において被写体101と略同一の位置に配置した平面鏡に鏡像として写り込む光源の中心位置点L’,L’i+jを算出する。 In step S601, the center position points L ′ i and L ′ i + j of the light source reflected as a mirror image on the plane mirror arranged at substantially the same position as the subject 101 at the positions Pos (i) and Pos (i + j) of the optical unit 102 are calculated. .

具体的には、図11に示すように、光学ユニット102の位置の原点Oを基準とした点L’,L’i+jの位置を以下の式(8)、式(9)に従い算出する。 Specifically, as shown in FIG. 11, the positions of the points L ′ i and L ′ i + j with respect to the origin O of the position of the optical unit 102 are calculated according to the following equations (8) and (9).

,Lは光源位置Lのx座標とy座標であり、本実施例においてはL=1,L=0である。M,Mi+jは光学ユニットの位置Pos(i),Pos(i+j)における平面鏡の位置である。平面鏡の略平面がX軸に対して−Δθ傾いている為に、点Mi+jが点Mよりも距離kだけ原点Oに近くなっている。算出した光源位置L’,L’i+jはROM202等に記憶する。 L x and L y are the x coordinate and y coordinate of the light source position L, and in this embodiment, L x = 1 and L y = 0. M i and M i + j are the positions of the plane mirrors at the positions Pos (i) and Pos (i + j) of the optical unit. Since the substantially plane of the plane mirror is tilted by −Δθ with respect to the X axis, the point M i + j is closer to the origin O by the distance k than the point M i . The calculated light source positions L ′ i and L ′ i + j are stored in the ROM 202 or the like.

ステップS602において、ステップS601において算出した光源位置から、撮像装置103の光学中心Cを原点、光軸nをz軸とする座標系(カメラ座標系)に変換した光源位置L’ CAM,L’i+j CAMを式(10)、式(11)に従い算出する。 In step S602, the light source position L ′ i CAM , L converted from the light source position calculated in step S601 into a coordinate system (camera coordinate system) having the optical center C of the imaging device 103 as the origin and the optical axis n C as the z axis. ' i + j CAM is calculated according to Equation (10) and Equation (11).


Rot(φ,θ)は以下の式(3)に示す回転行列である。本実施例においては、n=(1/√2,0,1/√2)なので、φ=0°,θ=45°となる。算出した光源位置L’ CAM,L’i+j CAMはROM202等に記憶する。

Rot (φ, θ) is a rotation matrix shown in the following equation (3). In this embodiment, since n c = (1 / √2, 0, 1 / √2), φ = 0 ° and θ = 45 °. The calculated light source positions L ′ i CAM and L ′ i + j CAM are stored in the ROM 202 or the like.

ステップS603において、ステップS602において算出した光源位置L’ CAM,L’i+j CAMの撮像画像上における画素位置L’ UV,L’i+j UVを以下の式(12)、式(13)に従い算出する。 In step S603, the pixel positions L ′ i UV and L ′ i + j UV on the captured image of the light source positions L ′ i CAM and L ′ i + j CAM calculated in step S602 are calculated according to the following expressions (12) and (13). To do.


fは撮像装置103のレンズの焦点距離である。c,cは撮像画像上の光軸中心の画素位置であり、本実施例においてはc=c=128とする。算出した画素位置L’ UV,L’i+j UVはROM202等に記憶する。

f is the focal length of the lens of the imaging device 103. c x and c y are pixel positions in the center of the optical axis on the captured image, and in this embodiment, c x = c y = 128. The calculated pixel positions L ′ i UV and L ′ i + j UV are stored in the ROM 202 or the like.

ステップS604において、ステップS603において算出した画素位置L’ UV,L’i+j UVから、以下の式(14)に従い撮像画像上における光源の移動方向L’L’i+j UVを算出する。 In step S604, the moving direction L ′ i L ′ i + j UV of the light source on the captured image is calculated from the pixel positions L ′ i UV and L ′ i + j UV calculated in step S603 according to the following equation (14).


ここで、φ=0°,θ=45°とすると、撮像画像上における光源の移動方向L’L’i+j UVは、以下の式(15)のようになる。

Here, assuming that φ = 0 ° and θ = 45 °, the moving direction L ′ i L ′ i + j UV of the light source on the captured image is expressed by the following equation (15).


ここでΔθは光学ユニット102と被写体101の平行出しにおける配置誤差に伴う微小な傾きであるため、sinΔθ≒0,cosΔθ≒1と近似している。
,Lは面光源104の位置Lのx座標とy座標であり、L=1,L=0である。C,Cは撮像装置103の位置Cのx座標とy座標であり、C=−1,C=0である。算出した光源の移動方向L’L’i+j UVはROM202等に記憶する。

Here, Δθ is a slight inclination due to an arrangement error in parallel placement of the optical unit 102 and the subject 101, and thus approximates sin Δθ≈0 and cosΔθ≈1.
L x and L y are the x and y coordinates of the position L of the surface light source 104, and L x = 1 and L y = 0. C x and C y are the x and y coordinates of the position C of the imaging apparatus 103, and C x = −1 and C y = 0. The calculated light source movement direction L ′ i L ′ i + j UV is stored in the ROM 202 or the like.

ステップS605において、ステップS604において算出した光源の移動方向L’L’i+j UVのu成分、v成分から、以下の式(16)に従い、光源の移動方向を表す直線式の係数α,βを算出する。 In step S605, linear coefficients α and β representing the light source moving direction are calculated from the u component and the v component of the light source moving direction L ′ i L ′ i + j UV calculated in step S604 according to the following equation (16). calculate.


尚、光源の移動方向を表す直線式は、以下の式(17)に従い、原点を通る直線方程式として表すことができる。

Note that the linear equation representing the moving direction of the light source can be represented as a linear equation passing through the origin according to the following equation (17).


ここで、以下の式(18)に示す係数Kが取り得る値について説明する。

Here, the possible values of the coefficient K shown in the following equation (18) will be described.


距離kは光学ユニット102の位置Pos(i)とPos(i+j)との間における光学ユニットの位置から平面鏡までの距離の差分であり、0<k<d−L/2を満たす。従って、図12に示すように0<k<d−L/2の範囲において係数Kは距離kに対して正の値をとる単調増加関数となる。光源の移動方向を表す直線式は式(16)に示す方程式を満たし、K≠0なので、式(15)で算出したα,βからKを除算することにより、以下の式(19)、式(20)に示す、光源の移動方向を表す直線式の係数α、βを算出する。

The distance k is a difference in the distance from the position of the optical unit to the plane mirror between the positions Pos (i) and Pos (i + j) of the optical unit 102, and satisfies 0 <k <d−L x / 2. Accordingly, as shown in FIG. 12, in the range of 0 <k <d−L x / 2, the coefficient K is a monotonically increasing function that takes a positive value with respect to the distance k. Since the linear equation representing the moving direction of the light source satisfies the equation shown in equation (16) and K ≠ 0, the following equations (19) and (19) are obtained by dividing K from α and β calculated in equation (15). Linear coefficients α and β representing the moving direction of the light source shown in (20) are calculated.


=1,L=0,C=−1,C=0であるため、α=0となる。よって式(17)は、v=0となり、撮像画像上における光源の移動方向はU軸方向となる。算出した光源の移動方向を表す直線式の係数α、βを移動方向データとしてROM202等に記憶し、ステップS407に移行する。

Since L x = 1, L y = 0, C x = −1, and C y = 0, α = 0. Therefore, in Expression (17), v = 0, and the movement direction of the light source on the captured image is the U-axis direction. The linear coefficients α and β representing the calculated light source movement direction are stored in the ROM 202 or the like as movement direction data, and the process proceeds to step S407.

<幾何変換データを生成する処理(S407)の流れ>
以下では、ステップS407における幾何変換データを生成する処理の詳細について図7のフローチャートを用いて説明する。尚、幾何変換データは、以下に示す拡縮量と移動量とを表すデータである。
<Flow of processing for generating geometric transformation data (S407)>
Below, the detail of the process which produces | generates the geometric transformation data in step S407 is demonstrated using the flowchart of FIG. Note that the geometric conversion data is data representing the following enlargement / reduction amount and movement amount.

ステップS701において、撮像画像データの番号iについて、i=2に初期化する。ステップS702において、補正用画像に写り込む光源の大きさを拡大又は縮小するための倍率(拡縮量)を設定する。所定の範囲1−ΔT<T<1+ΔT内でシェーディング画像を拡縮させる倍率を拡縮量Ti−1,Tとして設定する。本実施例においては、Ti−1=1,T=1.1を初期値として設定する。設定した拡縮量Ti−1,TはROM202等に記憶する。 In step S701, the number i of the captured image data is initialized to i = 2. In step S702, a magnification (enlargement / reduction amount) for enlarging or reducing the size of the light source reflected in the correction image is set. The magnifications for scaling the shading image within a predetermined range 1−ΔT <T <1 + ΔT are set as scaling amounts T i−1 and T i . In this embodiment, T i-1 = 1 and T i = 1.1 are set as initial values. The set scaling amounts T i−1 and T i are stored in the ROM 202 or the like.

ステップS703において、U軸上の所定の範囲−Δu<u<+Δu内で補正用画像内に写り込む光源を平行移動させる画素数を移動量(ui−1,vi−1),(u,v)として設定する。本実施例においては、ui−1=0,u=10を初期値として設定する。この初期値ui−1,uと光源の移動方向を表す直線式を特定するα,βとに基づいて、vi−1,vを算出する。具体的には、ui−1=0,u=10及びα,βを式(17)に代入することによってvi−1,vを算出する。尚、本実施例においては、U軸(画像の横方向)上の移動のみであるため、V軸(画像の縦方向)上の移動を表すvi−1,vは使用しない。設定した移動量(ui−1,vi−1),(u,v)はROM202等に記憶する。 In step S703, the number of pixels to which the light source reflected in the correction image is translated within a predetermined range −Δu <u <+ Δu on the U axis is set as the movement amount (u i−1 , v i−1 ), (u i , v i ). In this embodiment, u i-1 = 0 and u i = 10 are set as initial values. Based on the initial values u i−1 , u i and α, β specifying a linear expression representing the moving direction of the light source, v i−1 , v i are calculated. Specifically, v i−1 and v i are calculated by substituting u i−1 = 0, u i = 10 and α and β into the equation (17). In this embodiment, since only the movement on the U axis (the horizontal direction of the image) is performed, v i−1 and v i representing the movement on the V axis (the vertical direction of the image) are not used. The set movement amounts (u i−1 , v i−1 ), (u i , v i ) are stored in the ROM 202 or the like.

ステップS704において、補正用画像に写り込む光源の大きさを拡縮量Ti−1,Tだけ光源を中心に拡縮させる。拡大又は縮小には、上述したように、公知のバイリニア法などを用いる。補正用画像に写り込む光源をTi−1=1に基づいて拡縮した結果を図13(a)に示し、補正用画像に写り込む光源をT=1.1に基づいて拡縮した結果を図13(b)に示す。補正用画像に写り込む光源の大きさを拡縮させた補正用画像データはROM202等に記憶する。 In step S704, the size of the light source reflected in the correction image is enlarged or reduced about the light source by the enlargement / reduction amounts T i-1 and T i . For the enlargement or reduction, as described above, a known bilinear method or the like is used. FIG. 13A shows the result of scaling the light source reflected in the correction image based on T i−1 = 1, and the result of scaling the light source reflected in the correction image based on T i = 1.1. As shown in FIG. Correction image data in which the size of the light source reflected in the correction image is enlarged or reduced is stored in the ROM 202 or the like.

ステップS705において、ステップS704において拡縮した光源を、移動量(ui−1,vi−1),(u,v)だけ補正用画像内で平行移動させる。補正用画像に写り込む光源を(ui−1,vi−1)=(0,0)に基づいて平行移動した結果を図13(c)に示し、補正用画像に写り込む光源を(u,v)=(10,10)に基づいて平行移動した結果を図13(d)に示す。拡縮した光源を平行移動させた補正用画像データはROM202等に記憶する。 In step S705, the light source expanded / reduced in step S704 is translated in the correction image by movement amounts (u i−1 , v i−1 ), (u i , v i ). FIG. 13C shows the result of translation of the light source reflected in the correction image based on (u i−1 , v i−1 ) = (0, 0), and the light source reflected in the correction image is ( FIG. 13D shows the result of translation based on u i , v i ) = (10, 10). Correction image data obtained by translating the enlarged / reduced light source is stored in the ROM 202 or the like.

ステップS706において、撮像画像データi−1,iそれぞれに対して、写り込む光源を拡縮及び平行移動させた図13(c)、(d)に示す補正用画像データを用いたシェーディング補正を行う。シェーディング補正を施した撮像画像データi−1,iはROM202等に記憶する。   In step S706, shading correction is performed on each of the captured image data i-1 and i using the correction image data shown in FIGS. 13C and 13D in which the reflected light source is scaled and translated. The captured image data i-1 and i subjected to the shading correction are stored in the ROM 202 or the like.

ステップS707において、重複領域データR(i)に基づいて、シェーディング補正を施した撮像画像データi−1とシェーディング補正を施した撮像画像データiとの重複領域における画素値の差分を算出する。具体的には、各画素の差分を算出し、当該各画素の差分を平均することによって差分値Dを算出する。差分値DはROM202等に記憶する。   In step S707, based on the overlapping area data R (i), a difference between pixel values in the overlapping area between the captured image data i-1 subjected to shading correction and the captured image data i subjected to shading correction is calculated. Specifically, the difference value D is calculated by calculating the difference between the pixels and averaging the difference between the pixels. The difference value D is stored in the ROM 202 or the like.

ステップS708において、差分値D<Δthを満たすか否かを判定する。差分<Δthを満たす場合は、ステップS409における合成処理によって重複領域に歪み(段差)を生じさせないために十分な拡縮量及び移動量を算出したと判定し、ステップS709に移行する。差分値D<Δthを満たさない場合は、ステップS711に移行し、u及びTを更新してステップS702に戻る。本実施例においては、u=u+5,T=T+0.1とするが、更新の値は上記の値に限定されない。尚、ステップS702に戻る際のuとTとの更新を片方のみ行ってもよいし、交互に行うようにしてもよい。 In step S708, it is determined whether or not the difference value D < Δth is satisfied. When the difference < Δth is satisfied, it is determined that the enlargement / reduction amount and the movement amount sufficient to prevent distortion (step) from being generated in the overlapping region by the combining process in step S409, and the process proceeds to step S709. When the difference value D < Δth is not satisfied, the process proceeds to step S711, u i and T i are updated, and the process returns to step S702. In the present embodiment, u i = u i +5, T i = T i +0.1, but the update value is not limited to the above value. Incidentally, the update of the u i and T i in returning to the step S702 may be performed only one may be performed alternately.

ステップS709において、i=i+1に更新する。ステップS710において、i>Nを満たすか否かを判定する。i>Nを満たす場合は、全ての撮像画像データに対応する幾何変換データを生成したと判定し、ステップS408に移行する。i>Nを満たさない場合は、ステップS712に移行し、初期値u及びTをそれぞれ10及び1.1に初期化してステップS702に戻る。 In step S709, i = i + 1 is updated. In step S710, it is determined whether i> N is satisfied. If i> N is satisfied, it is determined that geometric transformation data corresponding to all the captured image data has been generated, and the process proceeds to step S408. When i> N is not satisfied, the process proceeds to step S712, the initial values u i and T i are initialized to 10 and 1.1, respectively, and the process returns to step S702.

<画像処理装置1が実行する処理の結果について>
図14(a)は光沢を有する被写体を表す図である。被写体の顔に対応する領域は光沢強度が高く、服に対応する領域は光沢強度が中程度、背景に対応する領域は光沢強度が低くなっているとする。図14(b)に、本実施例における処理を施さずに、被写体を分割撮像することによって得られた複数の画像に通常のシェーディング補正を施した後合成した結果を示す。つまり、本実施例における幾何変換データによる補正用画像データの補正を行わずにシェーディング補正を行った場合の処理の結果である。この場合、X軸に対して被写体の略平面が−Δθ傾いている為に、各Pos(i)におけるシェーディング補正の際の誤差が発生し、合成画像データ内における合成する前の画像の境界領域(重複領域)で段差(歪み)が生じている。
<Results of processing executed by image processing apparatus 1>
FIG. 14A is a diagram illustrating a subject having gloss. It is assumed that the area corresponding to the subject's face has high gloss intensity, the area corresponding to clothes has medium gloss intensity, and the area corresponding to the background has low gloss intensity. FIG. 14B shows a result obtained by performing normal shading correction on a plurality of images obtained by dividing and imaging a subject without performing the processing in the present embodiment, and then combining them. In other words, this is a result of the processing in the case where the shading correction is performed without correcting the correction image data based on the geometric transformation data in this embodiment. In this case, since the substantially plane of the subject is inclined by −Δθ with respect to the X axis, an error in shading correction in each Pos (i) occurs, and the boundary region of the image before composition in the composite image data A step (distortion) occurs in (overlapping region).

次に、図14(c)に、本実施例における処理を施して得られる合成画像データが表す合成画像を示す。本実施例においては、Pos(i)の撮像画像データの重複領域内のシェーディング補正の誤差が所定の閾値以下となるように、補正用画像データを補正する。これにより、光学ユニットと被写体との間の傾きに伴うシェーディング補正の誤差が低減され、合成した際に図14(b)に示すような段差が生じない合成画像データを得ることができる。   Next, FIG. 14C shows a composite image represented by composite image data obtained by performing the processing in this embodiment. In the present embodiment, the correction image data is corrected so that the shading correction error in the overlapping area of the captured image data of Pos (i) is equal to or less than a predetermined threshold value. As a result, shading correction errors due to the inclination between the optical unit and the subject are reduced, and composite image data that does not cause a step as shown in FIG.

以上に示した処理を施すことにより、被写体を複数の領域に分割して撮像することによって得られる画像の歪みを低減することができる。さらに、それら複数の画像を合成することによって生じる歪みを低減することができる。   By performing the processing described above, it is possible to reduce distortion of an image obtained by dividing the subject into a plurality of areas and capturing images. Furthermore, distortion caused by combining the plurality of images can be reduced.

<変形例>
本実施例においては、撮像装置103を点Cの位置にnの向きで配置し、縦1、横1の大きさの面光源104を点Lの位置にnの向きで配置したが、上記一例には限定されない。
<Modification>
In the present embodiment, the imaging device 103 is arranged in the direction of n C at the position of the point C, and the surface light source 104 having a size of 1 vertical and 1 horizontal is arranged in the direction of n L at the position of the point L. It is not limited to the above example.

本実施例においては、被写体101が油彩画であるとして説明したが、上記一例には限定されない。被写体101は油彩画のような凹凸を有している必要はなく、光沢についても、表面全面で正反射光(光沢)が取得できる被写体であればよい。   In the present embodiment, the subject 101 has been described as an oil painting, but is not limited to the above example. The subject 101 does not need to have unevenness like an oil painting, and the gloss may be any subject that can acquire regular reflection light (gloss) over the entire surface.

本実施例においては、基準板を鏡面を有する平面鏡としたが、鏡面に近い反射特性を有する基準板であれば鏡面を有していなくてもよい。   In the present embodiment, the reference plate is a plane mirror having a mirror surface, but may not have a mirror surface as long as it is a reference plate having reflection characteristics close to the mirror surface.

本実施例においては、光学ユニット102の移動方向に隣接する2枚の撮像画像データi−1,i間で重複領域データを生成したが、上記一例には限定されない。例えば、撮像画像データiに対して上下左右に隣接する撮像画像データと重複する領域を算出してもよい。   In the present embodiment, the overlapping area data is generated between the two pieces of captured image data i-1 and i adjacent in the moving direction of the optical unit 102, but is not limited to the above example. For example, an area overlapping with captured image data adjacent to the captured image data i vertically and horizontally may be calculated.

本実施例においては、光学ユニット102の移動方向に隣接する2枚の撮像画像データi−1,iからシェーディング補正の誤差が所定の閾値以下となる幾何条件データを生成したが、上記一例には限定されない。例えば、撮像画像データiに対して上下左右に隣接する撮像画像データからシェーディング補正の誤差が所定の閾値以下となる幾何条件データを生成しても良い。   In the present embodiment, geometric condition data in which the shading correction error is equal to or less than a predetermined threshold value is generated from the two captured image data i-1 and i adjacent in the moving direction of the optical unit 102. In the above example, It is not limited. For example, geometric condition data in which the shading correction error is a predetermined threshold value or less may be generated from captured image data adjacent to the captured image data i vertically and horizontally.

本実施例においては、被写体101の配置の誤差により被写体101の略平面がX軸に対して傾いている場合について説明したが上記一例には限定されない。例えば、被写体の略平面がY軸方向に対して傾いていても上記の処理を適用できる。この場合、被写体101の上下端間で被写体の略平面及び略平面上に写り込む光源位置のずれが生じるので、光源位置のずれから、補正用画像内に写り込む光源の平行移動方向を算出すれば良い。   In the present embodiment, the case where the substantially plane of the subject 101 is inclined with respect to the X axis due to the placement error of the subject 101 has been described, but the present invention is not limited to the above example. For example, the above processing can be applied even when the substantially plane of the subject is inclined with respect to the Y-axis direction. In this case, since the displacement of the light source position reflected on the substantially plane and the substantially plane of the subject 101 occurs between the upper and lower ends of the subject 101, the parallel movement direction of the light source reflected in the correction image can be calculated from the displacement of the light source position. It ’s fine.

本実施例においては、幾何変換データとして、補正用画像内に写り込む光源の移動量及び拡縮量を算出したが、上記一例には限定されない。例えば、被写体101の配置の誤差及び被写体101のたわみにより、被写体101の略平面がX軸及びY軸方向ともに傾いている場合がある。この場合、重複領域における各撮像画像間のシェーディング補正誤差が所定の閾値以下となる射影変換行列データを幾何変換データとして生成しても良い。   In the present embodiment, the movement amount and expansion / contraction amount of the light source reflected in the correction image are calculated as the geometric transformation data, but the present invention is not limited to the above example. For example, a substantially flat surface of the subject 101 may be inclined in both the X-axis and Y-axis directions due to an error in the placement of the subject 101 and the deflection of the subject 101. In this case, projective transformation matrix data in which a shading correction error between captured images in the overlapping region is equal to or less than a predetermined threshold may be generated as geometric transformation data.

本実施例においては、処理の結果として合成画像データを出力する例を示したが、上記一例には限定されない。例えば、ステップS407までの処理を行って得られた幾何変換データを出力し、処理を終了してもよい。また、ステップS408までの処理を行って得られた補正後画像データを出力し、処理を終了してもよい。   In the present embodiment, an example of outputting the composite image data as a result of the processing has been shown, but the present invention is not limited to the above example. For example, the geometric transformation data obtained by performing the processing up to step S407 may be output, and the processing may be terminated. Further, the corrected image data obtained by performing the processing up to step S408 may be output, and the processing may be terminated.

本実施例においては、差分値D<Δthを満たした拡縮量と移動量とを幾何変換データとしたが、上記一例に限定されない。1−ΔT<T<1+ΔT及び−Δu<u<+Δuの範囲内で全ての拡縮量と移動量との組み合わせについて差分値Dを算出し、差分値Dが最少となる拡縮量と移動量との組み合わせを幾何変換データとしてもよい。 In the present embodiment, the expansion / contraction amount and the movement amount satisfying the difference value D < Δth are used as the geometric transformation data, but the present invention is not limited to the above example. The difference value D is calculated for all the combinations of the enlargement / reduction amount and the movement amount within the range of 1−ΔT <T <1 + ΔT and −Δu <u <+ Δu, and the difference between the enlargement / reduction amount and the movement amount that minimizes the difference value D is calculated. The combination may be geometric transformation data.

本実施例においては、ステップS408において補正後画像データを生成したが、上記一例には限定されない。例えば、ステップS708の処理において差分値D<Δthを満たした場合の拡縮量と移動量とによって補正されROM202等に記憶された、補正後画像データを直接合成画像データ生成部313に出力してもよい。この場合、ステップS408の処理は行わない。 In this embodiment, the corrected image data is generated in step S408, but is not limited to the above example. For example, the corrected image data corrected by the enlargement / reduction amount and the movement amount when the difference value D < Δth is satisfied in step S708 and stored in the ROM 202 or the like is directly output to the composite image data generation unit 313. Also good. In this case, the process of step S408 is not performed.

本実施例においては、ステップS406において、光源データと撮像データとに基づいて移動方向データを生成したが、上記一例には限定されない。例えば、第1取得部305が取得する複数の撮像画像データにおける重心の位置を算出し、隣合う画像同士の重心の位置のずれを表すベクトルを移動方向データとして算出してもよい。また、移動方向を特定する情報をユーザに入力させるUI画面をディスプレイ215に表示させ、ユーザから受け付けた情報を移動方向データとしてもよい。   In this embodiment, in step S406, the moving direction data is generated based on the light source data and the imaging data, but the present invention is not limited to the above example. For example, the position of the center of gravity in the plurality of captured image data acquired by the first acquisition unit 305 may be calculated, and a vector representing the shift in the position of the center of gravity between adjacent images may be calculated as the movement direction data. Also, a UI screen that allows the user to input information for specifying the moving direction may be displayed on the display 215, and the information received from the user may be used as moving direction data.

本実施例においては、ステップS408において、幾何変換データを用いて、補正用画像データが表す補正用画像内に写り込んだ光源を幾何変換する。その後、写り込んだ光源が幾何変換された補正用画像データを用いて撮像画像データをシェーディング補正することによって補正後画像データを生成したが、上記一例に限定されない。例えば、幾何変換データと補正用画像データとを用いて、一度に撮像画像データをシェーディング補正してもよい。   In this embodiment, in step S408, geometric conversion is performed on the light source reflected in the correction image represented by the correction image data using the geometric conversion data. After that, the corrected image data is generated by performing shading correction on the captured image data using the correction image data obtained by geometric conversion of the reflected light source, but is not limited to the above example. For example, the captured image data may be subjected to shading correction at once using the geometric conversion data and the correction image data.

[実施例2]
<実施例1との差分について>
実施例1においては、微細な凹凸を有する被写体101を撮像することによって得られた複数の撮像画像データにおける歪みを低減する方法を説明した。本実施例においては、被写体101が凹凸の大きい物体である為に光源照明下で被写体を撮像する際に影が生じる場合であっても、分割撮像して得られた複数の撮像画像データの歪みを低減する方法について説明する。本実施例の処理の流れは、重複領域データを生成する処理(S405)以外は実施例1と同様であるため、説明を省略する。
[Example 2]
<Differences from Example 1>
In the first embodiment, the method of reducing distortion in a plurality of captured image data obtained by imaging the subject 101 having fine unevenness has been described. In the present embodiment, since the subject 101 is an object with large unevenness, even when a shadow is generated when the subject is imaged under light source illumination, a plurality of captured image data distortions obtained by split imaging are obtained. A method for reducing the above will be described. Since the processing flow of the present embodiment is the same as that of the first embodiment except for the processing for generating overlapping area data (S405), the description thereof is omitted.

<重複領域データを生成する処理(S405)の流れ>
以下、本実施例において重複領域データ生成部309が実行する重複領域データを生成する処理(S405)の詳細を図15を用いて説明する。
<Flow of processing for generating overlapping area data (S405)>
Hereinafter, details of the process (S405) of generating overlapping area data executed by the overlapping area data generation unit 309 in the present embodiment will be described with reference to FIG.

ステップ501〜ステップS504は実施例1と同様の処理を行うため、説明を省略する。   Since steps 501 to S504 perform the same processing as in the first embodiment, the description thereof is omitted.

ステップS1501において、撮像画像データi−1における重複領域データR(i)が表す重複領域内の影領域S(i,i−1)を算出する。本実施例においては、図16(a)に示す撮像画像データi−1における重複領域R(i)内の画素値に対して、2値化処理により所定の閾値以下の領域を抽出する。この抽出された領域を、図16(b)に示す影領域S(i,i−1)とする。算出した影領域S(i,i−1)はROM202等に記憶する。   In step S1501, a shadow area S (i, i-1) in the overlapping area represented by the overlapping area data R (i) in the captured image data i-1 is calculated. In the present embodiment, a region having a predetermined threshold value or less is extracted by binarization processing on the pixel values in the overlapping region R (i) in the captured image data i-1 shown in FIG. This extracted area is assumed to be a shadow area S (i, i−1) shown in FIG. The calculated shadow area S (i, i-1) is stored in the ROM 202 or the like.

ステップS1502において、撮像画像データiにおける重複領域データR(i)が表す重複領域内の影領域S(i,i)を算出する。本実施例においては、図16(c)に示す撮像画像データiにおける重複領域R(i)内の画素値に対して、2値化処理により所定の閾値以下の領域を抽出する。この抽出された領域を、図16(d)に示す影領域S(i,i)とする。光学ユニット102の位置Pos(i−1)とPos(i)との違いにより、被写体の凹凸で影が生じる領域が変わる為、影領域S(i,i−1)とS(i,i)とは異なる領域となっている。算出した影領域S(i,i)はROM202等に記憶する。   In step S1502, a shadow area S (i, i) in the overlapping area represented by the overlapping area data R (i) in the captured image data i is calculated. In the present embodiment, an area that is equal to or smaller than a predetermined threshold is extracted by a binarization process for the pixel values in the overlapping area R (i) in the captured image data i shown in FIG. This extracted area is assumed to be a shadow area S (i, i) shown in FIG. Due to the difference between the positions Pos (i-1) and Pos (i) of the optical unit 102, the area where the shadow is caused by the unevenness of the subject changes, so that the shadow areas S (i, i-1) and S (i, i) It is a different area. The calculated shadow area S (i, i) is stored in the ROM 202 or the like.

ステップS1503において、重複領域データR(i)が表す重複領域から、ステップS1501で算出した影領域S(i,i−1)を除外する。つまり、重複領域データR(i)の画素値が1である領域(重複領域)について、影領域S(i,i−1)に対応する領域の画素値を0にする。図16(b)に示す影領域S(i,i−1)を重複領域から除外することにより、図16(e)に示す重複領域を表す重複領域データR(i)が生成される。影領域S(i,i−1)が除外された重複領域データR(i)はROM202等に記憶する。   In step S1503, the shadow area S (i, i-1) calculated in step S1501 is excluded from the overlapping area represented by the overlapping area data R (i). That is, the pixel value of the region corresponding to the shadow region S (i, i−1) is set to 0 for the region (overlapping region) where the pixel value of the overlapping region data R (i) is 1. By excluding the shadow area S (i, i-1) shown in FIG. 16B from the overlapping area, overlapping area data R (i) representing the overlapping area shown in FIG. 16E is generated. The overlapping area data R (i) excluding the shadow area S (i, i-1) is stored in the ROM 202 or the like.

ステップS1504において、ステップS1503において影領域S(i,i−1)が除外された重複領域データR(i)から、ステップS1502において算出した影領域S(i,i)を除外する。つまり、重複領域データR(i)の画素値が1である領域(重複領域)について、影領域S(i,i)に対応する領域の画素値を0にする。図16(e)に示す重複領域を表す重複領域データR(i)から図16(d)に示す影領域S(i,i)を除外することにより、図16(f)に示す重複領域を表す重複領域データR(i)が生成される。除外した重複領域R(i)は所定の記憶領域に記憶する。   In step S1504, the shadow region S (i, i) calculated in step S1502 is excluded from the overlapping region data R (i) from which the shadow region S (i, i-1) is excluded in step S1503. That is, the pixel value of the region corresponding to the shadow region S (i, i) is set to 0 for the region (overlapping region) where the pixel value of the overlapping region data R (i) is 1. By excluding the shadow area S (i, i) shown in FIG. 16D from the overlapping area data R (i) representing the overlapping area shown in FIG. 16E, the overlapping area shown in FIG. The overlapping area data R (i) to be expressed is generated. The excluded overlapping area R (i) is stored in a predetermined storage area.

ステップ505及びステップS506は実施例1と同様の処理を行うため、説明を省略する。   Steps 505 and S506 perform the same processing as in the first embodiment, and thus the description thereof is omitted.

以上のように、各光学ユニットの位置における撮像によって撮像画像に生じる影領域を算出して重複領域から除外することにより、影によるシェーディング補正の精度低下を抑制することができる。よって、被写体を複数の領域に分割して撮像することによって得られる画像の歪みを低減することができる。さらに、それら複数の画像を合成することによって生じる歪みを低減することができる。   As described above, by calculating the shadow area generated in the captured image by imaging at the position of each optical unit and excluding it from the overlapping area, it is possible to suppress a reduction in the accuracy of shading correction due to the shadow. Therefore, it is possible to reduce distortion of an image obtained by dividing the subject into a plurality of areas and capturing images. Furthermore, distortion caused by combining the plurality of images can be reduced.

[その他の実施例]
本発明は、上述の実施例の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other Examples]
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

1 画像処理装置
305 第1取得部
306 第2取得部
311 幾何変換データ生成部
DESCRIPTION OF SYMBOLS 1 Image processing apparatus 305 1st acquisition part 306 2nd acquisition part 311 Geometric transformation data generation part

Claims (20)

被写体を隣り合った領域に重複領域を設けて複数の領域に分割し、光源からの光が照射された前記複数の領域それぞれを撮像することによって得られた複数の画像データの歪みを補正するための画像処理装置であって、
前記重複領域を含む前記複数の領域それぞれにおける前記被写体の光沢を表す前記複数の画像データを取得する第1取得手段と、
前記複数の領域に対応する所定の領域に配置された基準板を撮像することによって、前記複数の画像データそれぞれの歪みを補正するための補正用画像データを取得する第2取得手段と、
前記複数の画像データに基づいて、前記補正用画像データが表す補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させるための移動量と、前記補正用画像内に写り込んだ前記光源の大きさを前記補正用画像内において拡大又は縮小するための倍率とを表す、前記複数の画像データそれぞれの補正に対応する幾何変換データを生成する第1生成手段と、
を有することを特徴とする画像処理装置。
In order to correct distortion of a plurality of image data obtained by providing an overlapping region in an adjacent region and dividing the subject into a plurality of regions and imaging each of the plurality of regions irradiated with light from a light source Image processing apparatus,
First acquisition means for acquiring the plurality of image data representing the gloss of the subject in each of the plurality of regions including the overlapping region;
Second acquisition means for acquiring correction image data for correcting distortion of each of the plurality of image data by imaging a reference plate arranged in a predetermined region corresponding to the plurality of regions;
Based on the plurality of image data, a movement amount for translating the position corresponding to the light source reflected in the correction image represented by the correction image data in the correction image, and the correction image First generation means for generating geometric transformation data corresponding to the correction of each of the plurality of image data, each of which represents a magnification for enlarging or reducing the size of the light source reflected in the correction image. ,
An image processing apparatus comprising:
前記幾何変換データに基づいて、前記補正用画像データを補正する第1補正手段をさらに有することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising first correction means for correcting the correction image data based on the geometric transformation data. 前記第1補正手段によって補正された前記補正用画像データに基づいて、前記複数の画像データを補正する第2補正手段をさらに有することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, further comprising: a second correction unit that corrects the plurality of image data based on the correction image data corrected by the first correction unit. 前記幾何変換データと前記補正用画像データとに基づいて、前記複数の画像データを補正する補正手段をさらに有することを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising a correcting unit that corrects the plurality of image data based on the geometric transformation data and the correction image data. 補正された前記複数の画像データを合成することによって1つの画像を表す合成画像データを生成する第2生成手段をさらに有することを特徴とする請求項3又は請求項4に記載の画像処理装置。   5. The image processing apparatus according to claim 3, further comprising a second generation unit configured to generate combined image data representing one image by combining the plurality of corrected image data. 前記第1生成手段は、前記基準板が配置された前記所定の位置と前記複数の領域それぞれの位置とのずれの方向を、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させる方向として算出することによって、前記移動方向データを生成することを特徴とする請求項1乃至請求項5のいずれか一項に記載の画像処理装置。   The first generation means sets a position corresponding to the light source reflected in the correction image, indicating the direction of deviation between the predetermined position where the reference plate is disposed and the position of each of the plurality of regions. 6. The image processing apparatus according to claim 1, wherein the moving direction data is generated by calculating as a direction of translation in a correction image. 7. 前記光源に関する情報を有する光源データを取得する第3取得手段と、
前記複数の画像データを得るために前記被写体を撮像した撮像装置に関する情報を有する撮像データを取得する第4取得手段と、
前記光源データと前記撮像データとに基づいて、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させる方向を表す移動方向データを生成する第3生成手段と、をさらに有し、
前記第1生成手段は、前記複数の画像データに基づいて、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において前記移動方向データが表す前記方向へ平行移動させるための前記移動量と、前記補正用画像内に写り込んだ前記光源の大きさを前記補正用画像内において拡大又は縮小するための前記倍率とを表す、前記複数の画像データそれぞれの補正に対応する前記幾何変換データを生成することを特徴とする請求項1乃至請求項6のいずれか一項に記載の画像処理装置。
Third acquisition means for acquiring light source data having information on the light source;
Fourth acquisition means for acquiring imaging data having information relating to an imaging device that images the subject to obtain the plurality of image data;
Third generation means for generating movement direction data representing a direction in which the position corresponding to the light source reflected in the correction image is translated in the correction image based on the light source data and the imaging data. And
The first generation means translates a position corresponding to the light source reflected in the correction image in the direction indicated by the movement direction data in the correction image based on the plurality of image data. Corresponding to the correction of each of the plurality of image data, which represents the amount of movement for the image and the magnification for enlarging or reducing the size of the light source reflected in the image for correction in the image for correction The image processing apparatus according to claim 1, wherein the geometric transformation data to be generated is generated.
前記第3取得手段は、面光源である前記光源の位置と前記光源の面法線の向きとを表す前記光源データを取得することを特徴とする請求項7に記載の画像処理装置。   The image processing apparatus according to claim 7, wherein the third acquisition unit acquires the light source data representing a position of the light source that is a surface light source and a direction of a surface normal of the light source. 前記第4取得手段は、前記撮像装置の位置と、前記撮像装置の光軸の向きと、前記撮像装置の焦点距離とを表す前記撮像データを取得することを特徴とする請求項7又は請求項8に記載の画像処理装置。   The said 4th acquisition means acquires the said imaging data showing the position of the said imaging device, the direction of the optical axis of the said imaging device, and the focal distance of the said imaging device, The Claim 7 or Claim characterized by the above-mentioned. The image processing apparatus according to 8. 前記複数の画像データに基づいて、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させる方向を表す移動方向データを生成する第3生成手段をさらに有し、
前記第1生成手段は、前記複数の画像データに基づいて、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において前記移動方向データが表す前記方向へ平行移動させるための前記移動量と、前記補正用画像内に写り込んだ前記光源の大きさを前記補正用画像内において拡大又は縮小するための前記倍率とを表す、前記複数の画像データそれぞれの補正に対応する前記幾何変換データを生成することを特徴とする請求項1乃至請求項6のいずれか一項に記載の画像処理装置。
The image forming apparatus further includes third generation means for generating movement direction data representing a direction in which the position corresponding to the light source reflected in the correction image is translated in the correction image based on the plurality of image data. And
The first generation means translates a position corresponding to the light source reflected in the correction image in the direction indicated by the movement direction data in the correction image based on the plurality of image data. Corresponding to the correction of each of the plurality of image data, which represents the amount of movement for the image and the magnification for enlarging or reducing the size of the light source reflected in the image for correction in the image for correction The image processing apparatus according to claim 1, wherein the geometric transformation data to be generated is generated.
前記第3生成手段は、前記複数の画像データが表す複数の画像のうち、前記重複領域を有する画像同士の重心のずれを算出し、前記重心のずれに基づいて、前記補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させる方向を表す前記移動方向データを生成することを特徴とする請求項10に記載の画像処理装置。   The third generation unit calculates a shift of the center of gravity of the images having the overlap region among the plurality of images represented by the plurality of image data, and is reflected in the correction image based on the shift of the center of gravity. The image processing apparatus according to claim 10, wherein the moving direction data representing a direction in which a position corresponding to the light source is translated in the correction image is generated. 前記第1生成手段は、前記移動量と前記倍率とを用いて前記補正用画像データが補正された場合に、補正された前記補正用画像データを用いて補正された前記複数の画像データが表す複数の画像のうち前記重複領域を有する2つの画像について、前記重複領域における光沢の差分が所定の閾値以下となるように、前記移動量と前記倍率とを算出することを特徴とする請求項1乃至請求項11のいずれか一項に記載の画像処理装置。   The first generation unit represents the plurality of image data corrected using the corrected image data when the correction image data is corrected using the movement amount and the magnification. 2. The movement amount and the magnification are calculated so that a difference in glossiness in the overlapping region is equal to or less than a predetermined threshold value for two images having the overlapping region among a plurality of images. The image processing apparatus according to claim 11. 前記複数の画像データに基づいて、前記重複領域を表す重複領域データを生成する第4生成手段をさらに有し、
前記第1生成手段は、前記移動量と前記倍率とを用いて前記補正用画像データが補正された場合に、補正された前記補正用画像データを用いて補正された前記複数の画像データが表す複数の画像のうち前記重複領域を有する2つの画像について、前記重複領域データが表す前記重複領域における光沢の差分が所定の閾値以下となるように、前記移動量と前記倍率とを算出することを特徴とする請求項12に記載の画像処理装置。
Based on the plurality of image data, further comprising fourth generation means for generating overlapping area data representing the overlapping area;
The first generation unit represents the plurality of image data corrected using the corrected image data when the correction image data is corrected using the movement amount and the magnification. Calculating the amount of movement and the magnification of two images having the overlapping area among a plurality of images so that a difference in gloss in the overlapping area represented by the overlapping area data is equal to or less than a predetermined threshold value. The image processing apparatus according to claim 12, characterized in that:
前記第1補正手段は、前記倍率に基づいて、前記補正用画像内に写り込んだ前記光源に対応する領域の大きさを拡大又は縮小し、前記移動量に基づいて、前記補正用画像内に写り込んだ前記光源の位置に対応する画素値を前記補正用画像内において平行移動させることによって前記補正用画像データを補正することを特徴とする請求項2に記載の画像処理装置。   The first correction means enlarges or reduces the size of the area corresponding to the light source reflected in the correction image based on the magnification, and includes the correction amount in the correction image based on the movement amount. The image processing apparatus according to claim 2, wherein the correction image data is corrected by translating a pixel value corresponding to the position of the reflected light source in the correction image. 前記第2補正手段は、前記複数の画像データの画素値を、前記第1補正手段によって補正された前記補正用画像データの画素値で除算することによって、前記複数の画像データを補正することを特徴とする請求項3に記載の画像処理装置。   The second correction unit corrects the plurality of image data by dividing a pixel value of the plurality of image data by a pixel value of the correction image data corrected by the first correction unit. The image processing apparatus according to claim 3. 前記第2生成手段は、補正された前記複数の画像データを、αブレンディングを用いて合成することによって前記合成画像データを生成することを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the second generation unit generates the composite image data by combining the plurality of corrected image data using α blending. 前記被写体は表面に凹凸を有する物体であって、
前記第4生成手段は、前記複数の画像データに基づいて、前記重複領域から前記凹凸によって生じる影に対応する領域を除いた領域を表す重複領域データを生成することを特徴とする請求項13に記載の画像処理装置。
The subject is an object having an uneven surface,
The said 4th production | generation means produces | generates the duplication area | region data showing the area | region remove | excluding the area | region corresponding to the shadow produced by the said unevenness | corrugation from the said duplication area | region based on these several image data. The image processing apparatus described.
前記第4生成手段は、前記重複領域において所定の閾値以下となる画素値を有する領域を前記影に対応する領域とすることを特徴とする請求項17に記載の画像処理装置。   The image processing apparatus according to claim 17, wherein the fourth generation unit sets a region having a pixel value equal to or less than a predetermined threshold in the overlapping region as a region corresponding to the shadow. コンピュータを請求項1乃至請求項18のいずれか一項に記載の画像処理装置の各手段として機能させるためのプログラム。   A program for causing a computer to function as each unit of the image processing apparatus according to any one of claims 1 to 18. 被写体を隣り合った領域に重複領域を設けて複数の領域に分割し、光源からの光が照射された前記複数の領域それぞれを撮像することによって得られた複数の画像データの歪みを補正するための画像処理方法であって、
前記重複領域を含む前記複数の領域それぞれにおける前記被写体の光沢を表す前記複数の画像データを取得する第1取得ステップと、
前記複数の領域に対応する所定の領域に配置された基準板を撮像することによって、前記複数の画像データそれぞれの歪みを補正するための補正用画像データを取得する第2取得ステップと、
前記複数の画像データに基づいて、前記補正用画像データが表す補正用画像内に写り込んだ前記光源に対応する位置を前記補正用画像内において平行移動させるための移動量と、前記補正用画像内に写り込んだ前記光源の大きさを前記補正用画像内において拡大又は縮小するための倍率とを表す、前記複数の画像データそれぞれの補正に対応する幾何変換データを生成する生成ステップと、
を有することを特徴とする画像処理方法。
In order to correct distortion of a plurality of image data obtained by providing an overlapping region in an adjacent region and dividing the subject into a plurality of regions and imaging each of the plurality of regions irradiated with light from a light source Image processing method,
A first acquisition step of acquiring the plurality of image data representing gloss of the subject in each of the plurality of regions including the overlapping region;
A second acquisition step of acquiring correction image data for correcting distortion of each of the plurality of image data by imaging a reference plate disposed in a predetermined region corresponding to the plurality of regions;
Based on the plurality of image data, a movement amount for translating the position corresponding to the light source reflected in the correction image represented by the correction image data in the correction image, and the correction image A step of generating geometric transformation data corresponding to the correction of each of the plurality of image data, representing a magnification for enlarging or reducing the size of the light source reflected in the correction image;
An image processing method comprising:
JP2017089718A 2017-04-28 2017-04-28 Image processing system, image processing method, and program Pending JP2018191050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017089718A JP2018191050A (en) 2017-04-28 2017-04-28 Image processing system, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017089718A JP2018191050A (en) 2017-04-28 2017-04-28 Image processing system, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2018191050A true JP2018191050A (en) 2018-11-29

Family

ID=64479987

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017089718A Pending JP2018191050A (en) 2017-04-28 2017-04-28 Image processing system, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2018191050A (en)

Similar Documents

Publication Publication Date Title
JP6299124B2 (en) Projection system, image processing apparatus, projection method, and program
JP6569742B2 (en) Projection system, image processing apparatus, projection method, and program
US9818377B2 (en) Projection system, image processing apparatus, and correction method
JP4818053B2 (en) High resolution device and method
CN108028900B (en) Projection apparatus, projection method, and program storage medium
KR100525425B1 (en) Image warping method and apparatus
JP5445461B2 (en) Pixel position correspondence specifying system, pixel position correspondence specifying method, and pixel position correspondence specifying program
CN105128539B (en) A kind of method and laser marking system of optical projection laser marking
JPWO2011010438A1 (en) Parallax detection device, distance measuring device, and parallax detection method
JP4871820B2 (en) Video display system and parameter generation method for the system
JP5151922B2 (en) Pixel position correspondence specifying system, pixel position correspondence specifying method, and pixel position correspondence specifying program
US9967528B2 (en) Image processing apparatus and image processing method
JP4686388B2 (en) Image enlarging apparatus and image enlarging method
JP4594848B2 (en) Inscribed rectangle detection apparatus and inscribed rectangle detection program
JP6274744B2 (en) Image processing apparatus and image processing method
JP2018191050A (en) Image processing system, image processing method, and program
JP2010177832A (en) Image processing apparatus and image processing method
JP5925109B2 (en) Image processing apparatus, control method thereof, and control program
JP6755737B2 (en) Distance measuring device, imaging device, and distance measuring method
JP6632434B2 (en) Image processing apparatus, image processing method, and program
JP4925112B2 (en) Free viewpoint image generation method
JP2006113001A (en) Three-dimensional measuring method and device by photogrammetry
US11893706B2 (en) Image correction device
JP2017224169A (en) Distance image resolution conversion device, distance image resolution conversion method, and computer program
JP2013157890A (en) Image processing device, image processing method, and program