Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6330458B2 - Image processing apparatus and computer program - Google Patents
[go: Go Back, main page]

JP6330458B2 - Image processing apparatus and computer program - Google Patents

Image processing apparatus and computer program Download PDF

Info

Publication number
JP6330458B2
JP6330458B2 JP2014095447A JP2014095447A JP6330458B2 JP 6330458 B2 JP6330458 B2 JP 6330458B2 JP 2014095447 A JP2014095447 A JP 2014095447A JP 2014095447 A JP2014095447 A JP 2014095447A JP 6330458 B2 JP6330458 B2 JP 6330458B2
Authority
JP
Japan
Prior art keywords
area
image
search
region
processing apparatus
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.)
Active
Application number
JP2014095447A
Other languages
Japanese (ja)
Other versions
JP2015213253A (en
Inventor
卓也 嶋橋
卓也 嶋橋
長谷川 智彦
智彦 長谷川
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2014095447A priority Critical patent/JP6330458B2/en
Publication of JP2015213253A publication Critical patent/JP2015213253A/en
Application granted granted Critical
Publication of JP6330458B2 publication Critical patent/JP6330458B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

本発明は、第1の画像内の参照領域に類似する第2の画像内の対象領域を決定する技術に関する。   The present invention relates to a technique for determining a target area in a second image similar to a reference area in the first image.

第1の画像と第2の画像とが合成された画像を表す出力画像データを生成する技術が知られている。例えば、特許文献1に開示された技術では、一度には読み取れない大きさの原稿を、スキャナを用いて2回に分けて読み取ることによって、第1の画像を表すスキャンデータと、第2の画像を表すスキャンデータと、が取得される。そして、2個のスキャンデータを用いて、第1の画像と第2の画像とが合成された合成画像を表す合成画像データが生成される。第1の画像と第2の画像とを合成する位置は、パターンマッチングを用いて決定される。パターンマッチングは、第1の画像内の一部の領域と類似する領域を第2の画像内において探索する処理である。   A technique for generating output image data representing an image obtained by combining a first image and a second image is known. For example, in the technique disclosed in Patent Document 1, an original having a size that cannot be read at one time is read in two using a scanner, and scan data representing the first image and the second image are read. Is obtained. Then, composite image data representing a composite image obtained by combining the first image and the second image is generated using the two scan data. The position where the first image and the second image are combined is determined using pattern matching. Pattern matching is a process of searching for a region similar to a partial region in the first image in the second image.

特開2003−23530号公報JP 2003-23530 A

しかしながら、上記技術では、パターンマッチングにおいて探索対象とされる第2の画像内の範囲が十分に適正化されているとは言えなかった。このために、第1の画像内の参照領域に類似する第2の画像内の対象領域を決定するための処理時間が長くなる可能性があった。   However, in the above technique, it cannot be said that the range in the second image to be searched for pattern matching is sufficiently optimized. For this reason, there is a possibility that the processing time for determining the target area in the second image similar to the reference area in the first image becomes long.

本発明は、第1の画像内の参照領域に類似する第2の画像内の対象領域を決定するための処理時間を低減することができる新たな技術を提供することを目的とする。   An object of the present invention is to provide a new technique capable of reducing a processing time for determining a target area in a second image similar to a reference area in the first image.

本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。   SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following application examples.

[適用例1]画像処理装置であって、第1の画像を表す第1の画像データと、第2の画像を表す第2の画像データと、を取得する取得部と、前記第1の画像データを用いて、前記第1の画像内の一部の領域である参照領域を決定する参照領域決定部と、前記第2の画像データと、前記参照領域の位置を示す位置情報と、前記参照領域の外形に関する外形情報と、を用いて、前記第2の画像内の一部の領域である探索領域を決定する探索領域決定部と、前記参照領域に類似する前記第2の画像内の対応領域を、前記第2の画像の前記探索領域内から決定する対応領域決定部と、前記第1の画像データと前記第2の画像データとを用いて、前記参照領域と前記対応領域とが重なるように、前記第1の画像と前記第2の画像とが合成された合成画像を表す合成画像データを生成する生成部と、を備える、画像処理装置。 Application Example 1 An image processing apparatus, an acquisition unit that acquires first image data representing a first image and second image data representing a second image, and the first image A reference area determining unit that determines a reference area, which is a partial area in the first image, using the data; the second image data; position information indicating a position of the reference area; and the reference A search region determination unit that determines a search region that is a partial region in the second image using external shape information regarding the external shape of the region, and a correspondence in the second image that is similar to the reference region The reference area and the corresponding area overlap using a corresponding area determining unit that determines an area from within the search area of the second image, the first image data, and the second image data. As described above, the synthesized image obtained by synthesizing the first image and the second image. And a generation unit for generating a composite image data representing the image processing apparatus.

上記構成によれば、参照領域の位置情報と外形情報とを用いて、適切な位置に配置され適切なサイズを有する探索領域が決定されため、第2の画像内の一部の領域である探索領域を用い、効率良く対応領域を決定することができる。したがって、第1の画像内の参照領域に類似する第2の画像内の対象領域を決定するための処理時間を低減することができる。
[適用例2]
適用例1に記載の画像処理装置であって、
前記探索領域決定部は、
前記第1の画像の基準の位置である第1の基準位置を示す情報と、前記第2の画像の基準の位置である第2の基準位置を示す情報と、を取得し、
前記参照領域の位置と前記第1の基準位置との関係と、前記第2の基準位置と、に基づいて、前記探索領域の位置を決定する、画像処理装置。
[適用例3]
適用例2に記載の画像処理装置であって、
前記第1の基準位置は、前記参照領域の基準の位置を示す情報であり、
前記第2の基準位置は、前記探索領域の基準の位置を示す情報であり、
前記第1の基準位置を示す情報と、前記第2の基準位置を示す情報とは、それぞれに、第1の方向の位置を示す情報と、第1の方向と垂直な第2の方向の位置を示す情報と、を含み、
前記第1の方向は、前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向であり、
前記探索領域決定部は、前記参照領域の位置が前記第1の基準位置に対して前記第1の方向にずれている場合には、前記探索領域の位置が前記第2の基準位置に対して前記第1の方向にずれ、かつ、前記参照領域の位置が前記第1の基準位置に対して前記第2の方向にずれている場合には、前記探索領域の位置が前記第2の基準位置に対して前記第2の方向にずれるように、前記探索領域の位置を決定する、画像処理装置。
[適用例4]
適用例1〜3のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、
前記参照領域の基準となる第1の基準領域の外形を示す情報と、前記探索領域の基準となる第2の基準領域の外形を示す情報とを、取得し、
前記参照領域の外形と前記第1の基準領域の外形との関係と、前記第2の基準領域の外形と、に基づいて、前記探索領域の外形を決定する、画像処理装置。
[適用例5]
適用例4に記載の画像処理装置であって、
前記探索領域決定部は、
前記参照領域の第1の方向の長さと前記第1の基準領域の前記第1の方向の長さとの比率を用いて、前記探索領域の前記第1の方向の長さを決定する、画像処理装置。
[適用例6]
適用例5に記載の画像処理装置であって、
前記第1の方向は、生成されるべき前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向であり、
前記探索領域決定部は、
前記探索領域の前記第1の方向と垂直な第2の方向の長さを、前記参照領域の前記第2の方向の長さに決定する、画像処理装置。
[適用例7]
適用例5または6に記載の画像処理装置であって、
前記探索領域決定部は、前記探索領域の前記第1の方向の長さを、前記第2の基準領域の前記第1の方向の長さより小さな値に決定する、画像処理装置。
[適用例8]
適用例4〜7のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、前記参照領域の外形と前記第1の基準領域の外形との関係と、前記第2の基準領域の外形と、に基づいて決定された前記探索領域が、前記第2の画像より外側の領域を含む場合には、修正後の前記探索領域が前記第2の画像内に含まれるように、前記探索領域を修正する、画像処理装置。
[適用例9]
適用例4〜8のいずれかに記載の画像処理装置であって、
前記第2の基準領域は、前記第2の画像の第1の方向の端に沿って配置され、
前記第1の基準領域は、前記第1の画像の前記第1の方向とは反対方向の端に沿って配置され、
前記第1の方向は、生成されるべき前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向である、画像処理装置。
[適用例10]
適用例1〜9のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、
前記参照領域の第1の方向の長さが長いほど、前記探索領域の前記第1の方向の長さを長く決定する、画像処理装置。
[適用例11]
適用例1〜10のいずれかに記載の画像処理装置であって、
前記位置情報は、前記参照領域の位置を特定する座標を含み、
前記外形情報は、前記参照領域のサイズを示す第1の方向の長さと、前記第1の方向と垂直な第2の方向の長さと、を含む。
[適用例12]
適用例1〜11のいずれかに記載の画像処理装置であって、
前記参照領域決定部は、前記第1の画像内の複数個の画素の値のばらつきに基づいて、前記参照領域を決定し、
前記探索領域決定部は、ばらつきに基づいて決定された前記参照領域に応じて、前記探索領域を決定する、画像処理装置。
[適用例13]
適用例1〜12のいずれかに記載の画像処理装置であって、
前記第1の画像データは、原稿の第1の領域を光学的に読み取ることによって得られる画像データであり、
前記第2の画像データは、前記原稿の第2の領域を光学的に読み取ることによって得られる画像データである、画像処理装置。

According to the above configuration, a search area that is arranged at an appropriate position and has an appropriate size is determined using the position information and the external shape information of the reference area, and thus a search that is a partial area in the second image. Using the region, the corresponding region can be determined efficiently. Therefore, it is possible to reduce the processing time for determining the target area in the second image similar to the reference area in the first image.
[Application Example 2]
An image processing apparatus according to Application Example 1,
The search area determination unit
Obtaining information indicating a first reference position, which is a reference position of the first image, and information indicating a second reference position, which is a reference position of the second image;
An image processing apparatus that determines a position of the search area based on a relationship between a position of the reference area and the first reference position and the second reference position.
[Application Example 3]
An image processing apparatus according to Application Example 2,
The first reference position is information indicating a reference position of the reference area,
The second reference position is information indicating a reference position of the search area,
The information indicating the first reference position and the information indicating the second reference position are respectively information indicating the position in the first direction and a position in the second direction perpendicular to the first direction. Including information indicating
The first direction is a direction in which the first image and the second image are arranged in the composite image,
When the position of the reference area is shifted in the first direction with respect to the first reference position, the search area determining unit determines that the position of the search area is relative to the second reference position. When the position of the reference area is shifted in the second direction with respect to the first reference position, the position of the search area is shifted to the second reference position. An image processing apparatus that determines a position of the search region so as to be shifted in the second direction with respect to the image.
[Application Example 4]
The image processing apparatus according to any one of Application Examples 1 to 3,
The search area determination unit
Obtaining information indicating the outer shape of the first reference area serving as the reference area of the reference area and information indicating the outer shape of the second reference area serving as the reference of the search area;
An image processing apparatus that determines an outer shape of the search region based on a relationship between an outer shape of the reference region and an outer shape of the first reference region and an outer shape of the second reference region.
[Application Example 5]
An image processing apparatus according to Application Example 4,
The search area determination unit
Image processing for determining a length of the search region in the first direction using a ratio between a length of the reference region in the first direction and a length of the first reference region in the first direction apparatus.
[Application Example 6]
An image processing apparatus according to Application Example 5,
The first direction is a direction in which the first image and the second image are arranged in the composite image to be generated;
The search area determination unit
An image processing apparatus that determines a length of the search region in a second direction perpendicular to the first direction as a length of the reference region in the second direction.
[Application Example 7]
The image processing apparatus according to Application Example 5 or 6,
The search region determination unit is an image processing device that determines the length of the search region in the first direction to a value smaller than the length of the second reference region in the first direction.
[Application Example 8]
The image processing apparatus according to any one of Application Examples 4 to 7,
The search region determination unit is configured to determine whether the search region determined based on a relationship between an outer shape of the reference region and an outer shape of the first reference region and an outer shape of the second reference region is the second shape. An image processing device that corrects the search area so that the corrected search area is included in the second image when an area outside the first image is included.
[Application Example 9]
An image processing apparatus according to any one of Application Examples 4 to 8,
The second reference region is disposed along an edge in a first direction of the second image;
The first reference region is disposed along an end of the first image in a direction opposite to the first direction;
The image processing apparatus, wherein the first direction is a direction in which the first image and the second image are arranged in the composite image to be generated.
[Application Example 10]
The image processing apparatus according to any one of Application Examples 1 to 9,
The search area determination unit
An image processing apparatus that determines the length of the search region in the first direction to be longer as the length of the reference region in the first direction is longer.
[Application Example 11]
The image processing apparatus according to any one of Application Examples 1 to 10,
The position information includes coordinates that specify the position of the reference region,
The external shape information includes a length in a first direction indicating the size of the reference region and a length in a second direction perpendicular to the first direction.
[Application Example 12]
An image processing apparatus according to any one of Application Examples 1 to 11,
The reference area determining unit determines the reference area based on a variation in values of a plurality of pixels in the first image;
The image processing apparatus, wherein the search area determination unit determines the search area according to the reference area determined based on variation.
[Application Example 13]
An image processing apparatus according to any one of Application Examples 1 to 12,
The first image data is image data obtained by optically reading a first area of a document,
The image processing apparatus, wherein the second image data is image data obtained by optically reading a second area of the document.

なお、本発明は、種々の形態で実現することが可能であり、例えば、画像読取装置、画像処理装置や画像読取装置の制御方法、これらの装置または方法を実現するためのコンピュータプ口グラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。   The present invention can be realized in various forms, for example, an image reading apparatus, an image processing apparatus, a method for controlling the image reading apparatus, a computer program for realizing these apparatuses or methods, and the like. It can be realized in the form of a recording medium on which a computer program is recorded.

実施例における画像処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the image processing system in an Example. 画像処理システム1000の動作を示すシーケンス図である。FIG. 11 is a sequence diagram showing an operation of the image processing system 1000. 本実施例で用いられる原稿の一例を示す図である。It is a figure which shows an example of the original document used by a present Example. UI画面の一例を示す図である。It is a figure which shows an example of UI screen. スキャン画像の一例を示す図である。It is a figure which shows an example of a scanned image. 合成画像30の一例を示す図である。3 is a diagram illustrating an example of a composite image 30. FIG. 参照領域決定処理のフローチャートである。It is a flowchart of a reference area determination process. 参照領域決定処理の説明図である。It is explanatory drawing of a reference area determination process. ばらつき画素と非ばらつき画素とを説明する図である。It is a figure explaining a variation pixel and a non-variation pixel. 参照領域配置処理のフローチャートである。It is a flowchart of a reference area arrangement process. ばらつき領域VAに基づいて決定される参照領域RA1の一例を示す図である。It is a figure showing an example of reference field RA1 determined based on variation field VA. 探索領域決定処理のフローチャートである。It is a flowchart of a search area | region determination process. 探索領域決定処理の説明図である。It is explanatory drawing of a search area | region determination process. 対応領域決定処理のフローチャートである。It is a flowchart of a corresponding area determination process. 探索領域SA1内に特定されるべき複数個の候補領域について説明する図である。It is a figure explaining the several candidate area | region which should be specified in search area | region SA1.

A.実施例:
A−1:画像処理システム1000の構成
図1は、実施例における画像処理システムの構成を示すブロック図である。画像処理システム1000は、画像処理装置としてのサーバ400と、複合機200と、を備えている。サーバ400は、インターネット70に接続されており、複合機200は、LAN(Local Area Network)80を介して、インターネット70に接続されている。この結果、サーバ400と複合機200は、LAN80とインターネット70とを介して、通信可能である。また、LAN80には、複合機200のユーザのパーソナルコンピュータ500が接続されていても良い。
A. Example:
A-1: Configuration of Image Processing System 1000 FIG. 1 is a block diagram illustrating a configuration of an image processing system in the embodiment. The image processing system 1000 includes a server 400 as an image processing apparatus and a multifunction device 200. The server 400 is connected to the Internet 70, and the multi-function device 200 is connected to the Internet 70 via a LAN (Local Area Network) 80. As a result, the server 400 and the multifunction device 200 can communicate with each other via the LAN 80 and the Internet 70. Further, the personal computer 500 of the user of the multifunction device 200 may be connected to the LAN 80.

サーバ400は、CPU410と、DRAMなどの揮発性記憶装置420と、ハードディスクドライブやフラッシュメモリなどの不揮発性記憶装置430と、インターネット70などのネットワークに接続するためのインタフェースを含む通信部480と、を備えている。揮発性記憶装置420には、CPU410が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域421が設けられている。不揮発性記憶装置430には、コンピュータプログラム431と、UIデータ群433と、が格納されている。   The server 400 includes a CPU 410, a volatile storage device 420 such as a DRAM, a nonvolatile storage device 430 such as a hard disk drive or a flash memory, and a communication unit 480 including an interface for connecting to a network such as the Internet 70. I have. The volatile storage device 420 is provided with a buffer area 421 for temporarily storing various intermediate data generated when the CPU 410 performs processing. The nonvolatile storage device 430 stores a computer program 431 and a UI data group 433.

コンピュータプログラム431、および、UIデータ群433は、例えば、サーバ400の管理者によって、インターネット70を介してサーバ400にアップロードされることにより、サーバ400にインストールされる。または、コンピュータプログラム431、および、UIデータ群433は、例えば、DVD−ROMなどに格納された形態で提供され、サーバ400の管理者によって、サーバ400にインストールされても良い。CPU410は、コンピュータプログラム431を実行することにより、後述する画像処理を実現する。   The computer program 431 and the UI data group 433 are installed in the server 400 by being uploaded to the server 400 via the Internet 70 by an administrator of the server 400, for example. Alternatively, the computer program 431 and the UI data group 433 may be provided in a form stored in, for example, a DVD-ROM, and may be installed in the server 400 by the administrator of the server 400. The CPU 410 implements image processing to be described later by executing the computer program 431.

複合機200は、CPU210と、DRAMなどの揮発性記憶装置220と、フラッシュメモリやハードディスクドライブなどの不揮発性記憶装置230と、プリンタ部240と、スキャナ部250と、タッチパネルやボタンなどの操作部260と、液晶ディスプレイなどの表示部270と、外部機器と通信を行う通信部280と、を備えている。例えば、通信部280は、LAN80などのネットワークに接続するためのインタフェースや、外部記憶装置(例えば、USBメモリ)と接続するためのインタフェースを含んでいる。   The MFP 200 includes a CPU 210, a volatile storage device 220 such as a DRAM, a nonvolatile storage device 230 such as a flash memory and a hard disk drive, a printer unit 240, a scanner unit 250, and an operation unit 260 such as a touch panel and buttons. A display unit 270 such as a liquid crystal display, and a communication unit 280 that communicates with an external device. For example, the communication unit 280 includes an interface for connecting to a network such as the LAN 80 and an interface for connecting to an external storage device (for example, a USB memory).

揮発性記憶装置220には、CPU210が処理を行う際に生成される種々のデータを一時的に格納するバッファ領域221が設けられている。不揮発性記憶装置230には、制御プログラム231が格納されている。   The volatile storage device 220 is provided with a buffer area 221 for temporarily storing various data generated when the CPU 210 performs processing. A control program 231 is stored in the non-volatile storage device 230.

プリンタ部240は、インクジェット方式やレーザー方式などの印刷方式を用いて印刷を実行する。スキャナ部250は、光電変換素子(例えば、CCD、CMOS)を用いて光学的に原稿を読み取ることによってカラー画像やグレー画像を表すスキャンデータを生成する。スキャナ部250は、いわゆるフラットベッド式の原稿台を備えている。なお、原稿台の長手方向のサイズは、ISO(International Organization for Standardizationの略称)216で定められている紙の寸法を規定するA4サイズの長手方向の長さである297mmより少しだけ(例えば、数センチ)長いサイズである。そして、原稿台の短手方向のサイズは、ANSI/ASME(American National Standards Institute/American Society of Mechanical Engineersの略称)Y14.1で定められている紙の寸法を規定するレターサイズの短手方向の長さである215.9mmより少しだけ(例えば、数センチ)長いサイズである。本実施例では、1回で読み取ることができる原稿の最大サイズは、A4サイズより大きくA3サイズ(ISOで定められている紙の寸法)より小さいサイズである。具体的には、スキャナ部250は、長手方向の長さがA4サイズの長手方向の長さより少しだけ長く、かつ、短手方向の長さがレターサイズの短手方向の長さより少しだけ長い原稿を読み取り、当該原稿のサイズの画像を表す画像データを生成する。このために、後述するように、A3サイズの原稿の長手方向の中央付近が重複するように、A3サイズの原稿を2回に分けて読み取ることができる。   The printer unit 240 executes printing using a printing method such as an inkjet method or a laser method. The scanner unit 250 generates scan data representing a color image or a gray image by optically reading a document using a photoelectric conversion element (for example, CCD, CMOS). The scanner unit 250 includes a so-called flatbed type document table. The size of the document table in the longitudinal direction is slightly smaller than 297 mm, which is the length in the longitudinal direction of the A4 size that defines the dimensions of paper defined by ISO (International Organization for Standardization) 216 (for example, several Cm) Long size. The size of the manuscript table in the short direction is the size in the short direction of the letter size that prescribes the paper dimensions defined in ANSI / ASME (Abbreviation of American National Standards Institute / American Society of Mechanical Engineers) Y14.1. The size is slightly longer (for example, several centimeters) than the length 215.9 mm. In this embodiment, the maximum size of a document that can be read at one time is larger than the A4 size and smaller than the A3 size (the paper size defined by ISO). Specifically, the scanner unit 250 is a document in which the length in the longitudinal direction is slightly longer than the length in the longitudinal direction of A4 size, and the length in the lateral direction is slightly longer than the length in the lateral direction of the letter size. Is generated, and image data representing an image of the size of the document is generated. Therefore, as will be described later, the A3 size document can be read in two steps so that the vicinity of the center in the longitudinal direction of the A3 size document overlaps.

CPU210は、制御プログラム231を実行することにより、複合機200の制御を実行する。例えば、CPU210は、プリンタ部240やスキャナ部250を制御して、コピー処理、印刷処理、スキャン処理などを実行する。さらに、CPU210は、サーバ400にアクセスして、サーバ400が提供するサービスを利用するサービス利用処理を、実行することができる。   The CPU 210 executes control of the multifunction device 200 by executing the control program 231. For example, the CPU 210 controls the printer unit 240 and the scanner unit 250 to execute a copy process, a print process, a scan process, and the like. Furthermore, the CPU 210 can access the server 400 and execute a service use process that uses a service provided by the server 400.

A−2:画像処理システム1000の動作
図2は、画像処理システム1000の動作を示すシーケンス図である。このシーケンス図の処理は、複合機200が、サーバ400が提供する画像生成サービスの利用指示を、ユーザから受け付けた場合に開始される。この画像生成サービスは、詳細は後述するが、複数個のスキャンデータによって表される複数個のスキャン画像を合成するサービスである。複数個のスキャンデータは、詳細は後述するが、例えば、1回で読み取り可能なサイズより大きなサイズの原稿を、複数回に分けて読み取ることによって生成される。
A-2: Operation of Image Processing System 1000 FIG. 2 is a sequence diagram showing the operation of the image processing system 1000. The processing in the sequence diagram is started when the multifunction device 200 receives an instruction to use an image generation service provided by the server 400 from a user. As will be described in detail later, this image generation service is a service that combines a plurality of scan images represented by a plurality of scan data. The details of the plurality of scan data are described later. For example, the plurality of scan data are generated by reading a document having a size larger than the size that can be read at one time in a plurality of times.

処理が開始されると、S5では、複合機200のCPU210は、サービス開始要求を、サーバ400に対して送信する。サーバ400のCPU410は、サービス開始要求を受信すると、UIデータ群433(図1)から画像生成サービスの提供に必要なUIデータを選択し、該UIデータを複合機200に対して送信する(S10)。UIデータは、具体的には、ユーザインタフェース画面(以下、UI画面)を表す画面データと、制御データと、を含む。この制御データは、例えば、UI画面を利用して複合機200が所定の処理(具体的には、後述するS15のスキャン処理)を行うために必要な各種のデータを含む。例えば、制御データは、UI画面(例えば、図4)を介して受け付けたユーザの指示に基づいて、複合機200が実行すべき処理(例えば、サーバ400へのスキャンデータの送信)を行うために必要な情報(例えば、スキャンデータの送信先アドレス)を含む。   When the process is started, in S5, the CPU 210 of the multifunction device 200 transmits a service start request to the server 400. When receiving the service start request, the CPU 410 of the server 400 selects UI data necessary for providing the image generation service from the UI data group 433 (FIG. 1), and transmits the UI data to the multifunction device 200 (S10). ). Specifically, the UI data includes screen data representing a user interface screen (hereinafter referred to as UI screen) and control data. This control data includes, for example, various data necessary for the MFP 200 to perform predetermined processing (specifically, scan processing in S15 described later) using the UI screen. For example, the control data is used to perform processing (for example, transmission of scan data to the server 400) to be executed by the multifunction device 200 based on a user instruction received via a UI screen (for example, FIG. 4). Necessary information (for example, transmission address of scan data) is included.

S15では、CPU210は、受信したUIデータに基づいて、複数個のスキャンデータを生成するスキャン処理を実行する。スキャン処理では、CPU210は、ユーザが用意した原稿を2回に分けて読み取ることによって、2個のスキャンデータを生成する。本実施例のスキャンデータは、RGBの各成分の値(例えば、0〜255の256階調の値)を画素ごとに含むRGB画像データである。   In S15, the CPU 210 executes a scan process for generating a plurality of scan data based on the received UI data. In the scan process, the CPU 210 generates two pieces of scan data by reading the document prepared by the user in two steps. The scan data according to the present embodiment is RGB image data including RGB component values (for example, values of 256 gradations from 0 to 255) for each pixel.

図3は、本実施例で用いられる原稿の一例を示す図である。図3の原稿10のサイズは、スキャナ部250が1回で読み取り可能なサイズ(本実施例では、A4サイズより少し大きなサイズ)の約2倍のサイズ(本実施例では、A3サイズ)である。   FIG. 3 is a diagram illustrating an example of a document used in this embodiment. The size of the original 10 in FIG. 3 is about twice the size (A3 size in this embodiment) that is readable by the scanner unit 250 at one time (in this embodiment, a size slightly larger than the A4 size). .

図4は、UI画面の一例を示す図である。先ず、CPU210は、図4のUI画面UG1を表示部270に表示する。例えば、UI画面UG1は、原稿台への原稿10の適切な設置を促すメッセージMS1と、スキャンボタンSBと、キャンセルボタンCBと、を含んでいる。ユーザは、UI画面UG1に従って、原稿10の左側の約半分の領域10L(図3)を読み取ることができるように、原稿10を原稿台に設置し、スキャンボタンSBを押下する。スキャンボタンSBの押下に応じて、CPU210は、スキャナ部250を制御して原稿を読み取ることによって、左側スキャンデータを生成する。   FIG. 4 is a diagram illustrating an example of a UI screen. First, the CPU 210 displays the UI screen UG1 of FIG. For example, the UI screen UG1 includes a message MS1 for prompting appropriate placement of the document 10 on the document table, a scan button SB, and a cancel button CB. The user places the document 10 on the document table and presses the scan button SB so that the left half 10L (FIG. 3) of the left side of the document 10 can be read according to the UI screen UG1. In response to the pressing of the scan button SB, the CPU 210 controls the scanner unit 250 to read the original, thereby generating left scan data.

図5は、スキャン画像の一例を示す図である。図5(A)には、左側スキャンデータによって表される左側スキャン画像20Lが示されている。左側スキャン画像20Lは、原稿10の左側の約半分の領域10L(図3)を示す左側原稿画像HILと、余白WBLと、を含んでいる。   FIG. 5 is a diagram illustrating an example of a scanned image. FIG. 5A shows a left scan image 20L represented by the left scan data. The left-side scanned image 20L includes a left-side original image HIL that shows an approximately half area 10L (FIG. 3) on the left side of the original 10, and a margin WBL.

次に、CPU210は、所定のUI画面(図示省略)を表示部270に表示する。このUI画面は、UI画面UG1と同様に、原稿台への原稿10の適切な設置を促すメッセージと、スキャンボタンと、キャンセルボタンと、を含んでいる。ユーザは、UI画面に従って、原稿10の右側の約半分の領域10R(図3)を読み取ることができるように、原稿10を原稿台に設置し、スキャンボタンを押下する。CPU210は、スキャンボタンの押下に応じて、スキャナ部250を制御して原稿を読み取ることによって、右側スキャンデータを生成する。   Next, the CPU 210 displays a predetermined UI screen (not shown) on the display unit 270. Similar to the UI screen UG1, this UI screen includes a message for prompting appropriate placement of the document 10 on the document table, a scan button, and a cancel button. In accordance with the UI screen, the user places the document 10 on the document table and presses the scan button so that the half area 10R (FIG. 3) on the right side of the document 10 can be read. The CPU 210 generates right-side scan data by controlling the scanner unit 250 and reading a document in response to pressing of the scan button.

図5(B)には、右側スキャンデータによって表される右側スキャン画像20Rが示されている。右側スキャン画像20Rは、原稿10の右側の約半分の領域10R(図3)を示す右側原稿画像HIRと、余白WBRと、を含んでいる。   FIG. 5B shows a right scan image 20R represented by the right scan data. The right-side scanned image 20R includes a right-side original image HIR that shows an approximately half area 10R (FIG. 3) on the right side of the original 10, and a margin WBR.

ここで、図3の原稿10の横方向の中央部CAを表す画像は、左側スキャン画像20Lの右端に沿った領域と、右側スキャン画像20Rの左端に沿った領域と、の両方に含まれている。すなわち、図5にハッチングで示すように、左側スキャン画像20Lは、原稿10の中央部CAを表す画像CILを含み、右側スキャン画像20Rは、原稿10の中央部CAを表す画像CIRを含んでいる。これは、例えば、UI画面や複合機200の説明書などによって、原稿10の中央部CAが、右側スキャンデータの生成時と左側スキャンデータの生成時との両方で読み取られるように、原稿10を原稿台に設置するように、ユーザに指示することによって、実現される。なお、左側スキャン画像20L内の画像CILと、右側スキャン画像20R内の画像CIRとは、ともに原稿10の中央部CAを表しているが、ユーザによって原稿台に設置された原稿10の位置、スキャナ部250の光電変換素子の特性などによって、面積や色などに多少の差は、生じ得る。   Here, the image representing the lateral center CA of the document 10 in FIG. 3 is included in both the area along the right edge of the left scan image 20L and the area along the left edge of the right scan image 20R. Yes. That is, as shown by hatching in FIG. 5, the left-side scan image 20L includes an image CIL that represents the center portion CA of the document 10, and the right-side scan image 20R includes an image CIR that represents the center portion CA of the document 10. . This is because, for example, the central portion CA of the original 10 is read by both the generation of the right scan data and the generation of the left scan data according to a UI screen or a manual of the multifunction device 200. This is realized by instructing the user to place the document on the document table. Note that the image CIL in the left scan image 20L and the image CIR in the right scan image 20R both represent the center CA of the document 10, but the position of the document 10 placed on the document table by the user, the scanner Depending on the characteristics of the photoelectric conversion element of the portion 250, a slight difference in area, color, and the like may occur.

図2のS20では、CPU210は、右側スキャン画像20Rを表す右側スキャンデータと、左側スキャン画像20Lを表す左側スキャンデータと、をサーバ400に対して送信する。この結果、S25にて、サーバ400のCPU410は、右側スキャンデータと、左側スキャンデータと、取得して、バッファ領域421に格納する。   In S20 of FIG. 2, the CPU 210 transmits right scan data representing the right scan image 20R and left scan data representing the left scan image 20L to the server 400. As a result, in S25, the CPU 410 of the server 400 acquires the right side scan data and the left side scan data, and stores them in the buffer area 421.

S30では、CPU410は、右側スキャンデータを用いて、参照領域決定処理を実行する。参照領域決定処理は、右側スキャンデータによって表される右側スキャン画像20Rの一部の領域である参照領域RA1を決定する処理である。なお、参照領域決定処理の詳細は、後述する。   In S30, the CPU 410 executes a reference area determination process using the right side scan data. The reference area determination process is a process of determining a reference area RA1 that is a partial area of the right scan image 20R represented by the right scan data. Details of the reference area determination process will be described later.

S32では、CPU410は、探索領域決定処理を実行する。探索領域決定処理は、左側スキャンデータを用いて、左側スキャン画像20L内の一部の領域である探索領域SA1を決定する処理である。なお、探索領域決定処理の詳細は、後述する。   In S32, the CPU 410 executes a search area determination process. The search area determination process is a process of determining a search area SA1, which is a partial area in the left scan image 20L, using the left scan data. Details of the search area determination process will be described later.

S35では、CPU410は、対応領域決定処理を実行する。対応領域決定処理は、右側スキャン画像20R内の参照領域RA1に対応する左側スキャン画像20L内の対応領域CPを決定する処理である。参照領域RA1に対応する対応領域CPは、次のように定義できる。右側スキャン画像20R内の参照領域RA1(図5(B))内に表されている原稿10の一部分を特定部分SPT(図3)とする。参照領域RA1に対応する対応領域CPは、左側スキャン画像20Lにおいて、原稿10の特定部分SPTを表す領域である。対応領域CPは、S32の探索領域決定処理によって左側スキャン画像20L内に決定された探索領域SA1内から決定される。なお、対応領域処理の詳細は、後述する。   In S35, the CPU 410 executes a corresponding area determination process. The corresponding area determination process is a process for determining the corresponding area CP in the left scan image 20L corresponding to the reference area RA1 in the right scan image 20R. The corresponding area CP corresponding to the reference area RA1 can be defined as follows. A part of the document 10 shown in the reference area RA1 (FIG. 5B) in the right-side scan image 20R is defined as a specific portion SPT (FIG. 3). The corresponding area CP corresponding to the reference area RA1 is an area representing the specific portion SPT of the document 10 in the left scan image 20L. The corresponding area CP is determined from the search area SA1 determined in the left scan image 20L by the search area determination processing in S32. Details of the corresponding area processing will be described later.

S40では、CPU410は、合成処理を実行する。合成処理では、右側スキャンデータと左側スキャンデータとを用いて、右側スキャン画像20R内の右側原稿画像HIRと、左側スキャン画像20L内の左側原稿画像HILとが合成された合成画像30を表す合成画像データが生成される。   In S40, the CPU 410 executes a composition process. In the composition process, a composite image representing a composite image 30 in which the right original image HIR in the right scan image 20R and the left original image HIL in the left scan image 20L are combined using the right scan data and the left scan data. Data is generated.

図6は、合成画像30の一例を示す図である。図6に示すように、合成画像30において、右側原稿画像HIRと左側原稿画像HILとは、右側原稿画像HIR内の参照領域RA1と、左側原稿画像HIL内の対応領域CPと、が重なるように、合成される。合成画像30において、右側原稿画像HIRと左側原稿画像HILとが互いに重なり合う領域内の画素の値には、例えば、右側原稿画像HIR(右側スキャン画像20R)内の画素の値が優先的に採用される。これによって、右側原稿画像HIRと左側原稿画像HILとが合成されて、図3の原稿10を表す合成画像30が生成される。   FIG. 6 is a diagram illustrating an example of the composite image 30. As shown in FIG. 6, in the composite image 30, the right original image HIR and the left original image HIL are such that the reference area RA1 in the right original image HIR and the corresponding area CP in the left original image HIL overlap. Is synthesized. In the composite image 30, for example, the pixel value in the right original image HIR (right scan image 20R) is preferentially adopted as the pixel value in the region where the right original image HIR and the left original image HIL overlap each other. The As a result, the right original image HIR and the left original image HIL are combined to generate a combined image 30 representing the original 10 in FIG.

なお、後述する対応領域決定処理において、参照領域RA1に対応する対応領域CPを決定できなかった場合には、例えば、機械的に、左側スキャン画像20Lの右端の辺と、右側スキャン画像20Rの左端の辺と、が接するように、2個のスキャン画像が合成された合成画像を表す合成画像データが生成される(図示省略)。   If the corresponding area CP corresponding to the reference area RA1 cannot be determined in the corresponding area determination process described later, for example, the right edge of the left scanned image 20L and the left edge of the right scanned image 20R are mechanically processed. Composite image data representing a composite image obtained by combining the two scan images is generated (not shown in the drawing) such that the side of the image is in contact with each other.

図2のS45では、CPU410は、生成された合成画像データを複合機200に対して送信する。複合機200のCPU210は、合成画像データを受信すると、受信した合成画像データを不揮発性記憶装置230に格納するとともに、ユーザに合成画像データを受信したことを通知する。合成画像データは、ユーザの利用に供される。例えば、複合機200は、ユーザの指示に基づいて、合成画像データを用いて、合成画像30を印刷することができる。   In S <b> 45 of FIG. 2, the CPU 410 transmits the generated composite image data to the multifunction device 200. When the composite image data is received, the CPU 210 of the multifunction device 200 stores the received composite image data in the nonvolatile storage device 230 and notifies the user that the composite image data has been received. The composite image data is used for the user. For example, the multifunction device 200 can print the composite image 30 using the composite image data based on a user instruction.

以上説明した画像処理システム1000によれば、一の原稿10(図3)からそれぞれ別の領域を読み取ることによって得られる複数個の画像データ(具体的には、右側スキャンデータと左側スキャンデータ)を用いて、一の原稿10を表す合成画像データを生成することができる。   According to the image processing system 1000 described above, a plurality of image data (specifically, right side scan data and left side scan data) obtained by reading different areas from one original 10 (FIG. 3) are obtained. By using this, composite image data representing one original 10 can be generated.

次に、図2のS30で示した参照領域決定処理を説明する。図7は、参照領域決定処理のフローチャートである。図8は、参照領域決定処理の説明図である。S105では、CPU410は、CPU410は、右側スキャン画像20R内に、配置範囲FAを決定する。決定された配置範囲FAの内側に、参照領域決定処理によって、参照領域RA1が決定される。配置範囲FAの位置、形状、サイズ(すなわち、縦方向および横方向の画素数)は、予め定められている。   Next, the reference area determination process shown in S30 of FIG. 2 will be described. FIG. 7 is a flowchart of the reference area determination process. FIG. 8 is an explanatory diagram of the reference area determination process. In S105, the CPU 410 determines the arrangement range FA in the right scan image 20R. The reference area RA1 is determined by the reference area determination process inside the determined arrangement range FA. The position, shape, and size (that is, the number of pixels in the vertical and horizontal directions) of the arrangement range FA are determined in advance.

具体的には、配置範囲FAは、図5(B)に示すように、右側スキャン画像20Rの4つの端のうち、原稿10の中央部CAを表す画像CIRが位置している端、本実施例では、右側スキャン画像20Rの左端に沿って配置される。   Specifically, as shown in FIG. 5B, the arrangement range FA is the end where the image CIR representing the central portion CA of the document 10 is located, among the four ends of the right-side scan image 20R. In the example, it is arranged along the left end of the right scanned image 20R.

配置範囲FAの横方向の長さ(すなわち、短手方向の長さ)は、右側スキャン画像20Rにおいて、原稿10の中央部CAを表す画像CIRの横方向の幅より狭いことが好ましい。配置範囲FAの縦方向の長さ(すなわち、長手方向の長さ)は、右側スキャン画像20Rの縦方向の長さと等しい。   The lateral length of the arrangement range FA (that is, the lateral length) is preferably narrower than the lateral width of the image CIR representing the central portion CA of the document 10 in the right-side scan image 20R. The length in the vertical direction of the arrangement range FA (that is, the length in the longitudinal direction) is equal to the length in the vertical direction of the right scan image 20R.

S110では、CPU410は、配置範囲FAに配置する単位領域のサイズを決定する。本実施例では、単位領域のサイズは、予め定められた値に決定される。例えば、1個の単位領域の横方向のサイズは、例えば、1〜2画素程度であり、1個の単位領域の縦方向のサイズは、右側スキャン画像20Rの縦方向の画素数の1/6〜1/3程度である。   In S110, the CPU 410 determines the size of the unit area to be arranged in the arrangement range FA. In the present embodiment, the size of the unit area is determined to be a predetermined value. For example, the horizontal size of one unit region is, for example, about 1 to 2 pixels, and the vertical size of one unit region is 1/6 of the number of pixels in the vertical direction of the right scan image 20R. About 1/3.

S115では、CPU410は、配置範囲FA内の複数個の単位領域の中から、1個の注目単位領域を選択する。図8(A)には、配置範囲FA内の複数個の単位領域が示されている。説明のために、配置範囲FA内の画素の座標を、右方向を正方向とするX軸と下方向を正方向とするY軸とを有し、配置範囲FAの左上の画素を(1、1)とする2次元座標系を用いて表す。   In S115, the CPU 410 selects one unit area of interest from the plurality of unit areas in the arrangement range FA. FIG. 8A shows a plurality of unit areas within the arrangement range FA. For the sake of explanation, the coordinates of the pixels in the arrangement range FA have the X axis with the right direction as the positive direction and the Y axis with the lower direction as the positive direction. This is expressed using a two-dimensional coordinate system 1).

図8(A)には、4つの単位領域UAa〜UAdが示されている。単位領域UAaの上端および左端は、配置範囲FAの上端および左端と一致する。単位領域UAbの下端および左端は、配置範囲FAの下端および左端と一致する。単位領域UAcの上端および右端は、配置範囲FAの上端および右端と一致する。単位領域UAdの下端および右端は、配置範囲FAの下端および右端と一致する。   FIG. 8A shows four unit areas UAa to UAd. The upper end and the left end of the unit area UAa coincide with the upper end and the left end of the arrangement range FA. The lower end and the left end of the unit area UAb coincide with the lower end and the left end of the arrangement range FA. The upper end and right end of the unit area UAc coincide with the upper end and right end of the arrangement range FA. The lower end and the right end of the unit area UAd coincide with the lower end and the right end of the arrangement range FA.

先ず、左上の端の単位領域UAaが最初の注目単位領域として選択される。そして、図8(A)に矢印で示すように、1画素ずつ下方向に位置がずれた単位領域が、順次に選択される。そして、左下の端の単位領域UAbが選択されると、左上の端の単位領域UAaの位置から1画素だけ右方向にずれた部分画像が選択される。その後は、再び1画素ずつ下方向に位置がずれた部分画像が、順次に選択される。最後に選択される部分画像は、右下の端の単位領域UAdである。   First, the unit area UAa at the upper left end is selected as the first target unit area. Then, as indicated by arrows in FIG. 8A, unit regions whose positions are shifted downward by one pixel are sequentially selected. When the lower left end unit area UAb is selected, a partial image shifted rightward by one pixel from the position of the upper left end unit area UAa is selected. Thereafter, partial images whose positions are shifted downward by one pixel are sequentially selected. The partial image selected last is the unit area UAd at the lower right end.

1個の注目単位領域が選択されると、S120では、CPU410は、注目単位領域内の複数個の画素を、ばらつき画素と、非ばらつき画素と、に分類し、ばらつき画素の個数(ばらつき画素数)VCuを算出する。   When one target unit region is selected, in S120, the CPU 410 classifies the plurality of pixels in the target unit region into a variation pixel and a non-variation pixel, and the number of variation pixels (the number of variation pixels). ) Calculate VCu.

図9は、ばらつき画素と非ばらつき画素とを説明する図である。CPU410は、注目単位領域内の複数個の画素を1個ずつ注目画素TPとして選択して、注目画素TPを中心とする横3画素×3画素分の領域FL内の画素を用いて、注目画素TPのばらつき値Vを算出する。まず、図9の式に示すように、CPU410は、注目画素TPの値(R0、G0、B0)と、周囲の8個の画素の値(Rn、Gn、Bn)のそれぞれと、の差分ΔVnを算出する。nは、注目画素TPの周囲の8個の画素を識別する1〜8までの番号であり、図9の領域FL内の各画素に付された番号である。CPU410は、図9に式で示すように、算出された8個の差分ΔVnの合計値を、注目画素TPのばらつき値Vとして算出する。注目画素TPのばらつき値Vが、所定の閾値Vth以上である場合には、注目画素TPは、ばらつき画素に分類され、所定の閾値Vth未満である場合には、注目画素TPは、非ばらつき画素に分類される。   FIG. 9 is a diagram for explaining a variation pixel and a non-variation pixel. The CPU 410 selects a plurality of pixels in the target unit region one by one as the target pixel TP, and uses the pixels in the region FL corresponding to three horizontal pixels × three pixels centered on the target pixel TP, A variation value V of TP is calculated. First, as shown in the equation of FIG. 9, the CPU 410 determines the difference ΔVn between the value of the target pixel TP (R0, G0, B0) and the values of the surrounding eight pixels (Rn, Gn, Bn). Is calculated. n is a number from 1 to 8 that identifies eight pixels around the pixel of interest TP, and is a number assigned to each pixel in the region FL of FIG. The CPU 410 calculates the total value of the calculated eight differences ΔVn as the variation value V of the target pixel TP, as shown by an equation in FIG. When the variation value V of the target pixel TP is greater than or equal to the predetermined threshold Vth, the target pixel TP is classified as a variation pixel, and when the variation value V is less than the predetermined threshold Vth, the target pixel TP is a non-variable pixel. are categorized.

S125では、CPU410は、注目単位領域のばらつき画素数VCuと、所定の閾値VCthと、を比較する。注目単位領域のばらつき画素数VCuが、閾値VCth以上である場合には(S130:YES)、S135において、CPU410は、注目単位領域の左上の画素の座標UP(X1、Y1)を、内部の画素の値のばらつきが比較的大きい単位領域(以下、ばらつき単位領域とも呼ぶ)を示す情報として記憶する。注目単位領域のばらつき画素数VCuが、閾値VCth未満である場合には(S130:NO)、CPU410は、S135をスキップして、S140に処理を進める。   In S125, the CPU 410 compares the variation pixel number VCu in the unit area of interest with a predetermined threshold value VCth. When the variation pixel number VCu in the unit area of interest is equal to or greater than the threshold value VCth (S130: YES), in S135, the CPU 410 determines the coordinates UP (X1, Y1) of the upper left pixel of the unit unit area as the internal pixel. Is stored as information indicating a unit region (hereinafter also referred to as a variation unit region) having a relatively large variation in the value of. If the variation pixel number VCu in the unit area of interest is less than the threshold value VCth (S130: NO), the CPU 410 skips S135 and proceeds to S140.

S140では、CPU410は、配置範囲FA内の全ての単位領域(図8(A))を注目単位領域として処理したか否かを判断する。未処理の単位画像がある場合には(S140:NO)、CPU410は、S115に戻る。全ての単位領域が処理された場合には(S140:YES)、S145において、CPU410は、上述したS135にて1個以上の単位領域の座標P(X1、Y1)が記憶されているか否かを判断する。   In S140, the CPU 410 determines whether or not all unit areas (FIG. 8A) in the arrangement range FA have been processed as the target unit area. If there is an unprocessed unit image (S140: NO), the CPU 410 returns to S115. When all the unit areas have been processed (S140: YES), in S145, the CPU 410 determines whether or not the coordinates P (X1, Y1) of one or more unit areas are stored in S135 described above. to decide.

単位領域の座標UP(X1、Y1)が記憶されていない場合には(S145:NO)、S150において、CPU410は、基準参照領域RA0(デフォルトの領域)を、参照領域RA1として決定する。基準参照領域RA0については後述する。単位領域の座標UP(X1、Y1)が記憶されている場合には(S145:YES)、S155において、CPU410は、参照領域配置処理を実行する。   If the unit area coordinates UP (X1, Y1) are not stored (S145: NO), in S150, the CPU 410 determines the standard reference area RA0 (default area) as the reference area RA1. The reference reference area RA0 will be described later. When the unit area coordinates UP (X1, Y1) are stored (S145: YES), in S155, the CPU 410 executes a reference area arrangement process.

図10は、参照領域配置処理のフローチャートである。先ず、図10の参照領域配置処理が開始される時点で、配置範囲FA内には、複数個のばらつき単位領域が特定されている(図8(B))。図8(B)において、黒い丸は、特定されたばらつき単位領域の左上の画素(領域特定画素とも呼ぶ)の位置を示している。   FIG. 10 is a flowchart of the reference area arrangement process. First, when the reference area arrangement process in FIG. 10 is started, a plurality of variation unit areas are specified in the arrangement area FA (FIG. 8B). In FIG. 8B, the black circle indicates the position of the upper left pixel (also referred to as region specifying pixel) of the specified variation unit region.

S205では、CPU410は、特定された複数個のばらつき単位領域の中から、互いに近接している1個以上のばらつき単位領域(以下、近接ばらつき単位領域群と呼ぶ)を選択する。具体的には、CPU410は、所定の大きさの判定枠JH(図8(B))を用いて配置範囲FA内を走査して、内部に含まれる領域特定画素の個数が最大である判定枠JHの位置を決定する。   In S205, the CPU 410 selects one or more variation unit regions (hereinafter referred to as a proximity variation unit region group) that are close to each other from the plurality of specified variation unit regions. Specifically, the CPU 410 scans the arrangement range FA using the determination frame JH having a predetermined size (FIG. 8B), and the determination frame having the maximum number of area specifying pixels included therein. Determine the position of JH.

図8(B)には、内部に含まれる領域特定画素の個数が最大である判定枠JHが示されている。図8(B)に示す判定枠JHには、5個の領域特定画素UP1〜UP5が含まれている。CPU410は、さらに、これらの5個の領域特定画素UP1〜UP5との距離が、基準距離Dthより近い領域特定画素を特定する。図8(B)の例では、領域特定画素UP1〜UP5との距離が、基準距離Dthより近い2個の領域特定画素P6、P7が特定される。この結果、図8(B)の例では、7個の領域特定画素UP1〜UP7に対応する7個のばらつき単位領域が、近接ばらつき単位領域群として選択される。   FIG. 8B shows a determination frame JH in which the number of area specifying pixels included therein is the maximum. The determination frame JH shown in FIG. 8B includes five area specifying pixels UP1 to UP5. Further, the CPU 410 specifies an area specifying pixel whose distance from these five area specifying pixels UP1 to UP5 is shorter than the reference distance Dth. In the example of FIG. 8B, two area specifying pixels P6 and P7 whose distances from the area specifying pixels UP1 to UP5 are closer than the reference distance Dth are specified. As a result, in the example of FIG. 8B, seven variation unit regions corresponding to the seven region specifying pixels UP1 to UP7 are selected as the proximity variation unit region group.

S210では、CPU410は、近接ばらつき単位領域群によって規定される領域VA(以下、ばらつき領域VAとも呼ぶ)内の画素数PCを算出する。図8(C)には、近接ばらつき単位領域群によって規定されるばらつき領域VAの一例を示す図である。ばらつき領域VAは、近接ばらつき単位領域群に含まれる1個以上のばらつき単位領域のうちの少なくとも一個の単位領域に含まれる複数個の画素によって構成される。   In S210, the CPU 410 calculates the number of pixels PC in an area VA defined by the proximity variation unit area group (hereinafter also referred to as a variation area VA). FIG. 8C is a diagram showing an example of the variation area VA defined by the proximity variation unit area group. The variation area VA includes a plurality of pixels included in at least one unit area among one or more variation unit areas included in the proximity variation unit area group.

S215〜S240では、CPU410は、算出された画素数PCと、3個の画素数閾値PCth1〜PCth3(PCth1<PCth2<PCth3)と、を比較することによって、参照領域RA1を決定する。   In S215 to S240, the CPU 410 determines the reference region RA1 by comparing the calculated pixel number PC with the three pixel number threshold values PCth1 to PCth3 (PCth1 <PCth2 <PCth3).

先ず、S215では、CPU410は、画素数PCが、第1の画素数閾値PCth1未満であるか否かを判断する。画素数PCが、第1の画素数閾値PCth1未満である場合には(S215:YES)、S230において、CPU410は、基準参照領域RA0(後述)のサイズ(デフォルトのサイズ)の領域を、参照領域RA1として決定する。この場合には、ばらつき領域VAが過度に小さいので、参照領域RA1が過度に小さくならないように、ばらつき領域VAの重心位置を中心とするデフォルトのサイズの領域が、参照領域RA1として決定される。   First, in S215, the CPU 410 determines whether or not the pixel number PC is less than the first pixel number threshold PCth1. When the number of pixels PC is less than the first pixel number threshold PCth1 (S215: YES), in S230, the CPU 410 sets an area having a size (default size) of a reference reference area RA0 (described later) as a reference area. Determine as RA1. In this case, since the variation area VA is excessively small, a default size area centered on the position of the center of gravity of the variation area VA is determined as the reference area RA1 so that the reference area RA1 is not excessively small.

画素数PCが、第1の画素数閾値PCth1以上である場合には(S215:NO)、S220において、CPU410は、画素数PCが、第2の画素数閾値PCth2未満であるか否かを判断する。画素数PCが、第2の画素数閾値PCth2未満である場合には(S220:YES)、S240において、CPU410は、ばらつき領域VAの外接矩形を、参照領域RA1として決定する。図11は、ばらつき領域VAに基づいて決定される参照領域RA1の一例を示す図である。図11(A)には、特定のばらつき領域VA1の外接矩形が、特定の参照領域RA11として決定される例が示されている。   When the pixel number PC is greater than or equal to the first pixel number threshold PCth1 (S215: NO), in S220, the CPU 410 determines whether or not the pixel number PC is less than the second pixel number threshold PCth2. To do. When the pixel number PC is less than the second pixel number threshold PCth2 (S220: YES), in S240, the CPU 410 determines a circumscribed rectangle of the variation area VA as the reference area RA1. FIG. 11 is a diagram illustrating an example of the reference area RA1 determined based on the variation area VA. FIG. 11A shows an example in which the circumscribed rectangle of the specific variation area VA1 is determined as the specific reference area RA11.

画素数PCが、第2の画素数閾値PCth2以上である場合には(S220:NO)、S225において、CPU410は、画素数PCが、第3の画素数閾値PCth3未満であるか否かを判断する。画素数PCが、第3の画素数閾値PCth3未満である場合には(S225:YES)、S235において、CPU410は、ばらつき領域VAの内接矩形を、参照領域RA1として決定する。図11(B)には、特定のばらつき領域VA2の内接矩形が、特定の参照領域RA12として決定される例が示されている。   When the pixel number PC is equal to or larger than the second pixel number threshold PCth2 (S220: NO), in S225, the CPU 410 determines whether or not the pixel number PC is less than the third pixel number threshold PCth3. To do. When the pixel number PC is less than the third pixel number threshold PCth3 (S225: YES), in S235, the CPU 410 determines the inscribed rectangle of the variation area VA as the reference area RA1. FIG. 11B shows an example in which the inscribed rectangle of the specific variation area VA2 is determined as the specific reference area RA12.

画素数PCが、第3の画素数閾値PCth3以上である場合には(S225:NO)、S230において、CPU410は、デフォルトのサイズの領域を、参照領域RA1として決定する。この場合は、ばらつき領域VAが過度に大きいので、参照領域RA1が過度に大きくならないように、デフォルトサイズの領域が、参照領域RA1として決定される。参照領域RA1が決定されると、参照領域決定処理は終了される。以上の説明から解るように、本実施例の参照領域決定処理では、配置範囲FA内の比較的ばらつきが大きな部分画像の領域が、参照領域RA1として決定される。図5(B)には、右側スキャン画像20Rの配置範囲FA内に決定された参照領域RA1の一例が図示されている。   When the pixel number PC is equal to or greater than the third pixel number threshold value PCth3 (S225: NO), in S230, the CPU 410 determines a default size region as the reference region RA1. In this case, since the variation area VA is excessively large, an area having a default size is determined as the reference area RA1 so that the reference area RA1 is not excessively large. When the reference area RA1 is determined, the reference area determination process is terminated. As can be understood from the above description, in the reference area determination process of the present embodiment, a partial image area having a relatively large variation within the arrangement range FA is determined as the reference area RA1. FIG. 5B shows an example of the reference area RA1 determined within the arrangement range FA of the right-side scan image 20R.

次に図2のS32の探索領域決定処理について説明する。図12は、探索領域決定処理のフローチャートである。図13は、探索領域決定処理の説明図である。図13(A)には、探索領域SA1の基準となる領域である基準探索領域SA0の例が示されている。図13(B)には、参照領域RA1の基準となる領域である基準参照領域RA0の例が示されている。図13(C)には、探索領域決定処理によって決定されるべき探索領域SA1の例が示されている。図13(D)には、上述した参照領域決定処理(図7)によって決定された参照領域RA1の例が示されている。   Next, the search area determination process in S32 of FIG. 2 will be described. FIG. 12 is a flowchart of search area determination processing. FIG. 13 is an explanatory diagram of the search area determination process. FIG. 13A shows an example of a reference search area SA0 that is an area serving as a reference for the search area SA1. FIG. 13B shows an example of a reference reference area RA0 that is a reference area of the reference area RA1. FIG. 13C shows an example of the search area SA1 to be determined by the search area determination process. FIG. 13D shows an example of the reference area RA1 determined by the above-described reference area determination process (FIG. 7).

図12のS305では、CPU410は、図7の参照領域決定処理によって決定された参照領域RA1の位置情報と外形情報とを取得する。上述したように参照領域RA1は、右側スキャン画像20R内に決定される領域である。参照領域RA1の位置情報は、具体的には、参照領域RA1の左上の画素の位置を示す左上座標(Rx1、Ry1)である(図13(D))。参照領域RA1の外形情報は、具体的には、参照領域RA1の幅Rw1と高さRh1である(図13(D))。幅は、横方向の長さを意味し、高さは、縦方向の長さを意味する。   In S305 of FIG. 12, the CPU 410 acquires the position information and the outline information of the reference area RA1 determined by the reference area determination process of FIG. As described above, the reference area RA1 is an area determined in the right scan image 20R. Specifically, the position information of the reference area RA1 is upper left coordinates (Rx1, Ry1) indicating the position of the upper left pixel of the reference area RA1 (FIG. 13D). Specifically, the external shape information of the reference region RA1 is the width Rw1 and the height Rh1 of the reference region RA1 (FIG. 13D). The width means the length in the horizontal direction, and the height means the length in the vertical direction.

図13(D)に示すように、参照領域RA1の左上座標(Rx1、Ry1)は、右方向を正方向とするX軸と下方向を正方向とするY軸とを有し、右側スキャン画像20Rの左上の画素の座標を(0、0)とする2次元座標系を用いて表される。また、参照領域RA1の幅Rw1と高さRh1は、画素数で表される。   As shown in FIG. 13D, the upper left coordinates (Rx1, Ry1) of the reference area RA1 have an X axis with the right direction as the positive direction and a Y axis with the lower direction as the positive direction. It is expressed using a two-dimensional coordinate system in which the coordinates of the upper left pixel of 20R are (0, 0). Further, the width Rw1 and the height Rh1 of the reference region RA1 are represented by the number of pixels.

S310では、CPU410は、基準参照領域RA0の位置情報と外形情報、具体的には、基準参照領域RA0の左上の画素の位置を示す左上座標(Rx0、Ry0)と、幅Rw0と、高さRh0と、を取得する(図13(B))。基準参照領域RA0の左上座標(Rx0、Ry0)は、参照領域RA1の左上座標(Rx1、Ry1)と同じ座標系を用いて表される。基準参照領域RA0の幅Rw0と高さRh0は、画素数で表される。   In S310, the CPU 410 determines the position information and outer shape information of the reference reference area RA0, specifically, the upper left coordinates (Rx0, Ry0) indicating the position of the upper left pixel of the reference reference area RA0, the width Rw0, and the height Rh0. Are acquired (FIG. 13B). The upper left coordinates (Rx0, Ry0) of the reference reference area RA0 are expressed using the same coordinate system as the upper left coordinates (Rx1, Ry1) of the reference area RA1. The width Rw0 and the height Rh0 of the reference reference area RA0 are represented by the number of pixels.

基準参照領域RA0は、右側スキャン画像20R上に予め規定された領域であり、これらの位置情報と外形情報は、予め定められた値が取得される。本実施例では、基準参照領域RA0は、右側スキャン画像20Rの左端と上端とに接する矩形の領域である。したがって、基準参照領域RA0の左上座標は、右側スキャン画像20Rの左上座標と一致している。すなわち、左上座標(Rx0、Ry0)=(0、0)である。   The reference reference area RA0 is an area defined in advance on the right-side scan image 20R, and predetermined values are acquired for the position information and the outline information. In the present embodiment, the reference reference area RA0 is a rectangular area in contact with the left end and the upper end of the right scanned image 20R. Therefore, the upper left coordinate of the reference reference area RA0 matches the upper left coordinate of the right scan image 20R. That is, the upper left coordinates (Rx0, Ry0) = (0, 0).

また、基準参照領域RA0の幅Rw0は、例えば、5画素〜20画素である。基準参照領域RA0の高さRh0は、右側スキャン画像20Rの高さの1/4〜1/2である。   Further, the width Rw0 of the standard reference region RA0 is, for example, 5 to 20 pixels. The height Rh0 of the reference reference area RA0 is 1/4 to 1/2 of the height of the right-side scan image 20R.

S315では、CPU410は、基準探索領域SA0の位置情報と外形情報、具体的には、基準探索領域SA0の右上の画素の位置を示す右上座標(Sx0、Sy0)と、幅Sw0と、高さSh0と、を取得する(図13(A))。基準探索領域SA0の右上座標(Sx0、Sy0)は、右方向を正方向とするX軸と下方向を正方向とするY軸とを有し、左側スキャン画像20Lの左上の画素の座標を(0、0)とする2次元座標系を用いて表される。   In S315, the CPU 410 determines the position information and outline information of the reference search area SA0, specifically, the upper right coordinates (Sx0, Sy0) indicating the position of the upper right pixel of the reference search area SA0, the width Sw0, and the height Sh0. Are acquired (FIG. 13A). The upper right coordinates (Sx0, Sy0) of the reference search area SA0 have an X axis with the right direction as the positive direction and a Y axis with the lower direction as the positive direction, and the coordinates of the upper left pixel of the left scan image 20L are ( (0, 0) is represented using a two-dimensional coordinate system.

基準探索領域SA0は、左側スキャン画像20L上に予め規定された領域であり、これらの位置情報と外形情報は、予め定められた値が取得される。本実施例では、基準探索領域SA0は、左側スキャン画像20Lの右端と上端とに接する矩形の領域である。したがって、基準探索領域SA0の右上座標は、右側スキャン画像20Rの右上座標と一致している。   The reference search area SA0 is an area defined in advance on the left-side scan image 20L, and predetermined values are acquired for the position information and the outline information. In the present embodiment, the reference search area SA0 is a rectangular area in contact with the right end and the upper end of the left scan image 20L. Therefore, the upper right coordinate of the reference search area SA0 matches the upper right coordinate of the right scan image 20R.

また、基準探索領域SA0の幅Sw0は、例えば、左側スキャン画像20Lの幅の1/4〜1/2である。基準探索領域SA0の高さは、上述した基準参照領域RA0の高さと同じである。すなわち、基準探索領域SA0の高さは、左側スキャン画像20Lの高さの1/4〜1/2である。   Further, the width Sw0 of the reference search area SA0 is, for example, ¼ to ½ of the width of the left scan image 20L. The height of the reference search area SA0 is the same as the height of the reference reference area RA0 described above. That is, the height of the reference search area SA0 is 1/4 to 1/2 of the height of the left scan image 20L.

S320〜S360の処理によって、決定すべき探索領域SA1が決定される。具体的には、図13(C)に示すように、探索領域SA1は、左側スキャン画像20L上に配置される矩形の領域である。探索領域SA1は、探索領域SA1の右上の画素の位置を示す右上座標(Sx1、Sy1)と、探索領域SA1の幅Sw1と、探索領域SA1の高さSh1と、によって定義される。したがって、S320〜S360の処理によって、右上座標(Sx1、Sy1)と、幅Sw1と、高さSh1と、が決定されることによって、探索領域SA1が決定される。   The search area SA1 to be determined is determined by the processes of S320 to S360. Specifically, as shown in FIG. 13C, the search area SA1 is a rectangular area arranged on the left scan image 20L. The search area SA1 is defined by upper right coordinates (Sx1, Sy1) indicating the position of the upper right pixel of the search area SA1, the width Sw1 of the search area SA1, and the height Sh1 of the search area SA1. Therefore, the search area SA1 is determined by determining the upper right coordinates (Sx1, Sy1), the width Sw1, and the height Sh1 by the processes of S320 to S360.

S320では、CPU410は、探索領域SA1の右上座標(Sx1、Sy1)のY座標Sy1を決定する。具体的には、右上座標(Sx1、Sy1)のY座標Sy1は、参照領域RA1の左上座標(Rx1、Ry1)のY座標Ry1と同じ値に決定される(Sy1=Ry1)。   In S320, the CPU 410 determines the Y coordinate Sy1 of the upper right coordinates (Sx1, Sy1) of the search area SA1. Specifically, the Y coordinate Sy1 of the upper right coordinates (Sx1, Sy1) is determined to be the same value as the Y coordinate Ry1 of the upper left coordinates (Rx1, Ry1) of the reference area RA1 (Sy1 = Ry1).

S325では、CPU410は、探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1を決定する。具体的には、右上座標(Sx1、Sy1)のX座標Sx1は、基準探索領域SA0の右上座標(Sx0、Sy0)のX座標Sx0に、(Rx1−Rx0)を加算した値に決定される(Sx1=Sx0+(Rx1−Rx0))。(Rx1−Rx0)は、基準参照領域RA0から見て参照領域RA1が右方向にずれている量(以下、参照領域RA1の横ずれ量と呼ぶ。)を表している。したがって、探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1は、基準探索領域SA0の右上座標(Sx0、Sy0)のX座標Sx0を、参照領域RA1の横ずれ量(Rx1−Rx0)分だけ、同じ方向にずらした位置に決定される。   In S325, the CPU 410 determines the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) of the search area SA1. Specifically, the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) is determined as a value obtained by adding (Rx1-Rx0) to the X coordinate Sx0 of the upper right coordinate (Sx0, Sy0) of the reference search area SA0 ( Sx1 = Sx0 + (Rx1-Rx0)). (Rx1-Rx0) represents an amount by which the reference region RA1 is displaced in the right direction when viewed from the standard reference region RA0 (hereinafter referred to as a lateral displacement amount of the reference region RA1). Therefore, the X coordinate Sx1 of the upper right coordinates (Sx1, Sy1) of the search area SA1 is equal to the X coordinate Sx0 of the upper right coordinates (Sx0, Sy0) of the reference search area SA0 by the amount of lateral deviation (Rx1-Rx0) of the reference area RA1. The position is shifted in the same direction.

S335では、CPU410は、探索領域SA1の高さSh1を決定する。具体的には、探索領域SA1の高さSh1は、参照領域RA1の高さRh1と同じ値に決定される(Sh1=Rh1)。   In S335, the CPU 410 determines the height Sh1 of the search area SA1. Specifically, the height Sh1 of the search area SA1 is determined to be the same value as the height Rh1 of the reference area RA1 (Sh1 = Rh1).

S340では、CPU410は、探索領域SA1の幅Sw1を決定する。具体的には、探索領域SA1の幅Sw1は、基準参照領域RA0の幅Rw0に対する参照領域RA1の幅Rw1の比率(Rw1/Rw0)を、基準探索領域SA0の幅Sw0に乗じた値に決定される(Sw1=(Rw1/Rw0)×Sw0)。   In S340, the CPU 410 determines the width Sw1 of the search area SA1. Specifically, the width Sw1 of the search area SA1 is determined to be a value obtained by multiplying the width Sw0 of the reference search area SA0 by the ratio (Rw1 / Rw0) of the width Rw1 of the reference area RA1 to the width Rw0 of the reference reference area RA0. (Sw1 = (Rw1 / Rw0) × Sw0).

S345では、CPU410は、S340で決定された探索領域SA1の幅Sw1が、所定の条件を満たすか否かを判断する。所定の条件は、Sw1<(Sw0+Sx1−Sx0)、かつ、(Sx1−Sx0)>0である。この条件は、基準探索領域SA0の左端のX座標(Sx0−Sw0)より、探索領域SA1の左端のX座標(Sx1−Sw1)が右側にある場合に、すなわち、((Sx0−Sw0)<(Sx1−Sw1))である場合に、満たされる。換言すれば、この条件が満たされない場合は、探索領域SA1の左端が、基準探索領域SA0の左端より左側に位置しており、探索領域SA1が過度に左側に拡がっていることを意味している。   In S345, the CPU 410 determines whether or not the width Sw1 of the search area SA1 determined in S340 satisfies a predetermined condition. The predetermined conditions are Sw1 <(Sw0 + Sx1-Sx0) and (Sx1-Sx0)> 0. This condition is obtained when the left end X coordinate (Sx1-Sw1) of the search region SA1 is on the right side of the left end X coordinate (Sx0-Sw0) of the reference search region SA0, that is, ((Sx0-Sw0) <( Sx1-Sw1)). In other words, if this condition is not satisfied, it means that the left end of the search area SA1 is located on the left side of the left end of the reference search area SA0, and the search area SA1 extends excessively to the left side. .

上記の所定の条件が満たされない場合には(S345:NO)、S350において、CPU410は、探索領域SA1の幅Sw1を修正する。具体的には、基準探索領域SA0の左端のX座標(Sx0−Sw0)と、探索領域SA1の左端のX座標(Sx1−Sw1)とが同じになるように、すなわち、(Sx0−Sw0)=(Sx1−Sw1)となるように、幅Sw1の値を修正する(Sw1=Sw0+Sx1−Sx0)。   When the predetermined condition is not satisfied (S345: NO), in S350, the CPU 410 corrects the width Sw1 of the search area SA1. Specifically, the left end X coordinate (Sx0-Sw0) of the reference search area SA0 and the left end X coordinate (Sx1-Sw1) of the search area SA1 are the same, that is, (Sx0-Sw0) = The value of the width Sw1 is corrected so as to be (Sx1-Sw1) (Sw1 = Sw0 + Sx1-Sx0).

上記の所定の条件が満たされる場合には(S345:YES)、CPU410は、S350をスキップして、処理をS355に進める。   If the predetermined condition is satisfied (S345: YES), the CPU 410 skips S350 and advances the process to S355.

S355では、CPU410は、探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1が、左側スキャン画像20L内に位置しているか否かを判断する。具体的には、探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1が、左側スキャン画像20Lの右上座標のX座標より大きいか否かを判断する。なお、本実施例では、左側スキャン画像20Lの右上座標は、基準探索領域SA0の右上座標(Sx0、Sy0)と一致している。CPU410は、Sx1が、左側スキャン画像20Lの右端のX座標(本実施例ではSx0)より大きい場合には、Sx1が、左側スキャン画像20L内に位置していないと判断する。   In S355, the CPU 410 determines whether or not the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) of the search area SA1 is located in the left scan image 20L. Specifically, it is determined whether or not the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) of the search area SA1 is larger than the X coordinate of the upper right coordinate of the left scan image 20L. In the present embodiment, the upper right coordinate of the left scan image 20L matches the upper right coordinate (Sx0, Sy0) of the reference search area SA0. When Sx1 is larger than the X coordinate (Sx0 in this embodiment) of the right end of the left scan image 20L, the CPU 410 determines that Sx1 is not located in the left scan image 20L.

探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1が、左側スキャン画像20L内に位置していない場合には(S355:NO)、S360において、CPU410は、Sx1の値を左側スキャン画像20Lの右端のX座標(本実施例では、基準探索領域SA0の右上座標(Sx0、Sy0)のX座標Sx0)に修正して、探索領域決定処理を終了する。図13(C)には、修正後の右上座標(Sx1a、Sy1)が図示されている(Sx1a=Sx0)。   When the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) of the search area SA1 is not located in the left scan image 20L (S355: NO), in S360, the CPU 410 sets the value of Sx1 to the left scan image 20L. To the right end X coordinate (in this embodiment, the X coordinate Sx0 of the upper right coordinate (Sx0, Sy0) of the reference search area SA0), and the search area determination process ends. FIG. 13C illustrates the corrected upper right coordinates (Sx1a, Sy1) (Sx1a = Sx0).

探索領域SA1の右上座標(Sx1、Sy1)のX座標Sx1が、左側スキャン画像20L内に位置している場合には(S355:YES)、CPU410は、S360をスキップして、探索領域決定処理を終了する。図13(C)の例では、ハッチングされた領域が最終的に探索領域SA1として決定される。   When the X coordinate Sx1 of the upper right coordinate (Sx1, Sy1) of the search area SA1 is located in the left scan image 20L (S355: YES), the CPU 410 skips S360 and performs the search area determination process. finish. In the example of FIG. 13C, the hatched area is finally determined as the search area SA1.

次に、図2のS35の対応領域決定処理について説明する。図14は、対応領域決定処理のフローチャートである。S410では、CPU410は、探索領域SA1内に特定されるべき複数個の候補領域の中から、1個の注目候補領域を特定する。   Next, the corresponding area determination process in S35 of FIG. 2 will be described. FIG. 14 is a flowchart of the corresponding area determination process. In S410, the CPU 410 specifies one attention candidate area from among a plurality of candidate areas to be specified in the search area SA1.

図15は、探索領域SA1内に特定されるべき複数個の候補領域について説明する図である。候補領域の形状およびサイズは、図7の参照領域決定処理によって右側スキャン画像20R内に決定された参照領域RA1(図5(B))に応じて決定される。まず、参照領域RA1と同じ形状およびサイズを有する枠NPが、探索領域SA1の少なくとも一部とが重なるように、探索領域SA1に対して配置される。そして、枠NP内の領域のうち、探索領域SA1と重なる領域が注目候補領域として特定される。   FIG. 15 is a diagram for explaining a plurality of candidate areas to be specified in the search area SA1. The shape and size of the candidate area are determined according to the reference area RA1 (FIG. 5B) determined in the right-side scan image 20R by the reference area determination process of FIG. First, the frame NP having the same shape and size as the reference area RA1 is arranged with respect to the search area SA1 so as to overlap at least a part of the search area SA1. And the area | region which overlaps search area | region SA1 among the area | regions in frame NP is pinpointed as an attention candidate area | region.

図15(A)の枠NPaは、最も右側かつ上側に配置される枠である。この枠NPaの左上の画素Paの座標を(k、1)とする。なお、画素Paの座標を(k、1)は、参照領域決定処理の説明の便宜のために用いる座標であり、上述した探索領域決定処理において探索領域SA1を定義するために用いられた座標系の座標とは無関係である。後述する画素Pb〜Pdの座標についても同様である。画素Paの横方向(X軸方向)の位置は、探索領域SA1の右端の画素の横方向の位置と同じである。画素Paの縦方向(Y軸方向)の位置は、探索領域SA1の上端の画素より所定長(具体的には、50〜100画素分の長さ)だけ上方に位置している。したがって、図15(A)においてハッチングで示すように、枠NPa内の領域のうち、左端の1本の画素のライン上に位置する複数個の画素の下側の一部分の領域が、探索領域SA1と重なっている。   A frame NPa in FIG. 15A is a frame arranged on the rightmost side and on the upper side. The coordinates of the upper left pixel Pa of the frame NPa are (k, 1). Note that the coordinates (k, 1) of the pixel Pa are coordinates used for convenience of the description of the reference area determination process, and the coordinate system used to define the search area SA1 in the search area determination process described above. It has nothing to do with the coordinates. The same applies to the coordinates of pixels Pb to Pd described later. The position in the horizontal direction (X-axis direction) of the pixel Pa is the same as the horizontal position of the rightmost pixel in the search area SA1. The position of the pixel Pa in the vertical direction (Y-axis direction) is positioned above the uppermost pixel of the search area SA1 by a predetermined length (specifically, a length corresponding to 50 to 100 pixels). Accordingly, as indicated by hatching in FIG. 15A, a partial area below a plurality of pixels located on the line of one pixel at the left end of the area within the frame NPa is a search area SA1. It overlaps with.

図15(B)の枠NPbは、最も右側かつ下側に配置される枠である。この枠NPbの左上の画素Pbの座標を(k、m)とする。画素Pbの横方向の位置は、探索領域SA1の右端の画素の横方向の位置と同じである。画素Pbの縦方向の位置は、探索領域SA1の下端の画素より所定長だけ下方に位置している。したがって、図15(B)においてハッチングで示すように、枠NPb内の領域のうち、左端の1本の画素のライン上に位置する複数個の画素の上側の一部分の領域が、探索領域SA1と重なっている。   A frame NPb in FIG. 15B is a frame arranged on the rightmost side and the lower side. The coordinates of the upper left pixel Pb of the frame NPb are (k, m). The horizontal position of the pixel Pb is the same as the horizontal position of the rightmost pixel in the search area SA1. The vertical position of the pixel Pb is located below the lower end pixel of the search area SA1 by a predetermined length. Therefore, as shown by hatching in FIG. 15B, among the regions in the frame NPb, the upper partial region of the plurality of pixels located on the leftmost pixel line is the search region SA1. overlapping.

図15(C)の枠NPcは、最も左側かつ上側に配置される枠である。この枠NPcの左上の画素Pcの座標を(1、1)とする。画素Pcの横方向の位置は、探索領域SA1の左端の画素の横方向の位置と同じである。画素Pcの縦方向の位置は、探索領域SA1の上端の画素より所定長だけ上方に位置している。したがって、図15(C)においてハッチングで示すように、枠NPc内の領域のうち、下側の一部分の領域が探索領域SA1と重なっている。   A frame NPc in FIG. 15C is a frame arranged on the leftmost side and the upper side. The coordinates of the upper left pixel Pc of the frame NPc are (1, 1). The horizontal position of the pixel Pc is the same as the horizontal position of the leftmost pixel in the search area SA1. The vertical position of the pixel Pc is located above the upper end pixel of the search area SA1 by a predetermined length. Therefore, as indicated by hatching in FIG. 15C, a partial region on the lower side of the region in the frame NPc overlaps the search region SA1.

図15(D)の枠NPdは、最も左側かつ下側に配置される枠である。この枠NPdの左上の画素Pdの座標を(1、m)とする。画素Pdの横方向の位置は、探索領域SA1の左端の画素の横方向の位置と同じである。画素Pcの縦方向の位置は、探索領域SA1の下端の画素より所定長だけ下方に位置している。したがって、図15(D)においてハッチングで示すように、枠NPc内の領域のうち、上側の一部分の領域が探索領域SA1と重なっている。   A frame NPd in FIG. 15D is a frame arranged on the leftmost side and the lower side. The coordinates of the upper left pixel Pd of the frame NPd are (1, m). The horizontal position of the pixel Pd is the same as the horizontal position of the leftmost pixel in the search area SA1. The vertical position of the pixel Pc is located below the lower end pixel of the search area SA1 by a predetermined length. Therefore, as indicated by hatching in FIG. 15D, an upper partial region of the region in the frame NPc overlaps the search region SA1.

複数個の候補領域を特定するために配置される枠NPの左上の画素の座標は、(p、q)で表される(k×m)個の座標の中から、順次に選択される。ここで、pは、1以上k以下の任意の整数であり、qは、1以上m以下の任意の整数である。したがって、探索領域SA1には、(k×m)個の枠NPが配置可能である。換言すれば、探索領域SA1内には、(k×m)個の候補領域が特定可能である。   The coordinates of the upper left pixel of the frame NP arranged to specify a plurality of candidate areas are sequentially selected from (k × m) coordinates represented by (p, q). Here, p is an arbitrary integer from 1 to k, and q is an arbitrary integer from 1 to m. Accordingly, (k × m) frames NP can be arranged in the search area SA1. In other words, (k × m) candidate areas can be specified in the search area SA1.

図15(A)〜図15(C)に矢印で示すように、これらの(k×m)個の枠NPの中から、右上の端の枠NPa(図15(A))が配置されるべき枠NPとして最初に選択される。そして、次回の注目候補領域が特定されるときに、1画素ずつ下方向に位置がずれた枠NPが、順次に選択される。そして、右下の端の枠NPb(図15(B))が選択されると、右上の端の枠NPaの位置から1画素だけ左方向にずれた枠NPが選択される。その後は、再び1画素ずつ下方向に位置がずれた枠NPが、順次に選択される。最後に選択される枠NPは、左下の端の枠NPd(図15(D))である。   As indicated by arrows in FIGS. 15A to 15C, the upper right end frame NPa (FIG. 15A) is arranged from among these (k × m) frames NP. It is first selected as the power frame NP. Then, when the next candidate region of interest is specified, the frames NP whose positions are shifted downward by one pixel are sequentially selected. When the lower right end frame NPb (FIG. 15B) is selected, a frame NP that is shifted leftward by one pixel from the position of the upper right end frame NPa is selected. Thereafter, the frames NP whose positions are shifted downward one pixel at a time are sequentially selected. The frame NP selected last is the frame NPd at the lower left end (FIG. 15D).

図15(A)〜図15(D)の枠NPa〜NPdのように、ほとんどの場合に枠NPの一部が探索領域SA1より外側に位置するので、注目候補領域の大きさは、図5(B)の参照領域RA1より小さくなる。   As in the frames NPa to NPd in FIGS. 15A to 15D, in most cases, a part of the frame NP is located outside the search area SA1, and therefore the size of the attention candidate area is as shown in FIG. It becomes smaller than the reference area RA1 in (B).

1個の注目候補領域が特定されると、S415では、CPU410は、注目候補領域内の全ての画素のうち、1個の画素を注目画素として選択する。   When one attention candidate area is specified, in S415, the CPU 410 selects one pixel as the attention pixel among all the pixels in the attention candidate area.

S420では、CPU410は、注目候補領域内の注目画素の値と、当該注目画素に対応する参照領域RA1内の画素の値と、の差ΔVPを算出する。注目画素に対応する参照領域RA1内の画素は、注目候補領域内の画像と参照領域RA1内の画像とを、注目候補領域を特定する際に用いた枠NPと、参照領域RA1の外縁とが一致するように重ねた場合に、注目画素と重なる参照領域RA1内の画素である。差ΔVPを算出すべき2個の画素の値を、(R1、G1、B1)と(R2、G2、B2)とする。差ΔVPは、3種類の成分値間の差分の絶対値の和で表される。すなわち、差ΔVPは、(R1−R2)の絶対値と、(G1−G2)の絶対値と、(B1−B2)の絶対値と、の合計値で表される。   In S420, the CPU 410 calculates a difference ΔVP between the value of the target pixel in the target candidate region and the value of the pixel in the reference region RA1 corresponding to the target pixel. A pixel in the reference area RA1 corresponding to the target pixel includes an image in the target candidate area and an image in the reference area RA1, and a frame NP used for specifying the target candidate area and an outer edge of the reference area RA1. The pixels in the reference area RA1 that overlap with the target pixel when they are overlapped so as to match. The values of the two pixels for which the difference ΔVP is to be calculated are (R1, G1, B1) and (R2, G2, B2). The difference ΔVP is represented by the sum of absolute values of differences between the three types of component values. That is, the difference ΔVP is represented by the sum of the absolute value of (R1−R2), the absolute value of (G1−G2), and the absolute value of (B1−B2).

続くS425では、CPU410は、算出された差ΔVPが、所定の基準値TH1以下であるか否かを判断する。差ΔVPが、所定の基準値TH1以下である場合には(S425:YES)、S430において、CPU410は、類似画素数SCをカウントアップする。差ΔVPが、所定の基準値TH1以下である場合には、注目候補領域内の注目画素と、当該注目画素に対応する参照領域RA1内の画素とは、類似する画素であると判断できるからである。   In subsequent S425, CPU 410 determines whether or not calculated difference ΔVP is equal to or smaller than a predetermined reference value TH1. When the difference ΔVP is equal to or smaller than the predetermined reference value TH1 (S425: YES), in S430, the CPU 410 counts up the number of similar pixels SC. When the difference ΔVP is equal to or smaller than the predetermined reference value TH1, it is possible to determine that the target pixel in the target candidate region and the pixel in the reference region RA1 corresponding to the target pixel are similar pixels. is there.

差ΔVPが、所定の基準値TH1より大きい場合には(S425:NO)、CPU410は、S430をスキップして、処理をS435に進める。基準値TH1は、例えば、10〜40とされる。   When the difference ΔVP is larger than the predetermined reference value TH1 (S425: NO), the CPU 410 skips S430 and advances the process to S435. The reference value TH1 is 10 to 40, for example.

S435では、CPU410は、注目候補領域内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S435:NO)、CPU410は、S415に戻って、未処理の画素を注目画素として選択する。全ての画素が処理された場合には(S435:YES)、CPU410は、S440に処理を進める。   In S435, the CPU 410 determines whether or not all the pixels in the attention candidate area have been processed as the attention pixels. When there is an unprocessed pixel (S435: NO), the CPU 410 returns to S415 and selects an unprocessed pixel as a target pixel. When all the pixels have been processed (S435: YES), the CPU 410 advances the process to S440.

S440では、CPU410は、参照領域RA1と、注目候補領域と、の類似度(SC/Nt)を算出する。類似度(SC/Nt)は、注目候補領域内の画素の総数Ntに対する類似画素数SCの割合である。類似度(SC/Nt)が大きいほど、参照領域RA1と、注目候補領域とは、類似している。   In S440, the CPU 410 calculates the similarity (SC / Nt) between the reference area RA1 and the attention candidate area. The similarity (SC / Nt) is a ratio of the number of similar pixels SC to the total number Nt of pixels in the target candidate region. As the similarity (SC / Nt) is larger, the reference area RA1 and the attention candidate area are more similar.

S445では、CPU410は、類似度(SC/Nt)が、閾値TH2以上であるか否かを判断する。即ち、CPU410は、現在の注目候補領域が参照領域RA1に類似しているか否かを判断する。   In S445, CPU 410 determines whether or not the similarity (SC / Nt) is equal to or higher than threshold value TH2. That is, the CPU 410 determines whether or not the current attention candidate area is similar to the reference area RA1.

類似度(SC/Nt)が、閾値TH2以上である場合、即ち、現在の注目候補領域が参照領域RA1に類似していると判断する場合には(S445:YES)、S450において、CPU410は、現在の注目候補領域を、参照領域RA1に類似する対応領域CPとして決定して、対応領域決定処理を終了する。   When the similarity (SC / Nt) is equal to or higher than the threshold value TH2, that is, when it is determined that the current candidate region of interest is similar to the reference region RA1 (S445: YES), in S450, the CPU 410 The current attention candidate region is determined as a corresponding region CP similar to the reference region RA1, and the corresponding region determination process is ended.

類似度(SC/Nt)が、閾値TH2未満である場合には(S445:NO)、S455において、CPU410は、探索領域SA1内の全ての候補領域(図15)を注目候補領域として処理したか否かを判断する。未処理の候補領域がある場合には(S455:NO)、CPU410は、S460において、類似画素数SCを初期化したうえで、S410に戻って、未処理の候補領域を注目候補領域として選択する。全ての候補領域が処理された場合には(S455:YES)、CPU410は、参照領域RA1に対応する対応領域CPを決定できないまま、対応領域決定処理を終了する。   If the similarity (SC / Nt) is less than the threshold value TH2 (S445: NO), in S455, has the CPU 410 processed all candidate areas (FIG. 15) in the search area SA1 as attention candidate areas? Judge whether or not. If there is an unprocessed candidate area (S455: NO), the CPU 410 initializes the number of similar pixels SC in S460, returns to S410, and selects the unprocessed candidate area as the target candidate area. . When all candidate areas have been processed (S455: YES), the CPU 410 ends the corresponding area determination process without determining the corresponding area CP corresponding to the reference area RA1.

図5(A)には、左側スキャン画像20L内に、決定された対応領域CPが図示されている。   FIG. 5A shows the determined corresponding region CP in the left scan image 20L.

以上説明した実施例によれば、探索領域決定処理において、参照領域RA1の位置を示す位置情報(具体的には、図13(D)の左上座標(Rx1、Ry1))と、参照領域RA1の外形に関する外形情報(具体的には、図13(D)の幅Rw1、高さRh1)と、を用いて、探索領域SA1が決定される(図12のS320〜S340)。そして、対応領域決定処理(図14、図15)では、決定された探索領域SA1内から対応領域CPが決定される。この結果、効率良く対応領域CPを決定することができる。したがって、合成画像データを生成するための処理時間を低減することができる。   According to the embodiment described above, in the search area determination process, the position information indicating the position of the reference area RA1 (specifically, the upper left coordinates (Rx1, Ry1) in FIG. 13D) and the reference area RA1 The search area SA1 is determined using the external shape information (specifically, the width Rw1 and the height Rh1 in FIG. 13D) (S320 to S340 in FIG. 12). In the corresponding area determining process (FIGS. 14 and 15), the corresponding area CP is determined from the determined search area SA1. As a result, the corresponding region CP can be determined efficiently. Therefore, it is possible to reduce the processing time for generating the composite image data.

より詳しく説明すると、例えば、複合機200のスキャナ部250の仕様などによって、左側スキャン画像20L内の左側原稿画像HILに対して、右側スキャン画像20R内の右側原稿画像HIRの位置が縦方向にずれる量は、所定の想定範囲内に収まる。したがって、参照領域RA1の高さRh1に対して、探索領域SA1の高さSh1が過度に大きいと、探索領域SA1のうち、対応領域CPが存在しない領域が過度に大きくなる。そうすると、対応領域CPとはなり得ない候補領域を注目候補領域として、対応領域CPを探索する処理(図14の対応領域決定処理のS415〜S445)が実行される頻度が高くなる。そうすると、合成画像データを生成するための処理時間が必要以上に長くなる可能性がある。また、左側スキャン画像20Lと右側スキャン画像20Rにおいて、共通に含まれる原稿10の中央部CAの横方向の幅は、所定の想定範囲内に収まるので、参照領域RA1の幅Rw1に対して、探索領域SA1の幅Sw1が過度に大きくても、同様に、処理時間が必要以上に長くなる可能性がある。また、参照領域RA1の位置に対して、探索領域SA1の位置が適切な位置にない場合には、探索領域SA1内に、探索すべき対応領域CPが確実に含まれるようにするために、探索領域SA1のサイズ(幅および高さ)を大きくせざるを得なくなるので、処理時間が必要以上に長くなる可能性がある。上記実施例によれば、参照領域RA1の位置情報と外形情報とを用いて、適切な位置に配置され、適切なサイズを有する探索領域SA1が決定されるので、このような不都合を避けて、合成画像データを生成するための処理時間を低減することができる。   More specifically, the position of the right original image HIR in the right scan image 20R is shifted in the vertical direction with respect to the left original image HIL in the left scan image 20L due to, for example, the specifications of the scanner unit 250 of the multifunction device 200. The amount falls within a predetermined assumed range. Therefore, if the height Sh1 of the search area SA1 is excessively large with respect to the height Rh1 of the reference area RA1, an area where the corresponding area CP does not exist is excessively large in the search area SA1. Then, the frequency of performing the process of searching for the corresponding area CP (S415 to S445 of the corresponding area determining process in FIG. 14) using the candidate area that cannot be the corresponding area CP as the target candidate area is increased. Then, there is a possibility that the processing time for generating the composite image data becomes longer than necessary. Further, in the left side scan image 20L and the right side scan image 20R, the width in the horizontal direction of the central portion CA of the document 10 included in common falls within a predetermined assumed range, so that the search is performed with respect to the width Rw1 of the reference region RA1. Even if the width Sw1 of the area SA1 is excessively large, similarly, the processing time may be longer than necessary. In addition, when the position of the search area SA1 is not an appropriate position with respect to the position of the reference area RA1, a search is performed to ensure that the corresponding area CP to be searched is included in the search area SA1. Since the size (width and height) of the area SA1 must be increased, the processing time may be longer than necessary. According to the above-described embodiment, the search area SA1 that is arranged at an appropriate position and has an appropriate size is determined using the position information and the outline information of the reference area RA1, so that such inconvenience is avoided, The processing time for generating the composite image data can be reduced.

また、参照領域RA1の位置に対して、探索領域SA1の位置が適切な位置にない場合には、探索領域SA1内に探索すべき対応領域CPが含まれない可能性が高くなる。この結果、参照領域RA1に対応する対応領域CPを探索することができずに、2個の画像が精度良く結合された合成画像を表す合成画像データを生成することができない可能性がある。本実施例によれば、参照領域RA1の位置情報と外形情報とを用いて、適切な位置に配置され、適切なサイズを有する探索領域SA1が決定されるので、探索すべき対応領域CPが含まれるように、適切な探索領域SA1を決定することができる。この結果、2個の画像が精度良く結合された合成画像を表す合成画像データを生成することができる。   Further, when the position of the search area SA1 is not an appropriate position with respect to the position of the reference area RA1, there is a high possibility that the corresponding area CP to be searched is not included in the search area SA1. As a result, the corresponding area CP corresponding to the reference area RA1 cannot be searched, and there is a possibility that composite image data representing a composite image in which two images are combined with high accuracy cannot be generated. According to the present embodiment, the search area SA1 that is arranged at an appropriate position and has an appropriate size is determined using the position information and the outer shape information of the reference area RA1, and therefore the corresponding area CP to be searched is included. Thus, an appropriate search area SA1 can be determined. As a result, it is possible to generate composite image data representing a composite image in which two images are combined with high accuracy.

さらに、上記実施例の探索領域決定処理では、参照領域RA1の基準の位置である第1の基準位置を示す情報として、基準参照領域RA0の左上座標(Rx0、Ry0)が取得される(S310)。また、探索領域SA1の基準の位置である第2の基準位置を示す情報として基準探索領域SA0の右上座標(Sx0、Sy0)が取得される(S315)。そして、参照領域RA1の位置と第1の基準位置との関係と、第2の基準位置と、に基づいて、探索領域SA1の位置が決定される。この結果、参照領域RA1の位置と、基準参照領域RA0および基準探索領域SA0の位置とに応じて、適切な探索領域を決定することができる。   Further, in the search area determination process of the above embodiment, the upper left coordinates (Rx0, Ry0) of the standard reference area RA0 are acquired as information indicating the first standard position, which is the standard position of the reference area RA1 (S310). . Also, the upper right coordinates (Sx0, Sy0) of the reference search area SA0 are acquired as information indicating the second reference position, which is the reference position of the search area SA1 (S315). Then, the position of the search area SA1 is determined based on the relationship between the position of the reference area RA1 and the first reference position and the second reference position. As a result, an appropriate search area can be determined according to the position of the reference area RA1 and the positions of the standard reference area RA0 and the standard search area SA0.

具体的には、探索領域SA1の位置を規定する座標(Sx1、Sy1)は、図13(A)〜(D)に示すように、参照領域RA1の位置が第1の基準位置(すなわち、基準参照領域RA0の位置)に対して右方向にずれている場合には、探索領域SA1の位置が第2の基準位置(すなわち、基準探索領域SA0の位置)に対して右方向にずれ、かつ、参照領域RA1の位置が第1の基準位置に対して上方向にずれている場合には、探索領域SA1の位置が第2の基準位置に対して上方向にずれるように、探索領域SA1の位置が決定される。これは、参照領域RA1が右側スキャン画像20Rの左端から比較的離れた位置、すなわち、基準参照領域RA0の位置から右側にずれた位置に決定された場合には、対応領域CPは、左側スキャン画像20L内においてより右端に近い位置に存在する可能性が高いからである。参照領域RA1が右側スキャン画像20R内の比較的上側に決定された場合には、対応領域CPは、左側スキャン画像20L内の比較的上側に存在する可能性が高いからである。この結果、参照領域RA1の位置と基準参照領域RA0の位置との間の縦方向および横方向の関係に応じて、適切な探索領域SA1を決定することができる。   Specifically, the coordinates (Sx1, Sy1) defining the position of the search area SA1 are set such that the position of the reference area RA1 is the first reference position (ie, the reference position) as shown in FIGS. The position of the search area SA1 is shifted to the right with respect to the second reference position (that is, the position of the reference search area SA0), and When the position of the reference area RA1 is shifted upward with respect to the first reference position, the position of the search area SA1 is set so that the position of the search area SA1 is shifted upward with respect to the second reference position. Is determined. This is because when the reference area RA1 is determined at a position relatively distant from the left end of the right scan image 20R, that is, a position shifted to the right from the position of the standard reference area RA0, the corresponding area CP is determined as the left scan image. This is because there is a high possibility of being in a position closer to the right end in 20L. This is because, when the reference area RA1 is determined on the relatively upper side in the right scan image 20R, the corresponding area CP is likely to exist on the relatively upper side in the left scan image 20L. As a result, an appropriate search area SA1 can be determined according to the relationship in the vertical and horizontal directions between the position of the reference area RA1 and the position of the reference reference area RA0.

さらに、上記実施例の探索領域決定処理では、基準参照領域RA0の外形を示す情報(具体的には、幅Rw0と高さRh0)と、基準探索領域SA0の外形を示す情報(具体的には、幅Sw0と高さSh0)とが、取得される(S310、S315)。そして、参照領域RA1の外形と基準参照領域RA0の外形との関係と、基準探索領域SA0の外形と、に基づいて、探索領域SA1の外形が決定される。具体的には、図13(A)〜(D)に示すように、参照領域RA1の幅Rw1が基準参照領域RA0の幅Rw0より長いほど、探索領域SA1の幅Sw1は、基準探索領域SA0の幅Sw0より長くされる。そして、参照領域RA1の高さRh1が基準参照領域RA0の高さRh0より大きいほど、探索領域SA1の高さSh1は、基準探索領域SA0の高さSh0より大きくされる。この結果、参照領域RA1の外形と、基準参照領域RA0の外形と、基準探索領域SA0の外形とに応じて、適切な探索領域SA1の外形を決定することができる。   Furthermore, in the search area determination process of the above embodiment, information (specifically, width Rw0 and height Rh0) indicating the outer shape of the reference reference area RA0 and information (specifically, information indicating the outer shape of the reference search area SA0). , Width Sw0 and height Sh0) are acquired (S310, S315). Then, the outline of the search area SA1 is determined based on the relationship between the outline of the reference area RA1 and the outline of the standard reference area RA0 and the outline of the standard search area SA0. Specifically, as shown in FIGS. 13A to 13D, as the width Rw1 of the reference region RA1 is longer than the width Rw0 of the reference reference region RA0, the width Sw1 of the search region SA1 is larger than that of the reference search region SA0. The width is longer than Sw0. Then, as the height Rh1 of the reference area RA1 is larger than the height Rh0 of the standard reference area RA0, the height Sh1 of the search area SA1 is made larger than the height Sh0 of the standard search area SA0. As a result, an appropriate outer shape of the search region SA1 can be determined according to the outer shape of the reference region RA1, the outer shape of the standard reference region RA0, and the outer shape of the standard search region SA0.

より具体的には、探索領域SA1の幅Sw1は、参照領域RA1の幅Rw1と基準参照領域RA0の幅Rw0との比率(Rw1/Rw0)を用いて、決定される(S340)。この結果、参照領域RA1と基準参照領域RA0との間の幅の関係に応じて、適切な探索領域SA1の幅を決定することができる。また、探索領域SA1の高さSh1は、参照領域RA1の高さRh1に決定される(S335)。この結果、探索領域SA1の高さSh1を参照領域RA1の高さRh1に応じて適切に決定することができる。換言すれば、探索領域SA1の高さSh1や幅Sh1が、参照領域RA1に対して過度に大きくなることや、過度に小さくなることを抑制して、合成画像データを生成するための処理時間の低減や、合成画像における2個の画像の結合精度の向上を実現することができる。   More specifically, the width Sw1 of the search area SA1 is determined using a ratio (Rw1 / Rw0) between the width Rw1 of the reference area RA1 and the width Rw0 of the reference reference area RA0 (S340). As a result, an appropriate width of the search area SA1 can be determined in accordance with the width relationship between the reference area RA1 and the reference reference area RA0. Further, the height Sh1 of the search area SA1 is determined as the height Rh1 of the reference area RA1 (S335). As a result, the height Sh1 of the search area SA1 can be appropriately determined according to the height Rh1 of the reference area RA1. In other words, the processing time for generating the composite image data while suppressing the height Sh1 and the width Sh1 of the search area SA1 from becoming excessively large or excessively small with respect to the reference area RA1. Reduction and improvement in the accuracy of combining two images in a composite image can be realized.

さらに、探索領域SA1の左端が、基準探索領域SA0の左端より左側に位置しないように、探索領域SA1の幅Sw1が修正される(図3のS345、S350)。換言すれば、探索領域SA1の幅Sw1は、基準探索領域SA0の幅Sw0より小さな値に決定される。この結果、探索領域SA1の幅Sw1が過度に長くなることを抑制して、合成画像データを生成するための処理時間が過度に長くなることを抑制することができる。   Further, the width Sw1 of the search area SA1 is corrected so that the left end of the search area SA1 is not positioned to the left of the left end of the reference search area SA0 (S345 and S350 in FIG. 3). In other words, the width Sw1 of the search area SA1 is determined to be smaller than the width Sw0 of the reference search area SA0. As a result, the width Sw1 of the search area SA1 can be suppressed from becoming excessively long, and the processing time for generating the composite image data can be suppressed from becoming excessively long.

さらに、参照領域RA1の外形と基準参照領域RA0の外形との関係と、基準探索領域SA0の外形と、に基づいて決定された探索領域SA1が、左側スキャン画像20Lより外側の領域を含む場合には、修正後の探索領域SA1が左側スキャン画像20Lに含まれるように、探索領域SA1が修正される(図3のS355、S360)。この結果、左側スキャン画像20Lに含まれる適切な探索領域SA1を決定することができる。   Further, when the search area SA1 determined based on the relationship between the outer shape of the reference area RA1 and the outer shape of the standard reference area RA0 and the outer shape of the standard search area SA0 includes an area outside the left scan image 20L. The search area SA1 is corrected so that the corrected search area SA1 is included in the left-side scan image 20L (S355 and S360 in FIG. 3). As a result, an appropriate search area SA1 included in the left scan image 20L can be determined.

また、図13(B)に示すように、基準参照領域RA0は、右側スキャン画像20Rの左方向(X軸方向の反対方向)の端に沿って配置されている。そして、図13(A)に示すように、基準探索領域SA0は、左側スキャン画像20Lの右方向の端に沿って配置されている。ここで、X軸方向は、本実施例において、生成されるべき合成画像において左側スキャン画像20Lと右側スキャン画像20Rとが並ぶ方向と言うことができる。上記構成によれば、適切な基準領域を用いて、合成画像データを生成するための対応領域を決定するために適切な探索領域SA1を決定することができる。   Further, as shown in FIG. 13B, the reference reference area RA0 is arranged along the left end (the opposite direction to the X-axis direction) of the right-side scan image 20R. As shown in FIG. 13A, the reference search area SA0 is arranged along the right end of the left scan image 20L. Here, the X-axis direction can be said to be a direction in which the left scan image 20L and the right scan image 20R are arranged in the composite image to be generated in the present embodiment. According to the above configuration, it is possible to determine an appropriate search area SA1 for determining a corresponding area for generating composite image data using an appropriate reference area.

さらに、参照領域決定処理(図7〜図9)では、右側スキャン画像20R内の複数個の画素の値のばらつきに基づいて参照領域RA1が決定される。例えば、参照領域RA1の位置、大きさ、サイズは、それぞれ、右側スキャン画像20Rの配置範囲FA内の複数個の画素の値に基づいて決定されている。具体的には、画素の値のばらつきが比較的大きい単位領域を含むように、参照領域RA1が決定される(図8など)。そして、対応領域決定処理(図14)では、ばらつきに基づいて決定された参照領域に応じて、複数個の候補領域が特定される。この結果、参照領域RA1に対応する適切な対応領域CPが容易に決定される。   Further, in the reference area determination process (FIGS. 7 to 9), the reference area RA1 is determined based on the variation in the values of the plurality of pixels in the right-side scan image 20R. For example, the position, size, and size of the reference area RA1 are each determined based on the values of a plurality of pixels in the arrangement range FA of the right-side scan image 20R. Specifically, the reference region RA1 is determined so as to include a unit region in which the pixel value variation is relatively large (FIG. 8 and the like). In the corresponding area determination process (FIG. 14), a plurality of candidate areas are specified according to the reference area determined based on the variation. As a result, an appropriate corresponding region CP corresponding to the reference region RA1 is easily determined.

より具体的に説明すると、画素の値のばらつきが比較的小さい領域は、特徴が乏しい。このために、画素の値のばらつきが比較的小さい領域が参照領域RA1に決定されると、左側スキャン画像20L内の対応領域CPを決定することが困難になる可能性がある。例えば、左側スキャン画像20L内の誤った領域が、対応領域CPに決定されやすい。画素のばらつきが比較的小さい領域には、例えば、背景を示す領域や、オブジェクトの内部の色の変化が乏しい領域などが含まれる。   More specifically, an area where the variation in pixel values is relatively small has poor characteristics. For this reason, when the region where the variation in pixel values is relatively small is determined as the reference region RA1, it may be difficult to determine the corresponding region CP in the left-side scan image 20L. For example, an erroneous area in the left scanned image 20L is easily determined as the corresponding area CP. The region where the pixel variation is relatively small includes, for example, a region indicating the background and a region where the color change inside the object is poor.

これに対して、画素の値のばらつきが比較的大きな領域は、エッジなどを比較的多く含むので、特徴的な部分を含む可能性が高い。このために、画素の値のばらつきが比較的大きな領域が参照領域RA1に決定されると、左側スキャン画像20L内の対応領域CPを容易に決定できる。換言すれば、ばらつきが比較的小さい領域を基準にするよりも、ばらつきが比較的大きい領域を基準にするほうが、対応領域CPに対応する対応領域CPを精度良く決定できる。あるいは、ばらつきが比較的小さい領域を基準にするよりも、ばらつきが比較的大きい領域を基準にするほうが、対応領域CPのサイズが小さくても適切な対応領域CPを決定できるので、処理時間が短くなる。   On the other hand, a region having a relatively large variation in pixel values includes a relatively large number of edges and the like, and thus is likely to include a characteristic portion. For this reason, when a region having a relatively large variation in pixel values is determined as the reference region RA1, the corresponding region CP in the left-side scan image 20L can be easily determined. In other words, it is possible to determine the corresponding region CP corresponding to the corresponding region CP with higher accuracy by using the region having a relatively large variation as a reference than using the region having a relatively small variation as a reference. Alternatively, it is possible to determine an appropriate corresponding region CP even if the size of the corresponding region CP is smaller than the region where the variation is relatively larger than the region where the variation is relatively small. Become.

B.変形例
(1)上記実施例では、参照領域RA1の位置情報として、左上座標(Rx1、Ry1)が用いられ、参照領域RA1の外形情報として、幅Rw1と高さRh1が用いられている。これに代えて、参照領域RA1の位置情報と外形情報とを兼ねる情報として、参照領域RA1の対角を形成する2つの頂点に位置する2つの画素の座標が用いられても良い。具体的には、左上の画素を表す左上座標と、右下の画素を表す右下座標と、の組み合わせが用いられても良い。また、参照領域RA1の位置情報と外形情報とを兼ねる情報として、参照領域RA1の4つの頂点に位置する4つの画素の座標が用いられても良い。上述したいずれの位置情報であっても、参照領域RA1の右側スキャン画像20R上の位置を特定することができる。また、上述したいずれの外形情報であっても、参照領域RA1のサイズを示す幅と高さとを特定することができる。
B. Modification (1) In the above embodiment, the upper left coordinates (Rx1, Ry1) are used as the position information of the reference area RA1, and the width Rw1 and the height Rh1 are used as the outer shape information of the reference area RA1. Instead, the coordinates of two pixels located at the two vertices forming the diagonal of the reference area RA1 may be used as information that serves as both position information and outer shape information of the reference area RA1. Specifically, a combination of an upper left coordinate representing the upper left pixel and a lower right coordinate representing the lower right pixel may be used. Further, the coordinates of the four pixels located at the four vertices of the reference area RA1 may be used as information that serves as both position information and outer shape information of the reference area RA1. Any position information described above can identify the position of the reference area RA1 on the right-side scan image 20R. In addition, any of the above-described outline information can specify the width and height indicating the size of the reference area RA1.

なお、基準参照領域RA0の位置情報および外形情報、基準探索領域SA0の位置情報および外形情報も、参照領域RA1の位置情報および外形情報と同様に、矩形の対角を形成する2つの頂点に位置する2つの画素の座標や、矩形の4つの頂点に位置する4つの画素の座標が用いられても良い。   Note that the position information and outline information of the reference reference area RA0 and the position information and outline information of the reference search area SA0 are also located at the two vertices forming the diagonal of the rectangle, similar to the position information and outline information of the reference area RA1. Alternatively, the coordinates of two pixels or four pixels located at four vertices of a rectangle may be used.

(2)上記実施例では、探索領域SA1を決定するために、参照領域RA1の位置情報と外形情報に加えて、基準参照領域RA0や基準探索領域SA0の位置情報や外形情報が用いられている。これに代えて、CPU410は、基準参照領域RA0や基準探索領域SA0の位置情報や外形情報を用いることなく、参照領域RA1の位置情報と外形情報のみを用いて、参照領域RA1を決定しても良い。例えば、CPU410は、探索領域SA1の高さを、参照領域RA1の高さと同じ高さに決定する。そして、CPU410は、探索領域SA1の幅を、参照領域RA1の幅の所定数倍(例えば、20倍)に決定する。そして、CPU410は、探索領域SA1の縦方向の位置を、参照領域RA1の縦方向の位置と同じ位置に決定する。そして、CPU410は、探索領域SA1の横方向の位置を、探索領域SA1の右端の位置が、左側スキャン画像20Lの右端と同じ位置となるように、決定する。 (2) In the above embodiment, in order to determine the search area SA1, in addition to the position information and the outline information of the reference area RA1, the position information and the outline information of the standard reference area RA0 and the reference search area SA0 are used. . Instead, the CPU 410 may determine the reference area RA1 using only the position information and the outer shape information of the reference area RA1 without using the position information and the outer shape information of the standard reference area RA0 and the standard search area SA0. good. For example, the CPU 410 determines the height of the search area SA1 to be the same as the height of the reference area RA1. Then, the CPU 410 determines the width of the search area SA1 to be a predetermined number of times (for example, 20 times) the width of the reference area RA1. Then, the CPU 410 determines the vertical position of the search area SA1 as the same position as the vertical position of the reference area RA1. Then, the CPU 410 determines the horizontal position of the search area SA1 so that the right end position of the search area SA1 is the same position as the right end of the left scan image 20L.

(3)上記実施例では、探索領域SA1を決定するために、基準参照領域RA0の位置と参照領域RA1の位置との関係と、基準探索領域SA0の位置と、を用いている。これに代えて、CPU410は、右側スキャン画像20Rの基準の位置(例えば、右側スキャン画像20Rの左上の画素の位置)と、参照領域RA1の位置と、の関係と、左側スキャン画像20Lの基準の位置(例えば、左側スキャン画像20Lの右上の画素の位置)と、を用いて、探索領域SA1を決定しても良い。例えば、CPU410は、右側スキャン画像20Rの左上の画素の位置に対する参照領域RA1の左上の画素の位置と、左側スキャン画像20Lの右上の画素の位置に対する探索領域SA1の右上の画素の位置とが、鏡像の関係になるように、探索領域SA1を決定しても良い。 (3) In the above embodiment, in order to determine the search area SA1, the relationship between the position of the standard reference area RA0 and the position of the reference area RA1 and the position of the standard search area SA0 are used. Instead, the CPU 410 determines the relationship between the reference position of the right scan image 20R (for example, the position of the upper left pixel of the right scan image 20R) and the position of the reference area RA1, and the reference position of the left scan image 20L. The search area SA1 may be determined using the position (for example, the position of the upper right pixel of the left scan image 20L). For example, the CPU 410 determines that the position of the upper left pixel of the reference area RA1 with respect to the position of the upper left pixel of the right scan image 20R and the position of the upper right pixel of the search area SA1 with respect to the position of the upper right pixel of the left scan image 20L. The search area SA1 may be determined so as to have a mirror image relationship.

(4)2個のスキャンデータによって表される2個の画像を、第1の画像と、第2の画像とする。上記実施例では、第1の画像(具体的には、右側スキャン画像20R)の左端近傍と、第2の画像(具体的には、左側スキャン画像20L)の右端近傍と、が結合されるように、合成画像が生成されている。これに代えて、例えば、2個のスキャンデータの生成に用いられる一つの原稿に応じて、第1の画像の右端近傍と、第2の画像の左端近傍とが、結合されるように、合成画像が生成されてもよい。あるいは、第1の画像の下端近傍と、第2の画像の上端近傍とが、結合されるように、合成画像が生成されても良く、第1の画像の上端近傍と、第2の画像の下端近傍と、が結合されるように、合成画像が生成されてもよい。 (4) Let two images represented by two scan data be a first image and a second image. In the above embodiment, the vicinity of the left end of the first image (specifically, the right scan image 20R) and the vicinity of the right end of the second image (specifically, the left scan image 20L) are combined. In addition, a composite image is generated. Instead, for example, in accordance with one original used for generating two pieces of scan data, the vicinity of the right end of the first image and the vicinity of the left end of the second image are combined so as to be combined. An image may be generated. Alternatively, a composite image may be generated such that the vicinity of the lower end of the first image and the vicinity of the upper end of the second image are combined, and the vicinity of the upper end of the first image and the vicinity of the second image A composite image may be generated so that the vicinity of the lower end is combined.

そして、このような第1の画像と第2の画像との結合の態様は、予め決められていても良いし、上述した4個の結合の態様の全てについて、それぞれ、参照領域RA1の決定と、対応領域CPの決定と、を実行しても良い。後者の場合には、参照領域RA1と対応領域CPとの類似度が最も高い結合の態様で、第1の画像と第2の画像とが結合された合成画像を表す合成画像データが生成されてもよい。   Then, such a combination mode of the first image and the second image may be determined in advance, and for each of the four combination modes described above, the determination of the reference region RA1 is performed. The determination of the corresponding area CP may be executed. In the latter case, combined image data representing a combined image in which the first image and the second image are combined is generated in a combination mode in which the similarity between the reference region RA1 and the corresponding region CP is the highest. Also good.

4個の結合の態様によって、決定される参照領域RA1や探索領域SA1は異なる。また、4個の結合の態様によって、用いられる基準参照領域RA0や基準探索領域SA0は異なる。例えば、第1の画像の下端近傍と、第2の画像の上端近傍とが、結合されるように、合成画像が生成される場合を考える。この場合には、例えば、第1の画像の下端近傍に参照領域RA1が決定され、第2の画像の上端近傍に、探索領域SA1が決定される。例えば、基準参照領域RA0は、第1の画像の下端に沿って配置され、基準探索領域SA0は、第2の画像の上端に沿って配置される。そして、例えば、探索領域SA1の幅は、参照領域RA1の幅と同じに決定され、探索領域SA1の高さは、参照領域RA1の高さと基準参照領域RA0の高さとの比率に、基準探索領域SA0の高さを乗じた値に決定される。   The reference area RA1 and the search area SA1 to be determined differ depending on the mode of the four combinations. Further, the standard reference area RA0 and the standard search area SA0 to be used are different depending on the four coupling modes. For example, consider a case where a composite image is generated such that the vicinity of the lower end of the first image and the vicinity of the upper end of the second image are combined. In this case, for example, the reference area RA1 is determined near the lower end of the first image, and the search area SA1 is determined near the upper end of the second image. For example, the standard reference area RA0 is arranged along the lower end of the first image, and the standard search area SA0 is arranged along the upper end of the second image. For example, the width of the search area SA1 is determined to be the same as the width of the reference area RA1, and the height of the search area SA1 is equal to the ratio between the height of the reference area RA1 and the height of the standard reference area RA0. The value is determined by multiplying the height of SA0.

(5)上記実施例では、探索領域SA1の高さSh1は、参照領域RA1の高さRh1と同じにされる(図12のS335)。これは、上記実施例では、右側スキャン画像20R内の右側原稿画像HIRと、左側スキャン画像20L内の左側原稿画像HILとの、縦方向のずれ量が比較的小さいことを想定して、基準探索領域SA0の高さSh0と、基準参照領域RA0の高さRh0と、が等しい値とされているからである(Sh0=Rh0(図13))。例えば、右側スキャン画像20R内の右側原稿画像HIRと、左側スキャン画像20L内の左側原稿画像HILとの、縦方向のずれ量が比較的大きいことを想定される場合には、基準探索領域SA0の高さSh0が、基準参照領域RA0の高さRh0より大きくされ得る(Sh0>Rh0)。 (5) In the above embodiment, the height Sh1 of the search area SA1 is made the same as the height Rh1 of the reference area RA1 (S335 in FIG. 12). In the above-described embodiment, this is based on the assumption that the amount of vertical deviation between the right original image HIR in the right scan image 20R and the left original image HIL in the left scan image 20L is relatively small. This is because the height Sh0 of the area SA0 and the height Rh0 of the standard reference area RA0 are equal to each other (Sh0 = Rh0 (FIG. 13)). For example, if it is assumed that the amount of vertical deviation between the right original image HIR in the right scan image 20R and the left original image HIL in the left scan image 20L is relatively large, the reference search area SA0 The height Sh0 can be larger than the height Rh0 of the reference reference region RA0 (Sh0> Rh0).

この場合には、探索領域SA1の高さSh1は、参照領域RA1と基準参照領域RA0との高さの比率(Rh1/Rh0)に、基準探索領域SA0の高さSh0を乗じた値に決定されても良い(Sh1=(Rh1/Rh0)×Sh0)。あるいは、探索領域SA1の高さSh1は、参照領域RA1の高さRh1に、想定される縦方向のずれ量を考慮して決定された所定長Mのマージンを加算した値に決定されても良い(Sh1=Sh0+M)。一般的には、探索領域SA1の高さSh1は、参照領域RA1の高さRh1が大きいほど大きくなるように決定されることが好ましい。   In this case, the height Sh1 of the search area SA1 is determined to be a value obtained by multiplying the height ratio (Rh1 / Rh0) between the reference area RA1 and the standard reference area RA0 by the height Sh0 of the standard search area SA0. (Sh1 = (Rh1 / Rh0) × Sh0). Alternatively, the height Sh1 of the search area SA1 may be determined to be a value obtained by adding a margin of a predetermined length M determined in consideration of an assumed vertical shift amount to the height Rh1 of the reference area RA1. (Sh1 = Sh0 + M). In general, the height Sh1 of the search area SA1 is preferably determined so as to increase as the height Rh1 of the reference area RA1 increases.

(6)参照領域RA1の位置情報は、座標とは異なる情報であっても良い。例えば、参照領域RA1の位置情報は、参照領域RA1の縦方向の位置を3段階(具体的には、上、中、下)で表す情報であっても良い。参照領域RA1の外形情報は、幅と高さとは異なる情報であっても良い。例えば、参照領域RA1の外形情報は、参照領域RA1のサイズを3段階(具体的には、大、中、小)で表す情報であっても良い。この場合には、例えば、参照領域決定処理では、CPU410は、右側スキャン画像20R内の複数個の画素の値のばらつきに基づいて、3段階の位置情報と3段階の外形情報とを組み合わせて得られる9種類のパターンに対応する9種類の参照領域の中から、1個の参照領域RA1を決定する。そして、CPU410は、決定された参照領域RA1に対応する9種類のパターンに対応する9種類の探索領域の中から、1個の探索領域SA1を決定しても良い。 (6) The position information of the reference area RA1 may be information different from the coordinates. For example, the position information of the reference area RA1 may be information representing the vertical position of the reference area RA1 in three stages (specifically, upper, middle, and lower). The external shape information of the reference area RA1 may be information different from the width and the height. For example, the outer shape information of the reference area RA1 may be information representing the size of the reference area RA1 in three levels (specifically, large, medium, and small). In this case, for example, in the reference area determination process, the CPU 410 obtains a combination of the three-stage position information and the three-stage outline information based on the variation in the values of the plurality of pixels in the right-side scan image 20R. One reference region RA1 is determined from nine types of reference regions corresponding to the nine types of patterns. Then, the CPU 410 may determine one search area SA1 from nine types of search areas corresponding to the nine types of patterns corresponding to the determined reference area RA1.

(7)上記実施例では、2個のスキャンデータを用いて、2個のスキャン画像が合成された合成画像を表す合成画像データが生成されている。これに限らず、任意の個数のスキャンデータを用いて合成画像データが生成されても良い。例えば、4個のスキャン画像データを用いて、4個のスキャン画像が合成された合成画像を表す合成画像データが生成されてもよい。 (7) In the above-described embodiment, composite image data representing a composite image obtained by combining two scan images is generated using two scan data. The present invention is not limited to this, and the composite image data may be generated using an arbitrary number of scan data. For example, composite image data representing a composite image obtained by combining four scan images may be generated using the four scan image data.

(8)上記実施例では、合成画像データの生成に用いられる2個の画像データは、複合機200のスキャナ部250によって原稿が読み取られることによって生成される2個のスキャンデータである。これに代えて、2個の画像データは、デジタルカメラによって原稿の複数個の領域を撮影することによって、2個の画像データが生成されても良い。 (8) In the above embodiment, the two pieces of image data used for generating the composite image data are two pieces of scan data generated by reading a document by the scanner unit 250 of the multifunction device 200. Instead of this, two pieces of image data may be generated by photographing a plurality of areas of a document with a digital camera.

(9)上記実施例では、合成画像データの生成に用いられる2個のスキャンデータは、1つの原稿10を読み取って得られる右側スキャンデータと左側スキャンデータである。これに代えて、2個のスキャンデータは、2個の原稿をそれぞれ読み取って得られる2個のスキャンデータであっても良い。 (9) In the above embodiment, the two scan data used for generating the composite image data are the right side scan data and the left side scan data obtained by reading one document 10. Alternatively, the two scan data may be two scan data obtained by reading two originals, respectively.

(10)上記実施例においてサーバ400のCPU410によって実行される処理(例えば、図2のS25〜S40の処理)は、例えば、複合機200のCPU210によって実行されても良い。この場合には、サーバ400は不要であり、複合機200が単体で図2の処理を実行すればよい。また、サーバ400のCPU410によって実行される処理は、複合機200と接続されたパーソナルコンピュータ500(図1)のCPU(図示省略)によって実行されても良い。例えば、パーソナルコンピュータ500のCPUは、パーソナルコンピュータ500にインストールされたスキャナドライバプログラムを実行することによって、これらの処理を実行しても良い。また、サーバ400は、本実施例のように1つの計算機で構成されても良く、複数個の計算機を含む計算システムによって構成されていても良い。 (10) The processing (for example, the processing of S25 to S40 in FIG. 2) executed by the CPU 410 of the server 400 in the above embodiment may be executed by the CPU 210 of the multifunction device 200, for example. In this case, the server 400 is unnecessary, and the multi-function device 200 may execute the processing of FIG. 2 alone. Further, the processing executed by the CPU 410 of the server 400 may be executed by the CPU (not shown) of the personal computer 500 (FIG. 1) connected to the multifunction device 200. For example, the CPU of the personal computer 500 may execute these processes by executing a scanner driver program installed in the personal computer 500. Further, the server 400 may be configured with one computer as in the present embodiment, or may be configured with a computer system including a plurality of computers.

(11)上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。 (11) In the above embodiment, a part of the configuration realized by hardware may be replaced with software, and conversely, a part of the configuration realized by software may be replaced with hardware. Also good.

200...複合機、210...CPU、220...揮発性記憶装置、221...バッファ領域、230...不揮発性記憶装置、231...制御プログラム、240...プリンタ部、250...スキャナ部、260...操作部、270...表示部、280...通信部、400...サーバ、410...CPU、420...揮発性記憶装置、421...バッファ領域、430...不揮発性記憶装置、431...コンピュータプログラム、433...UIデータ群、480...通信部、500...パーソナルコンピュータ、1000...画像処理システム   200 ... multifunction device, 210 ... CPU, 220 ... volatile storage device, 221 ... buffer area, 230 ... nonvolatile storage device, 231 ... control program, 240 ... printer , 250 ... scanner unit, 260 ... operation unit, 270 ... display unit, 280 ... communication unit, 400 ... server, 410 ... CPU, 420 ... volatile storage device 421 ... buffer area, 430 ... nonvolatile storage device, 431 ... computer program, 433 ... UI data group, 480 ... communication unit, 500 ... personal computer, 1000 ... Image processing system

Claims (13)

画像処理装置であって、
第1の画像を表す第1の画像データと、第2の画像を表す第2の画像データと、を取得する取得部と、
前記第1の画像データを用いて、前記第1の画像内の一部の領域である参照領域を決定する参照領域決定部と、
前記第2の画像データと、前記参照領域の位置を示す位置情報と、前記参照領域の外形に関する外形情報と、を用いて、前記第2の画像内の一部の領域である探索領域を決定する探索領域決定部と、
前記参照領域に類似する前記第2の画像内の対応領域を、前記第2の画像の前記探索領域内から決定する対応領域決定部と、
前記第1の画像データと前記第2の画像データとを用いて、前記参照領域と前記対応領域とが重なるように、前記第1の画像と前記第2の画像とが合成された合成画像を表す合成画像データを生成する生成部と、
を備え
前記探索領域決定部は、
前記参照領域の基準となる第1の基準領域の外形を示す情報と、前記探索領域の基準となる第2の基準領域の外形を示す情報とを、取得し、
前記参照領域の外形と前記第1の基準領域の外形との関係と、前記第2の基準領域の外形と、に基づいて、前記探索領域の外形を決定する、画像処理装置。
An image processing apparatus,
An acquisition unit that acquires first image data representing a first image and second image data representing a second image;
A reference area determining unit that determines a reference area, which is a partial area in the first image, using the first image data;
A search area, which is a partial area in the second image, is determined using the second image data, position information indicating the position of the reference area, and outline information regarding the outline of the reference area. A search area determination unit to perform,
A corresponding area determining unit that determines a corresponding area in the second image similar to the reference area from within the search area of the second image;
Using the first image data and the second image data, a synthesized image obtained by synthesizing the first image and the second image so that the reference area and the corresponding area overlap with each other is obtained. A generating unit that generates composite image data to be represented;
Equipped with a,
The search area determination unit
Obtaining information indicating the outer shape of the first reference area serving as the reference area of the reference area and information indicating the outer shape of the second reference area serving as the reference of the search area;
And the relationship between the contour of the outer shape and the first reference region of the reference region, and the outer shape of the second reference area, based on, that determine the outer shape of the search area, the image processing apparatus.
請求項1に記載の画像処理装置であって、
前記探索領域決定部は、
前記第1の画像の基準の位置である第1の基準位置を示す情報と、前記第2の画像の基準の位置である第2の基準位置を示す情報と、を取得し、
前記参照領域の位置と前記第1の基準位置との関係と、前記第2の基準位置と、に基づいて、前記探索領域の位置を決定する、画像処理装置。
The image processing apparatus according to claim 1,
The search area determination unit
Obtaining information indicating a first reference position, which is a reference position of the first image, and information indicating a second reference position, which is a reference position of the second image;
An image processing apparatus that determines a position of the search area based on a relationship between a position of the reference area and the first reference position and the second reference position.
請求項2に記載の画像処理装置であって、
前記第1の基準位置は、前記参照領域の基準の位置を示す情報であり、
前記第2の基準位置は、前記探索領域の基準の位置を示す情報であり、
前記第1の基準位置を示す情報と、前記第2の基準位置を示す情報とは、それぞれに、第1の方向の位置を示す情報と、第1の方向と垂直な第2の方向の位置を示す情報と、を含み、
前記第1の方向は、前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向であり、
前記探索領域決定部は、前記参照領域の位置が前記第1の基準位置に対して前記第1の方向にずれている場合には、前記探索領域の位置が前記第2の基準位置に対して前記第1の方向にずれ、かつ、前記参照領域の位置が前記第1の基準位置に対して前記第2の方向にずれている場合には、前記探索領域の位置が前記第2の基準位置に対して前記第2の方向にずれるように、前記探索領域の位置を決定する、画像処理装置。
The image processing apparatus according to claim 2,
The first reference position is information indicating a reference position of the reference area,
The second reference position is information indicating a reference position of the search area,
The information indicating the first reference position and the information indicating the second reference position are respectively information indicating the position in the first direction and a position in the second direction perpendicular to the first direction. Including information indicating
The first direction is a direction in which the first image and the second image are arranged in the composite image,
When the position of the reference area is shifted in the first direction with respect to the first reference position, the search area determining unit determines that the position of the search area is relative to the second reference position. When the position of the reference area is shifted in the second direction with respect to the first reference position, the position of the search area is shifted to the second reference position. An image processing apparatus that determines a position of the search region so as to be shifted in the second direction with respect to the image.
請求項1〜3のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、
前記参照領域の第1の方向の長さと前記第1の基準領域の前記第1の方向の長さとの比率を用いて、前記探索領域の前記第1の方向の長さを決定する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 3 ,
The search area determination unit
Image processing for determining a length of the search region in the first direction using a ratio between a length of the reference region in the first direction and a length of the first reference region in the first direction apparatus.
請求項に記載の画像処理装置であって、
前記第1の方向は、生成されるべき前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向であり、
前記探索領域決定部は、
前記探索領域の前記第1の方向と垂直な第2の方向の長さを、前記参照領域の前記第2の方向の長さに決定する、画像処理装置。
The image processing apparatus according to claim 4 ,
The first direction is a direction in which the first image and the second image are arranged in the composite image to be generated;
The search area determination unit
An image processing apparatus that determines a length of the search region in a second direction perpendicular to the first direction as a length of the reference region in the second direction.
請求項またはに記載の画像処理装置であって、
前記探索領域決定部は、前記探索領域の前記第1の方向の長さを、前記第2の基準領域の前記第1の方向の長さより小さな値に決定する、画像処理装置。
The image processing apparatus according to claim 4 or 5 , wherein
The search region determination unit is an image processing device that determines the length of the search region in the first direction to a value smaller than the length of the second reference region in the first direction.
請求項のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、前記参照領域の外形と前記第1の基準領域の外形との関係と、前記第2の基準領域の外形と、に基づいて決定された前記探索領域が、前記第2の画像より外側の領域を含む場合には、修正後の前記探索領域が前記第2の画像内に含まれるように、前記探索領域を修正する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 6,
The search region determination unit is configured to determine whether the search region determined based on a relationship between an outer shape of the reference region and an outer shape of the first reference region and an outer shape of the second reference region is the second shape. if from the image including the outer regions, so that the search region after correction is included in the second image, modifying the search area, the image processing apparatus.
請求項のいずれかに記載の画像処理装置であって、
前記第2の基準領域は、前記第2の画像の第1の方向の端に沿って配置され、
前記第1の基準領域は、前記第1の画像の前記第1の方向とは反対方向の端に沿って配置され、
前記第1の方向は、生成されるべき前記合成画像において前記第1の画像と前記第2の画像とが並ぶ方向である、画像処理装置。
An image processing apparatus according to any one of claims 1 to 7,
The second reference region is disposed along an edge in a first direction of the second image;
The first reference region is disposed along an end of the first image in a direction opposite to the first direction;
The image processing apparatus, wherein the first direction is a direction in which the first image and the second image are arranged in the composite image to be generated.
請求項1〜のいずれかに記載の画像処理装置であって、
前記探索領域決定部は、
前記参照領域の第1の方向の長さが長いほど、前記探索領域の前記第1の方向の長さを長く決定する、画像処理装置。
An image processing apparatus according to any one of claims 1-8,
The search area determination unit
An image processing apparatus that determines the length of the search region in the first direction to be longer as the length of the reference region in the first direction is longer.
請求項1〜のいずれかに記載の画像処理装置であって、
前記位置情報は、前記参照領域の位置を特定する座標を含み、
前記外形情報は、前記参照領域のサイズを示す第1の方向の長さと、前記第1の方向と垂直な第2の方向の長さと、を含む。
An image processing apparatus according to any one of claims 1 to 9 ,
The position information includes coordinates that specify the position of the reference region,
The external shape information includes a length in a first direction indicating the size of the reference region and a length in a second direction perpendicular to the first direction.
請求項1〜1のいずれかに記載の画像処理装置であって、
前記参照領域決定部は、前記第1の画像内の複数個の画素の値のばらつきに基づいて、前記参照領域を決定し、
前記探索領域決定部は、ばらつきに基づいて決定された前記参照領域に応じて、前記探索領域を決定する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 10 ,
The reference area determining unit determines the reference area based on a variation in values of a plurality of pixels in the first image;
The image processing apparatus, wherein the search area determination unit determines the search area according to the reference area determined based on variation.
請求項1〜1のいずれかに記載の画像処理装置であって、
前記第1の画像データは、原稿の第1の領域を光学的に読み取ることによって得られる画像データであり、
前記第2の画像データは、前記原稿の第2の領域を光学的に読み取ることによって得られる画像データである、画像処理装置。
An image processing apparatus according to any one of claims 1 to 1 1,
The first image data is image data obtained by optically reading a first area of a document,
The image processing apparatus, wherein the second image data is image data obtained by optically reading a second area of the document.
コンピュータプログラムであって、
第1の画像を表す第1の画像データと、第2の画像を表す第2の画像データと、を取得する取得機能と、
前記第1の画像データを用いて、前記第1の画像内の一部の領域である参照領域を決定する参照領域決定機能と、
前記第2の画像データと、前記参照領域の位置を示す位置情報と、前記参照領域の外形に関する外形情報と、を用いて、前記第2の画像内の一部の領域である探索領域を決定する探索領域決定機能と、
前記参照領域に類似する前記第2の画像内の対応領域を、前記第2の画像の前記探索領域内から決定する対応領域決定機能と、
前記第1の画像データと前記第2の画像データとを用いて、前記参照領域と前記対応領域とが重なるように、前記第1の画像と前記第2の画像とが合成された合成画像を表す合成画像データを生成する生成機能と、
をコンピュータに実現させ
前記探索領域決定機能は、
前記参照領域の基準となる第1の基準領域の外形を示す情報と、前記探索領域の基準となる第2の基準領域の外形を示す情報とを、取得し、
前記参照領域の外形と前記第1の基準領域の外形との関係と、前記第2の基準領域の外形と、に基づいて、前記探索領域の外形を決定するコンピュータプログラム。
A computer program,
An acquisition function for acquiring first image data representing a first image and second image data representing a second image;
A reference area determination function for determining a reference area, which is a partial area in the first image, using the first image data;
A search area, which is a partial area in the second image, is determined using the second image data, position information indicating the position of the reference area, and outline information regarding the outline of the reference area. A search area determination function to
A corresponding area determination function for determining a corresponding area in the second image similar to the reference area from within the search area of the second image;
Using the first image data and the second image data, a synthesized image obtained by synthesizing the first image and the second image so that the reference area and the corresponding area overlap with each other is obtained. A generating function for generating composite image data to be represented;
Is realized on a computer ,
The search area determination function is:
Obtaining information indicating the outer shape of the first reference area serving as the reference area of the reference area and information indicating the outer shape of the second reference area serving as the reference of the search area;
And the relationship between the contour of the outer shape of the reference region of the first reference area, said the outer shape of the second reference area, based on a computer program that determines the outer shape of the search area.
JP2014095447A 2014-05-02 2014-05-02 Image processing apparatus and computer program Active JP6330458B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014095447A JP6330458B2 (en) 2014-05-02 2014-05-02 Image processing apparatus and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014095447A JP6330458B2 (en) 2014-05-02 2014-05-02 Image processing apparatus and computer program

Publications (2)

Publication Number Publication Date
JP2015213253A JP2015213253A (en) 2015-11-26
JP6330458B2 true JP6330458B2 (en) 2018-05-30

Family

ID=54697297

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014095447A Active JP6330458B2 (en) 2014-05-02 2014-05-02 Image processing apparatus and computer program

Country Status (1)

Country Link
JP (1) JP6330458B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7171295B2 (en) 2018-08-01 2022-11-15 キヤノン株式会社 Reading control device, control method, and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4301137B2 (en) * 2004-10-20 2009-07-22 富士ゼロックス株式会社 Image composition apparatus, image composition method, image composition program, and recording medium
JP2009136421A (en) * 2007-12-05 2009-06-25 Toshiba Corp X-ray diagnostic apparatus, X-ray image processing method, and storage medium

Also Published As

Publication number Publication date
JP2015213253A (en) 2015-11-26

Similar Documents

Publication Publication Date Title
JP2010226252A (en) Image processing apparatus and image forming apparatus control method
JP6344064B2 (en) Image processing apparatus and computer program
US20160100075A1 (en) Dual-mode scanning device and scanning method thereof
US7684617B2 (en) Apparatus and methods for processing images
JP6256206B2 (en) Image processing apparatus and computer program
JP6330458B2 (en) Image processing apparatus and computer program
JP6152818B2 (en) Image processing apparatus and computer program
JP6108220B2 (en) Image processing apparatus and image processing program
US9886648B2 (en) Image processing device generating arranged image data representing arranged image in which images are arranged according to determined relative position
JP6409460B2 (en) Image processing apparatus and computer program
US9811877B2 (en) Image processing device selecting arrangement method for generating arranged image data
JP6149782B2 (en) Image processing apparatus and computer program
JP6314633B2 (en) Image processing apparatus and computer program
JP6322923B2 (en) Information processing apparatus, information processing program, storage medium, information processing system, and information processing method
JP6064390B2 (en) Image reading apparatus, image reading system, image reading program, and portable terminal program
US8416469B2 (en) Image processing apparatus, image processing method and computer program
JP6394060B2 (en) Image processing apparatus and computer program
JP4561433B2 (en) Image reading device
JP6372397B2 (en) Image processing apparatus and computer program
JP2016178367A (en) Image processing apparatus and computer program
JP2024119157A (en) Computer program, server, and system
JP2017143464A (en) Image processing system, image processing apparatus, image processing method, and program
JP5359713B2 (en) Image processing apparatus and image forming apparatus
EP3122028A1 (en) Image processing apparatus and processing method
JP2017028424A (en) Image processing apparatus, image forming apparatus, and image forming method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170425

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171027

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171107

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180103

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: 20180327

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180409

R150 Certificate of patent or registration of utility model

Ref document number: 6330458

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150