JP2016092560A - Image processing apparatus and computer program - Google Patents

Image processing apparatus and computer program Download PDF

Info

Publication number
JP2016092560A
JP2016092560A JP2014223785A JP2014223785A JP2016092560A JP 2016092560 A JP2016092560 A JP 2016092560A JP 2014223785 A JP2014223785 A JP 2014223785A JP 2014223785 A JP2014223785 A JP 2014223785A JP 2016092560 A JP2016092560 A JP 2016092560A
Authority
JP
Japan
Prior art keywords
image
area
pixel
region
partial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014223785A
Other languages
Japanese (ja)
Other versions
JP6428166B2 (en
Inventor
良平 小澤
Ryohei Ozawa
良平 小澤
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 JP2014223785A priority Critical patent/JP6428166B2/en
Publication of JP2016092560A publication Critical patent/JP2016092560A/en
Application granted granted Critical
Publication of JP6428166B2 publication Critical patent/JP6428166B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)

Abstract

PROBLEM TO BE SOLVED: To create an appropriate composite image including characteristics of a background image and a target image.SOLUTION: An image processing apparatus comprises: an acquisition unit that acquires background image data and target image data; a region determination part that determines a composite region as a region in a background image to be composed a target image; a region division part that divides the composite region into a first kind region and a second kind region based on characteristics of a partial image in the composite region of the background image; a creation part that creates processed background image data that shows a processed background image in which the composite image obtained by composing the partial image and the target image is arranged in the composite region by determining the pixel value in the first kind region and the pixel value in the second kind region with a different processing; and an output part that outputs the processed background image data. A reflection rate of the partial image of first kind region of composite image is larger than that of the partial image of second kind region of composite image.SELECTED DRAWING: Figure 5

Description

本明細書は、背景画像に対象画像を合成する画像処理に関するものである。   The present specification relates to image processing for combining a target image with a background image.

従来から、画像を表す画像データの種々の処理が行われている。例えば、背景画像と対象画像とを合成し、その合成画像をプリントする技術が提案されている(例えば、特許文献1参照)。   Conventionally, various processing of image data representing an image has been performed. For example, a technique has been proposed in which a background image and a target image are combined and the combined image is printed (see, for example, Patent Document 1).

特開2001−76127号公報JP 2001-76127 A

しかしながら、画像の合成に関しては、十分な工夫がなされていないのが実情であった。例えば、背景画像と対象画像とを合成すると、一方の画像(例えば、背景画像)の特徴が失われる可能性があった。   However, the actual situation is that no sufficient ingenuity has been made regarding the synthesis of images. For example, when the background image and the target image are combined, the characteristics of one image (for example, the background image) may be lost.

本明細書は、背景画像と対象画像とを合成する際に、背景画像の特徴と対象画像の特徴とを含む適切な合成画像を生成する技術を提供する。   This specification provides a technique for generating an appropriate composite image including the characteristics of the background image and the characteristics of the target image when the background image and the target image are combined.

本明細書は、以下の適用例を開示する。   The present specification discloses the following application examples.

[適用例1]画像処理装置であって、背景画像を表す背景画像データと、対象画像を表す対象画像データと、を取得する取得部と、前記対象画像が合成されるべき前記背景画像内の領域である合成領域を決定する領域決定部と、前記背景画像のうちの前記合成領域内の部分画像の特徴に基づいて、前記合成領域を第1種の領域と第2種の領域とに区分する領域区分部と、前記第1種の領域内の画素の値と前記第2種の領域内の画素の値とを互いに異なる処理によって決定することによって、前記部分画像と前記対象画像とが合成された合成画像が、前記合成領域内に配置された処理済背景画像を表す処理済背景画像データを生成する生成部であって、前記合成画像の前記第1種の領域の前記部分画像の反映率は、前記合成画像の前記第2種の領域の前記部分画像の反映率より大きく、前記部分画像の反映率は、各画素の値に対して前記部分画像内の各画素の値が反映される程度である、前記生成部と、前記処理済背景画像データを出力する出力部と、を備える、画像処理装置。 [Application Example 1] An image processing apparatus, an acquisition unit that acquires background image data representing a background image and target image data representing a target image, and an image processing device in which the target image is to be synthesized Based on the characteristics of the partial image in the composite area of the background image, an area determination unit that determines a composite area that is an area, and divides the composite area into a first type area and a second type area The partial image and the target image are synthesized by determining the region segmentation unit to be performed, and the pixel value in the first type region and the pixel value in the second type region by different processes. The generated composite image is a generation unit that generates processed background image data representing the processed background image arranged in the composite region, and reflects the partial image of the first type region of the composite image The rate is the second type of the composite image. The generation unit, and the processing, wherein the reflection rate of the partial image is larger than the reflection rate of the partial image in a region, and the reflection rate of the partial image is such that the value of each pixel in the partial image is reflected on the value of each pixel. And an output unit for outputting completed background image data.

上記構成によれば、背景画像の部分画像の特徴に基づいて、合成領域内に第1種の領域と第2種の領域とが決定される。そして、合成画像の第1種の領域内の部分画像の反映率が対象画像の反映率は、合成画像の第2種の領域の部分画像の反映率より大きい。この結果、部分画像(すなわち、背景画像)の特徴と対象画像の特徴とを含む適切な合成画像が生成される。   According to the above configuration, the first type region and the second type region are determined in the synthesis region based on the characteristics of the partial image of the background image. The reflection rate of the partial image in the first type region of the composite image is higher than the reflection rate of the partial image in the second type region of the composite image. As a result, an appropriate composite image including the characteristics of the partial image (that is, the background image) and the characteristics of the target image is generated.

なお、本明細書が開示する技術は、種々の形態で実現することが可能であり、例えば、画像読取装置、印刷装置、画像処理方法、これらの装置または方法を実現するためのコンピュータプ口グラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。   The technology disclosed in the present specification can be realized in various forms. For example, an image reading device, a printing device, an image processing method, a computer program for realizing these devices or methods, It can be realized in the form of a recording medium on which the computer program is recorded.

一実施例としてのシステム900を示す説明図である。It is explanatory drawing which shows the system 900 as one Example. システム900の動作のフローチャートである。5 is a flowchart of the operation of the system 900. 本実施例で用いられる画像データの説明図である。It is explanatory drawing of the image data used by a present Example. 合成処理のフローチャートである。It is a flowchart of a synthetic | combination process. 合成処理を説明するための図である。It is a figure for demonstrating a synthetic | combination process. エンボス画像EIのヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of embossed image EI. 処理済背景画像CBIと比較例の画像との一例を示す図である。It is a figure which shows an example of the processed background image CBI and the image of a comparative example. 第2実施例における背景残存率BRの決定のフローチャートである。It is a flowchart of determination of the background residual ratio BR in 2nd Example. 第2実施例の背景残存率BRを決定するためのテーブルの説明図である。It is explanatory drawing of the table for determining the background residual ratio BR of 2nd Example. 第3実施例の合成処理のフローチャートである。It is a flowchart of the synthetic | combination process of 3rd Example. 第4実施例の合成処理のフローチャートである。It is a flowchart of the synthetic | combination process of 4th Example.

A.第1実施例:
図1は、一実施例としてのシステム900を示す説明図である。このシステム900は、インターネットなどのネットワーク500と、端末装置100と、プリンタ200と、サーバ300と、を備えている。端末装置100とサーバ300とは、それぞれ、ネットワーク500に接続されている。このために、端末装置100とサーバ300とは、互いに通信可能である。
A. First embodiment:
FIG. 1 is an explanatory diagram showing a system 900 as an example. The system 900 includes a network 500 such as the Internet, a terminal device 100, a printer 200, and a server 300. The terminal device 100 and the server 300 are each connected to the network 500. For this reason, the terminal device 100 and the server 300 can communicate with each other.

端末装置100は、例えば、スマートフォンなどの携帯端末である。端末装置100は、端末装置100の全体を制御するコントローラとしてのCPU110と、DRAM等の揮発性記憶装置120と、フラッシュメモリ等の不揮発性記憶装置130と、液晶パネル等の表示部140と、液晶パネルと重畳されたタッチパネル等の操作部150と、ネットワーク500と接続するための通信インタフェース180(例えば、IEEE802.11a/b/g/nの規格に準拠した無線通信インタフェース)と、を備えている。揮発性記憶装置120には、CPU110が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域122が設けられている。不揮発性記憶装置130は、コンピュータプログラム132を格納している。コンピュータプログラム132は、例えば、サーバなどの計算機からネットワーク500を介してダウンロードされる形態で提供されるアプリケーションプログラムである。これに代えて、コンピュータプログラム132は、DVDーROMなどに格納される形態で提供されても良い。   The terminal device 100 is a mobile terminal such as a smartphone, for example. The terminal device 100 includes a CPU 110 as a controller that controls the entire terminal device 100, a volatile storage device 120 such as a DRAM, a nonvolatile storage device 130 such as a flash memory, a display unit 140 such as a liquid crystal panel, and a liquid crystal An operation unit 150 such as a touch panel superimposed on the panel and a communication interface 180 for connecting to the network 500 (for example, a wireless communication interface compliant with the IEEE 802.11a / b / g / n standard) are provided. . The volatile storage device 120 is provided with a buffer area 122 for temporarily storing various intermediate data generated when the CPU 110 performs processing. The non-volatile storage device 130 stores a computer program 132. The computer program 132 is an application program provided in a form downloaded from a computer such as a server via the network 500, for example. Instead, the computer program 132 may be provided in a form stored in a DVD-ROM or the like.

CPU110は、揮発性記憶装置120と不揮発性記憶装置130とを用いてコンピュータプログラム132を実行することによって、サーバ300と協働して後述する図2の処理を実行する。   The CPU 110 executes the computer program 132 using the volatile storage device 120 and the nonvolatile storage device 130, thereby executing the processing of FIG. 2 described later in cooperation with the server 300.

プリンタ200は、画像を印刷する装置であり、いわゆるインクジェットプリンタである。これに代えて、他の種類のプリンタ(例えば、いわゆるレーザプリンタ)が採用されてもよい。   The printer 200 is a device that prints an image, and is a so-called inkjet printer. Instead, other types of printers (for example, so-called laser printers) may be employed.

本実施例の画像処理装置としてのサーバ300は、サーバ300の全体を制御するコントローラとしてのCPU310と、DRAM等の揮発性記憶装置320と、ハードディスクドライブ等の不揮発性記憶装置330と、ネットワーク500に接続するための通信インタフェース380(例えば、IEEE802.3の規格に準拠した有線通信インタフェース)と、を備えている。揮発性記憶装置320には、CPU310が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域322が設けられている。不揮発性記憶装置330は、コンピュータプログラム332と、テンプレート画像データ群334と、を格納している。このコンピュータプログラム332は、例えば、DVD−ROMなどに格納される形態や、他のサーバなどの計算機からネットワーク500を介してダウンロードされる形態で提供される。テンプレート画像データ群334は、後述する画像処理(図2)で用いられる複数個のテンプレート画像データを含んでいる。具体的には、テンプレート画像データ群334は、後述する背景画像データの候補となる複数個のテンプレート画像データと、後述する合成対象画像データの候補となる複数個のテンプレート画像データと、を含んでいる。   A server 300 as an image processing apparatus according to the present embodiment includes a CPU 310 as a controller that controls the entire server 300, a volatile storage device 320 such as a DRAM, a nonvolatile storage device 330 such as a hard disk drive, and a network 500. And a communication interface 380 (for example, a wired communication interface compliant with the IEEE 802.3 standard) for connection. The volatile storage device 320 is provided with a buffer area 322 for temporarily storing various intermediate data generated when the CPU 310 performs processing. The nonvolatile storage device 330 stores a computer program 332 and a template image data group 334. The computer program 332 is provided, for example, in a form stored on a DVD-ROM or the like, or downloaded from a computer such as another server via the network 500. The template image data group 334 includes a plurality of template image data used in image processing (FIG. 2) described later. Specifically, the template image data group 334 includes a plurality of template image data that are candidates for background image data to be described later and a plurality of template image data that are candidates for synthesis target image data to be described later. Yes.

CPU310は、揮発性記憶装置320と不揮発性記憶装置330とを用いてコンピュータプログラム332を実行することによって、端末装置100と協働して、後述する図2の処理を実行する。   The CPU 310 executes the computer program 332 using the volatile storage device 320 and the nonvolatile storage device 330, thereby executing the processing of FIG. 2 described later in cooperation with the terminal device 100.

図2は、システム900の動作のフローチャートである。図中には、端末装置100による処理と、サーバ300による処理と、が示されている。図2の処理は、年賀状の絵柄面に印刷すべき画像(印刷画像とも呼ぶ)を表す印刷画像データを生成し、当該印刷画像データを用いてはがきに画像を印刷する処理である。図2の処理は、端末装置100において、コンピュータプログラム132が起動された場合に開始される。   FIG. 2 is a flowchart of the operation of the system 900. In the figure, processing by the terminal device 100 and processing by the server 300 are shown. The process of FIG. 2 is a process of generating print image data representing an image (also referred to as a print image) to be printed on the New Year's card pattern and printing the image on a postcard using the print image data. The process of FIG. 2 is started when the computer program 132 is activated in the terminal device 100.

S5では、CPU110は、印刷画像データを生成するために用いられるテンプレート画像データ群の要求をサーバ300に対して送信する。S10では、当該要求に対する応答として、CPU310は、テンプレート画像データ群334を端末装置100に送信する。この結果、テンプレート画像データ群334がサーバ300から端末装置100にダウンロードされる。   In S <b> 5, the CPU 110 transmits a request for a template image data group used for generating print image data to the server 300. In S <b> 10, the CPU 310 transmits a template image data group 334 to the terminal device 100 as a response to the request. As a result, the template image data group 334 is downloaded from the server 300 to the terminal device 100.

S15では、CPU110は、ユーザの指示に基づいて、1個の背景画像データを選択する。具体的には、CPU110は、背景画像データの候補となるテンプレート画像データによって表される画像のサムネイル画像を含むUI画面(図示省略)を表示部140に表示して、ユーザから1個の背景画像データを指定する指示を受け取る。CPU110は、当該指示に従って、複数個のテンプレート画像データの中から、1個の背景画像データを選択する。   In S15, the CPU 110 selects one background image data based on a user instruction. Specifically, the CPU 110 displays a UI screen (not shown) including a thumbnail image of an image represented by template image data that is a candidate for background image data on the display unit 140, and receives one background image from the user. Receives instructions to specify data. CPU 110 selects one background image data from a plurality of template image data in accordance with the instruction.

図3は、本実施例で用いられる画像データの説明図である。図3(A)には、背景画像データによって表される背景画像BIの一例が示されている。背景画像BIは、下地Bgと、複数個のオブジェクトBo1〜Bo3と、を含む。オブジェクトBo1〜Bo3は、例えば、文字Bo1や描画Bo2、Bo3を含む。図3(A)の例では、下地Bgは、単純なベタ塗りの画像ではなく、特定のテクスチャ(質感)を有する画像、例えば、細かいノイズやしわを含む画像である。背景画像データは、例えば、RGB表色系の色値(RGB値)で画素ごとの色を表すRGB画像データである。   FIG. 3 is an explanatory diagram of image data used in this embodiment. FIG. 3A shows an example of the background image BI represented by the background image data. The background image BI includes a background Bg and a plurality of objects Bo1 to Bo3. The objects Bo1 to Bo3 include, for example, a character Bo1, a drawing Bo2, and Bo3. In the example of FIG. 3A, the base Bg is not a simple solid image, but an image having a specific texture (texture), for example, an image including fine noise and wrinkles. The background image data is, for example, RGB image data that represents a color for each pixel with an RGB color system color value (RGB value).

また、背景画像データには、付属データとして、背景残存率BRが対応付けられている。背景残存率BRは、後述する合成処理にて用いられる値であり、例えば、0%〜60%の範囲の値(図3(A)の例では40%)である。背景残存率BRは、背景画像データごとに予め決定された値である。例えば、背景画像BI内の下地BgやオブジェクトBo1〜Bo3が、上述した細かいノイズやしわなどの特定のテクスチャを有する画像である場合や、背景画像BI内のエッジ量が比較的多い場合には、背景残存率BRは、比較的大きい値に決定される(例えば、30%〜60%)。また、背景画像BI内の下地BgやオブジェクトBo1〜Bo3が、単純なベタ塗りの画像である場合や、背景画像BI内のエッジ量が比較的少ない場合には、背景残存率BRは、比較的低い値に決定される(例えば、0%〜30%)。   Further, the background remaining rate BR is associated with the background image data as attached data. The background residual ratio BR is a value used in a synthesis process to be described later, and is, for example, a value in the range of 0% to 60% (40% in the example of FIG. 3A). The background residual ratio BR is a value determined in advance for each background image data. For example, when the background Bg and the objects Bo1 to Bo3 in the background image BI are images having a specific texture such as the fine noise and wrinkles described above, or when the amount of edges in the background image BI is relatively large, The background residual ratio BR is determined to be a relatively large value (for example, 30% to 60%). When the background Bg and the objects Bo1 to Bo3 in the background image BI are simple solid images, or when the edge amount in the background image BI is relatively small, the background remaining rate BR is relatively A low value is determined (for example, 0% to 30%).

S20では、CPU110は、ユーザの指示に基づいて、1個の合成対象画像データを選択する。具体的には、CPU110は、合成対象画像データの候補となる複数個のテンプレート画像データによって表される画像のサムネイル画像を含むUI画面(図示省略)を表示部140に表示して、ユーザから1個の合成対象画像データを指定する指示を受け取る。CPU110は、当該指示に従って、複数個のテンプレート画像データの中から、1個の合成対象画像データを選択する。   In S20, the CPU 110 selects one compositing target image data based on a user instruction. Specifically, the CPU 110 displays a UI screen (not shown) including thumbnail images of images represented by a plurality of template image data that are candidates for the composition target image data on the display unit 140, and receives 1 from the user. An instruction to specify the image data to be combined is received. In accordance with the instruction, the CPU 110 selects one compositing target image data from a plurality of template image data.

図3(B)には、合成対象画像データによって表される合成対象画像CIの一例が示されている。合成対象画像CIは、本実施例では、特定の文字(図3(B)の例では、「賀正」)を含む印影を表す画像(印影画像とも呼ぶ)である。合成対象画像CIは、印影を構成する複数個のオブジェクト画素OP1と、印影を構成しない複数個の非オブジェクト画素BP1と、を含んでいる。合成対象画像データは、例えば、RGB表色系の色値(RGB値)で画素ごとの色を表すRGB画像データである。   FIG. 3B shows an example of the compositing target image CI represented by the compositing target image data. In the present embodiment, the compositing target image CI is an image (also referred to as an imprint image) representing an imprint including a specific character (“Kagasho” in the example of FIG. 3B). The compositing target image CI includes a plurality of object pixels OP1 constituting an imprint and a plurality of non-object pixels BP1 not constituting an imprint. The synthesis target image data is, for example, RGB image data that represents a color for each pixel with an RGB color system color value (RGB value).

また、合成対象画像データには、付属データとして、マスクデータが対応付けられている。マスクデータによって表されるマスク画像FI(図3(B))は、テンプレート画像と同じサイズ(すなわち、縦方向の画素数および横方向の画素数)を有する。マスク画像FIは、対応する合成対象画像CI内のオブジェクト画素OP1を特定するための二値画像である。すなわち、マスク画像FIの各画素は、合成対象画像CI内の対応する画素がオブジェクト画素OP1であることを示すON画素と、合成対象画像CI内の対応する画素が非オブジェクト画素BP1であることを示すOFF画素と、のいずれかである。本実施例のマスク画像データには、画素ごとに透過率を規定するアルファチャンネルが用いられる。例えば、ON画素の値は、透過率が0%であることを示す値(例えば、255)であり、OFF画素の値は、透過率が100%であることを示す値(例えば、0)である。図3(B)のマスク画像FIの黒色の領域は、ON画素によって構成される領域を示し、白色の領域は、OFF画素によって構成される領域を示す。   Further, mask data is associated with the compositing target image data as attached data. The mask image FI (FIG. 3B) represented by the mask data has the same size as the template image (that is, the number of pixels in the vertical direction and the number of pixels in the horizontal direction). The mask image FI is a binary image for specifying the object pixel OP1 in the corresponding compositing target image CI. That is, each pixel of the mask image FI includes an ON pixel indicating that the corresponding pixel in the compositing target image CI is the object pixel OP1, and a corresponding pixel in the compositing target image CI is the non-object pixel BP1. One of the OFF pixels shown. In the mask image data of the present embodiment, an alpha channel that defines the transmittance for each pixel is used. For example, the value of the ON pixel is a value (for example, 255) indicating that the transmittance is 0%, and the value of the OFF pixel is a value (for example, 0) indicating that the transmittance is 100%. is there. The black area of the mask image FI in FIG. 3B indicates an area configured by ON pixels, and the white area indicates an area configured by OFF pixels.

S25では、CPU110は、ユーザの指示に基づいて、背景画像BI内に合成領域CAを決定する。合成領域CAは、合成対象画像CIが合成される領域であり、合成対象画像CIと同じサイズおよび形状を有する領域である。具体的には、CPU110は、背景画像BIと、背景画像BIに重畳された合成対象画像CIと、を含むUI画面(図示省略)を、表示部140に表示する。該UI画面において、ユーザは、表示部140の合成対象画像CIが表示された部分を押下してドラッグ処理を実行することにより、背景画像BI内において、合成対象画像CIを移動させる。そして、該UI画面において、ユーザは、背景画像BI上の所望の位置に、合成対象画像CIが配置された状態で、位置決定指示を入力する。CPU110は、位置決定指示が入力された時点で、UI画面において合成対象画像CIが配置されている背景画像BI内の領域を、合成領域CAに決定する。以下では、図3(A)に示す位置に、合成領域CAが決定された場合を例に説明を続ける。   In S25, the CPU 110 determines a synthesis area CA in the background image BI based on a user instruction. The synthesis area CA is an area where the synthesis target image CI is synthesized, and is an area having the same size and shape as the synthesis target image CI. Specifically, the CPU 110 displays a UI screen (not shown) including the background image BI and the compositing target image CI superimposed on the background image BI on the display unit 140. In the UI screen, the user moves the compositing target image CI in the background image BI by pressing a portion of the display unit 140 where the compositing target image CI is displayed and executing a drag process. Then, on the UI screen, the user inputs a position determination instruction in a state where the composition target image CI is arranged at a desired position on the background image BI. When the position determination instruction is input, the CPU 110 determines the area in the background image BI where the composition target image CI is arranged on the UI screen as the composition area CA. In the following, the description will be continued by taking as an example the case where the synthesis area CA is determined at the position shown in FIG.

S30では、CPU110は、サーバ300に合成指示を送信する。合成指示には、例えば、選択された背景画像データおよび合成対象画像データを特定するための情報(例えば、ファイル名)と、S25で決定された合成領域CAを特定するための情報(例えば、合成領域CAの左上の頂点の座標情報)と、が含まれる。   In S <b> 30, the CPU 110 transmits a composition instruction to the server 300. In the compositing instruction, for example, information (for example, file name) for specifying the selected background image data and compositing target image data, and information for specifying the compositing area CA determined in S25 (for example, compositing) Coordinate information of the upper left vertex of the area CA).

サーバ300が合成指示を受信すると、S35にて、CPU310は、合成指示に含まれる情報に従って、サーバ300の不揮発性記憶装置330内に格納されるテンプレート画像データ群334から、背景画像データを取得する。S40では、同様に、CPU310は、サーバ300の不揮発性記憶装置330内に格納されるテンプレート画像データ群334から、合成対象画像データを取得する。S45では、CPU310は、合成指示に含まれる情報に従って、背景画像BI内に、合成領域CAを決定する。S50では、CPU310は、合成処理を実行する。   When server 300 receives the compositing instruction, in S35, CPU 310 acquires background image data from template image data group 334 stored in nonvolatile storage device 330 of server 300 according to the information included in the compositing instruction. . In S <b> 40, similarly, the CPU 310 acquires composition target image data from the template image data group 334 stored in the nonvolatile storage device 330 of the server 300. In S45, CPU 310 determines a synthesis area CA in background image BI according to the information included in the synthesis instruction. In S50, the CPU 310 executes a composition process.

図4は、合成処理のフローチャートである。図5は、合成処理を説明するための図である。合成処理は、合成画像が合成領域CA内に配置された処理済背景画像を表す処理済背景画像データを生成する処理である。合成画像は、合成対象画像CI(図3(B))と、背景画像BIの合成領域CA内の部分画像(図3(A))と、が合成された画像である。   FIG. 4 is a flowchart of the synthesis process. FIG. 5 is a diagram for explaining the synthesis process. The composition process is a process for generating processed background image data representing a processed background image in which the composite image is arranged in the composition area CA. The synthesized image is an image obtained by synthesizing the synthesis target image CI (FIG. 3B) and the partial image (FIG. 3A) in the synthesis area CA of the background image BI.

S100では、CPU310は、背景画像BIを表す背景画像データから、合成領域CA内の部分画像PIを表す部分画像データを抽出する。図5(A)には、部分画像PIの一例が示されている。図5(A)の例では、部分画像PIは、背景画像BI内のオブジェクトBo2、Bo3の一部と、下地Bgの一部と、を含んでいる。   In S100, the CPU 310 extracts partial image data representing the partial image PI in the synthesis area CA from the background image data representing the background image BI. FIG. 5A shows an example of the partial image PI. In the example of FIG. 5A, the partial image PI includes a part of the objects Bo2 and Bo3 in the background image BI and a part of the background Bg.

S105では、CPU310は、部分画像データを用いて、エンボス画像EIを表すエンボス画像データを生成する。具体的には、CPU310は、部分画像PIの各画素の色値(RGB値)を、所定の変換式を用いて輝度値Yに変換することによって、部分画像PIの画素ごとの輝度を表す輝度データを生成する。輝度値Yは、RGB値(R、G、B)を用いて、例えば、輝度値Y=((0.298912×R)+(0.586611×G)+(0.114478×B))という式で算出される。輝度値Yは、例えば、0から256までのいずれかの値を取る。CPU310は、部分画像PIの輝度データに対して、エンボスフィルタFL(図4)を適用して、エンボス画像データを生成する。図4のエンボスフィルタFLを適用後の画素の値は、−(3×255)から、+(3×255)までのいずれかの値を取るが、0から256までの値に正規化される。   In S105, the CPU 310 generates embossed image data representing the embossed image EI using the partial image data. Specifically, the CPU 310 converts the color value (RGB value) of each pixel of the partial image PI into a luminance value Y using a predetermined conversion formula, thereby expressing the luminance for each pixel of the partial image PI. Generate data. The luminance value Y is calculated by using an RGB value (R, G, B), for example, by an equation of luminance value Y = ((0.298912 × R) + (0.586611 × G) + (0.114478 × B)). The luminance value Y takes any value from 0 to 256, for example. CPU 310 applies emboss filter FL (FIG. 4) to the luminance data of partial image PI to generate emboss image data. The pixel value after applying the emboss filter FL in FIG. 4 takes any value from − (3 × 255) to + (3 × 255), but is normalized to a value from 0 to 256. .

図5(B)には、エンボス画像EIの一例が示されている。エンボス画像EIでは、部分画像PIにおける単色の領域のように特徴に乏しい領域を構成する画素の値は、中間値(すなわち、128)の近傍の値となる。そして、エンボス画像EIでは、部分画像PIのエッジを構成する画素(エッジ画素とも呼ぶ)の値は、中間値から離れた値、例えば、中間値より大幅に大きな値や小さな値をとる。一般的には、エンボス画像EIにおいて、部分画像PIのエッジは、中間値より大きな値を有する画素によって構成される線と、中間値より小さな値を有する画素によって構成される線と、の二重線として抽出される。また、エンボス画像EIには、部分画像PIに含まれるテクスチャ(質感)が、浮き彫り状に強調される。換言すれば、エンボス画像EIを生成することによって、エッジ、および、テクスチャなどの部分画像PIの特徴が抽出される。ここで、テクスチャは、上述した紙のしわなどを表現した所定サイズ以下の模様である。所定サイズは、例えば、縦方向および横方向の画素数が10画素以下であり、合成対象画像CIの横方向および縦方向の画素数の1/100程度の画素数である。   FIG. 5B shows an example of the embossed image EI. In the embossed image EI, the value of a pixel constituting a region with poor features such as a single color region in the partial image PI is a value in the vicinity of the intermediate value (that is, 128). In the embossed image EI, the value of a pixel (also referred to as an edge pixel) constituting the edge of the partial image PI takes a value that is far from the intermediate value, for example, a value that is significantly larger or smaller than the intermediate value. In general, in the embossed image EI, the edge of the partial image PI is a double of a line constituted by pixels having a value larger than the intermediate value and a line constituted by pixels having a value smaller than the intermediate value. Extracted as a line. Further, in the embossed image EI, the texture (texture) included in the partial image PI is emphasized in a relief pattern. In other words, by generating the embossed image EI, features of the partial image PI such as edges and textures are extracted. Here, the texture is a pattern of a predetermined size or less expressing the above-mentioned paper wrinkles. The predetermined size is, for example, the number of pixels in the vertical direction and the horizontal direction is 10 pixels or less, and is about 1/100 of the number of pixels in the horizontal direction and the vertical direction of the compositing target image CI.

図5(B)には、エンボス画像EIの一例が示されている。エンボス画像EIには、部分画像PIの特徴が浮き彫り状に現れるが、図5(B)では、図の煩雑を避けるために、エンボス画像EIは簡略化して図示されている。このエンボス画像EIにおいて、グレーのみの領域は、部分画像PIの特徴に乏しい領域、すなわち、上述したエッジやテクスチャが比較的少ない領域を示す。また、黒の領域は、部分画像PIの特徴のある領域、上述したエッジやテクスチャが比較的多い領域を示している。このエンボス画像EIには、部分画像PIのオブジェクトBo2のエッジEg2や、オブジェクトBo3のエッジEg3が現れている。また、このエンボス画像EIには、部分画像PIの下地BgのテクスチャBeが現れている。   FIG. 5B shows an example of the embossed image EI. In the embossed image EI, the feature of the partial image PI appears in a relief shape, but in FIG. 5B, the embossed image EI is illustrated in a simplified manner in order to avoid complication of the drawing. In the embossed image EI, the gray-only region indicates a region with poor features of the partial image PI, that is, a region with relatively few edges and textures. The black area indicates a characteristic area of the partial image PI and an area having a relatively large number of edges and textures. In this embossed image EI, an edge Eg2 of the object Bo2 of the partial image PI and an edge Eg3 of the object Bo3 appear. Further, the texture Be of the base Bg of the partial image PI appears in the embossed image EI.

S110では、CPU310は、エンボス画像EIのヒストグラムを生成する。ヒストグラムは、エンボス画像EI内の各画素を、画素の値に応じて、複数個のクラスに分類したデータである。本実施例では、本実施例では、256階調の画素の値のそれぞれを、1個のクラスとして、ヒストグラムが生成される。   In S110, the CPU 310 generates a histogram of the embossed image EI. The histogram is data in which each pixel in the embossed image EI is classified into a plurality of classes according to the pixel value. In the present embodiment, in this embodiment, a histogram is generated with each of 256 gradation pixel values as one class.

図6は、エンボス画像EIのヒストグラムの一例を示す図である。中央部のピークPcは、下地Bgや、オブジェクトBo2、Bo3のエッジ以外の部分に対応している。中央部から離れたピーク(例えば、Ps1、Ps2)は、エッジに対応している。下地Bgが単色のベタ塗りに近いほど、ピークPcは、高く細くなる。下地Bgが模様などのテクスチャを有しており、単色のベタ塗りではない場合には、ピークPcは、低く太くなる。   FIG. 6 is a diagram illustrating an example of a histogram of the embossed image EI. The peak Pc at the center corresponds to a portion other than the base Bg and the edges of the objects Bo2 and Bo3. The peaks (for example, Ps1 and Ps2) far from the center correspond to the edges. The closer the base Bg is to solid monochrome coating, the higher the peak Pc becomes. When the base Bg has a texture such as a pattern and is not solid black, the peak Pc is low and thick.

S115では、CPU310は、背景残存率BRを決定する。背景残存率BRは、上述したように、背景画像データに付属データとして対応付けられている。CPU310は、S35で取得された背景画像データに対応付けられている背景残存率BR(単位は%)を、本合成処理で用いる背景残存率BRとして決定する。   In S115, the CPU 310 determines the background remaining rate BR. As described above, the background remaining rate BR is associated with background image data as attached data. The CPU 310 determines the background remaining rate BR (unit:%) associated with the background image data acquired in S35 as the background remaining rate BR used in this synthesis process.

S120では、CPU310は、二値化閾値TH1を決定する。具体的には、CPU310は、エンボス画像EIの全画素数AR、すなわち、部分画像PIの全画素数ARを算出する。そして、CPU310は、全画素数ARに対する二値化閾値TH1より大きな値を有する画素の割合が、背景残存率BR以下となる最小の画素の値を、二値化閾値TH1として決定する。換言すれば、画素の値が大きい順に、AR個の画素を並べた場合に、{AR×(BR/100)}番目に位置する画素が決定される。そして、決定された画素の値が、二値化閾値TH1に決定される。   In S120, the CPU 310 determines a binarization threshold TH1. Specifically, the CPU 310 calculates the total pixel number AR of the embossed image EI, that is, the total pixel number AR of the partial image PI. Then, the CPU 310 determines, as the binarization threshold TH1, the minimum pixel value at which the ratio of the pixels having a value larger than the binarization threshold TH1 with respect to the total number of pixels AR is equal to or less than the background residual ratio BR. In other words, when AR pixels are arranged in descending order of the pixel value, the {AR × (BR / 100)}-th pixel is determined. Then, the determined pixel value is determined as the binarization threshold TH1.

S125では、CPU310は、領域区分画像AIを表す領域区分画像データを生成する。領域区分画像AIは、合成領域CAを、ON画素によって構成されるON領域とOFF画素によって構成されるOFF領域とに区分する二値画像である。領域区分画像AIにおいて、ON領域に対するOFF領域の画素数の比率(面積比とも言うことができる)は、背景残存率BRとほぼ等しくなる。   In S125, the CPU 310 generates area segment image data representing the area segment image AI. The area division image AI is a binary image that divides the synthesis area CA into an ON area constituted by ON pixels and an OFF area constituted by OFF pixels. In the area segmented image AI, the ratio of the number of pixels in the OFF area to the ON area (which can also be referred to as an area ratio) is substantially equal to the background remaining rate BR.

具体的には、CPU310は、エンボス画像EIの各画素の値を、二値化閾値TH1を用いて二値化することによって、領域区分画像データを生成する。本ステップの二値化では、エンボス画像EI内の注目画素の値が二値化閾値TH1以下である場合には、当該注目画素の値は、ON領域を構成するON画素に決定される。また、エンボス画像EI内の注目画素の値が二値化閾値TH1より大きい場合には、当該注目画素の値は、OFF領域を構成するOFF画素に決定される。   Specifically, the CPU 310 generates region segmented image data by binarizing the value of each pixel of the embossed image EI using the binarization threshold TH1. In the binarization in this step, when the value of the pixel of interest in the embossed image EI is equal to or less than the binarization threshold TH1, the value of the pixel of interest is determined as the ON pixel that constitutes the ON region. When the value of the pixel of interest in the embossed image EI is larger than the binarization threshold TH1, the value of the pixel of interest is determined as an OFF pixel that constitutes an OFF region.

図5(C)には、領域区分画像AIの一例が示されている。図5(C)の領域区分画像AIの黒色の領域は、ON領域を示し、白色の領域は、OFF領域を示す。図5(C)に示すように、領域区分画像AIのOFF領域は、部分画像PIのエッジに対応する領域を含んでいる。上述したピークPs1に属する画素がOFF画素に分類されるからである。また、領域区分画像AIにおいて、部分画像PIの下地Bgに対応する領域には、下地Bgのテクスチャに応じて、ON領域とOFF領域とが混在している。上述したピークPcの一部がON画素に、他の一部がOFF画素に分類されるからである。   FIG. 5C shows an example of the area segment image AI. The black area of the area segment image AI in FIG. 5C indicates the ON area, and the white area indicates the OFF area. As shown in FIG. 5C, the OFF area of the area segment image AI includes an area corresponding to the edge of the partial image PI. This is because the pixels belonging to the above-described peak Ps1 are classified as OFF pixels. In the area division image AI, an ON area and an OFF area are mixed in the area corresponding to the background Bg of the partial image PI according to the texture of the background Bg. This is because a part of the above-described peak Pc is classified as an ON pixel and the other part is classified as an OFF pixel.

S130〜S150では、背景画像BI(図3(A))内の合成領域CAに、合成対象画像CI(図3(B))を合成する処理が実行される。先ず、S130では、CPU310は、背景画像BIの合成領域CA内の複数個の画素から1個の注目画素を選択する。S135では、CPU310は、注目画素に対応するマスク画像FI(図3(B))の画素が、ON画素であるか否かを判断する。マスク画像FIの対応画素は、背景画像BIの合成領域CAにマスク画像FIを配置した場合に、注目画素と重なるマスク画像FIの画素である。   In S130 to S150, a process of synthesizing the synthesis target image CI (FIG. 3B) with the synthesis area CA in the background image BI (FIG. 3A) is executed. First, in S130, the CPU 310 selects one target pixel from a plurality of pixels in the synthesis area CA of the background image BI. In S135, the CPU 310 determines whether or not the pixel of the mask image FI (FIG. 3B) corresponding to the target pixel is an ON pixel. The corresponding pixel of the mask image FI is a pixel of the mask image FI that overlaps the target pixel when the mask image FI is arranged in the synthesis area CA of the background image BI.

マスク画像FIの対応画素がON画素である場合には(S135:YES)、S140にて、CPU310は、注目画素に対応する領域区分画像AI(図5(C))の画素が、ON画素であるか否かを判断する。領域区分画像AIの対応画素は、背景画像BIの合成領域CAに領域区分画像AIを配置した場合に、注目画素と重なる領域区分画像AIの画素である。   When the corresponding pixel of the mask image FI is an ON pixel (S135: YES), in S140, the CPU 310 determines that the pixel of the area segment image AI (FIG. 5C) corresponding to the target pixel is an ON pixel. Judge whether there is. The corresponding pixels of the area segment image AI are pixels of the area segment image AI that overlap the target pixel when the area segment image AI is arranged in the synthesis area CA of the background image BI.

領域区分画像AIの対応画素がON画素である場合には(S140:YES)、S145にて、CPU310は、注目画素の値(RGB値)を、注目画素に対応する合成対象画像CIの画素の値(RGB値)に置換する。合成対象画像CIの対応画素は、背景画像BIの合成領域CAに合成対象画像CIを配置した場合に、注目画素と重なる合成対象画像CIの画素である。   When the corresponding pixel of the area segment image AI is an ON pixel (S140: YES), in S145, the CPU 310 sets the value of the target pixel (RGB value) to the pixel of the compositing target image CI corresponding to the target pixel. Replace with value (RGB value). The corresponding pixel of the synthesis target image CI is a pixel of the synthesis target image CI that overlaps the target pixel when the synthesis target image CI is arranged in the synthesis area CA of the background image BI.

マスク画像FIの対応画素がOFF画素である場合(S135:NO)、または、領域区分画像AIの対応画素がOFF画素である場合には(S140:NO)、CPU310は、S145を実行することなく、S150に処理を進める。   When the corresponding pixel of the mask image FI is an OFF pixel (S135: NO), or when the corresponding pixel of the region segmented image AI is an OFF pixel (S140: NO), the CPU 310 does not execute S145. , The process proceeds to S150.

S150では、CPU310は、背景画像BIの合成領域CA内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S150:NO)、CPU310は、S130に戻って、未処理の画素を次の注目画素として選択する。全ての画素が処理された場合には(S150:YES)、CPU310は、合成処理を終了する。合成処理によって、部分画像PIと合成対象画像CIとが合成された合成画像CMIが、合成領域CAに配置された処理済背景画像CBIを表す処理済背景画像データが生成される。   In S150, the CPU 310 determines whether or not all the pixels in the synthesis area CA of the background image BI have been processed as the target pixel. If there is an unprocessed pixel (S150: NO), the CPU 310 returns to S130 and selects the unprocessed pixel as the next pixel of interest. When all the pixels have been processed (S150: YES), the CPU 310 ends the composition process. As a result of the synthesis process, processed background image data representing the processed background image CBI in which the synthesized image CMI obtained by synthesizing the partial image PI and the synthesis target image CI is arranged in the synthesis area CA is generated.

図7は、処理済背景画像CBIと、比較例の画像と、の一例を示す図である。図7(A)の処理済背景画像CBIの合成領域CAには、合成画像CMIが配置されていることが解る。また、図5(D)には、合成画像CMIのうち、合成対象画像CI(図3(A))の対応画素の値に置換された画素(置換画素とも呼ぶ)のみによって表される画像(置換画像とも呼ぶ)RIが示されている。   FIG. 7 is a diagram illustrating an example of the processed background image CBI and the image of the comparative example. It can be seen that the composite image CMI is arranged in the composite area CA of the processed background image CBI in FIG. FIG. 5D shows an image (only a pixel (also referred to as a replacement pixel) that is replaced with the value of the corresponding pixel in the synthesis target image CI (FIG. 3A) in the synthesis image CMI. RI, also referred to as a replacement image) is shown.

図5(D)から解るように、背景画像BIの合成領域CA内の全ての画素が、合成対象画像CIの画素に置換されるわけではない。置換画素は、図4の合成処理から解るように、合成領域CA内の全ての画素のうち、マスク画像FIの対応画素がONであり、かつ、領域区分画像AIがONである画素である。換言すれば、置換画素は、合成対象画像CIの対応画素がオブジェクト画素OP1であり、かつ、領域区分画像AIの対応画素がONである画素である。非置換画素は、マスク画像FIの対応画素と領域区分画像AIの対応画素とのうちの少なくとも一方がOFFである画素である。合成領域CAのうち、非置換画素によって構成される領域を、第1種の領域とも呼び、合成領域CAのうち、置換画素によって構成される領域を、第2種の領域とも呼ぶ。上述したように、領域区分画像AIのON領域に対するOFF領域の画素数の比率は、背景残存率BRに基づいて決定されている。そして、領域区分画像AIと、予め定められたマスク画像FIと、に基づいて、第1種の領域と第2種の領域が決定されるから、第2種の領域に対する第1種の領域の画素数の比率は、背景残存率BRに基づいて決定されている、と言うことができる。   As can be seen from FIG. 5D, all the pixels in the synthesis area CA of the background image BI are not replaced with the pixels of the synthesis target image CI. As will be understood from the synthesis process of FIG. 4, the replacement pixel is a pixel in which the corresponding pixel of the mask image FI is ON and the area segment image AI is ON among all the pixels in the synthesis area CA. In other words, the replacement pixel is a pixel in which the corresponding pixel of the compositing target image CI is the object pixel OP1 and the corresponding pixel of the region segmented image AI is ON. The non-replacement pixel is a pixel in which at least one of the corresponding pixel of the mask image FI and the corresponding pixel of the region segmented image AI is OFF. Of the synthesis area CA, an area constituted by non-replacement pixels is also referred to as a first type area, and among the synthesis area CA, an area constituted by substitution pixels is also referred to as a second type area. As described above, the ratio of the number of pixels in the OFF region to the ON region of the region segmented image AI is determined based on the background remaining rate BR. Then, since the first type region and the second type region are determined based on the region division image AI and the predetermined mask image FI, the first type region with respect to the second type region is determined. It can be said that the ratio of the number of pixels is determined based on the background residual ratio BR.

図5(D)の置換画像RIにおいて、グレーの領域OPは、第2種の領域を示し、白の領域VP1〜VP3は、第1種の領域を示している。第1種の領域は、部分画像PIのエッジに対応する領域VP1と、部分画像PIの下地Bgのテクスチャに応じて生じる領域VP2と、マスク画像FIのOFF画素に対応する領域VP3と、を含んでいる。すなわち、部分画像PI内の複数個の画素のうち、合成対象画像CIのオブジェクト画素OP1に対応する複数個の画素は、エッジを構成する画素と、テクスチャ(所定サイズ以下の模様)を構成する画素と、それ以外の画素(主としてベタ塗りの単色領域の画素)と、を含んでいる。エッジを構成する画素は、ほぼ全てが非置換画素に分類される。所定サイズ以下の模様を構成する画素は、置換画素と非置換画素のいずれにも分類される。それ以外の画素は、置換画素に分類される。換言すれば、これらの画素のうち、第1種の領域に分類される割合(すなわち、合成画像において、画素値が維持される割合)は、エッジを構成する画素、所定サイズ以下の模様を構成する画素、それ以外の画素の順に高い。   In the replacement image RI of FIG. 5D, the gray area OP indicates the second type area, and the white areas VP1 to VP3 indicate the first type area. The first type region includes a region VP1 corresponding to the edge of the partial image PI, a region VP2 generated according to the texture of the background Bg of the partial image PI, and a region VP3 corresponding to the OFF pixel of the mask image FI. It is out. That is, among the plurality of pixels in the partial image PI, the plurality of pixels corresponding to the object pixel OP1 of the synthesis target image CI are pixels that form an edge and pixels that form a texture (pattern of a predetermined size or less). And other pixels (mainly pixels in a solid monochrome region). Almost all the pixels constituting the edge are classified as non-replacement pixels. Pixels that make up a pattern of a predetermined size or less are classified as either replacement pixels or non-replacement pixels. Other pixels are classified as replacement pixels. In other words, among these pixels, the proportion classified into the first type region (that is, the proportion in which the pixel value is maintained in the composite image) constitutes pixels constituting the edge, a pattern having a predetermined size or less. Higher in the order of pixels to be processed and other pixels.

処理済背景画像データが生成されると、図2のS55では、CPU310は、生成された処理済背景画像データを、ネットワーク500を介して、端末装置100に送信する。端末装置100が、サーバ300から処理済背景画像データを受信すると、S60では、CPU110は、印刷処理を実行する。具体的には、CPU110は、処理済背景画像データを用いて印刷データを生成し、生成した印刷データをプリンタ200に供給する。プリンタ200は、受信した印刷データに従って、処理済背景画像CBIを印刷する。例えば、図7(A)に示す処理済背景画像CBIがはがきに印刷される。   When the processed background image data is generated, the CPU 310 transmits the generated processed background image data to the terminal device 100 via the network 500 in S55 of FIG. When the terminal device 100 receives the processed background image data from the server 300, in S60, the CPU 110 executes a printing process. Specifically, the CPU 110 generates print data using the processed background image data, and supplies the generated print data to the printer 200. The printer 200 prints the processed background image CBI according to the received print data. For example, the processed background image CBI shown in FIG. 7A is printed on a postcard.

以上説明した第1実施例によれば、背景画像BIのうちの合成領域CA内の部分画像PIの特徴に基づいて、合成領域CAは第1種の領域と第2種の領域とに区分される。より具体的には、部分画像PIのエッジやテクスチャなどの特徴を抽出するために、エンボス画像EI(図5(B))が生成され(図4のS105)、エンボス画像EIを二値化することによって、領域区分画像AI(図5(C))が生成される(図4のS125)。そして、領域区分画像AIと、マスク画像FIと、に基づいて、第1種の領域と第2種の領域とが決定される(図4のS135、S140)。この結果、合成領域CAは第1種の領域と第2種の領域とに区分される。   According to the first embodiment described above, the composite area CA is divided into the first type area and the second type area based on the characteristics of the partial image PI in the composite area CA of the background image BI. The More specifically, in order to extract features such as edges and textures of the partial image PI, an embossed image EI (FIG. 5B) is generated (S105 in FIG. 4), and the embossed image EI is binarized. As a result, the area segment image AI (FIG. 5C) is generated (S125 in FIG. 4). Then, based on the area division image AI and the mask image FI, the first type area and the second type area are determined (S135 and S140 in FIG. 4). As a result, the synthesis area CA is divided into a first type area and a second type area.

そして、合成領域CA内の第1種の領域内の画素の値は、背景画像BI(すなわち、部分画像PI)の画素の値に維持され、合成領域CA内の第2種の領域内の画素の値は、合成対象画像CIの対応画素の値に置換されることによって、合成画像CMIが生成される(図4のS145)。すなわち、第1種の領域内の画素の値と第2種の領域内の画素の値とを互いに異なる処理によって決定される。そして、合成画像CMIが合成領域CAに配置された処理済背景画像CBIを表す処理済背景画像データが出力される(図2のS55)。   The value of the pixel in the first type area in the synthesis area CA is maintained at the value of the pixel in the background image BI (that is, the partial image PI), and the pixel in the second type area in the synthesis area CA. Is replaced with the value of the corresponding pixel in the compositing target image CI, thereby generating a composite image CMI (S145 in FIG. 4). That is, the value of the pixel in the first type region and the value of the pixel in the second type region are determined by different processes. Then, processed background image data representing the processed background image CBI in which the composite image CMI is arranged in the composite area CA is output (S55 in FIG. 2).

この結果、背景画像BIの部分画像PIの特徴と合成対象画像CIの特徴とを含む適切な合成画像CMIが生成される。   As a result, an appropriate composite image CMI including the characteristics of the partial image PI of the background image BI and the characteristics of the compositing target image CI is generated.

より具体的には、CPU310は、エンボス画像EIを生成することによって、部分画像PI内のエッジ(例えば、図5(B)のEg2、Eg)を抽出する。そして、CPU310は、エンボス画像EIを二値化して領域区分画像AIを生成することによって、抽出されたエッジの領域を、第1種の領域に決定する(図5(C))。   More specifically, the CPU 310 extracts edges (for example, Eg2 and Eg in FIG. 5B) in the partial image PI by generating the embossed image EI. Then, the CPU 310 binarizes the embossed image EI to generate an area segmented image AI, thereby determining the extracted edge area as the first type area (FIG. 5C).

この結果、背景画像BIの部分画像PI内のエッジが合成画像CMIから失われることを抑制することができる。したがって、合成画像CMI、ひいては、処理済背景画像CBIの見栄えが低下することを抑制することができる。   As a result, it is possible to prevent the edge in the partial image PI of the background image BI from being lost from the composite image CMI. Therefore, it is possible to suppress the appearance of the composite image CMI, and thus the processed background image CBI, from being deteriorated.

図7(B)には、比較例の画像SBIの一例が示されている。この画像SBIは、背景画像BIの合成領域CAに合成対象画像CIを重ねた場合に、合成対象画像CIのオブジェクト画素OP1と重なる合成領域CAの画素の値を、当該オブジェクト画素の値に置換することによって、生成される画像である。この画像SBIの合成領域CA内の画像SMI(単純合成画像とも呼ぶ)では、合成対象画像CIのオブジェクト(枠や文字)が合成されたことによって、部分画像PIのエッジが失われていることが解る。これに対して、本実施例の処理済背景画像CBIの合成画像CMIでは、部分画像PIのエッジが失われていないことが解る。   FIG. 7B shows an example of the image SBI of the comparative example. In the image SBI, when the composition target image CI is superimposed on the composition area CA of the background image BI, the value of the pixel in the composition area CA that overlaps the object pixel OP1 of the composition target image CI is replaced with the value of the object pixel. Thus, the image is generated. In the image SMI (also referred to as a simple synthesized image) in the synthesis area CA of the image SBI, the edge of the partial image PI may be lost due to the synthesis of the object (frame or character) of the synthesis target image CI. I understand. In contrast, it can be seen that the edge of the partial image PI is not lost in the composite image CMI of the processed background image CBI of the present embodiment.

また、CPU310は、エンボス画像EIを生成することによって、部分画像PI内に示されるテクスチャ(例えば、下地Bgのテクスチャ)を抽出する。すなわち、部分画像PIに含まれる所定サイズ以下の模様が抽出される。そして、CPU310は、エンボス画像EIを二値化して領域区分画像AIを生成することによって、抽出された所定サイズ以下の模様に応じて第1種の領域と第2種の領域とが決定される。   In addition, the CPU 310 extracts the texture (for example, the texture of the background Bg) shown in the partial image PI by generating the embossed image EI. That is, a pattern of a predetermined size or less included in the partial image PI is extracted. Then, the CPU 310 binarizes the embossed image EI to generate an area segmented image AI, whereby the first type area and the second type area are determined according to the extracted pattern of a predetermined size or less. .

この結果、部分画像PI内に示されるテクスチャが合成画像CMIから失われることを抑制することができる。したがって、合成画像CMI、ひいては、処理済背景画像CBIの見栄えが低下することを抑制することができる。   As a result, it is possible to suppress the loss of the texture shown in the partial image PI from the composite image CMI. Therefore, it is possible to suppress the appearance of the composite image CMI, and thus the processed background image CBI, from being deteriorated.

なお、図4のS105〜S125までの処理は、部分画像PI内の画素を、置換画素と、非置換画素とに、分類する分類処理である、と言うことができる。そして、CPU110は、置換画素によって構成される第1種の領域内の画素の値を部分画像PIの画素の値に決定し、非置換画素によって構成される第2種の領域内の画素の値を合成対象画像CIの画素の値に決定することによって、部分画像PIと合成対象画像CIとを合成している(図4のS135〜S145)。この結果、部分画像PIと合成対象画像CIとを適切に合成して、部分画像PIの特徴と合成対象画像CIの特徴とを含む適切な合成画像を生成することができる。   It can be said that the processes from S105 to S125 in FIG. 4 are classification processes for classifying the pixels in the partial image PI into replacement pixels and non-replacement pixels. Then, the CPU 110 determines the value of the pixel in the first type region configured by the replacement pixel as the pixel value of the partial image PI, and the value of the pixel in the second type region configured by the non-replacement pixel. Is determined as the pixel value of the compositing target image CI, thereby synthesizing the partial image PI and the compositing target image CI (S135 to S145 in FIG. 4). As a result, it is possible to appropriately synthesize the partial image PI and the synthesis target image CI and generate an appropriate synthesized image including the features of the partial image PI and the characteristics of the synthesis target image CI.

そして、この分類処理には、エンボスフィルタが用いられている。これにより、部分画像PI内のエッジやテクスチャを適切に抽出することができるので、部分画像PI内のエッジやテクスチャに応じて、第1種の領域と第2種の領域を適切に決定することができる。したがって、部分画像PI内のエッジやテクスチャが合成画像CMIから失われることを適切に抑制することができる。   An embossing filter is used for this classification process. Thereby, since the edge and the texture in the partial image PI can be extracted appropriately, the first type region and the second type region are appropriately determined according to the edge and the texture in the partial image PI. Can do. Accordingly, it is possible to appropriately suppress the loss of the edge and texture in the partial image PI from the composite image CMI.

また、図2のS15にて、合成処理に用いられる背景画像BIを表す背景画像データは、テンプレート画像データ群334に含まれる複数個のテンプレート画像データの中から選択される。そして、これらの背景画像データには、付属データとして、背景残存率BRが対応付けられている(図3(A))。そして、上述したように、背景残存率BRに基づいて、第2種の領域に対する第1種の領域の画素数の比率が決定される。換言すれば、背景画像データとして、第1のテンプレート画像データが選択された場合には、第2種の領域に対する第1種の領域の比率は、第1の比率に決定され、第2のテンプレート画像データが選択された場合には、当該比率は、第2の比率に決定される。この結果、選択されるテンプレート画像データに応じて、適切な合成画像CMIを生成することができる。   In S15 of FIG. 2, the background image data representing the background image BI used for the composition process is selected from a plurality of template image data included in the template image data group 334. These background image data are associated with a background remaining rate BR as attached data (FIG. 3A). Then, as described above, the ratio of the number of pixels of the first type region to the second type region is determined based on the background remaining rate BR. In other words, when the first template image data is selected as the background image data, the ratio of the first type area to the second type area is determined to be the first ratio, and the second template When image data is selected, the ratio is determined as the second ratio. As a result, an appropriate composite image CMI can be generated according to the selected template image data.

例えば、紙のしわ状のテクスチャを含む下地を含むテンプレート画像を表すテンプレート画像データには、比較的大きい値の背景残存率BR(例えば、40%)が対応付けられている。この結果、当該テンプレート画像データが背景画像データとして選択された場合には、合成画像CMIにおいて、合成画像CMIにおける第1種の領域の比率が高くなるので、合成画像CMIは、しわのある紙に印鑑を押した場合のように、かすれた印影を表現する画像となる。また、紙のしわ状のテクスチャを含まず、ベタ塗りの下地を含むテンプレート画像を表すテンプレート画像データには、比較的低い値の背景残存率BR(例えば、10%)が対応付けられている。この結果、当該テンプレート画像データが背景画像データとして選択された場合には、合成画像CMIにおいて、合成画像CMIにおける第1種の領域の比率が低くなるので、合成画像CMIは、しわのない紙に印鑑を押した場合のように、かすれのないくっきりした印影を表現する画像となる。   For example, a relatively large value of the background remaining rate BR (for example, 40%) is associated with template image data representing a template image including a background including a paper wrinkled texture. As a result, when the template image data is selected as the background image data, the ratio of the first type area in the composite image CMI is high in the composite image CMI, so the composite image CMI is printed on wrinkled paper. It becomes an image that expresses a faint impression as when a seal stamp is pressed. Further, a relatively low value of the background remaining rate BR (for example, 10%) is associated with template image data representing a template image that does not include a paper wrinkle-like texture and includes a solid background. As a result, when the template image data is selected as background image data, the ratio of the first type region in the composite image CMI is low in the composite image CMI, so the composite image CMI is printed on paper without wrinkles. As in the case of pressing a seal, the image represents a clear imprint with no blur.

B.第2実施例
上記第1実施例では、背景残存率BRは、背景画像データに付属データとして対応付けられているが、背景残存率BRは、部分画像PIの特徴に応じて決定されても良い。図8は、第2実施例における背景残存率BRの決定のフローチャートである。図9は、第2実施例の背景残存率BRを決定するためのテーブルの説明図である。
B. Second Embodiment In the first embodiment, the background remaining rate BR is associated with background image data as attached data, but the background remaining rate BR may be determined according to the characteristics of the partial image PI. . FIG. 8 is a flowchart for determining the background remaining rate BR in the second embodiment. FIG. 9 is an explanatory diagram of a table for determining the background remaining rate BR of the second embodiment.

第2実施例では、図4のS115の背景残存率BRの決定は、図9のフローチャートに処理によって行われる。S200では、CPU310は、エンボス画像EIの画素の値の標準偏差σを算出する。標準偏差σは、以下の式(1)を用いて算出される。式(1)におけるVaveは、エンボス画像EIの全ての画素の値の平均値である。また、式(1)におけるnは、エンボス画像EIの画素の総数である。そして、式(1)におけるViは、エンボス画像EIのn個の画素のそれぞれの値である(1≦i≦n)。部分画像PIの画素の値のばらつきが大きいほど、エンボス画像EIの各画素の値のばらつきも大きくなるので、エンボス画像EIの各画素の値のばらつきを示す特徴量である標準偏差σは、部分画像PIの画素の値のばらつきを示す特徴量とも言うことができる。   In the second embodiment, the determination of the background remaining rate BR in S115 of FIG. 4 is performed by processing in the flowchart of FIG. In S200, the CPU 310 calculates the standard deviation σ of the pixel value of the embossed image EI. The standard deviation σ is calculated using the following formula (1). Vave in Expression (1) is an average value of the values of all the pixels of the embossed image EI. Further, n in the formula (1) is the total number of pixels of the embossed image EI. Vi in Expression (1) is a value of each of n pixels of the embossed image EI (1 ≦ i ≦ n). As the variation in the pixel value of the partial image PI increases, the variation in the value of each pixel in the embossed image EI also increases. Therefore, the standard deviation σ, which is a feature amount indicating the variation in the value of each pixel in the embossed image EI, It can also be said to be a feature amount indicating variation in pixel values of the image PI.

S210では、CPU310は、標準偏差σに基づいて、背景残存率BRを決定する。具体的には、CPU310は、図9に示す標準偏差σと背景残存率BRとの対応関係を規定したテーブルを参照して、算出された標準偏差σに対応する背景残存率BRを決定する。このテーブルは、コンピュータプログラム332に予め組み込まれている。図9に示すように、標準偏差σが0である場合に、背景残存率BRは、最小値BRminに決定され、標準偏差σが特定値σs以上である場合に、背景残存率BRは、最大値BRmaxに決定される。そして、0≦σ≦σsの範囲では、標準偏差σが大きいほど、背景残存率BRは直線的に大きくなるように、決定される。BRmin、BRmax、σsの値は、例えば、ばらつきが互いに異なる背景画像BIの複数個のサンプルと、合成対象画像CIサンプルと、を用いた処理済背景画像CBIのサンプルを、背景残存率BRを変更しながら生成し、生成された処理済背景画像CBIのサンプルの見栄えを評価することによって、実験的に決定される。BRminは、例えば、0%であり、BRmaxは、例えば、60%である。   In S210, the CPU 310 determines the background remaining rate BR based on the standard deviation σ. Specifically, the CPU 310 refers to a table that defines the correspondence relationship between the standard deviation σ and the background remaining rate BR shown in FIG. 9, and determines the background remaining rate BR corresponding to the calculated standard deviation σ. This table is preinstalled in the computer program 332. As shown in FIG. 9, when the standard deviation σ is 0, the background remaining rate BR is determined to be the minimum value BRmin, and when the standard deviation σ is greater than or equal to the specific value σs, the background remaining rate BR is the maximum The value BRmax is determined. In the range of 0 ≦ σ ≦ σs, the background remaining rate BR is determined so as to increase linearly as the standard deviation σ increases. The values of BRmin, BRmax, and σs are, for example, the background residual ratio BR is changed for a sample of the processed background image CBI that uses a plurality of samples of the background image BI that are different from each other and the synthesis target image CI sample. And experimentally determined by evaluating the appearance of the generated processed background image CBI sample. BRmin is, for example, 0%, and BRmax is, for example, 60%.

以上説明した第2実施例によれば、部分画像PIの特徴に応じて、背景残存率BRが決定される。すなわち、部分画像PIの特徴に応じて、合成領域CAにおける第2種の領域に対する第1種の領域の比率が決定される。この結果、部分画像PIの特徴に応じて、部分画像PIの特徴を合成画像CMIに残す程度を適切に決定することができる。   According to the second embodiment described above, the background remaining rate BR is determined according to the characteristics of the partial image PI. That is, the ratio of the first type region to the second type region in the synthesis region CA is determined according to the characteristics of the partial image PI. As a result, according to the feature of the partial image PI, the extent to which the feature of the partial image PI remains in the composite image CMI can be appropriately determined.

具体的には、部分画像PIの画素の値のばらつきを示す特徴量である標準偏差σが大きいほど、背景残存率BRが大きくされる(図9)。したがって、標準偏差σが大きいほど第2種の領域に対する第1種の領域の比率が大きくされる。すなわち、合成画像CMIに部分画像PIの特徴が残される程度が大きくなる。一般的に、部分画像PIの画素の値のばらつきが大きいほど、合成画像CMIにおいて部分画像PIの特徴を残す程度を大きくすることが好ましいと考えられる。部分画像PIの画素の値のばらつきが大きいほど、部分画像PIに多くのエッジが含まれる可能性が高い。また、部分画像PIの画素の値のばらつきが大きいほど、部分画像PIに特徴的なテクスチャが含まれる可能性が高い。従って、部分画像PIの画素の値のばらつきが大きいほど、合成画像CMIにおいて、エッジやテクスチャなどの部分画像PIの特徴を残すことで合成画像CMIの見栄えを向上できる可能性が高いからである。また、部分画像PIの画素の値のばらつきが比較的低い場合には、例えば、部分画像PIがベタ塗りの単色の領域である場合には、合成画像CMIにおいて、部分画像PIの特徴を残す意義が比較的低い。部分画像PIの特徴を残す程度を過度に大きくすると、合成画像CMIにおいて、逆に、合成対象画像CIの特徴が損なわれる可能性があるので、部分画像PIの画素の値のばらつきが比較的低い場合には、部分画像PIの特徴を残す程度を比較的低くすることが好ましいと考えられる。以上の説明から解るように、第2実施例によれば、部分画像PIの画素の値のばらつきに応じて、より好ましい合成画像CMIを生成することができる。   Specifically, the background residual ratio BR is increased as the standard deviation σ, which is a feature amount indicating variations in the pixel values of the partial image PI, is increased (FIG. 9). Therefore, the larger the standard deviation σ, the larger the ratio of the first type region to the second type region. That is, the extent to which the characteristics of the partial image PI are left in the composite image CMI is increased. In general, it is considered that it is preferable to increase the degree of remaining characteristics of the partial image PI in the composite image CMI as the variation in the pixel values of the partial image PI increases. The greater the variation in the pixel values of the partial image PI, the higher the possibility that the partial image PI contains more edges. In addition, the larger the variation in the pixel values of the partial image PI, the higher the possibility that a characteristic texture is included in the partial image PI. Therefore, the greater the variation in the pixel values of the partial image PI, the higher the possibility that the appearance of the composite image CMI can be improved by leaving the features of the partial image PI such as edges and textures in the composite image CMI. In addition, when the variation in the pixel values of the partial image PI is relatively low, for example, when the partial image PI is a solid-colored single color area, the significance of leaving the characteristics of the partial image PI in the composite image CMI is significant. Is relatively low. If the level of the characteristic of the partial image PI is excessively increased, the characteristic of the synthesis target image CI may be impaired in the synthesized image CMI. Therefore, the variation in the pixel values of the partial image PI is relatively low. In such a case, it may be preferable to make the degree of leaving the characteristics of the partial image PI relatively low. As can be seen from the above description, according to the second embodiment, a more preferable composite image CMI can be generated in accordance with variations in the pixel values of the partial image PI.

なお、第2実施例では、部分画像PIの画素の値のばらつきを示す特徴量として、エンボス画像EIの画素の値の標準偏差σが用いられているが、これに代えて、部分画像PIの画素の値の標準偏差σ、分散σ、平均エッジ量などが用いられても良い。 In the second embodiment, the standard deviation σ of the pixel value of the embossed image EI is used as the feature amount indicating the variation of the pixel value of the partial image PI. A standard deviation σ of pixel values, a variance σ 2 , an average edge amount, and the like may be used.

C.第3実施例
第1実施例では、背景画像データには、背景残存率BRが、付属データとして対応付けられている。これに代えて、第3実施例では、背景画像データには、単純合成処理を行うか、特殊合成処理を行うか、を示す処理指定情報が、付属データとして対応付けられている。例えば、背景画像BI内の下地やオブジェクトが、細かいノイズやしわなどの特定のテクスチャ(質感)を有する画像である場合には、特殊合成処理を行うことを示す処理指定情報が、当該背景画像BIを表す背景画像データに対応付けられる。また、背景画像BI内の下地BgやオブジェクトBo1〜Bo3が、単純なベタ塗りの画像である場合には、単純合成処理を行うことを示す処理指定情報が、当該背景画像BIを表す背景画像データに対応付けられる。
C. Third Example In the first example, the background remaining rate BR is associated with the background image data as attached data. Instead, in the third embodiment, the background image data is associated with attached data as process designation information indicating whether simple synthesis processing or special synthesis processing is performed. For example, when the background or object in the background image BI is an image having a specific texture (texture) such as fine noise or wrinkles, the processing designation information indicating that the special composition processing is performed includes the background image BI. Is associated with the background image data. When the background Bg and the objects Bo1 to Bo3 in the background image BI are simple solid images, the process designation information indicating that simple composition processing is performed is background image data representing the background image BI. Is associated with.

図10は、第3実施例の合成処理のフローチャートである。S300では、CPU310は、合成処理に用いるべき背景画像BIが、特殊合成処理の対象であるか否かを判断する。具体的には、CPU310は、合成処理に用いるべき背景画像BIを表す背景画像データに対応付けられている処理指定情報を参照する。処理指定情報が特殊合成処理を行うことを示す場合には、CPU310は、背景画像BIが特殊合成処理の対象であると判断する。処理指定情報が単純合成処理を行うことを示す場合には、CPU310は、背景画像BIが特殊合成処理の対象でないと判断する。   FIG. 10 is a flowchart of the synthesis process according to the third embodiment. In S300, the CPU 310 determines whether or not the background image BI to be used for the composition process is a target for the special composition process. Specifically, the CPU 310 refers to the process designation information associated with the background image data representing the background image BI to be used for the synthesis process. When the process designation information indicates that the special composition process is to be performed, the CPU 310 determines that the background image BI is the target of the special composition process. When the process designation information indicates that simple composition processing is to be performed, the CPU 310 determines that the background image BI is not a target for special composition processing.

背景画像BIが特殊合成処理の対象である場合には(S300:YES)、S310にて、CPU310は、特殊合成処理として、第1実施例にて説明した図4のS100〜S150の合成処理を実行する。なお、第3実施例では、図4のS115にて決定される背景残存率BRは、固定値(例えば、40%)である。背景画像BIが特殊合成処理の対象でない場合には(S300:NO)、S320にて、CPU310は、単純合成処理を実行する。単純合成処理は、図7(B)の比較例の画像SBIを表す画像データを生成する処理である。すなわち、CPU310は、背景画像BIの合成領域CAに合成対象画像CIを重ねた場合に、合成対象画像CIのオブジェクト画素OP1と重なる合成領域CAの画素の値を、当該オブジェクト画素OP1の値に置換することによって、処理済背景画像データを生成する。   When the background image BI is the target of the special synthesis process (S300: YES), in S310, the CPU 310 performs the synthesis process of S100 to S150 of FIG. 4 described in the first embodiment as the special synthesis process. Run. In the third embodiment, the background remaining rate BR determined in S115 of FIG. 4 is a fixed value (for example, 40%). When the background image BI is not the target of the special synthesis process (S300: NO), in S320, the CPU 310 executes a simple synthesis process. The simple combining process is a process for generating image data representing the image SBI of the comparative example in FIG. That is, when the composition target image CI is superimposed on the composition area CA of the background image BI, the CPU 310 replaces the value of the pixel in the composition area CA that overlaps the object pixel OP1 of the composition target image CI with the value of the object pixel OP1. As a result, processed background image data is generated.

この第3実施例によれば、単純合成処理を用いることが好ましい背景画像BIが用いられる場合には、単純合成処理が実行され、特殊合成処理を用いることが好ましい背景画像BIが用いられる場合には、特殊合成処理が実行される。従って、合成処理に用いるべき背景画像BIに応じて、適切な処理済背景画像データを生成することができる。   According to the third embodiment, when the background image BI for which it is preferable to use the simple synthesis process is used, the simple synthesis process is executed, and when the background image BI for which the special synthesis process is preferably used is used. The special synthesis process is executed. Therefore, appropriate processed background image data can be generated in accordance with the background image BI to be used for the synthesis process.

D.第4実施例
第4実施例の合成処理は、領域区分画像AIを生成する処理が第1実施例の合成処理と異なる。図11は、第4実施例の合成処理のフローチャートである。S400では、図4のS100と同様に、CPU310は、背景画像BIを表す背景画像データから、合成領域CA内の部分画像PIを表す部分画像データを抽出する。
D. Fourth Embodiment The synthesizing process of the fourth example is different from the synthesizing process of the first example in the process of generating the area segment image AI. FIG. 11 is a flowchart of the synthesis process according to the fourth embodiment. In S400, as in S100 of FIG. 4, the CPU 310 extracts partial image data representing the partial image PI in the synthesis area CA from the background image data representing the background image BI.

S405では、CPU310は、部分画像PIの代表色値(RGB値)を算出する。例えば、部分画像PIの全ての画素のR成分値の平均値Ravと、G成分値の平均値Gavと、B成分値の平均値Bavとを含む平均色値(Rav、Gav、Bav)が、部分画像PIの代表色値として算出される。   In S405, the CPU 310 calculates a representative color value (RGB value) of the partial image PI. For example, an average color value (Rav, Gav, Bav) including an average value Rav of R component values of all pixels of the partial image PI, an average value Gav of G component values, and an average value Bav of B component values is Calculated as the representative color value of the partial image PI.

S410では、CPU310は、合成対象画像CIの代表色値を算出する。例えば、部分画像PIの代表色値と同様に、合成対象画像CIの全ての画素の平均色値が、合成対象画像CIの代表色値として算出される。   In S410, the CPU 310 calculates a representative color value of the compositing target image CI. For example, like the representative color value of the partial image PI, the average color value of all the pixels of the compositing target image CI is calculated as the representative color value of the compositing target image CI.

S415では、CPU310は、部分画像PIの代表色値と、合成対象画像CIの代表色値と、の間の距離Dを算出する。具体的には、これらの2個の色値のRGB色空間におけるユークリッド距離Dが算出される。   In S415, the CPU 310 calculates a distance D between the representative color value of the partial image PI and the representative color value of the compositing target image CI. Specifically, the Euclidean distance D in the RGB color space of these two color values is calculated.

S420では、CPU310は、距離Dに基づいて、予め規定された複数個の領域区分パターンの中から、用いるべき領域区分パターンを選択する。領域区分パターンは、第1実施例の領域区分画像AIと同様に、OFF領域とON領域とが区分された二値画像である。領域区分パターンにおいて、OFF領域とON領域とは、例えば、かすれた印影に現れるパターンを表現するように配置されている。本実施例では、図11に示すように、3種類の領域区分パターンAP1〜AP3の中から、用いるべき領域区分パターンが選択される。図11の領域区分パターンAP1〜AP3において、黒色の領域は、ON領域を示し、白色の領域は、OFF領域を示す。これらの領域区分パターンAP1〜AP3の間では、互いに、ON領域に対するOFF領域の画素数の比率が異なっている。当該比率は、パターンAP1、AP2、AP3の順に段階的に大きくなり、例えば、10%、25%、40%である。   In S420, based on the distance D, the CPU 310 selects an area division pattern to be used from a plurality of predetermined area division patterns. The area division pattern is a binary image in which an OFF area and an ON area are divided, like the area division image AI of the first embodiment. In the area segmentation pattern, the OFF area and the ON area are arranged so as to express a pattern that appears in a faint impression, for example. In the present embodiment, as shown in FIG. 11, an area division pattern to be used is selected from three types of area division patterns AP1 to AP3. In the area division patterns AP1 to AP3 in FIG. 11, the black area indicates the ON area, and the white area indicates the OFF area. Between these area division patterns AP1 to AP3, the ratio of the number of pixels in the OFF area to the ON area is different. The ratio increases stepwise in the order of the patterns AP1, AP2, and AP3, and is, for example, 10%, 25%, and 40%.

本実施例では、距離Dが、比較的小さい第1範囲(例えば、D<D1)内にある場合には、ON領域に対するOFF領域の画素数の比率が比較的小さい領域区分パターンAP1が選択される。距離Dが、中程度の第2範囲(例えば、D1≦D<D2)内にある場合には、ON領域に対するOFF領域の画素数の比率が中程度の領域区分パターンAP2が選択される。距離Dが、比較的大きい第3範囲(例えば、D2≦D)内にある場合には、ON領域に対するOFF領域の画素数の比率が比較的大きい領域区分パターンAP3が選択される。すなわち、距離Dが大きいほど、当該比率が大きな領域区分パターンが選択される。   In the present embodiment, when the distance D is within a relatively small first range (for example, D <D1), the area division pattern AP1 in which the ratio of the number of pixels in the OFF area to the ON area is relatively small is selected. The When the distance D is in the middle second range (for example, D1 ≦ D <D2), the area division pattern AP2 having a medium ratio of the number of pixels in the OFF area to the ON area is selected. When the distance D is within a relatively large third range (for example, D2 ≦ D), the area division pattern AP3 having a relatively large ratio of the number of pixels in the OFF area to the ON area is selected. That is, as the distance D is larger, a region division pattern having a larger ratio is selected.

S425では、CPU310は、選択された領域区分パターンを用いて、領域区分画像AIを生成する。具体的には、CPU310は、選択された領域区分パターンを部分画像PIのサイズ(すなわち、合成領域CAのサイズ)分だけ並べて配置することによって、部分画像PIと同じサイズの領域区分画像AIを生成する。したがって、領域区分画像AIにおけるON領域に対するOFF領域の画素数の比率は、選択された領域区分パターンにおける当該比率と同じになる。   In S425, the CPU 310 generates an area segment image AI using the selected area segment pattern. Specifically, the CPU 310 generates an area segment image AI having the same size as the partial image PI by arranging and arranging the selected area segment patterns by the size of the partial image PI (that is, the size of the synthesis area CA). To do. Therefore, the ratio of the number of pixels in the OFF area to the ON area in the area segment image AI is the same as the ratio in the selected area segment pattern.

領域区分画像AIが生成されると、S430では、図4のS130〜S150の処理が実行される。   When the region segmented image AI is generated, the processing of S130 to S150 of FIG. 4 is executed in S430.

以上説明した第4実施例によれば、部分画像PIの特徴に応じて、領域区分画像AIにおけるON領域に対するOFF領域の画素数の比率が決定される。より具体的には、部分画像PIの色と合成対象画像の色との差を示す特徴量である距離Dが大きいほど、ON領域に対するOFF領域の画素数の比率が大きくされる。この結果、部分画像PIの色と合成対象画像の色との差が大きいほど、合成領域CAにおける第2種の領域に対する第1種の領域の画素数の比率が大きくなる。この結果、部分画像PIの色と合成対象画像CIの色との差に応じて、より好ましい合成画像CMIを生成することができる。   According to the fourth embodiment described above, the ratio of the number of pixels in the OFF region to the ON region in the region segmented image AI is determined according to the characteristics of the partial image PI. More specifically, the ratio of the number of pixels in the OFF area to the ON area increases as the distance D, which is a feature amount indicating the difference between the color of the partial image PI and the color of the synthesis target image, increases. As a result, as the difference between the color of the partial image PI and the color of the synthesis target image increases, the ratio of the number of pixels of the first type area to the second type area in the synthesis area CA increases. As a result, a more preferable composite image CMI can be generated according to the difference between the color of the partial image PI and the color of the compositing target image CI.

より詳しく説明すると、部分画像PIの色と合成対象画像CIの色との差が大きい場合には、合成画像CMIに部分画像PIの特徴を残す意義が大きくなると考えられる。合成画像CMIに部分画像PIの特徴を残した場合に、当該特徴が目立ちやすいからである。このために、部分画像PIの色と合成対象画像CIの色との差が大きい場合には、合成領域CAにおける第2種の領域に対する第1種の領域の画素数の比率を大きくすることが好ましい。一方、部分画像PIの色と合成対象画像CIの色との差が小さい場合には、合成画像CMIに部分画像PIの特徴を残す意義が小さくなるので、逆に、合成対象画像CIの特徴が損なわれることを抑制することが好ましい。このために、部分画像PIの色と合成対象画像CIの色との差が小さい場合には、合成領域CAにおける第2種の領域に対する第1種の領域の画素数の比率を小さくすることが好ましい。したがって、第4実施例によれば、部分画像PIの色と合成対象画像CIの色との差に応じて、より好ましい合成画像CMIを生成することができる。   More specifically, when the difference between the color of the partial image PI and the color of the compositing target image CI is large, it is considered that the significance of leaving the characteristics of the partial image PI in the composite image CMI is increased. This is because when the feature of the partial image PI is left in the composite image CMI, the feature is easily noticeable. For this reason, when the difference between the color of the partial image PI and the color of the synthesis target image CI is large, the ratio of the number of pixels of the first type region to the second type region in the synthesis region CA may be increased. preferable. On the other hand, if the difference between the color of the partial image PI and the color of the compositing target image CI is small, the significance of leaving the characteristics of the partial image PI in the composite image CMI becomes small. It is preferable to suppress damage. For this reason, when the difference between the color of the partial image PI and the color of the synthesis target image CI is small, the ratio of the number of pixels of the first type region to the second type region in the synthesis region CA may be reduced. preferable. Therefore, according to the fourth embodiment, a more preferable synthesized image CMI can be generated according to the difference between the color of the partial image PI and the color of the synthesis target image CI.

E.変形例:
(1)上記各実施例では、合成画像CMIにおいて、第1種の領域内の画素の値は、背景画像BIの部分画像PIの画素の値が用いられ、第2種の領域内の画素の値は、合成対象画像CIの画素の値が用いられる。これに代えて、合成画像CMI内の画素の値には、部分画像PIの対応画素の値と、合成対象画像CIの対応画素の値と、の重み付き平均値が用いられても良い。
E. Variations:
(1) In each of the above embodiments, in the composite image CMI, the pixel value in the first type region is the pixel value of the partial image PI of the background image BI, and the pixel value in the second type region is used. As the value, the value of the pixel of the compositing target image CI is used. Instead, a weighted average value of the corresponding pixel value of the partial image PI and the corresponding pixel value of the compositing target image CI may be used as the pixel value in the composite image CMI.

例えば、一般的に、合成画像CMI内の画素の値(Rm、Gm、Bm)は、部分画像PIの対応画素の値(Rp、Gp、Bp)と、合成対象画像CIの対応画素の値(Rc、Gc、Bc)と、を用いて、以下の式(2)を用いて算出されても良い。   For example, generally, the pixel values (Rm, Gm, Bm) in the composite image CMI are the corresponding pixel values (Rp, Gp, Bp) of the partial image PI and the corresponding pixel values of the compositing target image CI ( Rc, Gc, Bc) may be used to calculate using the following equation (2).

Rm=Wp×Rp+Wc×Rc
Gm=Wp×Gp+Wc×Gc
Bm=Wp×Bp+Wc×Bc ...(2)
Rm = Wp × Rp + Wc × Rc
Gm = Wp × Gp + Wc × Gc
Bm = Wp × Bp + Wc × Bc (2)

ここで、Wpは、部分画像PIの画素に対する重みであり、Wcは、合成対象画像CIの画素に対する重みであり、(Wp+Wc)=1である。ここで、合成画像CMI内の画素のうち、第1種の領域内の画素を決定する際の重みWpを第1種の領域の重みWp1とする。また、第2種の領域内の画素を決定する際の重みWpを、第2種の領域の重みWp2とする。この場合に、第1種の領域の重みWp1は、第2種の領域の重みWp2より大きく設定されれば良い(Wp1>Wp2)。重みWpは、合成画像CMI内の各画素の値に対して部分画像PIの各画素の値が反映される程度を示す部分画像PIの反映率と言うことができる。こうすれば、部分画像PI(すなわち、背景画像)の特徴と合成対象画像CIの特徴とを含む適切な合成画像CMIを生成し得る。   Here, Wp is a weight for the pixel of the partial image PI, Wc is a weight for the pixel of the compositing target image CI, and (Wp + Wc) = 1. Here, among the pixels in the composite image CMI, the weight Wp when determining the pixels in the first type region is set as the weight Wp1 of the first type region. Further, the weight Wp when determining the pixels in the second type area is set as the weight Wp2 of the second type area. In this case, the weight Wp1 of the first type region may be set larger than the weight Wp2 of the second type region (Wp1> Wp2). The weight Wp can be said to be the reflection rate of the partial image PI indicating the degree to which the value of each pixel of the partial image PI is reflected with respect to the value of each pixel in the composite image CMI. In this way, it is possible to generate an appropriate composite image CMI including the characteristics of the partial image PI (that is, the background image) and the characteristics of the compositing target image CI.

ここで、合成画像CMI内の画素のうち、第1種の領域内の画素を決定する際の重みWcを第1種の領域の重みWc1とする。また、第2種の領域内の画素を決定する際の重みWcを、第2種の領域の重みWc2とする。さらに好ましくは、第1種の領域の重みWp1は、第1種の領域の重みWc1より大きく、第2種の領域の重みWc1は、第2種の領域の重みWp1より大きく設定される(Wp1>Wc1、かつ、Wc2>Wp2)。例えば、Wp1=0.8、Wc1=0.2、Wc2=0.8、Wp2=0.2に設定される。重みWcは、合成画像CMI内の各画素の値に対して合成対象画像CIの各画素の値が反映される程度を示す合成対象画像CIの反映率と言うことができる。こうすれば、部分画像PI(すなわち、背景画像)の特徴と合成対象画像CIの特徴とをより適切に残存させた合成画像CMIを生成し得る。   Here, among the pixels in the composite image CMI, the weight Wc when determining the pixel in the first type region is set as the weight Wc1 of the first type region. Further, the weight Wc when determining the pixels in the second type region is set as the weight Wc2 of the second type region. More preferably, the weight Wp1 of the first type region is set larger than the weight Wc1 of the first type region, and the weight Wc1 of the second type region is set larger than the weight Wp1 of the second type region (Wp1). > Wc1 and Wc2> Wp2). For example, Wp1 = 0.8, Wc1 = 0.2, Wc2 = 0.8, and Wp2 = 0.2 are set. The weight Wc can be said to be a reflection rate of the compositing target image CI indicating the degree to which the value of each pixel of the compositing target image CI is reflected with respect to the value of each pixel in the composite image CMI. By doing so, it is possible to generate a composite image CMI in which the characteristics of the partial image PI (that is, the background image) and the characteristics of the compositing target image CI are more appropriately left.

なお、上記各実施例は、第1種の領域内の画素の値が、Wp1=1、Wc1=0として、式(2)を用いて算出され、第2種の領域内の画素の値が、Wp2=0、Wc2=1として、式(2)を用いて算出される場合と、等価である。すなわち、上記各実施例は、(Wp1>Wp2)を満たしているとともに、(Wp1>Wc1、かつ、Wc2>Wp2)を満たしている。   In each of the above embodiments, the value of the pixel in the first type region is calculated by using Equation (2) assuming that Wp1 = 1 and Wc1 = 0, and the value of the pixel in the second type region is , Wp2 = 0 and Wc2 = 1, which is equivalent to the case where the calculation is performed using Expression (2). In other words, each of the above embodiments satisfies (Wp1> Wp2) and also satisfies (Wp1> Wc1 and Wc2> Wp2).

(2)上記第1実施例では、背景残存率BRは、背景画像データの付属データであるが、背景残存率BRは、合成対象画像データの付属データであっても良い。この場合には、合成対象画像データに対応付けられた背景残存率BRに基づいて、第2種の領域に対する第1種の領域の画素数の比率が決定される。換言すれば、合成対象画像データとして、第1のテンプレート画像データが選択された場合には、第2種の領域に対する第1種の領域の比率は、第1の比率に決定され、第2のテンプレート画像データが選択された場合には、当該比率は、第2の比率に決定される。 (2) In the first embodiment, the background remaining rate BR is data attached to the background image data, but the background remaining rate BR may be data attached to the synthesis target image data. In this case, the ratio of the number of pixels of the first type region to the second type region is determined based on the background remaining rate BR associated with the synthesis target image data. In other words, when the first template image data is selected as the compositing target image data, the ratio of the first type area to the second type area is determined as the first ratio, When template image data is selected, the ratio is determined to be the second ratio.

また、第3実施例では、単純合成処理を行うか、特殊合成処理を行うか、を示す処理指定情報は、背景画像データの付属データであるが、背景残存率BRは、合成対象画像データの付属データであっても良い。この場合には、図10のS300にて、CPU310は、合成対象画像データの付属データとしての処理指定情報に従って、特別合成処理を行うか、単純合成処理を行うかを決定すれば良い。   In the third embodiment, the process designation information indicating whether simple synthesis processing or special synthesis processing is performed is attached data of the background image data, but the background remaining rate BR is the value of the synthesis target image data. It may be attached data. In this case, in S300 of FIG. 10, the CPU 310 may determine whether to perform the special combining process or the simple combining process in accordance with the process designation information as the attached data of the combining target image data.

(4)上記第1実施例の合成処理(図2)では、部分画像PIにエンボスフィルタが適用されることによってエンボス画像EIが生成され、該エンボス画像EIが二値化されることによって、領域区分画像AIが生成されている。これに代えて、部分画像PIにSobelフィルタやPrewittフィルタなどのエッジ抽出フィルタが適用されることによってエッジ画像が生成され、該エッジ画像が二値化されることによって、領域区分画像が生成されても良い。この処理は、例えば、部分画像PIのエッジを残し、かつ、部分画像PIに含まれるテクスチャの特徴を残さないように、合成画像CMIを生成する場合に、好適である。 (4) In the composition processing (FIG. 2) of the first embodiment, an embossed image EI is generated by applying an emboss filter to the partial image PI, and the embossed image EI is binarized, thereby obtaining a region. A segmented image AI is generated. Instead, an edge image is generated by applying an edge extraction filter such as a Sobel filter or a Prewitt filter to the partial image PI, and an area segment image is generated by binarizing the edge image. Also good. This process is suitable, for example, when the composite image CMI is generated so as to leave the edge of the partial image PI and not leave the texture features included in the partial image PI.

(5)上記実施例では、背景画像データおよび合成対象画像データは、いずれも、複数個のテンプレート画像データの中から選択されている。これに代えて、背景画像データおよび合成対象画像データの一方または両方は、他の画像データ、例えば、ユーザの原稿をスキャナによって読み取ることによって得られるスキャンデータであっても良い。 (5) In the above embodiment, both the background image data and the compositing target image data are selected from a plurality of template image data. Alternatively, one or both of the background image data and the compositing target image data may be other image data, for example, scan data obtained by reading a user's original with a scanner.

(6)上記実施例では、処理済背景画像データの用途は、印刷であるが、これに限らず、任意の用途が採用可能である。例えば、端末装置100のCPU110は、取得した処理済背景画像データを、将来に利用するために、不揮発性記憶装置130に格納してもよい。また、処理済背景画像データは、端末装置100以外の装置、例えば、ネットワーク500に接続された他のサーバやユーザのパーソナルコンピュータ(図示省略)に、出力されてもよい。 (6) In the above-described embodiment, the use of the processed background image data is printing, but is not limited to this, and any use can be adopted. For example, the CPU 110 of the terminal device 100 may store the acquired processed background image data in the nonvolatile storage device 130 for future use. The processed background image data may be output to a device other than the terminal device 100, for example, another server connected to the network 500 or a user's personal computer (not shown).

(7)上記実施例のサーバ300が実行する画像処理は、サーバ300と異なる種類の装置(例えば、端末装置100、プリンタ、デジタルカメラ、スキャナ、複合機、パーソナルコンピュータ、携帯電話)によって実現されてもよい。例えば、端末装置100のCPU110は、上記実施例にてサーバ300が実行する画像処理を全て実行しても良い。また、プリンタ200のCPUが、上記実施例にて、端末装置100およびサーバ300のCPU110、310が実行する画像処理を全て実行しても良い。 (7) The image processing executed by the server 300 of the above embodiment is realized by a device of a different type from the server 300 (for example, the terminal device 100, a printer, a digital camera, a scanner, a multifunction device, a personal computer, a mobile phone). Also good. For example, the CPU 110 of the terminal device 100 may execute all image processing performed by the server 300 in the above embodiment. Further, the CPU of the printer 200 may execute all the image processing executed by the CPUs 110 and 310 of the terminal device 100 and the server 300 in the above embodiment.

(8)サーバ300は、ネットワークを介して互いに通信可能な複数個の装置(例えば、コンピュータ)を含んでも良い。サーバ300が実行する画像処理は、複数個の装置によって、一部ずつ実行され得る。この場合には、複数個の装置が、1個の画像処理装置として機能する。 (8) The server 300 may include a plurality of devices (for example, computers) that can communicate with each other via a network. The image processing executed by the server 300 can be executed in part by a plurality of devices. In this case, a plurality of devices function as one image processing device.

(9)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、サーバ300が実行する画像処理の全部または一部は、論理回路を含む専用のハードウェア回路によって実現されても良い。 (9) In each of the above embodiments, a part of the configuration realized by hardware may be replaced with software, and conversely, part or all of the configuration realized by software is replaced with hardware. You may do it. For example, all or part of the image processing executed by the server 300 may be realized by a dedicated hardware circuit including a logic circuit.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。   As mentioned above, although this invention was demonstrated based on the Example and the modification, Embodiment mentioned above is for making an understanding of this invention easy, and does not limit this invention. The present invention can be changed and improved without departing from the spirit and scope of the claims, and equivalents thereof are included in the present invention.

100...端末装置、110...CPU、120...揮発性記憶装置、122...バッファ領域、130...不揮発性記憶装置、132...コンピュータプログラム、140...表示部、150...操作部、180...通信インタフェース、200...プリンタ、300...サーバ、310...CPU、320...揮発性記憶装置、322...バッファ領域、330...不揮発性記憶装置、332...コンピュータプログラム、334...テンプレート画像データ群、380...通信インタフェース、500...ネットワーク、900...システム   DESCRIPTION OF SYMBOLS 100 ... Terminal device, 110 ... CPU, 120 ... Volatile memory device, 122 ... Buffer area, 130 ... Nonvolatile memory device, 132 ... Computer program, 140 ... Display 150, operation unit, 180 ... communication interface, 200 ... printer, 300 ... server, 310 ... CPU, 320 ... volatile storage device, 322 ... buffer area, 330 ... Nonvolatile storage device, 332 ... Computer program, 334 ... Template image data group, 380 ... Communication interface, 500 ... Network, 900 ... System

Claims (10)

画像処理装置であって、
背景画像を表す背景画像データと、対象画像を表す対象画像データと、を取得する取得部と、
前記対象画像が合成されるべき前記背景画像内の領域である合成領域を決定する領域決定部と、
前記背景画像のうちの前記合成領域内の部分画像の特徴に基づいて、前記合成領域を第1種の領域と第2種の領域とに区分領域区分部と、
前記第1種の領域内の画素の値と前記第2種の領域内の画素の値とを互いに異なる処理によって決定することによって、前記部分画像と前記対象画像とが合成された合成画像が、前記合成領域内に配置された処理済背景画像を表す処理済背景画像データを生成する生成部であって、前記合成画像の前記第1種の領域の前記部分画像の反映率は、前記合成画像の前記第2種の領域の前記部分画像の反映率より大きく、前記部分画像の反映率は、各画素の値に対して前記部分画像内の各画素の値が反映される程度である、前記生成部と、
前記処理済背景画像データを出力する出力部と、
を備える、画像処理装置。
An image processing apparatus,
An acquisition unit that acquires background image data representing a background image and target image data representing a target image;
An area determination unit that determines a synthesis area that is an area in the background image to be synthesized with the target image;
Based on the characteristics of the partial image in the synthesis area of the background image, the synthesis area is divided into a first type area and a second type area,
A composite image obtained by combining the partial image and the target image by determining the value of the pixel in the first type region and the value of the pixel in the second type region by different processes, A generating unit configured to generate processed background image data representing a processed background image arranged in the composite region, wherein the reflection rate of the partial image in the first type region of the composite image is the composite image Greater than the reflection rate of the partial image of the second type region, and the reflection rate of the partial image is such that the value of each pixel in the partial image is reflected with respect to the value of each pixel. A generator,
An output unit for outputting the processed background image data;
An image processing apparatus comprising:
請求項1に記載の画像処理装置であって、
前記領域区分部は、前記部分画像内のエッジを抽出し、抽出された前記エッジの領域を前記第1種の領域に決定する、画像処理装置。
The image processing apparatus according to claim 1,
The area classification unit is an image processing apparatus that extracts an edge in the partial image and determines the extracted area of the edge as the first type area.
請求項1または2に記載の画像処理装置であって、
前記領域区分部は、前記部分画像内の複数個の画素を第1種の画素と第2種の画素とに分類する分類処理であって、前記部分画像に特定のフィルタを適用する処理を含む分類処理を実行し、
前記生成部は、前記第1種の画素によって構成される前記第1種の領域内の画素の値を前記部分画像の画素の値に決定し、前記第2種の画素によって構成される前記第2種の領域内の画素の値を前記対象画像の画素の値に決定することによって、前記部分画像と前記対象画像とを合成する、画像処理装置。
The image processing apparatus according to claim 1, wherein:
The region classification unit includes a classification process for classifying a plurality of pixels in the partial image into a first type pixel and a second type pixel, and a process of applying a specific filter to the partial image. Perform the classification process,
The generation unit determines a value of a pixel in the first type region configured by the first type pixel as a value of a pixel of the partial image, and the second type of pixel configured by the second type pixel. An image processing apparatus that synthesizes the partial image and the target image by determining pixel values in two types of regions as pixel values of the target image.
請求項3に記載の画像処理装置であって、
前記領域区分部は、
前記部分画像に前記特定のフィルタを適用する処理を含む前記分類処理を実行することによって、前記部分画像に含まれる所定サイズ以下の模様に応じて前記合成領域を前記第1種の領域と前記第2の領域とに区分する、画像処理装置。
The image processing apparatus according to claim 3,
The area section is
By executing the classification process including the process of applying the specific filter to the partial image, the synthesis area is defined as the first type area and the first type according to a pattern having a predetermined size or less included in the partial image. An image processing apparatus that divides into two regions.
請求項4に記載の画像処理装置であって、
前記特定のフィルタは、エンボスフィルタである、画像処理装置。
The image processing apparatus according to claim 4,
The image processing apparatus, wherein the specific filter is an emboss filter.
請求項1〜5のいずれかに記載の画像処理装置であって、
前記領域区分部は、前記部分画像内の特徴に応じて、前記第2種の領域に対する前記第1種の領域の比率を決定する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 5,
The region classification unit is an image processing device that determines a ratio of the first type region to the second type region according to a feature in the partial image.
請求項6に記載の画像処理装置であって、
前記領域区分部は、前記部分画像内の画素の値のばらつきを示す特徴量が大きいほど、前記第1種の領域の比率を大きくする、画像処理装置。
The image processing apparatus according to claim 6,
The image processing apparatus according to claim 1, wherein the area classification unit increases the ratio of the first type area as the feature amount indicating the variation in the value of the pixel in the partial image increases.
請求項6に記載の画像処理装置であって、
前記領域区分部は、前記部分画像の色と前記対象画像の色との差を示す特徴量が大きいほど、前記第1種の領域の比率を大きくする、画像処理装置。
The image processing apparatus according to claim 6,
The image processing apparatus, wherein the area dividing unit increases the ratio of the first type area as the feature amount indicating the difference between the color of the partial image and the color of the target image increases.
請求項1〜8のいずれかに記載の画像処理装置であって、
取得される前記背景画像データと前記対象画像データとのうちの一方は、複数個のテンプレート画像データの中から選択され、
前記領域区分部は、
第1のテンプレート画像データが選択された場合には、前記第2種の領域に対する前記第1種の領域の比率を、第1の比率に決定し、
第2のテンプレート画像データが選択された場合には、前記第2種の領域に対する前記第1種の領域の比率を、第2の比率に決定する、画像処理装置。
The image processing apparatus according to claim 1,
One of the acquired background image data and the target image data is selected from a plurality of template image data,
The area section is
When the first template image data is selected, the ratio of the first type area to the second type area is determined as the first ratio,
When the second template image data is selected, the image processing apparatus determines a ratio of the first type area to the second type area as a second ratio.
コンピュータプログラムであって、
背景画像を表す背景画像データと、対象画像を表す対象画像データと、を取得する取得機能と、
前記対象画像が合成されるべき前記背景画像内の領域である合成領域を決定する領域決定機能と、
前記背景画像のうちの前記合成領域内の部分画像の特徴に基づいて、前記合成領域を第1種の領域と第2種の領域とに区分する領域区分機能と、
前記第1種の領域内の画素の値と前記第2種の領域内の画素の値とを互いに異なる処理によって決定することによって、前記部分画像と前記対象画像とが合成された合成画像が、前記合成領域内に配置された処理済背景画像を表す処理済背景画像データを生成する生成機能であって、前記合成画像の前記第1種の領域の前記部分画像の反映率は、前記合成画像の前記第2種の領域の前記部分画像の反映率より大きく、前記部分画像の反映率は、各画素の値に対して前記部分画像内の各画素の値が反映される程度である、前記生成機能と、
前記処理済背景画像データを出力する出力機能と、
をコンピュータに実現させるコンピュータプログラム。
A computer program,
An acquisition function for acquiring background image data representing a background image and target image data representing a target image;
A region determination function for determining a composite region that is a region in the background image to be combined with the target image;
A region dividing function for dividing the composite region into a first type region and a second type region based on a feature of a partial image in the composite region of the background image;
A composite image obtained by combining the partial image and the target image by determining the value of the pixel in the first type region and the value of the pixel in the second type region by different processes, A generation function for generating processed background image data representing a processed background image arranged in the composite region, wherein the reflection rate of the partial image in the first type region of the composite image is the composite image Greater than the reflection rate of the partial image of the second type region, and the reflection rate of the partial image is such that the value of each pixel in the partial image is reflected with respect to the value of each pixel. Generation function,
An output function for outputting the processed background image data;
A computer program that causes a computer to realize
JP2014223785A 2014-10-31 2014-10-31 Image processing apparatus and computer program Active JP6428166B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014223785A JP6428166B2 (en) 2014-10-31 2014-10-31 Image processing apparatus and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014223785A JP6428166B2 (en) 2014-10-31 2014-10-31 Image processing apparatus and computer program

Publications (2)

Publication Number Publication Date
JP2016092560A true JP2016092560A (en) 2016-05-23
JP6428166B2 JP6428166B2 (en) 2018-11-28

Family

ID=56019052

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014223785A Active JP6428166B2 (en) 2014-10-31 2014-10-31 Image processing apparatus and computer program

Country Status (1)

Country Link
JP (1) JP6428166B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019208164A (en) * 2018-05-30 2019-12-05 キヤノン株式会社 Drawing processing apparatus, drawing processing method, and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002077583A (en) * 2000-08-30 2002-03-15 Abc Japon Inc Expression of background image in markup language
JP2007067637A (en) * 2005-08-30 2007-03-15 Oki Data Corp Image processing device and image processing system
JP2013012115A (en) * 2011-06-30 2013-01-17 Canon Inc Information processing apparatus, method and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002077583A (en) * 2000-08-30 2002-03-15 Abc Japon Inc Expression of background image in markup language
JP2007067637A (en) * 2005-08-30 2007-03-15 Oki Data Corp Image processing device and image processing system
JP2013012115A (en) * 2011-06-30 2013-01-17 Canon Inc Information processing apparatus, method and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019208164A (en) * 2018-05-30 2019-12-05 キヤノン株式会社 Drawing processing apparatus, drawing processing method, and program
JP7146455B2 (en) 2018-05-30 2022-10-04 キヤノン株式会社 Drawing processing device, drawing processing method, and program

Also Published As

Publication number Publication date
JP6428166B2 (en) 2018-11-28

Similar Documents

Publication Publication Date Title
JP6781406B2 (en) Image processing equipment and computer programs
JP6769045B2 (en) Image processing equipment and computer programs
JP6417851B2 (en) Image processing apparatus and computer program
KR102015926B1 (en) Image processing apparatus, control method of image processing apparatus, and storage medium
CN105138317A (en) Window display processing method and device applied to terminal equipment
JP6233142B2 (en) Image processing apparatus and computer program
US11410278B2 (en) Automatic artifact removal in a digital image
JP6370080B2 (en) Image processing apparatus, image processing method, and program.
KR101887929B1 (en) Image Processing Apparatus, Image Processing Method, Computer Readable Recording Medium and Image Forming Apparatus
JP6428166B2 (en) Image processing apparatus and computer program
JP6031921B2 (en) Image processing apparatus and program
JP5007639B2 (en) Image processing apparatus and image processing program
JP2016039525A (en) Image processing system, image processing apparatus, program and image processing method
JP3952188B2 (en) Image interpolation apparatus, image interpolation method, and image interpolation program
JP2016092672A (en) Image processing apparatus and computer program
JP5672168B2 (en) Image processing apparatus, image processing method, and program
JP2013045205A (en) Image processor, image processing method and image processing program
JP2016192819A (en) Image processing system, image processing method, and image processing device
JP6477826B2 (en) Image processing system, image processing method, and image processing apparatus
JP6612167B2 (en) Rasterization processing apparatus, rasterization processing method, and program
JP6234234B2 (en) Information processing apparatus, information processing method, and program
JP5991406B2 (en) Image processing system, image processing method, and image processing apparatus
JP5949399B2 (en) Image processing apparatus and program
JP5454466B2 (en) Character detection device, character detection method, and computer program
JP2012231261A (en) Image processing apparatus and control method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170919

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180626

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180710

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180731

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180918

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181015

R150 Certificate of patent or registration of utility model

Ref document number: 6428166

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150