JP6694760B2 - Image synthesizing device and image synthesizing program - Google Patents

Image synthesizing device and image synthesizing program Download PDF

Info

Publication number
JP6694760B2
JP6694760B2 JP2016112876A JP2016112876A JP6694760B2 JP 6694760 B2 JP6694760 B2 JP 6694760B2 JP 2016112876 A JP2016112876 A JP 2016112876A JP 2016112876 A JP2016112876 A JP 2016112876A JP 6694760 B2 JP6694760 B2 JP 6694760B2
Authority
JP
Japan
Prior art keywords
pixel
image
background
foreground
peripheral
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016112876A
Other languages
Japanese (ja)
Other versions
JP2017220755A (en
Inventor
信夫 布施
信夫 布施
孝佳 石井
孝佳 石井
輝彦 卯木
輝彦 卯木
惇 吉田
惇 吉田
俊也 小林
俊也 小林
佑輔 寺内
佑輔 寺内
裕平 安達
裕平 安達
仁志 柳
仁志 柳
Original Assignee
株式会社フォトロン
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 株式会社フォトロン filed Critical 株式会社フォトロン
Priority to JP2016112876A priority Critical patent/JP6694760B2/en
Publication of JP2017220755A publication Critical patent/JP2017220755A/en
Application granted granted Critical
Publication of JP6694760B2 publication Critical patent/JP6694760B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、画像合成装置に係り、特に、第1画像と第2画像とを合成する画像合成装置に関する。   The present invention relates to an image synthesizing device, and more particularly to an image synthesizing device that synthesizes a first image and a second image.

第1画像と第2画像とをクロマキー合成する画像合成装置がある。第1に、当該装置は、第1画像から背景部分の色を抽出してマスク画像を生成し、第1画像とマスク画像の反転画像とのAND処理(論理積)により、第1画像から対象物部分が抽出された対象物部分画像を生成する。第2に、当該装置は、第2画像とマスク画像とのAND処理により、第2画像から背景部分が抽出された背景部分画像を生成する。第3に、当該装置は、対象物部分画像と背景部分画像とのOR処理(論理和)により、合成画像を生成する。   There is an image synthesizing device for chrominically synthesizing a first image and a second image. First, the apparatus extracts a color of a background portion from a first image to generate a mask image, and performs an AND process (logical product) between the first image and a reverse image of the mask image to obtain a target from the first image. An object part image in which the object part is extracted is generated. Secondly, the apparatus generates a background part image in which the background part is extracted from the second image by ANDing the second image and the mask image. Thirdly, the apparatus generates a composite image by OR processing (logical sum) of the object partial image and the background partial image.

概ね単一色を背景として撮影された第1画像を第2画像上に自動的に合成する自動クロマキー合成を行う技術が開示されている(例えば、特許文献1)。   A technique for performing automatic chroma-key composition that automatically combines a first image shot with a background of a substantially single color on a second image is disclosed (for example, Patent Document 1).

特開2014−72697号公報JP, 2014-72697, A

クロマキー合成では、第1画像の背景部分の色(クロマ)をキーとして、第1画像から、背景部分とは異なる対象物部分を抽出する処理を行っている。このため、第1画像の対象物部分の色が、第1画像の背景部分の色(青色又は緑色等)に似た色である場合に、第1画像中の対象物部分と背景部分との区別ができず、対象物部分を背景部分と認識してしまう。この場合、適切な合成画像が生成されない。   In the chroma key composition, a process of extracting an object part different from the background part from the first image is performed by using the color (chroma) of the background part of the first image as a key. Therefore, when the color of the object portion of the first image is similar to the color (blue or green) of the background portion of the first image, the object portion and the background portion of the first image are separated from each other. Indistinguishable, the object part is recognized as the background part. In this case, an appropriate composite image is not generated.

本発明は、上述した事情を考慮してなされたもので、第1画像の対象物部分の色に因らず適切な合成画像を生成できる画像合成装置を提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an image synthesizing apparatus capable of generating an appropriate synthetic image regardless of the color of the object portion of the first image.

本発明の一実施形態に係る画像合成装置は、上述した課題を解決するために、市松模様を背景として撮影された第1画像の各画素について、その周辺の周辺画素列によって決定される色パターンと、前記市松模様に基づく色パターンとを比較し、前記各画素が前景部分に相当する前景画素であるか、又は、背景部分に相当する背景画素であるかを判断する判断手段と、前記前景画素及び前記背景画素からなるマスク画像を生成し、前記マスク画像の反転画像及び前記第1画像に基づく画像と、前記第1画像とは異なる第2画像及び前記マスク画像に基づく画像とを合成処理することで、合成画像を生成する生成手段と、を有する。   In order to solve the above-mentioned problems, an image synthesizing apparatus according to an embodiment of the present invention, for each pixel of a first image captured with a checkerboard pattern as a background, has a color pattern determined by a peripheral pixel row around the pixel. And a color pattern based on the checkerboard pattern to determine whether each pixel is a foreground pixel corresponding to a foreground portion or a background pixel corresponding to a background portion, and the foreground. A mask image composed of pixels and the background pixels is generated, and an inversion image of the mask image and an image based on the first image are combined with a second image different from the first image and an image based on the mask image. And generating means for generating a composite image.

本発明に係る画像合成装置によれば、第1画像の対象物部分の色に因らず適切な合成画像を生成できる。   According to the image composition device of the present invention, an appropriate composite image can be generated regardless of the color of the object portion of the first image.

実施形態に係る画像合成装置の一構成例を示すブロック図。FIG. 3 is a block diagram showing a configuration example of an image synthesizing apparatus according to the embodiment. 実施形態に係る画像合成装置の動作の一例をフローチャートとして示す図。The figure which shows as an example of an operation | movement of the image synthesizing | combining apparatus which concerns on embodiment as a flowchart. (A)は、第1画像を生成するための撮影風景を示す図、(B)は、第1画像の一例を示す図、(C)は、(B)の第1画像の拡大図、(D)は、第2画像の一例を示す図。(A) is a diagram showing a shooting scene for generating the first image, (B) is a diagram showing an example of the first image, (C) is an enlarged view of the first image of (B), D) is a diagram showing an example of a second image. (A)は、図3(C)の領域の一例を示す拡大図、(B),(C)は、各画素の周辺画素列の設定方法を示す図。3A is an enlarged view showing an example of the region of FIG. 3C, and FIGS. 3B and 3C are views showing a method of setting a peripheral pixel column of each pixel. (A)は、注目画素が他の色を示す画素値をもつ場合を示す図、(B)〜(L)は、注目画素が緑色又は黄色を示す画素値である場合を示す図。(A) is a figure which shows the case where a noticed pixel has a pixel value which shows another color, (B)-(L) is a figure which shows a case where a noticed pixel is a pixel value which shows green or yellow. (A)〜(G)は、注目画素が緑色又は黄色を示す画素値である場合を示す図。(A)-(G) is a figure which shows the case where a pixel of interest has a pixel value which shows green or yellow. 周辺画素列の色パターンによって、注目画素を幾つかの区分に分類するための表を示す図。FIG. 6 is a diagram showing a table for classifying a target pixel into some sections according to a color pattern of a peripheral pixel column. (A)は、マスク画像の反転画像の一例を示す図、(B)は、対象物部分画像の一例を示す図、(C)は、マスク画像の一例を示す図、(D)は、背景部分画像の一例を示す図、(E)は、合成画像の一例を示す図。(A) is a diagram showing an example of an inverted image of a mask image, (B) is a diagram showing an example of an object partial image, (C) is a diagram showing an example of a mask image, and (D) is a background. The figure which shows an example of a partial image, (E) is a figure which shows an example of a synthetic image.

本発明に係る実施の形態について、添付図面を参照して説明する。   Embodiments according to the present invention will be described with reference to the accompanying drawings.

1.構成
図1は、実施形態に係る画像合成装置の一構成例を示すブロック図である。
1. Configuration FIG. 1 is a block diagram showing a configuration example of an image synthesizing apparatus according to an embodiment.

図1は、実施形態に係る画像合成装置1を示す。画像合成装置1は、制御部11、記憶部12、入力部13、及び表示部14を有する。画像合成装置1は、コンピュータをベースとして構成されており、LAN(Local Area Network)などのネットワークを介して外部装置と相互通信可能である。   FIG. 1 shows an image synthesizing apparatus 1 according to the embodiment. The image composition device 1 includes a control unit 11, a storage unit 12, an input unit 13, and a display unit 14. The image synthesizing device 1 is configured based on a computer, and is capable of mutual communication with an external device via a network such as a LAN (Local Area Network).

制御部11は、共通信号伝送路としてのバスを介して、画像合成装置1を構成する各ハードウェア構成要素に相互接続される。制御部11は、専用のハードウェアで構成されてもよいし、内蔵のプロセッサによるソフトウェア処理で各種機能を実現するように構成してもよい。   The control unit 11 is interconnected to each hardware component configuring the image synthesizing device 1 via a bus serving as a common signal transmission path. The control unit 11 may be configured by dedicated hardware or may be configured to realize various functions by software processing by a built-in processor.

なお、上記説明におけるプロセッサとは、専用又は汎用のCPU(Central Processing Unit)、GPU(Graphics Processing Unit)を含む。また、専用のハードウェアとは、特定用途向け集積回路(ASIC:Application Specific Integrated Circuit)、プログラマブル論理デバイス、及び、フィールドプログラマブルゲートアレイ(FPGA:Field Programmable Gate Array)などの回路を含む。上記プログラマブル論理デバイスとしては、例えば、単純プログラマブル論理デバイス(SPLD:Simple Programmable Logic Device)、複合プログラマブル論理デバイス(CPLD:Complex Programmable Logic Device)などが挙げられる。   The processor in the above description includes a dedicated or general-purpose CPU (Central Processing Unit) and GPU (Graphics Processing Unit). The dedicated hardware includes circuits such as an application-specific integrated circuit (ASIC), a programmable logic device, and a field programmable gate array (FPGA). Examples of the programmable logic device include a simple programmable logic device (SPLD: Simple Programmable Logic Device) and a complex programmable logic device (CPLD: Complex Programmable Logic Device).

ここでは一例として、プロセッサによるソフトウェア処理によって制御部11が各種機能を実現する場合について説明する。制御部11は、記憶部12に記憶されたプログラム、又は、制御部11のプロセッサ内に直接組み込まれたプログラムを読み出し実行することで、各機能を実現する。   Here, as an example, a case where the control unit 11 realizes various functions by software processing by the processor will be described. The control unit 11 realizes each function by reading and executing the program stored in the storage unit 12 or the program directly installed in the processor of the control unit 11.

なお、制御部11は、単一のプロセッサによって構成されてもよいし、複数の独立したプロセッサの組み合わせによって構成されてもよい。後者の場合、複数のプロセッサにそれぞれ対応する複数の記憶部12が設けられると共に、各プロセッサにより実行されるプログラムが当該プロセッサに対応する記憶回路に記憶される構成でもよい。別の例としては、1個の記憶部12が複数のプロセッサの各機能に対応するプログラムを一括的に記憶する構成でもよい。   The control unit 11 may be composed of a single processor or a combination of a plurality of independent processors. In the latter case, a plurality of storage units 12 respectively corresponding to a plurality of processors may be provided, and a program executed by each processor may be stored in a storage circuit corresponding to the processor. As another example, one storage unit 12 may collectively store programs corresponding to respective functions of a plurality of processors.

記憶部12は、例えば、RAM(Random Access Memory)、フラッシュメモリ(Flash Memory)などの半導体メモリ素子、ハードディスク、光ディスクなどによって構成される。記憶部12は、USB(Universal Serial Bus)メモリ及びDVD(Digital Video Disk)などの可搬型メディアを脱着自在な回路して構成されてもよい。記憶部12は、制御部11において実行される各種プログラム(アプリケーションプログラムの他、OS(Operating System)等も含まれる)、プログラムの実行に必要な文字情報、及び画像データを記憶する。また、記憶部12には、OSを制御するための各種コマンドや、入力部13からの入力を支援するGUI(Graphical User Interface)のプログラムを記憶してもよい。   The storage unit 12 is configured by, for example, a semiconductor memory device such as a RAM (Random Access Memory) or a flash memory (Flash Memory), a hard disk, an optical disk, or the like. The storage unit 12 may be configured by a removable medium such as a USB (Universal Serial Bus) memory and a portable medium such as a DVD (Digital Video Disk). The storage unit 12 stores various programs executed by the control unit 11 (including an OS (Operating System) in addition to application programs), character information necessary for executing the programs, and image data. Further, the storage unit 12 may store various commands for controlling the OS and a GUI (Graphical User Interface) program that supports input from the input unit 13.

入力部13は、例えば、キーボード、テンキー、及びマウスなどを含む。入力部13は、操作者であるユーザにより入力された入力情報を制御部11に出力する。   The input unit 13 includes, for example, a keyboard, a numeric keypad, a mouse, and the like. The input unit 13 outputs the input information input by the user who is the operator to the control unit 11.

表示部14は、液晶ディスプレイパネル、プラズマディスプレイパネル、及び有機EL(Electro Luminescence)パネル等の表示装置である。表示部14は、制御部11の制御に従って文字や画像等を表示する。   The display unit 14 is a display device such as a liquid crystal display panel, a plasma display panel, and an organic EL (Electro Luminescence) panel. The display unit 14 displays characters, images, etc. under the control of the control unit 11.

図1に示すように、制御部11は、判断部41及び生成部42を備える。判断部41及び生成部42の夫々の機能は、記憶部12に格納されているプログラムを制御部11のプロセッサが実行することによって実現される。   As shown in FIG. 1, the control unit 11 includes a determination unit 41 and a generation unit 42. The functions of the determination unit 41 and the generation unit 42 are realized by the processor of the control unit 11 executing the programs stored in the storage unit 12.

判断部41は、市松模様を背景として撮影された第1画像の各画素について、その周辺の周辺画素列によって決定される色パターンと、市松模様に基づく色パターンとを比較し、各画素が前景部分に相当する前景画素であるか、又は、背景部分に相当する背景画素であるかを判断する。市松模様とは、格子模様の一種で、2色の正方形(又は長方形)を交互に配した模様のことである。ここでは、第1色が緑色であり、第2色が黄色である市松模様の場合について例示する。なお、第1画像は、周期的な模様を背景として撮影されたものであればよく、周期的な模様の一例としての市松模様を背景として撮影されたものに限定されるものではない。周期的な模様とは、例えば、2色のひし形を交互に配した模様や、2色の三角形を交互に配した模様である。また、周期的な模様とは、3色以上の形状を交互に配した模様であってもよい。   The determination unit 41 compares, for each pixel of the first image captured with the checkerboard pattern as a background, the color pattern determined by the peripheral pixel row around the pixel with the color pattern based on the checkered pattern, and each pixel has the foreground It is determined whether the pixel is a foreground pixel corresponding to a portion or a background pixel corresponding to a background portion. The checkered pattern is a kind of lattice pattern and is a pattern in which squares (or rectangles) of two colors are alternately arranged. Here, a case where the first color is green and the second color is yellow will be exemplified. The first image may be captured with a periodic pattern as a background, and is not limited to an image captured with a checkered pattern as an example of the periodic pattern as a background. The periodic pattern is, for example, a pattern in which two-color diamonds are alternately arranged or a pattern in which two-color triangles are alternately arranged. The periodic pattern may be a pattern in which three or more colors are alternately arranged.

生成部42は、判断部41によって判断された前景画素及び背景画素からなるマスク画像(図8(C)に図示)を生成する。また、生成部42は、マスク画像の反転画像及び第1画像に基づく画像(図8(B)に示す対象物部分画像)と、第1画像とは異なる第2画像及びマスク画像に基づく画像(図8(D)に示す背景部分画像)とを合成処理することで、合成画像(図8(E)に示す合成画像)を生成する。   The generation unit 42 generates a mask image (illustrated in FIG. 8C) including the foreground pixels and the background pixels determined by the determination unit 41. Further, the generation unit 42, the inverted image of the mask image and the image based on the first image (object partial image shown in FIG. 8B), the second image different from the first image and the image based on the mask image ( A synthetic image (a synthetic image shown in FIG. 8E) is generated by performing a synthetic process with the background partial image shown in FIG. 8D.

なお、判断部41及び生成部42の具体的な動作については後述する。   The specific operations of the determination unit 41 and the generation unit 42 will be described later.

2.動作
図1及び図2を用いて判断部41及び生成部42の具体的な動作について説明する。
2. Operation A specific operation of the determination unit 41 and the generation unit 42 will be described with reference to FIGS. 1 and 2.

図2は、実施形態に係る画像合成装置1の動作の一例をフローチャートとして示す図である。   FIG. 2 is a flowchart showing an example of the operation of the image composition device 1 according to the embodiment.

判断部41は、市松模様を背景として撮影された第1画像を記憶部12から読み出す(ステップST1)。判断部41は、第1画像を撮影するカメラから送られ、記憶部12に記憶された第1画像を読み出す。   The determination unit 41 reads the first image captured with the checkered pattern as the background from the storage unit 12 (step ST1). The determination unit 41 reads the first image sent from the camera that captures the first image and stored in the storage unit 12.

図3(A)は、第1画像を生成するための撮影風景を示す図である。図3(B)は、第1画像の一例を示す図である。図3(C)は、図3(B)に示す第1画像の拡大画像を示す図である。図3(D)は、第2画像の一例を示す図である。   FIG. 3A is a diagram showing a shooting landscape for generating the first image. FIG. 3B is a diagram showing an example of the first image. FIG. 3C is a diagram showing an enlarged image of the first image shown in FIG. 3B. FIG. 3D is a diagram showing an example of the second image.

図3(A)は、カメラにより、市松模様が付されたカーテンやスクリーンを背景として人物等の対象物が撮影される撮影風景を示す。この撮影により、図3(B)に示す第1画像が生成される。第1画像は、カメラから画像合成装置に送られ、記憶部12に記憶される。第1画像は、独立した静止画像であってもよく、動画像を構成する各コマの画像であってもよい。
FIG. 3A shows a shooting scene in which an object such as a person is shot by a camera against a curtain or screen with a checkered pattern as a background. By this photographing, the first image shown in FIG. 3B is generated. The first image is sent from the camera to the image synthesizing device 1 and stored in the storage unit 12. The first image may be an independent still image or an image of each frame forming a moving image.

図3(B),(C)に示すように、第1画像は、市松模様を構成する緑色及び黄色を示す色の情報(画素値)をもつ画素と、対象物を構成する緑色を示す画素値をもつ画素と、対象物を構成する緑色でも黄色でもない色を示す画素値をもつ画素とを含む。緑色を示す画素値とは、緑色を示す1個の画素値であってもよいし、緑色を示す複数の画素値(例えば、濃い緑を示す画素値や薄い緑を示す画素値)であってもよい。   As shown in FIGS. 3 (B) and 3 (C), the first image is a pixel having information (pixel value) of colors showing green and yellow forming a checkered pattern and pixels showing green forming an object. A pixel having a value and a pixel having a pixel value indicating a color that is neither green nor yellow that constitutes the object. The pixel value indicating green may be one pixel value indicating green or a plurality of pixel values indicating green (for example, a pixel value indicating dark green or a pixel value indicating light green). Good.

図2の説明に戻って、判断部41は、ステップST1によって読み出された第1画像から注目画素を抽出する(ステップST2)。判断部41は、ステップST2によって抽出された注目画素が、緑色又は黄色を示す画素値をもつか否かを判断する(ステップST3)。   Returning to the description of FIG. 2, the determination unit 41 extracts the target pixel from the first image read in step ST1 (step ST2). The determination unit 41 determines whether or not the pixel of interest extracted in step ST2 has a pixel value indicating green or yellow (step ST3).

ステップST3の判断にてYES、すなわち、注目画素が、緑色又は黄色を示す画素値をもつと判断される場合、ステップST2によって抽出された注目画素は、前景部分に相当する前景画素の可能性もあり、背景部分に相当する背景画素の可能性もある。そこで、ステップST3の判断にてYES、すなわち、注目画素が、緑色又は黄色を示す画素値をもつと判断される場合、判断部41は、ステップST2によって抽出された注目画素の周辺画素列によって決定される色パターンと、市松模様に基づく色パターンとを比較して、注目画素が前景画素であるか否かを判断する(ステップST4)。   If the result of determination in step ST3 is YES, that is, if the pixel of interest has a pixel value indicating green or yellow, the pixel of interest extracted in step ST2 may be a foreground pixel corresponding to the foreground portion. There is also a possibility of a background pixel corresponding to the background portion. Therefore, when the determination in step ST3 is YES, that is, when the pixel of interest has a pixel value indicating green or yellow, the determination unit 41 determines the peripheral pixel row of the pixel of interest extracted in step ST2. The determined color pattern is compared with the checkerboard-based color pattern to determine whether or not the pixel of interest is a foreground pixel (step ST4).

ステップST4の判断にてYES、すなわち、注目画素が前景画素であると判断される場合と、ステップST3の判断にてNO、すなわち、注目画素が緑色及び黄色以外のその他の色を示す画素値をもつと判断される場合、注目画素に黒色を示す画素値を付与する(ステップST5)。ステップST4の判断にてNO、すなわち、注目画素が背景画素であると判断される場合、注目画素に白色を示す画素値を付与する(ステップST6)。ステップST5,ST6によって付与された黒色及び白色を示す画素値は、マスク画像の元となる。   If the determination in step ST4 is YES, that is, if the pixel of interest is determined to be the foreground pixel, and if the determination in step ST3 is NO, that is, if the pixel of interest indicates a pixel value other than green and yellow, If it is determined that the target pixel is present, a pixel value indicating black is added to the target pixel (step ST5). If NO in the determination in step ST4, that is, if the target pixel is determined to be the background pixel, a pixel value indicating white is added to the target pixel (step ST6). The pixel values indicating black and white provided in steps ST5 and ST6 are the basis of the mask image.

ここで、図4〜図7を用いて、ステップST3〜ST6を具体的に説明する。   Here, steps ST3 to ST6 will be specifically described with reference to FIGS.

図4(A)は、図3(C)の領域Rの一例を示す拡大図である。   FIG. 4A is an enlarged view showing an example of the region R of FIG.

図4(A)に示す拡大図は、画素値をもつ複数画素を示す。右上の複数の画素(図中のその他の色の領域)は、第1画像の対象物部分を示し、緑色でも黄色でもない他の色を示す画素値をもつ。左側の複数の画素(図中の緑色及び黄色の市松模様の領域)は、第1画像の背景部分を示し、緑色又は黄色を示す画素値をもつ。右下の複数の画素(図中の緑色一色の領域)は、第1画像の対象物部分を示し、緑色を示す画素値をもつ。   The enlarged view shown in FIG. 4A shows a plurality of pixels having pixel values. The plurality of pixels on the upper right (regions of other colors in the figure) indicate the object portion of the first image and have pixel values indicating other colors that are neither green nor yellow. The plurality of pixels on the left side (green and yellow checkered areas in the figure) indicate the background portion of the first image, and have pixel values indicating green or yellow. A plurality of pixels at the lower right (one-color region of green in the figure) indicate an object portion of the first image and have a pixel value indicating green.

また、図4(A)中の太線は、背景部分と前景部分との理想的なエッジである。判断部41は、各画素が前景画素であるか、又は、背景画素であるかを判断し、前景画素と背景画素との境界が、太線で示す理想的なエッジに近づくようにするものとする。そのために、まず、判断部41は、注目画素に、周辺画素列を設定する。   The thick line in FIG. 4A is an ideal edge between the background portion and the foreground portion. The determination unit 41 determines whether each pixel is a foreground pixel or a background pixel, and the boundary between the foreground pixel and the background pixel approaches the ideal edge indicated by the thick line. .. For that purpose, first, the determination unit 41 sets a peripheral pixel row for the pixel of interest.

図4(B),(C)は、各画素の周辺画素列の設定方法を示す図である。   4B and 4C are diagrams showing a method of setting a peripheral pixel column of each pixel.

図4(C)に示すように、注目画素から距離s(図4(B)に図示)の範囲内に、周辺画素列が設定される。そして、周辺画素列によって決定される色パターンと、市松模様に基づく色パターンとが比較される。又は、図4(C)に示すように、注目画素から距離sの範囲内の周辺画素列と、その内側であって注目画素から距離t(図4(B)に図示)の範囲内の内周画素列と、が設定される。周辺画素列から内周画素列を除いた残りが外周画素列となる。そして、内周画素列によって決定される色パターンと、市松模様に基づく色パターンとが比較されると共に、外周画素列によって決定される色パターンと、市松模様に基づく色パターンとが比較される。以下、注目画素から距離sの範囲内の周辺画素列と、注目画素から距離tの範囲内の内周画素列と、が設定される場合について説明する。   As shown in FIG. 4C, the peripheral pixel row is set within the range of the distance s (illustrated in FIG. 4B) from the target pixel. Then, the color pattern determined by the peripheral pixel row is compared with the color pattern based on the checkered pattern. Alternatively, as shown in FIG. 4C, a peripheral pixel row within a range of a distance s from the target pixel and a range of a distance t (illustrated in FIG. 4B) from the target pixel inside the peripheral pixel row. Circular pixel rows and are set. The rest of the peripheral pixel column excluding the inner peripheral pixel column becomes the outer peripheral pixel column. Then, the color pattern determined by the inner peripheral pixel row is compared with the color pattern based on the checkered pattern, and the color pattern determined by the outer peripheral pixel row is compared with the color pattern based on the checkered pattern. Hereinafter, a case will be described in which a peripheral pixel column within a range of a distance s from the target pixel and an inner peripheral pixel column within a range of a distance t from the target pixel are set.

ここで、距離s,tは、任意に設定される。図4(A)に示す場合、左右及び上下方向)にそれぞれ2個の画素で市松模様の一要素が表現されている。内周画素列及び外周画素列にそれぞれ市松模様の両方の色を含めるために、内周画素列及び外周画素列の画素数がともに3個以上となる距離s,tが設定されることが好適である。このように、市松模様の一要素が何個の画素で表現されているかによって距離s,tが変更される。第1画像を撮影するカメラのズームインやズームアウトに従って距離s,tが変更されてもよい。   Here, the distances s and t are set arbitrarily. In the case shown in FIG. 4 (A), one pixel in a checkerboard pattern is represented by two pixels in each of the left, right, up and down directions. In order to include both checkered colors in the inner peripheral pixel row and the outer peripheral pixel row, the distances s and t are preferably set such that the number of pixels in the inner peripheral pixel row and the outer peripheral pixel row are both 3 or more. Is. In this way, the distances s and t are changed depending on how many pixels represent one element of the checkered pattern. The distances s and t may be changed according to zoom-in and zoom-out of the camera that captures the first image.

また、市松模様は、第1画像の撮影の際に背景のカーテン等に付与されるものであるが、カーテンの設置状況、例えば、カーテンのしわ等により、第1画像上の模様に歪みが生じることがある。また、市松模様が、第1画像の撮影の際に床面のカーテン等に付与された場合、遠近法により、第1画像上の模様に歪みが生じることがある。よって、左右及び上下方向にそれぞれ2個の画素で市松模様の一要素が表現されている場合、内周画素列及び外周画素列の画素数がともに4個以上となるように距離s、tが設定されてもよい。市松模様の一方の色が、隣り合う3個の画素で続けて現れる可能性があるからである。   The checkered pattern is given to the background curtain or the like when the first image is taken, but the pattern on the first image is distorted due to the installation condition of the curtain, for example, the wrinkles of the curtain. Sometimes. Further, when the checkered pattern is applied to the curtain or the like on the floor when the first image is taken, the perspective may distort the pattern on the first image. Therefore, when one element of the checkerboard pattern is expressed by two pixels in each of the left and right and the up and down directions, the distances s and t are set so that the number of pixels in the inner peripheral pixel row and the outer peripheral pixel row are both four or more. It may be set. This is because one color of the checkered pattern may appear continuously in three adjacent pixels.

図4(C)は、注目画素から距離sの範囲内であって、上下及び左右方向の4方向でそれぞれ6個の周辺画素を含む周辺画素列と、注目画素から距離tの範囲内であって、上下及び左右方向の4方向でそれぞれ3個の内周画素を含む内周画素列とを示す。以下、周辺画素列が上下及び左右方向の4方向であり、それぞれ6個の周辺画素を含む場合で、内周画素列が上下及び左右方向の4方向であり、それぞれ3個の内周画素を含む場合を例にとって説明する。なお、周辺画素列や内周画素列は、斜め方向で設定されてもよい。   FIG. 4C is within a range of a distance s from the target pixel, and is within a range of a distance t from the target pixel, and a peripheral pixel row including six peripheral pixels in each of the four vertical and horizontal directions. And an inner peripheral pixel row including three inner peripheral pixels in each of the four directions of up, down, left and right. Hereinafter, in the case where the peripheral pixel rows are four directions in the vertical and horizontal directions and each includes six peripheral pixels, the inner peripheral pixel row is the four directions in the vertical and horizontal directions, and the three inner peripheral pixels are respectively formed. The case of including will be described as an example. The peripheral pixel row and the inner peripheral pixel row may be set in an oblique direction.

続いて、注目画素の、前景画素又は背景画素の判断について説明する。   Next, the determination of the foreground pixel or the background pixel of the pixel of interest will be described.

図5(A)は、注目画素が他の色を示す画素値をもつ場合を示す図である。   FIG. 5A is a diagram showing a case where the pixel of interest has a pixel value indicating another color.

図5(A)に示すように、注目画素が図4(A)に示す画素P0である場合を考える。画素P0は、その他の色を示す画素値をもつ画素であるので、周辺画素列や内周画素列を使用するまでもなく、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P0 shown in FIG. 4A as shown in FIG. 5A. Since the pixel P0 is a pixel having a pixel value indicating another color, it is determined to be a foreground pixel without using the peripheral pixel row or the inner peripheral pixel row.

図5(B)〜(L)及び図6(A)〜(G)は、注目画素が緑色又は黄色を示す画素値である場合を示す図である。   FIGS. 5B to 5L and FIGS. 6A to 6G are diagrams showing a case where the pixel of interest has a pixel value indicating green or yellow.

また、図7は、周辺画素列の色パターンによって、注目画素を幾つかの区分に分類するための表を示す図である。注目画素が緑色又は黄色を示す画素値である場合は、先ず、その注目画素がどの区分に分類されるかを判断し、その後、その分類に基づいて、注目画素が背景画素であるのか、或いは、前景画素であるのかを判断する。   Further, FIG. 7 is a diagram showing a table for classifying the target pixel into some sections according to the color pattern of the peripheral pixel row. If the pixel of interest has a pixel value indicating green or yellow, it is first determined to which category the pixel of interest is classified, and then, based on the classification, whether the pixel of interest is a background pixel, or , Determine whether it is a foreground pixel.

図5(B)に示すように、注目画素が図4(A)に示す画素P1である場合を考える。画素P1は、緑色又は黄色を示す画素値をもつ画素であるので、画素P1の周辺画素列の画素値から画素P1が前景画素であるか背景画素であるかが判断される。注目画素の周囲の2方向以上の周辺画素列の色パターンが図7に示す分類A1(又は分類A)に該当すれば、周囲に市松模様を示す画素が多いとみなせる。この場合、その注目画素は、市松模様に相当する画素、つまり、背景画素であると判断される。画素P1の場合、4方向の全ての周辺画素列の色パターンが図7に示す分類A1に相当する。したがって、画素P1は背景画素であると判断される。   Consider a case where the target pixel is the pixel P1 shown in FIG. 4A as shown in FIG. 5B. Since the pixel P1 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P1 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P1. If the color patterns of the peripheral pixel rows in two or more directions around the target pixel correspond to the classification A1 (or classification A) shown in FIG. 7, it can be considered that there are many pixels showing a checkered pattern in the periphery. In this case, the pixel of interest is determined to be a pixel corresponding to a checkerboard pattern, that is, a background pixel. In the case of the pixel P1, the color patterns of all peripheral pixel rows in four directions correspond to the classification A1 shown in FIG. Therefore, the pixel P1 is determined to be the background pixel.

以下、注目画素P2〜P10,P17に関しては、背景画素と判断され、注目画素P11〜P16,P18に関しては前景画素と判断されることを、順次具体的に説明していく。   Hereinafter, the target pixels P2 to P10, P17 are determined to be background pixels, and the target pixels P11 to P16, P18 are determined to be foreground pixels.

図5(C)に示すように、注目画素が図4(A)に示す画素P2である場合を考える。画素P2は、緑色又は黄色を示す画素値をもつ画素であるので、画素P2の周辺画素列の画素値から画素P2が前景画素であるか背景画素であるかが判断される。画素P2の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P2は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the target pixel is the pixel P2 shown in FIG. 4A as shown in FIG. 5C. Since the pixel P2 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P2 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P2. The color pattern of the peripheral pixel row in three directions of the pixel P2, that is, in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P2 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(C)に示すように、画素P2が、その右側において、その他の色を示す前景画素に比較的近いことも推測できる。   Further, as shown in FIG. 5C, it can be inferred that the pixel P2 is relatively close to the foreground pixels showing other colors on the right side thereof.

図5(D)に示すように、注目画素が図4(A)に示す画素P3である場合を考える。画素P3は、緑色又は黄色を示す画素値をもつ画素であるので、画素P3の周辺画素列の画素値から画素P3が前景画素であるか背景画素であるかが判断される。画素P3の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P3は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the target pixel is the pixel P3 shown in FIG. 4A as shown in FIG. 5D. Since the pixel P3 is a pixel having a pixel value indicating green or yellow, whether the pixel P3 is a foreground pixel or a background pixel is determined from the pixel values of the peripheral pixel row of the pixel P3. The color pattern of the peripheral pixel row in three directions of the pixel P3, that is, in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P3 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(D)に示すように、画素P3が、その右側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 5D, it can be inferred that the pixel P3 is a pixel on the right side of the pixel P3 that is relatively close to the foreground pixels indicating other colors.

図5(E)に示すように、注目画素が図4(A)に示す画素P4である場合を考える。画素P4は、緑色又は黄色を示す画素値をもつ画素であるので、画素P4の周辺画素列の画素値から画素P4が前景画素であるか背景画素であるかが判断される。画素P4の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P4は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P4 shown in FIG. 4A as shown in FIG. 5E. Since the pixel P4 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P4 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P4. The color pattern of the pixel P4 in three directions, that is, the color patterns of the peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P4 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(E)に示すように、画素P4が、その右側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 5 (E), it can be inferred that the pixel P4 on the right side thereof is a pixel relatively close to the foreground pixels indicating other colors.

図5(F)に示すように、注目画素が図4(A)に示す画素P5である場合を考える。画素P5は、緑色又は黄色を示す画素値をもつ画素であるので、画素P5の周辺画素列の画素値から画素P5が前景画素であるか背景画素であるかが判断される。画素P5の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P5は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the target pixel is the pixel P5 shown in FIG. 4A as shown in FIG. Since the pixel P5 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P5 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P5. The color pattern of the peripheral pixel row in three directions of the pixel P5, that is, two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P5 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(F)に示すように、画素P5が、その右側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 5 (F), it can be inferred that the pixel P5 is a pixel on the right side thereof which is relatively close to the foreground pixels indicating other colors.

図5(G)に示すように、注目画素が図4(A)に示す画素P6である場合を考える。画素P6は、緑色又は黄色を示す画素値をもつ画素であるので、画素P6の周辺画素列の画素値から画素P6が前景画素であるか背景画素であるかが判断される。画素P6の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P6は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P6 shown in FIG. 4A as shown in FIG. Since the pixel P6 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P6 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P6. The color pattern of the pixel P6 in three directions, that is, the color patterns of the peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P6 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(G)に示すように、画素P6が、その右側において、その他の色を示す前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 5G, it can be inferred that the pixel P6 is a pixel on the right side of the boundary with the foreground pixel indicating another color.

図5(H)に示すように、注目画素が図4(A)に示す画素P7である場合を考える。画素P7は、緑色又は黄色を示す画素値をもつ画素であるので、画素P7の周辺画素列の画素値から画素P7が前景画素であるか背景画素であるかが判断される。画素P7の2方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P7は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P7 shown in FIG. 4A as shown in FIG. 5H. Since the pixel P7 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P7 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P7. The color patterns of the pixel P7 in two directions, that is, the peripheral pixel rows in two or more directions correspond to the classification A1 shown in FIG. In this case, the pixel P7 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(H)に示すように、画素P7が、その右側及び上側において、その他の色を示す前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 5 (H), it can be inferred that the pixel P7 is a pixel on the right side and the upper side of the pixel P7 at the boundary with the foreground pixels indicating other colors.

図5(I)に示すように、注目画素が図4(A)に示す画素P8である場合を考える。画素P8は、緑色又は黄色を示す画素値をもつ画素であるので、画素P8の周辺画素列の画素値から画素P8が前景画素であるか背景画素であるかが判断される。画素P8の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P8は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P8 shown in FIG. 4A as shown in FIG. Since the pixel P8 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P8 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P8. The color pattern of the pixel P8 in three directions, that is, in the peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P8 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(I)に示すように、画素P8が、その右側において、緑色又は黄色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 5 (I), it can be inferred that the pixel P8 on the right side thereof is a pixel relatively close to the foreground pixel showing green or yellow.

図5(J)に示すように、注目画素が図4(A)に示す画素P9である場合を考える。画素P9は、緑色又は黄色を示す画素値をもつ画素であるので、画素P9の周辺画素列の画素値から画素P9が前景画素であるか背景画素であるかが判断される。画素P9の2方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P9は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P9 shown in FIG. 4A as shown in FIG. Since the pixel P9 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P9 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P9. The color pattern of the pixel P9 in two directions, that is, the color patterns of the peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P9 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(J)に示すように、画素P9が、その右側において、緑色又は黄色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 5 (J), it can be inferred that the pixel P9 is a pixel on the right side thereof which is relatively close to the foreground pixel showing green or yellow.

図5(K)に示すように、注目画素が図4(A)に示す画素P10である場合を考える。画素P10は、緑色又は黄色を示す画素値をもつ画素であるので、画素P10の周辺画素列の画素値から画素P10が前景画素であるか背景画素であるかが判断される。画素P10の2方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P10は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P10 shown in FIG. 4A as shown in FIG. 5K. Since the pixel P10 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P10 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P10. The color pattern of the pixel P10 in two directions, that is, the peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P10 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図5(K)に示すように、画素P10が、その右側において、緑色又は黄色を示す前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 5K, it can be inferred that the pixel P10 is a pixel on the right side of the boundary with the foreground pixel showing green or yellow.

図5(L)に示すように、注目画素が図4(A)に示す画素P11である場合を考える。画素P11は、緑色又は黄色を示す画素値をもつ画素であるので、画素P11の周辺画素列の画素値から画素P11が前景画素であるか背景画素であるかが判断される。注目画素の周囲の2方向以上の周辺画素列の色パターンが図7に示す分類E5(又は分類E)に該当すれば、周囲に人物等の対象物を示す画素が多いとみなせる。この場合、その注目画素は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P11 shown in FIG. 4A as shown in FIG. Since the pixel P11 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P11 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P11. If the color pattern of the peripheral pixel rows in two or more directions around the pixel of interest corresponds to the category E5 (or the category E) shown in FIG. 7, it can be considered that there are many pixels around the target pixel such as a person. In this case, the pixel of interest is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図5(L)に示すように、画素P11が、その左側において、背景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 5L, it can be inferred that the pixel P11 is a pixel on the left side of the pixel P11 at the boundary with the background pixel.

図6(A)に示すように、注目画素が図4(A)に示す画素P12である場合を考える。画素P12は、緑色又は黄色を示す画素値をもつ画素であるので、画素P12の周辺画素列の画素値から画素P12が前景画素であるか背景画素であるかが判断される。画素P12の4方向全て、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P12は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P12 shown in FIG. 4A as shown in FIG. Since the pixel P12 has a pixel value indicating green or yellow, it is determined whether the pixel P12 is a foreground pixel or a background pixel based on the pixel values of the peripheral pixel row of the pixel P12. The color patterns of the pixel P12 in all four directions, that is, the color patterns of the peripheral pixel rows in two or more directions correspond to the classification E5 shown in FIG. 7. In this case, the pixel P12 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(A)に示すように、画素P12が、その上側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 6A, it can be inferred that the pixel P12 is a pixel on the upper side of the pixel P12 which is relatively close to the foreground pixels indicating other colors.

図6(B)に示すように、注目画素が図4(A)に示す画素P13である場合を考える。画素P13は、緑色又は黄色を示す画素値をもつ画素であるので、画素P13の周辺画素列の画素値から画素P13が前景画素であるか背景画素であるかが判断される。画素P13の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P13は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P13 shown in FIG. 4A as shown in FIG. 6B. Since the pixel P13 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P13 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P13. The color pattern of the peripheral pixel row in three directions of the pixel P13, that is, two or more directions corresponds to the classification E5 shown in FIG. 7. In this case, the pixel P13 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(B)に示すように、画素P13が、その上側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 6B, it can be inferred that the pixel P13 is a pixel on the upper side thereof which is relatively close to the foreground pixels indicating other colors.

図6(C)に示すように、注目画素が図4(A)に示す画素P14である場合を考える。画素P14は、緑色又は黄色を示す画素値をもつ画素であるので、画素P14の周辺画素列の画素値から画素P14が前景画素であるか背景画素であるかが判断される。画素P14の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P14は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the target pixel is the pixel P14 shown in FIG. 4A as shown in FIG. 6C. Since the pixel P14 is a pixel having a pixel value indicating green or yellow, whether the pixel P14 is a foreground pixel or a background pixel is determined from the pixel values of the peripheral pixel row of the pixel P14. The color pattern of the pixel P14 in three directions, that is, in the peripheral pixel rows in two or more directions corresponds to the category E5 shown in FIG. In this case, the pixel P14 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(C)に示すように、画素P14が、その上側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 6C, it can be inferred that the pixel P14 is a pixel on the upper side thereof which is relatively close to the foreground pixels indicating other colors.

図6(D)に示すように、注目画素が図4(A)に示す画素P15である場合を考える。画素P15は、緑色又は黄色を示す画素値をもつ画素であるので、画素P15の周辺画素列の画素値から画素P15が前景画素であるか背景画素であるかが判断される。画素P15の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P15は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P15 shown in FIG. 4A as shown in FIG. 6D. Since the pixel P15 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P15 is a foreground pixel or a background pixel based on the pixel values of the peripheral pixel row of the pixel P15. The color pattern of the pixel P15 in three directions, that is, the color patterns of the peripheral pixel rows in two or more directions corresponds to the classification E5 illustrated in FIG. 7. In this case, the pixel P15 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(D)に示すように、画素P15が、その上側において、その他の色を示す前景画素に比較的近い画素であることも推測できる。   Further, as shown in FIG. 6D, it can be inferred that the pixel P15 is a pixel on the upper side thereof which is relatively close to the foreground pixels indicating other colors.

図6(E)に示すように、注目画素が図4(A)に示す画素P16である場合を考える。画素P16は、緑色又は黄色を示す画素値をもつ画素であるので、画素P16の周辺画素列の画素値から画素P16が前景画素であるか背景画素であるかが判断される。画素P16の3方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P16は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the pixel of interest is the pixel P16 shown in FIG. 4A as shown in FIG. 6E. Since the pixel P16 is a pixel having a pixel value indicating green or yellow, whether the pixel P16 is a foreground pixel or a background pixel is determined from the pixel values of the peripheral pixel row of the pixel P16. The color pattern of the pixel P16 in three directions, that is, the color patterns of the peripheral pixel rows in two or more directions corresponds to the classification E5 shown in FIG. 7. In this case, the pixel P16 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(E)に示すように、画素P16が、その上側において、その他の色を示す前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 6E, it can be inferred that the pixel P16 is a pixel on the upper side of the pixel P16 which is a boundary with the foreground pixel indicating another color.

図6(F)に示すように、注目画素が図4(A)に示す画素P17である場合を考える。画素P17は、緑色又は黄色を示す画素値をもつ画素であるので、画素P17の周辺画素列の画素値から画素P17が前景画素であるか背景画素であるかが判断される。画素P17の2方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類A1に相当する。この場合、画素P17は、市松模様に相当する画素、つまり、背景画素であると判断される。   Consider a case where the pixel of interest is the pixel P17 shown in FIG. 4A as shown in FIG. 6F. Since the pixel P17 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P17 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P17. The color pattern of the pixel P17 in two directions, that is, the color patterns of peripheral pixel rows in two or more directions corresponds to the classification A1 shown in FIG. In this case, the pixel P17 is determined to be a pixel corresponding to a checkered pattern, that is, a background pixel.

また、図6(F)に示すように、画素P17が、その右側において、緑色又は黄色を示す前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 6 (F), it can be inferred that the pixel P17 is a pixel on the right side of the boundary with the foreground pixel showing green or yellow.

図6(G)に示すように、注目画素が図4(A)に示す画素P18である場合を考える。画素P18は、緑色又は黄色を示す画素値をもつ画素であるので、画素P18の周辺画素列の画素値から画素P18が前景画素であるか背景画素であるかが判断される。画素P18の2方向、つまり、2方向以上の周辺画素列の色パターンが図7に示す分類E5に相当する。この場合、画素P17は、対象物に相当する画素、つまり、前景画素であると判断される。   Consider a case where the target pixel is the pixel P18 shown in FIG. 4A as shown in FIG. 6G. Since the pixel P18 is a pixel having a pixel value indicating green or yellow, it is determined whether the pixel P18 is a foreground pixel or a background pixel from the pixel values of the peripheral pixel row of the pixel P18. The color pattern of the pixel P18 in two directions, that is, the peripheral pixel row in two or more directions corresponds to the classification E5 illustrated in FIG. 7. In this case, the pixel P17 is determined to be a pixel corresponding to the target object, that is, a foreground pixel.

また、図6(G)に示すように、画素P18が、その左側において、背景画素との境界の画素であることも推測できる。画素P18が、その上側において、その他の色の前景画素との境界の画素であることも推測できる。   Further, as shown in FIG. 6G, it can be inferred that the pixel P18 is a pixel on the left side of the pixel P18 at the boundary with the background pixel. It can also be inferred that the pixel P18 is a pixel on the upper side of the boundary with the foreground pixels of other colors.

図2の説明に戻って、判断部41は、ステップST1によって読み出された第1画像の全ての画素について、背景画素又は前景画素であるかを判断したか否かを判断する(ステップST7)。ステップST7についてYES,すなわち、第1画像の全ての画素について、背景画素又は前景画素であるかを判断したと判断される場合、生成部42は、ステップST5,ST6によって黒色及び白色を示す画素値がそれぞれ付与されたマスク画像を生成する(ステップST8)。生成部42は、ステップST1によって読み出された第1画像と、ステップST8によって生成されたマスク画像の反転画像とのAND処理(論理積)により、第1画像から対象物部分が抽出された対象物部分画像を生成する(ステップST9)。図8(B)は、図3(B)に示す第1画像と、図8(A)に示す反転画像に基づく対象物部分画像を示す。   Returning to the description of FIG. 2, the determination unit 41 determines whether or not it has been determined whether all the pixels of the first image read in step ST1 are background pixels or foreground pixels (step ST7). .. If YES in step ST7, that is, if it is determined that all pixels of the first image are background pixels or foreground pixels, the generation unit 42 determines in step ST5 and ST6 pixel values indicating black and white. To generate mask images (step ST8). The generation unit 42 performs an AND process (logical product) of the first image read out in step ST1 and the reverse image of the mask image generated in step ST8 to obtain the object from which the object portion is extracted. An object part image is generated (step ST9). FIG. 8B shows a partial image of the object based on the first image shown in FIG. 3B and the reverse image shown in FIG. 8A.

生成部42は、記憶部12から図3(D)に示す第2画像を読み出し、第2画像と、ステップST8によって生成されたマスク画像とのAND処理により、第2画像から背景部分が抽出された背景部分画像を生成する(ステップST10)。図3(D)に示す第2画像は、主として風景が撮影されることにより取得された画像である。第2画像は、第1画像と同様に、独立した静止画像であってもよく、動画像を構成する各コマの画像であってもよい。図8(D)は、図3(D)に示す第2画像と、図8(C)に示すマスク画像とのAND処理により、背景部分画像を示す。   The generation unit 42 reads the second image shown in FIG. 3D from the storage unit 12, and performs the AND process on the second image and the mask image generated in step ST8 to extract the background portion from the second image. The background portion image is generated (step ST10). The second image shown in FIG. 3D is an image acquired mainly by photographing a landscape. Similar to the first image, the second image may be an independent still image or an image of each frame forming a moving image. FIG. 8D shows a background partial image by AND processing of the second image shown in FIG. 3D and the mask image shown in FIG. 8C.

生成部42は、ステップST9によって生成された対象物部分画像と、ステップST10によって生成された背景部分画像とのOR処理(論理和)により、合成画像を生成する(ステップST11)。図8(E)は、図8(B)に示す対象物部分画像と、図8(D)に示す背景部部分画像に基づく合成画像を示す。   The production | generation part 42 produces | generates a synthetic | combination image by the OR process (OR) of the target object partial image produced | generated by step ST9, and the background partial image produced | generated by step ST10 (step ST11). FIG. 8E shows a composite image based on the object partial image shown in FIG. 8B and the background partial image shown in FIG. 8D.

上記ステップST1〜ST11の動作を、静止画像に相当する1個の第1画像に適用することで、静止画像を前景とし、静止画像を背景とした1個の合成画像を生成できる。又は、上記ステップST1〜ST11の動作を、動画像の複数コマに相当する複数の第1画像に適用することで、動画像を前景とし、動画像又は静止画像を背景とした複数の合成画像(動画像)を生成できる。   By applying the operations of steps ST1 to ST11 to one first image corresponding to a still image, one combined image with the still image as the foreground and the still image as the background can be generated. Alternatively, by applying the operations of steps ST1 to ST11 to a plurality of first images corresponding to a plurality of frames of a moving image, a plurality of composite images with the moving image as the foreground and the moving image or the still image as the background ( A moving image) can be generated.

3.効果
以上説明した実施形態によれば、第1画像の対象物部分の色に因らず適切な合成画像を生成できる。
3. Effect According to the embodiment described above, an appropriate composite image can be generated regardless of the color of the object portion of the first image.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。   It should be noted that the present invention is not limited to the above-described embodiments as they are, and can be embodied by modifying the constituent elements within a range not departing from the gist of the invention in an implementation stage. Further, various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the above-described embodiments. For example, some components may be deleted from all the components shown in the embodiment.

1…画像合成装置
11…制御部
12…記憶部
41…判断部
42…生成部
1 ... Image synthesizer 11 ... Control unit 12 ... Storage unit 41 ... Judgment unit 42 ... Generation unit

Claims (2)

市松模様を背景として撮影された第1画像の各画素について、その周辺の周辺画素列によって決定される色パターンと、前記市松模様に基づく色パターンとを比較し、前記各画素が前景部分に相当する前景画素であるか、又は、背景部分に相当する背景画素であるかを判断する判断手段と、
前記前景画素及び前記背景画素からなるマスク画像を生成し、前記マスク画像の反転画像及び前記第1画像に基づく画像と、前記第1画像とは異なる第2画像及び前記マスク画像に基づく画像とを合成処理することで、合成画像を生成する生成手段と、
を有し、
前記判断手段は、前記第1画像の各画素について、前記周辺画素列に含まれる内周画素列によって決定される内周色パターンと、前記市松模様に基づく色パターンとを比較すると共に、前記周辺画素列に含まれる外周画素列によって決定される外周色パターンと、前記市松模様に基づく色パターンとを比較する、
画像合成装置。
For each pixel of the first image photographed with the checkerboard pattern as a background, the color pattern determined by the peripheral pixel row around the first image is compared with the color pattern based on the checkerboard pattern, and each pixel corresponds to the foreground portion. A foreground pixel or a background pixel corresponding to the background portion,
A mask image composed of the foreground pixels and the background pixels is generated, and an inverted image of the mask image and an image based on the first image, and a second image different from the first image and an image based on the mask image are generated. Generating means for generating a combined image by performing a combining process;
Have a,
For each pixel of the first image, the determination means compares an inner peripheral color pattern determined by an inner peripheral pixel row included in the peripheral pixel row with a color pattern based on the checkerboard pattern, Comparing an outer peripheral color pattern determined by an outer peripheral pixel row included in the pixel row and a color pattern based on the checkerboard pattern,
Image synthesizer.
コンピュータに、  On the computer,
市松模様を背景として撮影された第1画像の各画素について、その周辺の周辺画素列によって決定される色パターンと、前記市松模様に基づく色パターンとを比較し、前記各画素が前景部分に相当する前景画素であるか、又は、背景部分に相当する背景画素であるかを判断する判断機能と、  For each pixel of the first image photographed with the checkerboard pattern as the background, the color pattern determined by the peripheral pixel row in the periphery is compared with the color pattern based on the checkerboard pattern, and each pixel corresponds to the foreground portion. And a determination function of determining whether the pixel is a foreground pixel or a background pixel corresponding to a background portion,
前記前景画素及び前記背景画素からなるマスク画像を生成し、前記マスク画像の反転画像及び前記第1画像に基づく画像と、前記第1画像とは異なる第2画像及び前記マスク画像に基づく画像とを合成処理することで、合成画像を生成する生成機能と、  A mask image composed of the foreground pixels and the background pixels is generated, and an inverted image of the mask image and an image based on the first image, and a second image different from the first image and an image based on the mask image are generated. A generation function that generates a composite image by performing composition processing,
を実現させ、  Is realized,
前記判断機能は、前記第1画像の各画素について、前記周辺画素列に含まれる内周画素列によって決定される内周色パターンと、前記市松模様に基づく色パターンとを比較すると共に、前記周辺画素列に含まれる外周画素列によって決定される外周色パターンと、前記市松模様に基づく色パターンとを比較する機能を含む、  The determination function compares, for each pixel of the first image, an inner peripheral color pattern determined by an inner peripheral pixel row included in the peripheral pixel row with a color pattern based on the checkered pattern, and A peripheral color pattern determined by a peripheral pixel row included in the pixel row, and a function of comparing the color pattern based on the checkered pattern,
画像合成プログラム。  Image synthesis program.
JP2016112876A 2016-06-06 2016-06-06 Image synthesizing device and image synthesizing program Active JP6694760B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016112876A JP6694760B2 (en) 2016-06-06 2016-06-06 Image synthesizing device and image synthesizing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016112876A JP6694760B2 (en) 2016-06-06 2016-06-06 Image synthesizing device and image synthesizing program

Publications (2)

Publication Number Publication Date
JP2017220755A JP2017220755A (en) 2017-12-14
JP6694760B2 true JP6694760B2 (en) 2020-05-20

Family

ID=60657878

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016112876A Active JP6694760B2 (en) 2016-06-06 2016-06-06 Image synthesizing device and image synthesizing program

Country Status (1)

Country Link
JP (1) JP6694760B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110234683A (en) 2017-11-16 2019-09-13 住友电气工业株式会社 Hollow extrusion formed body, its crosslinked, heat-shrinkable tube and multilayer heat-shrinkable tube

Also Published As

Publication number Publication date
JP2017220755A (en) 2017-12-14

Similar Documents

Publication Publication Date Title
US11501535B2 (en) Image processing apparatus, image processing method, and storage medium for reducing a visibility of a specific image region
US9767612B2 (en) Method, system and apparatus for removing a marker projected in a scene
JP2022071177A (en) Multiplexed high dynamic range image
TWI545508B (en) Method for performing a face tracking function and an electric device having the same
JP4848521B2 (en) Method for substituting mouse for projector projected image and system for substituting mouse for the same
JP2008198082A (en) Image processing method, image processing apparatus, and digital camera
JP6694760B2 (en) Image synthesizing device and image synthesizing program
JP2020119096A (en) Image processing system and image processing method and program
JP5573520B2 (en) Image generation apparatus, imaging apparatus, and image generation program
JP2023169254A (en) Imaging element, operating method for the same, program, and imaging system
US20140301638A1 (en) Color extraction-based image processing method, computer-readable storage medium storing the same, and digital image apparatus
US10602112B2 (en) Image processing apparatus
JP6726324B1 (en) Imaging device, image synthesizing method, and image synthesizing program
US20170076480A1 (en) Composite image creation system, composite image creation method, and non-transitory computer readable medium storing composite image creation program
US20160267356A1 (en) Image processing apparatus and image processing method of performing image segmentation
JP6056511B2 (en) Image processing apparatus, method, program, and imaging apparatus
US20170193636A1 (en) Image processing device
US20140368701A1 (en) Cloning image data patch in hole of pixel array (patch and clone)
JP2008071014A (en) Image processing program, image processor and electronic camera
KR102599584B1 (en) Image processing apparatus
CN107517367B (en) Baeyer area image interpolation method, device, picture processing chip and storage device
JP2011234229A (en) Imaging apparatus
JP2016091376A (en) Image processor and control method thereof, program and recording medium
US20220172401A1 (en) Image processing apparatus, image generation method, and storage medium
JP6671943B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190513

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200326

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200420

R150 Certificate of patent or registration of utility model

Ref document number: 6694760

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250