JP4303696B2 - Background replacement device, background replacement program, background replacement program storage medium, and background replacement method - Google Patents

Background replacement device, background replacement program, background replacement program storage medium, and background replacement method Download PDF

Info

Publication number
JP4303696B2
JP4303696B2 JP2005091461A JP2005091461A JP4303696B2 JP 4303696 B2 JP4303696 B2 JP 4303696B2 JP 2005091461 A JP2005091461 A JP 2005091461A JP 2005091461 A JP2005091461 A JP 2005091461A JP 4303696 B2 JP4303696 B2 JP 4303696B2
Authority
JP
Japan
Prior art keywords
background
image
color
replacement
determination method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005091461A
Other languages
Japanese (ja)
Other versions
JP2006279206A (en
Inventor
雅裕 久保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Corp
Original Assignee
Fujifilm Corp
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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2005091461A priority Critical patent/JP4303696B2/en
Publication of JP2006279206A publication Critical patent/JP2006279206A/en
Application granted granted Critical
Publication of JP4303696B2 publication Critical patent/JP4303696B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Description

本発明は、撮影画像中の背景を別の背景に置換して背景置換画像を作成する背景置換装置、コンピュータをその背景置換装置として動作させる背景置換プログラム、その背景置換プログラムが記憶されてなる背景置換プログラム記憶媒体、および、撮影画像中の背景を別の背景に置換して背景置換画像を作成する背景置換方法に関する。   The present invention relates to a background replacement device that creates a background replacement image by replacing a background in a captured image with another background, a background replacement program that causes a computer to operate as the background replacement device, and a background that stores the background replacement program The present invention relates to a replacement program storage medium and a background replacement method for generating a background replacement image by replacing a background in a captured image with another background.

従来、写真館等では、背景幕を使った撮影が行なわれている。しかし、このような撮影は、十分に背景を作り出すために大きな背景幕が使われ、広い撮影スペースを必要とする。また、背景幕の交換等にも手間がかかり、結果的に撮影コストが高くなる。   Conventionally, photography using a background curtain has been performed in a photo studio or the like. However, in such shooting, a large backdrop is used to create a sufficient background, and a large shooting space is required. In addition, it takes time to replace the background curtain, and as a result, the photographing cost increases.

そこで、もっと手軽に撮影を楽しむことができるように、従来のような大きな背景幕や広い撮影スペースが不要な、小型の撮影システムの開発が望まれている。このような小型の撮影システムでは、上記のような背景幕の替りに、何らかの仮の背景の前で撮影が行なわれることとなるため、撮影で得られた撮影画像に対して、撮影画像中の背景を、顧客が所望する背景と差替えるという背景置換処理を適用することが考えられる。   Therefore, there is a demand for the development of a compact photographing system that does not require a large background screen and a wide photographing space as in the past so that photographing can be performed more easily. In such a small shooting system, shooting is performed in front of some temporary background instead of the background curtain as described above. It is conceivable to apply a background replacement process in which the background is replaced with a background desired by the customer.

このような背景置換処理に関する技術の一例として、例えば、青色等に塗られた背景パネル等を被写体の背後に配置して撮影を行ない、その撮影で得られた撮影画像において、背景パネルの色と同色の部分と、異なる色の部分とを、それぞれ撮影画像中の背景領域と被写体領域として区別し、撮影画像中の背景領域に区別された部分を所望の背景に置換するクロマキー処理と呼ばれる処理が知られている。   As an example of the technology related to such background replacement processing, for example, a background panel painted in blue or the like is placed behind the subject to perform shooting, and in the captured image obtained by the shooting, the color of the background panel There is a process called chroma key processing that distinguishes the same color part and the different color part as a background area and a subject area in the photographed image and replaces the part distinguished in the background area in the photographed image with a desired background. Are known.

このクロマキー処理では、撮影画像中の背景パネル上に被写体の影が写っていると、この影が、被写体領域と背景領域との区別を妨げてしまうことがある。そこで、クロマキー処理の対象となる撮影画像を撮影する際には、背景として、面発光する背景パネルを用い、背景パネル上の被写体の影が、この背景パネルが発する光で打ち消された状態で撮影を行なうという技術が提案されている(例えば、特許文献1参照。)。また、この特許文献1では、クロマキー処理において、被写体領域として区別された部分と所望の背景とを合成する際には、被写体領域として区別された部分の色調を、その所望の背景の色調に応じた色調に調整することで、その所望の背景の中に被写体が自然に溶け込んで見える合成画像を作成するという処理も提案されている。   In this chroma key process, if a shadow of a subject appears on the background panel in the captured image, the shadow may interfere with the distinction between the subject region and the background region. Therefore, when shooting a photographic image that is subject to chroma key processing, a background panel that emits light is used as the background, and the shadow of the subject on the background panel is canceled with the light emitted from the background panel. The technique of performing is proposed (for example, refer to Patent Document 1). Further, in Patent Document 1, in the chroma key process, when a portion distinguished as a subject region and a desired background are combined, the color tone of the portion distinguished as the subject region is set according to the color tone of the desired background. There has also been proposed a process of creating a composite image in which a subject appears to be naturally blended into the desired background by adjusting the color tone.

また、例えば、屋外等といった、被写体の背後が開けた場所で、被写体に向けた照明を点灯した状態と、その照明を消灯した状態との2つの照明条件それぞれの下で撮影を行なって2つの撮影画像を取得し、これら2つの撮影画像において、互いに輝度が異なっている部分と輝度が同等な部分とを、それぞれ撮影画像中の被写体領域と背景領域として区別し、撮影画像中の背景領域に区別された部分を所望の背景に置換するという技術も知られている(例えば、特許文献2参照。)。
特開2000−224410号公報(第3−10頁、図3) 特開平10−210340号公報(第2−3頁、図1)
In addition, for example, in a place where the back of the subject is open, such as outdoors, shooting is performed under two illumination conditions, that is, a state where the illumination directed to the subject is turned on and a state where the illumination is turned off. A photographed image is acquired, and in these two photographed images, a part having a different luminance and a part having the same brightness are distinguished from each other as a subject area and a background area in the photographed image. There is also known a technique of replacing a distinguished portion with a desired background (see, for example, Patent Document 2).
JP 2000-224410 A (page 3-10, FIG. 3) Japanese Patent Laid-Open No. 10-210340 (page 2-3, FIG. 1)

ところで、写真館等において、上記の特許文献1や特許文献2や一般的なクロマキー処理等による背景置換処理が行なわれる際には、多くの場合、その処理によって作成される背景置換画像をプリントする前に、背景置換画像をモニター画面等に表示して顧客に提示するということが行なわれる。そして、顧客の要望によっては、置換用の背景を変えながら何度か背景置換処理を行ない、最終的に、顧客が最も気に入った背景置換画像をプリントするといった運用も行なわれる。このような運用においては、あまり顧客を待たせることなく、背景置換画像を素早く提示できることが望ましいが、一方で、この提示を素早くした分、プリント等といった手段によって顧客に最終的に提供される背景置換画像の画質が低下してしまっては本末転倒である。このように、背景置換処理については、背景置換画像の顧客への提示を素早く行なうことができ、かつ、最終的には、画質の良好な背景置換画像を顧客に提供できるという優れた運用性が望まれている。   By the way, when background replacement processing is performed by the above-described Patent Document 1, Patent Document 2, or general chroma key processing in a photo studio or the like, in many cases, a background replacement image created by the processing is printed. Prior to this, a background replacement image is displayed on a monitor screen or the like and presented to the customer. Depending on the customer's request, the background replacement process is performed several times while changing the replacement background, and finally the background replacement image that the customer likes most is printed. In such operations, it is desirable that the background replacement image can be presented quickly without waiting for the customer too much, but on the other hand, the background that is finally provided to the customer by means such as printing, etc. If the image quality of the replacement image deteriorates, it will fall to the end. As described above, the background replacement process has an excellent operability in that the background replacement image can be quickly presented to the customer, and finally, the background replacement image with good image quality can be provided to the customer. It is desired.

本発明は、上記事情に鑑み、運用性に優れた背景置換装置、コンピュータをそのような背景置換装置として動作させる背景置換プログラム、その背景置換プログラムが記憶されてなる背景置換プログラム記憶媒体、および、運用性に優れた背景置換方法を提供することを目的とする。   In view of the above circumstances, the present invention provides a background replacement device excellent in operability, a background replacement program that causes a computer to operate as such a background replacement device, a background replacement program storage medium in which the background replacement program is stored, and An object of the present invention is to provide a background replacement method with excellent operability.

上記目的を達成する本発明の背景置換装置は、複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
上記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、上記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを備えたことを特徴とする。
The background replacement device of the present invention that achieves the above object includes an image acquisition unit that acquires a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing And a background replacement unit that replaces the background of the captured image with another background using the ratio.

ここで、「決定方法を選択する」とは、ユーザによる選択操作に応じた選択であってもよいし、選択ルールに従った自動選択であっても良い。   Here, “selecting a determination method” may be selection according to a selection operation by the user, or may be automatic selection according to a selection rule.

モニター画面上等で顧客に背景置換画像を何度か提示し、最終的に顧客が気に入った背景置換画像をプリント等といった手段によって顧客に提供するという運用では、提示のための背景置換画像については即時性が求められ、最終的に顧客に提供される背景置換画像については高画質が求められる。このように、上記のような運用において作成される背景置換画像は、求められる特性が使用目的に応じて異なる。ここで、上記混合比は置換後の画質に大きな影響を与えるものであり、また、その混合比の決定時間は、背景の置換処理の処理時間のかなりの部分を占める。上記の本発明の背景置換装置によれば、混合比の決定時間が互いに異なる複数の決定方法のうちから1つの決定方法が選択され、その選択された決定方法を用いた背景の置換処理が行なわれる。これにより、例えば、顧客への提示用の背景置換画像を作成するときには、混合比の決定時間が短い決定方法を上記決定方法選択部で選択することで背景置換処理の処理時間の短縮を図り、顧客に背景置換処理を素早く提示することができる。また、最終的に顧客に提供される背景置換画像を作成するときには、上記混合比の決定時間が長い決定方法を上記決定方法選択部で選択することで、背景置換処理において高画質を得るための混合比を時間を掛けて決定し、顧客に高画質の背景置換処理を提供することができる。つまり、本発明の背景置換装置によれば、背景置換画像の顧客への提示を素早く行なうことができ、かつ、最終的には、画質の良好な背景置換画像を顧客に提供することができ、運用性に優れている。   In the operation of presenting the background replacement image to the customer several times on the monitor screen etc., and finally providing the customer with the background replacement image that the customer likes by means such as printing, etc. Immediateness is required, and high quality is required for the background replacement image that is finally provided to the customer. As described above, the background replacement image created in the operation as described above has different characteristics depending on the purpose of use. Here, the mixing ratio greatly affects the image quality after replacement, and the determination time of the mixing ratio occupies a considerable part of the processing time of the background replacement processing. According to the background replacement apparatus of the present invention described above, one determination method is selected from a plurality of determination methods with different mixing ratio determination times, and background replacement processing is performed using the selected determination method. It is. Thereby, for example, when creating a background replacement image for presentation to the customer, the determination method of the background replacement process is shortened by selecting a determination method with a short determination time of the mixing ratio by the determination method selection unit, The background replacement process can be quickly presented to the customer. In addition, when creating a background replacement image that is finally provided to a customer, the determination method selection unit selects a determination method with a long determination time of the mixing ratio, thereby obtaining high image quality in the background replacement processing. The mixing ratio can be determined over time to provide the customer with high quality background replacement processing. That is, according to the background replacement device of the present invention, the background replacement image can be quickly presented to the customer, and finally, the background replacement image with good image quality can be provided to the customer. Excellent operability.

また、本発明の背景置換装置において、「上記所定の撮影条件下で撮影された撮影画像に、上記決定方法選択部で選択された決定方法を示す決定情報と、その決定方法で決定された混合比とを付加して保存する画像保存部を備え、
上記背景置換部が、上記画像保存部によって保存された撮影画像についての再度の背景の置換処理も実行するものであり、その再度の背景の置換処理の際には、その撮影画像に付加されている決定情報が示す決定方法における混合比の決定時間以下の決定時間の決定方法が上記決定方法選択部で選択された場合には、その撮影画像に付加されている混合比を用いて背景の置換処理を実行し、その撮影画像に付加されている決定情報が示す決定方法における混合比の決定時間よりも長い決定時間の決定方法が上記決定方法選択部で選択された場合には、その選択された決定方法で混合比を決定し、決定した混合比を用いて背景の置換処理を実行するものである」という形態は好ましい形態である。
Further, in the background replacement device of the present invention, “decision information indicating the decision method selected by the decision method selection unit in the photographed image photographed under the predetermined photographing condition and the mixture determined by the decision method” It has an image storage unit that adds and stores ratios,
The background replacement unit also executes background replacement processing for the captured image stored by the image storage unit again, and is added to the captured image when the background replacement processing is performed again. When the determination method of the determination time equal to or less than the determination time of the mixture ratio in the determination method indicated by the determination information is selected by the determination method selection unit, the background replacement is performed using the mixture ratio added to the photographed image. When the determination method selection unit that selects a determination time longer than the determination time of the mixture ratio in the determination method indicated by the determination information added to the captured image is selected, the selected method is selected. In the preferred embodiment, the mixing ratio is determined by the determination method described above, and the background replacement process is executed using the determined mixing ratio.

上述したように、背景置換処理は、顧客の要望によって、置換用の背景を変えながら何度か繰り返されることがある。また、過去に顧客に提供した背景置換画像についての再注文において、顧客の要望によって、背景置換画像中の背景をさらに別の背景に置換するという再置換処理が行なわれることもある。上記の好ましい形態の背景置換処理によれば、上記のような背景置換処理の繰返しや再置換処理の際には、上記画像保存部によって保存された撮影画像とその撮影画像に付加された混合比が再利用され、処理の効率化が図られる。また、混合比の再利用について、その混合比が決定されたときの決定時間以下の決定時間に対応する決定方法が上記決定方法選択部で選択された場合に限り、その混合比を再利用するという制限を設けることにより、再度の背景の置換処理で得られる背景置換画像の画質が、過去に得られた背景置換画像の画質よりも低下してしまうことが回避される。   As described above, the background replacement process may be repeated several times while changing the replacement background according to the customer's request. Further, in the reordering of the background replacement image provided to the customer in the past, a replacement process may be performed in which the background in the background replacement image is replaced with another background according to the customer's request. According to the preferred embodiment of the background replacement process, when the background replacement process as described above is repeated or re-replaced, the captured image stored by the image storage unit and the mixing ratio added to the captured image are added. Is reused, and the processing efficiency is improved. Also, regarding the reuse of the mixture ratio, the mixture ratio is reused only when the determination method corresponding to the determination time equal to or less than the determination time when the mixture ratio is determined is selected by the determination method selection unit. By providing such a restriction, it is possible to avoid that the image quality of the background replacement image obtained by the background replacement process again is lower than the image quality of the background replacement image obtained in the past.

また、本発明の背景置換装置において、「上記複数の決定方法のうちの1つの決定方法が、撮影画像中の色は真の被写体色と背景色が上記混合比で混合した混合色であるという前提で真の被写体色と混合比とを決定する決定方法である」という形態も好ましい形態である。   Further, in the background replacement device of the present invention, “one of the plurality of determination methods is that the color in the captured image is a mixed color in which the true subject color and the background color are mixed at the above-mentioned mixing ratio. A form of “determining a true subject color and a mixing ratio on the premise” is also a preferable form.

この好ましい形態の背景置換装置によれば、上記決定方法選択部で、上記のような前提で真の被写体色と混合比とを決定する決定方法を選択し、その選択された決定方法を用いて背景の置換処理を行なうことにより画質の良好な背景置換画像を作成することができる。   According to this preferred embodiment of the background replacement apparatus, the determination method selection unit selects a determination method for determining the true subject color and the mixing ratio on the assumption as described above, and uses the selected determination method. By performing the background replacement process, a background replacement image with good image quality can be created.

また、本発明の背景置換装置において、「上記複数の決定方法のうちの1つの決定方法が、上記画像取得部で取得された撮影画像を縮小した縮小画像を用いて上記混合比を決定する決定方法である」という形態や、
「上記画像取得部で取得された撮影画像に基づいて、撮影画像中の被写体領域と背景領域と境界領域とを区別する領域区別部を備え、
上記複数の決定方法のうちの1つの決定方法が、上記背景領域、上記被写体領域、および上記境界領域に対し、それぞれ、純粋な背景色を表わす混合比、純粋な被写体色を表わす混合比、および一定の混合比を割り当てるという混合比の決定方法である」という形態も好ましい形態である。
Further, in the background replacement device of the present invention, “one determination method among the plurality of determination methods is to determine the mixture ratio using a reduced image obtained by reducing the captured image acquired by the image acquisition unit”. `` It is a method ''
“A region distinguishing unit that distinguishes a subject region, a background region, and a boundary region in a captured image based on the captured image acquired by the image acquiring unit,
One of the plurality of determination methods includes a mixing ratio representing a pure background color, a mixing ratio representing a pure subject color, and a mixing ratio representing a pure subject color, respectively, with respect to the background region, the subject region, and the boundary region. A form of “a method of determining a mixing ratio by assigning a certain mixing ratio” is also a preferable form.

これらの好ましい形態の背景置換装置によれば、上記決定方法選択部で、上記のような各方法を選択し、その選択された決定方法を用いて背景の置換処理を行なうことにより、背景置換処理の処理時間の短縮を図り、顧客に背景置換処理を素早く提示することができる。上記縮小画像を用いる決定方法では、上記混合比を決定する際に扱う画像データの量が少なくてすむので、混合比の決定時間の短縮、延いては背景置換処理の処理時間の短縮が図られる。また、領域に混合比を割り当てる決定方法では、混合比の決定が、上記領域区別部で区別された各領域に、予め用意された混合比を割り当てるという単純な処理となるので、混合比の決定時間の短縮、延いては背景置換処理の処理時間の短縮が図られる。   According to these preferred embodiments of the background replacement device, the determination method selection unit selects each method as described above, and performs the background replacement processing using the selected determination method, thereby performing background replacement processing. Therefore, the background replacement process can be quickly presented to the customer. In the determination method using the reduced image, it is possible to reduce the amount of image data to be handled when determining the mixture ratio, so that the determination time of the mixture ratio can be shortened and the processing time of the background replacement process can be shortened. . In addition, in the determination method for assigning the mixture ratio to the region, the determination of the mixture ratio is a simple process of assigning a prepared mixture ratio to each region identified by the region distinguishing unit. The time can be shortened, and the processing time of the background replacement process can be shortened.

また、上記目的を達成する本発明の背景置換プログラムは、コンピュータに組み込まれ、そのコンピュータ上で、
複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
上記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、上記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを構築することを特徴とする。
Further, the background replacement program of the present invention that achieves the above object is incorporated in a computer, and on the computer,
An image acquisition unit for acquiring a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing A background replacement unit that replaces the background of the captured image with another background using the ratio is constructed.

この本発明の背景置換プログラムによれば、上述した、運用性に優れた背景置換装置を容易に実現することができる。   According to the background replacement program of the present invention, the above-described background replacement device with excellent operability can be easily realized.

また、上記目的を達成する本発明の背景置換プログラム記憶媒体は、コンピュータに組み込まれ、そのコンピュータ上で、
複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
上記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、上記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを構築する背景置換プログラムが記憶されてなることを特徴とする。
Further, the background replacement program storage medium of the present invention that achieves the above object is incorporated in a computer, and on the computer,
An image acquisition unit for acquiring a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing A background replacement program for storing a background replacement unit that replaces the background of a captured image with another background using a ratio is stored.

本発明の記録媒体は、FD(フレキシブルディスク)、CD−R、CD−RW、MO、DVD等といった記憶媒体の他、ハードディスクやメモリチップ等であっても良い。   The recording medium of the present invention may be a hard disk, a memory chip, or the like in addition to a storage medium such as an FD (flexible disk), a CD-R, a CD-RW, an MO, and a DVD.

また、上記目的を達成する本発明の背景置換方法は、複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得過程と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択過程と、
上記画像取得過程によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、上記決定方法選択過程で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換過程とを備えたことを特徴とする。
Further, the background replacement method of the present invention that achieves the above object includes an image acquisition process for acquiring a plurality of captured images obtained by capturing a common subject under each of a plurality of shooting conditions;
A determination method selection process for determining a mixing ratio between the subject color and the background color and selecting any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected in the determination method selection process for a captured image captured under a predetermined imaging condition among a plurality of captured images acquired in the image acquisition process, and the determined mixture And a background replacement step of replacing the background of the photographed image with another background using the ratio.

この本発明の背景置換方法によれば、背景置換画像の顧客への提示を素早く行なうことができ、かつ、最終的には、画質の良好な背景置換画像を顧客に提供することができ、運用性に優れている。   According to the background replacement method of the present invention, the background replacement image can be quickly presented to the customer, and finally, the background replacement image with good image quality can be provided to the customer. Excellent in properties.

なお、上記の本発明の背景置換プログラム、本発明の背景置換プログラム記憶媒体、および本発明の背景置換方法については、ここではその基本形態のみを示すのにとどめるが、これは単に重複を避けるためであり、本発明にいう背景置換プログラム、背景置換プログラム記憶媒体、および背景置換方法には、前述した背景置換装置の各形態に対応する各種の形態が含まれる。   Note that the background replacement program of the present invention, the background replacement program storage medium of the present invention, and the background replacement method of the present invention are shown only in its basic form here, but this is merely to avoid duplication. The background replacement program, the background replacement program storage medium, and the background replacement method according to the present invention include various forms corresponding to the above-described forms of the background replacement device.

以上、説明したように、本発明によれば、運用性に優れた背景置換装置、コンピュータをそのような背景置換装置として動作させる背景置換プログラム、その背景置換プログラムが記憶されてなる背景置換プログラム記憶媒体、および、運用性に優れた背景置換方法を提供することができる。   As described above, according to the present invention, the background replacement device with excellent operability, the background replacement program that causes the computer to operate as such a background replacement device, and the background replacement program storage in which the background replacement program is stored A medium and a background replacement method excellent in operability can be provided.

以下図面を参照して本発明の実施の形態を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本発明の背景置換装置の一実施形態が適用された撮影システムを示す図である。   FIG. 1 is a diagram showing an imaging system to which an embodiment of the background replacement device of the present invention is applied.

この図1に示す撮影システム1は、被写体を撮影して撮影画像を取得する撮影スタジオ10と、その撮影画像における被写体と背景とを区別して、撮影画像中の背景を所望の背景に置換して背景置換画像を作成する、本発明の背景置換装置の一実施形態として動作するパーソナルコンピュータ20と、プリンタ30と、サーバ40とを備えている。また、撮影スタジオ10は、デジタルカメラ11と、閃光発光装置12と、EL(エレクトロルミネセンス)パネル130と、このELパネル用の電源14を備えている。   The photographing system 1 shown in FIG. 1 distinguishes between a photographing studio 10 for photographing a subject and obtaining a photographed image, and the subject and background in the photographed image, and replaces the background in the photographed image with a desired background. A personal computer 20 that operates as an embodiment of the background replacement device of the present invention that creates a background replacement image, a printer 30, and a server 40 are provided. The photographing studio 10 includes a digital camera 11, a flash light emitting device 12, an EL (electroluminescence) panel 130, and a power source 14 for the EL panel.

デジタルカメラ11は、連写機能を有しており、カメラマンがシャッタボタンを1回押すと、短時間の間に自動で被写体Pを2回撮影する。1回毎の撮影によって得られた撮影画像はデジタルカメラ11内のメモリに一時的に保存されるが、撮影システム1では、デジタルカメラ11がパーソナルコンピュータ20に接続されており、2回の撮影が終了した時点で、この2回の撮影で得られた撮影画像は、このパーソナルコンピュータ20に直ちに送られる。また、デジタルカメラ11は閃光発光装置12にも接続されており、デジタルカメラ11は、閃光発光装置12に対して閃光を発するように指示する指示信号を、その閃光発光装置12に撮影の度に発信する。   The digital camera 11 has a continuous shooting function. When the cameraman presses the shutter button once, the digital camera 11 automatically captures the subject P twice in a short time. A photographed image obtained by each photographing is temporarily stored in a memory in the digital camera 11, but in the photographing system 1, the digital camera 11 is connected to the personal computer 20, and two photographings are performed. When the processing is completed, the captured image obtained by the two capturing operations is immediately sent to the personal computer 20. The digital camera 11 is also connected to a flash light emitting device 12, and the digital camera 11 sends an instruction signal for instructing the flash light emitting device 12 to emit a flash light every time the flash light emitting device 12 is photographed. send.

ここで、本実施形態では、撮影スタジオ10について省スペース化が図られており、デジタルカメラ11は被写体を近距離から若干見下ろし気味に撮影することとなる。その結果、デジタルカメラ11で撮影される撮影画像には、画像の幅が、下に向かうほど狭まる、いわゆる台形歪みが生じている可能性が高い。本実施形態では、この台形歪みは、パーソナルコンピュータ20において補正される。   Here, in this embodiment, space saving is achieved for the photographing studio 10, and the digital camera 11 photographs the subject slightly looking down from a short distance. As a result, there is a high possibility that the captured image captured by the digital camera 11 has a so-called trapezoidal distortion in which the width of the image decreases as it goes downward. In the present embodiment, this trapezoidal distortion is corrected in the personal computer 20.

閃光発光装置12は、デジタルカメラ11から指示信号を受けて被写体Pに向かって閃光を発する。ここで、この閃光発光装置12は、1回発光する度に充電される必要があり、1回発光すると、次に発光できるようになるまで時間がかかる。デジタルカメラ11からは、上記の2回の撮影の際、撮影の度に上記の指示信号が発信されるが、閃光発光装置12は1回目の撮影の時だけ閃光を発し、2回目の撮影時には、充電が間に合わないために、閃光発光装置12は消灯したままでいることとなる。また、この閃光発光装置12が発する閃光は、発光の輝度がおよそ2000cd/m2という高輝度の光である。 The flash light emitting device 12 receives an instruction signal from the digital camera 11 and emits a flash toward the subject P. Here, the flash light emitting device 12 needs to be charged every time it emits light, and once it emits light, it takes time until the next light can be emitted. From the digital camera 11, the instruction signal is transmitted every time the above-described shooting is performed. However, the flash light emitting device 12 emits a flash only at the first shooting, and at the second shooting. Since the charging is not in time, the flash light emitting device 12 remains off. Further, the flash light emitted from the flash light emitting device 12 is high-intensity light having a light emission luminance of about 2000 cd / m 2 .

ELパネル130は、被写体Pが載る載置面131aと被写体Pの背後の面131bとが透明な筐体131、および、その筐体131内に収納された分散型EL素子132からなる。また、電源14は、この分散型EL素子132に駆動電圧を印加する電源である。また、筐体131の、被写体Pの背後の面131bの四隅にはこの面131bの範囲を示す4つのマーカ131cが配置されている。これら4つのマーカ131cは、撮影の際に被写体Pとともに撮影画像に写り、その撮影画像に対する、上記の台形歪みの補正等に利用されるものである。   The EL panel 130 includes a housing 131 in which a placement surface 131 a on which the subject P is placed and a surface 131 b behind the subject P are transparent, and a distributed EL element 132 housed in the housing 131. The power source 14 is a power source that applies a driving voltage to the distributed EL element 132. Further, four markers 131c indicating the range of the surface 131b are arranged at the four corners of the surface 131b behind the subject P of the casing 131. These four markers 131c appear in a photographed image together with the subject P at the time of photographing, and are used for correcting the trapezoidal distortion for the photographed image.

分散型EL素子132は、蛍光体粉末が高誘電率のバインダー中に分散されたものが、可撓性のプラスチックを基板とした2枚のシート形状の電極の間に挟み込まれて構成されたシート状の面発光光源である。この分散型EL素子132は、それら2枚の電極間に、電源14から交流電圧が印加されることにより発光する。   The dispersion type EL element 132 is a sheet in which phosphor powder is dispersed in a binder having a high dielectric constant and is sandwiched between two sheet-shaped electrodes having a flexible plastic substrate. Shaped surface emitting light source. The distributed EL element 132 emits light when an AC voltage is applied from the power source 14 between the two electrodes.

この分散型EL素子132は、厚みが数百μm〜1mmという非常に薄くて軽い光源であり、筐体131の内部のように、厚みに余裕のない場所に容易に設置することができる。この他、分散型EL素子132には、発光時の発熱が2℃程度と軽微である、発光開始から最高輝度に達するまでの応答速度が速い、発光の寿命がほぼ一定しており計画的な交換が可能、局所発光が可能、衝撃や振動に強い、消費電力が50W/m2(周波数が50Hzの交流電力印加時)と小さい等、性能面での様々な利点がある。さらに、分散型EL素子132には、簡単な製造工程で製造することができるため製造コストが安いという経済面での利点もある。 This distributed EL element 132 is a very thin and light light source having a thickness of several hundreds μm to 1 mm, and can be easily installed in a place where there is no sufficient thickness, such as the inside of the housing 131. In addition, the dispersion type EL element 132 has a slight heat generation at the time of light emission of about 2 ° C., has a fast response speed from the start of light emission until it reaches the maximum luminance, and has a constant light emission life and is planned. There are various advantages in terms of performance, such as replacement, local light emission, resistance to shock and vibration, and low power consumption of 50 W / m 2 (when AC power with a frequency of 50 Hz is applied). Further, the dispersion type EL element 132 can be manufactured by a simple manufacturing process, and thus has an economic advantage that the manufacturing cost is low.

また、一般的な分散型EL素子は、製造時に発光色の異なる複数の蛍光体粉末をさらに混合することで発光色を白色を含む様々な色に調整することが可能であるが、本実施形態における分散型EL素子132では、このような色調整のための蛍光体粉末は未混合である。この結果、この分散型EL素子132は、発光波長が400nm〜530nmの間に2つ以上の発光ピークを有することとなる。この光は、分散型EL素子本来の、青から緑の間の色の光であり、本実施形態における分散型EL素子132は、上記の2つ以上の発光ピークからなる青緑色の光を発光する。ここで、青緑色は、人物の肌の色の補色であるため、本実施形態の撮影システム1によれば、人物を被写体として撮影した際等に、撮影画像中の被写体と背景とを高い確度で区別することができる、背景が青緑色の撮影画像が得られる。また、上記の色調整のための蛍光体粉末は発光色の輝度を低下させる傾向があるが、本実施形態における分散型EL素子132は、このような蛍光体粉末が未混合であるので分散型EL素子本来の輝度で発光することとなる。   In addition, a general dispersion-type EL element can adjust the emission color to various colors including white by further mixing a plurality of phosphor powders having different emission colors at the time of manufacture. In the dispersion type EL element 132 in FIG. 1, the phosphor powder for color adjustment is not mixed. As a result, the dispersion-type EL element 132 has two or more emission peaks between emission wavelengths of 400 nm to 530 nm. This light is light of a color between blue and green, which is inherent to the dispersion-type EL element, and the dispersion-type EL element 132 in the present embodiment emits blue-green light composed of the above two or more emission peaks. To do. Here, since blue-green is a complementary color of the skin color of a person, according to the photographing system 1 of the present embodiment, when photographing a person as a subject, the subject and background in the photographed image are highly accurate. A captured image with a blue-green background can be obtained. Further, the phosphor powder for color adjustment described above tends to reduce the luminance of the emission color, but the dispersion type EL element 132 in the present embodiment is a dispersion type because such phosphor powder is not mixed. The EL element emits light with the original luminance.

電源14は、分散型EL素子132に印加する交流電圧を、周波数について50Hz〜10kHzの間、大きさについて40V〜300Vの間で調整することができる。分散型EL素子132の発光の輝度は、印加される交流電圧の大きさにほぼ比例する。本実施形態の撮影スタジオ10では、電源14において、交流電圧が、周波数については1.2kHz〜1.5kHzのうちのいずれかの周波数、大きさについては130V〜200Vのうちのいずれかの大きさに調整されており、その結果、分散型EL素子132の発光の輝度が、500cd/m2〜600cd/m2のうちのいずれかの輝度に調整されている。 The power source 14 can adjust the AC voltage applied to the distributed EL element 132 between 50 Hz to 10 kHz with respect to the frequency and between 40 V to 300 V with respect to the magnitude. The luminance of light emitted from the dispersion type EL element 132 is substantially proportional to the magnitude of the applied AC voltage. In the photography studio 10 of the present embodiment, the AC voltage of the power supply 14 is any frequency of 1.2 kHz to 1.5 kHz with respect to the frequency and any magnitude of 130 V to 200 V with respect to the magnitude. being adjusted to a result, the luminance of light emission of the dispersion-type EL element 132 is adjusted to one of the luminance of 500cd / m 2 ~600cd / m 2 .

ここで、本実施形態の撮影スタジオ10では、デジタルカメラ11による撮影は、ELパネル130が常時点灯した状態で行なわれる。また、上述したように、1回目の撮影は閃光発光装置12が閃光を発した状態で行なわれ、2回目の撮影は閃光発光装置12が消えた状態で行なわれる。さらに、この撮影スタジオ10では、閃光発光装置12が発する閃光の輝度は、ELパネル130が点灯したときの輝度よりもかなり高い。この結果、1回目の撮影では、ELパネル130の輝度よりも高い輝度の閃光が、デジタルカメラ11側から被写体Pを照らすという順光状態での撮影による、被写体Pがきれいに写った順光撮影画像が取得される。また、この1回目の撮影に連続して行なわれる2回目の撮影では、ELパネル130からの光のみが被写体Pを後方から照らすという逆光状態での撮影による、被写体Pの像がシャドウ側に偏り、背景パネル130の像がハイライト側に偏った逆光撮影画像が取得される。   Here, in the shooting studio 10 of the present embodiment, shooting by the digital camera 11 is performed in a state where the EL panel 130 is always lit. Further, as described above, the first shooting is performed with the flash light emitting device 12 emitting a flash, and the second shooting is performed with the flash light emitting device 12 turned off. Furthermore, in this photography studio 10, the brightness of the flash emitted by the flash light emitting device 12 is considerably higher than the brightness when the EL panel 130 is turned on. As a result, in the first shooting, a follow-up photographed image in which the subject P is clearly photographed in a follow-up state in which a flash having a brightness higher than that of the EL panel 130 illuminates the subject P from the digital camera 11 side. Is acquired. In the second shooting performed continuously after the first shooting, the image of the subject P is biased to the shadow side by shooting in a backlight state in which only the light from the EL panel 130 illuminates the subject P from behind. Then, a backlight image in which the image of the background panel 130 is biased toward the highlight side is acquired.

パーソナルコンピュータ20は、上述したように本発明の背景置換装置の一実施形態として動作するものである。このパーソナルコンピュータ20は、デジタルカメラ11から渡された上記の2つの撮影画像に対して、上記の台形歪みについての補正を含む画像補正処理を施す。この画像補正処理については後述する。   As described above, the personal computer 20 operates as an embodiment of the background replacement device of the present invention. The personal computer 20 performs image correction processing including correction on the trapezoidal distortion on the two captured images passed from the digital camera 11. This image correction process will be described later.

さらに、パーソナルコンピュータ20において、この補正済みの撮影画像に基づいて、背景が、顧客が所望する別の背景に置換された背景置換画像が作成されるが、本実施形態では、この補正済みの撮影画像について、次のような3種類の背景置換画像が作成される。   Further, the personal computer 20 creates a background replacement image in which the background is replaced with another background desired by the customer based on the corrected captured image. In this embodiment, the corrected captured image is used. For the image, the following three types of background replacement images are created.

まず、画質は他の背景置換画像よりも劣るものの、最短で作成可能で、撮影後、直ぐに顧客に提示される表示用置換画像が作成される。この表示用置換画像は、顧客が気に入った置換用の背景を見つけるまで繰返し作成され顧客に提示される。   First, although the image quality is inferior to other background replacement images, it can be created in the shortest time, and a display replacement image that is presented to the customer immediately after shooting is created. This display replacement image is repeatedly created and presented to the customer until a replacement background that the customer likes is found.

置換用の背景が決定されると、顧客にあまり違和感を与えない程度の画質を有し、顧客にあまり負担を与えることのない程度の時間で作成できる、最終的な確認のために顧客に提示される確認用背景置換画像が作成される。   Once the replacement background has been determined, it is presented to the customer for final confirmation that can be created in a time that does not place too much burden on the customer, with image quality that does not make the customer feel uncomfortable. A confirmation background replacement image is created.

ここまでの処理で、顧客とのやり取りが終了し、その後、このやり取りで決定された背景が使われて、作成には最も時間を要するが、画質が最も優れている出力用置換画像が作成される。そして、この出力用置換画像が出力され、顧客に提供される。   With the process so far, the exchange with the customer is completed, and then the background determined in this exchange is used, and the replacement image for output with the best image quality is created, although it takes the most time to create. The The output replacement image is output and provided to the customer.

ここで、表示用置換画像の作成から出力用置換画像の作成に至る一連の背景置換処理については後述する。   Here, a series of background replacement processes from the generation of the display replacement image to the generation of the output replacement image will be described later.

このパーソナルコンピュータ20は、外観構成上、フレキシブルディスク(以降、FDと呼ぶ)やCD−ROMの装填口を有し、その装填口に装填されたFDやCD−ROMへのアクセス機能を有する本体装置210、その本体装置210からの指示に応じて表示画面220a上に画像を表示する画像表示装置220、本体装置210にキー操作に応じた各種の情報を入力するキーボード230、表示画面220a上の任意の位置を指定することにより、その位置に表示された、例えばアイコン等に応じた指示を入力するマウス240、および、デジタルカメラ等で撮影画像の記憶に用いられる小型記憶メディアが装填され、その小型記憶メディアをアクセスするメディアドライブ250を備えている。   This personal computer 20 has a flexible disk (hereinafter referred to as FD) and a CD-ROM loading port in terms of appearance and has a function of accessing the FD and CD-ROM loaded in the loading port. 210, an image display device 220 that displays an image on the display screen 220a in accordance with an instruction from the main device 210, a keyboard 230 that inputs various types of information according to key operations to the main device 210, and an arbitrary on the display screen 220a Is designated, for example, a mouse 240 for inputting an instruction corresponding to an icon or the like displayed at that position, and a small storage medium used for storing a photographed image by a digital camera or the like are loaded. A media drive 250 for accessing storage media is provided.

プリンタ30は、パーソナルコンピュータ20から送られてくる画像をプリントするものであり、撮影システム1では、パーソナルコンピュータ20が背景置換処理によって作成した背景置換画像をプリントする役割を担っている。   The printer 30 prints an image sent from the personal computer 20, and the photographing system 1 plays a role of printing a background replacement image created by the personal computer 20 by the background replacement process.

サーバ40には、パーソナルコンピュータ20で実行される背景置換処理で使用される複数種類の背景が格納されている。このサーバ40内の背景は、表示画面220a上に表示されることによって顧客に提示される。また、この撮影システム1では、サーバ40内に格納されている背景以外にも、上記のCD−ROMや上記の小型記憶メディア等といった何らかの入力用記憶媒体を介して提供される背景も、表示画面220aを通じて顧客に提示される。顧客は、表示画面220a上に表示されたそれらの背景の中から所望の背景を選ぶ。   The server 40 stores a plurality of types of backgrounds used in the background replacement process executed by the personal computer 20. The background in the server 40 is presented to the customer by being displayed on the display screen 220a. In addition to the background stored in the server 40, the imaging system 1 also provides a background provided via some input storage medium such as the CD-ROM or the small storage medium. It is presented to the customer through 220a. The customer selects a desired background from the backgrounds displayed on the display screen 220a.

次に、この図1に示す撮影システム1で実行される、本発明の背景置換方法の一実施形態が適用された作業の流れについて説明する。尚、以下の説明では、図1に示す要素については特に図番を断らずに図1中の符号を使って参照する。   Next, a flow of work to which the embodiment of the background replacement method of the present invention executed in the photographing system 1 shown in FIG. 1 is applied will be described. In the following description, the elements shown in FIG. 1 are referred to by using the reference numerals in FIG.

図2は、図1の撮影システムで実行される、本発明の背景置換方法の一実施形態が適用された作業の流れを示すフローチャートである。   FIG. 2 is a flowchart showing a work flow to which the embodiment of the background replacement method of the present invention is applied, which is executed in the photographing system of FIG.

この図2のフローチャートが示す作業は、撮影スタジオ10において、被写体P、デジタルカメラ11、および閃光発光装置12がそれぞれ適当な位置に配置されていることを前提として行なわれる。   The operations shown in the flowchart of FIG. 2 are performed on the assumption that the subject P, the digital camera 11, and the flash light emitting device 12 are arranged at appropriate positions in the photographing studio 10.

まず、電源14から分散型EL素子132に電圧が印加され、ELパネル130が点灯する(ステップS101)。次に、カメラマンが、ピントや露光の調節等を行なった後にデジタルカメラ11のシャッタボタンを押すと、被写体Pに対する撮影が2回連続して行なわれる。まず1回目の撮影では、デジタルカメラ11から発信される指示信号に応じて閃光発光装置12がELパネル130の照明よりも高輝度の閃光を発し、この閃光による順光状態で被写体Pが撮影される(ステップS102)。続いて、2回目の撮影が、閃光発光装置12が消灯した状態、即ち、ELパネル130のみの照明による逆光状態で行なわれる(ステップS103)。ステップS102およびステップS103の処理でそれぞれ得られた、順光撮影画像と逆光撮影画像との2つの撮影画像は、デジタルカメラ11内のメモリに一時的に保存される。   First, a voltage is applied from the power supply 14 to the distributed EL element 132, and the EL panel 130 is turned on (step S101). Next, when the cameraman presses the shutter button of the digital camera 11 after adjusting the focus and exposure, the subject P is shot twice in succession. First, in the first shooting, the flash light emitting device 12 emits a flash with a luminance higher than that of the illumination of the EL panel 130 in response to an instruction signal transmitted from the digital camera 11, and the subject P is shot in a forward light state by the flash. (Step S102). Subsequently, the second shooting is performed in a state where the flash light emitting device 12 is turned off, that is, in a backlight state by illumination of only the EL panel 130 (step S103). Two captured images, a follow light image and a back light image, obtained in the processes of steps S102 and S103, respectively, are temporarily stored in the memory in the digital camera 11.

以上に説明したステップS101〜ステップS103の処理は、撮影スタジオ10において行なわれる、写真館の店員等といった人手による撮影処理である。   The processes in steps S101 to S103 described above are manual image capturing processes performed by the image studio 10 such as a clerk in a photo studio.

次に、このフローチャートにおけるステップS104以降の処理について説明するが、この以下に説明する処理のうち、ステップS104からステップS110に至る処理が、本発明の背景置換方法の一実施形態に相当する。   Next, processing after step S104 in this flowchart will be described. Of the processing described below, processing from step S104 to step S110 corresponds to an embodiment of the background replacement method of the present invention.

上記の撮影処理で得られた2つの撮影画像は、その撮影処理が終了すると直ちにパーソナルコンピュータ20に渡される。さらに、サーバ40に保存されている複数の背景の中から、顧客が所望する背景が読み出される(ステップS104)。このステップS104の処理が、本発明の背景置換方法における画像取得過程の一例に相当する。   The two photographed images obtained by the above photographing process are transferred to the personal computer 20 immediately after the photographing process is completed. Further, a background desired by the customer is read out from a plurality of backgrounds stored in the server 40 (step S104). The processing in step S104 corresponds to an example of an image acquisition process in the background replacement method of the present invention.

続いて、2つの撮影画像に、上記の台形歪みについての補正を含む後述の画像補正処理が施される(ステップS105)。   Subsequently, an image correction process described later including correction for the trapezoidal distortion is performed on the two captured images (step S105).

次に、被写体色と背景色との合成比を決定する決定方法が、決定時間が互いに異なる3種類の決定方法のうちから1つ選択される(ステップS106)。尚、ここでいう合成比は、本発明にいう「混合比」の一例に相当する。また、このステップS106の処理が、本発明の背景置換方法における決定方法選択過程の一例に相当する。   Next, a determination method for determining the composition ratio between the subject color and the background color is selected from three determination methods having different determination times (step S106). The synthesis ratio here corresponds to an example of “mixing ratio” in the present invention. The processing in step S106 corresponds to an example of a determination method selection process in the background replacement method of the present invention.

3種類の決定方法それぞれで決定される合成比による各背景置換画像は、決定時間が長いものほど画質が高い。そこで、本実施形態では、背景置換画像の使用目的に応じた決定方法が選択される。即ち、上記の表示用置換画像を作成する際には、3種類の決定方法のうちで最短で合成比を決定する第1の決定方法が選択され、上記の確認用背景置換画像を作成する際には、この第1の決定方法よりも若干合成比の決定に時間を要する第2の決定方法が選択され、上記の出力用置換画像を作成する際には、合成比を精密に決定するために、3種類の決定方法のうち決定時間が最長となる第3の決定方法が選択される。   Each background replacement image based on the composition ratio determined by each of the three determination methods has a higher image quality as the determination time is longer. Therefore, in the present embodiment, a determination method is selected according to the purpose of use of the background replacement image. That is, when creating the display replacement image, the first determination method that determines the composition ratio in the shortest of the three determination methods is selected, and when the confirmation background replacement image is created. In this case, the second determination method, which requires a slightly longer time for determining the composition ratio than the first determination method, is selected, and when the above output replacement image is created, the composition ratio is determined accurately. In addition, the third determination method having the longest determination time is selected from the three types of determination methods.

ここで、上記のステップS106の処理では、上記のステップS105の画像補正処理に続いて決定方法の選択が実行される場合には、上記の3種類の決定方法のうち第1の決定方法が選択される。   Here, in the process in step S106, when the determination method is selected following the image correction process in step S105, the first determination method is selected from the above three types of determination methods. Is done.

そして、このステップS106の処理で選択された決定方法を用いて合成比を決定し、その合成比を使って背景を置換する背景置換処理が、2つの補正済みの撮影画像のうち、補正済みの順光撮影画像に施される(ステップS107)。このステップS107の処理が、本発明の背景置換方法における背景置換過程の一例に相当する。   Then, the background replacement process for determining the composition ratio using the determination method selected in the process of step S106 and replacing the background using the composition ratio is performed by correcting the corrected image out of the two corrected photographed images. It is applied to the follow light image (step S107). The processing in step S107 corresponds to an example of a background replacement process in the background replacement method of the present invention.

さらに、作成された背景置換画像を表わす画像データが画像表示装置220に転送され(ステップS108)、表示画面220a上に表示される(ステップS109)。   Further, the created image data representing the background replacement image is transferred to the image display device 220 (step S108) and displayed on the display screen 220a (step S109).

また、ステップS107の処理で、背景置換処理の対象となった補正済みの順光撮影画像に、その背景置換処理で用いられた合成比の決定方法を示す決定情報と、その背景置換処理において決定された合成比とが付加されて保存用データが作成され、その保存用データが保存される(ステップS110)。   In addition, in the process of step S107, the correction information indicating the method for determining the composition ratio used in the background replacement process is determined for the corrected follow-light photographed image that is the target of the background replacement process, and determined in the background replacement process. The storage ratio is created by adding the synthesized ratio, and the storage data is stored (step S110).

ステップS110までの処理が終了すると、オペレータに対して背景置換処理を終了するか否かが問われる(ステップS111)。このとき、例えば、顧客が、現在、表示されている背景置換画像の背景が気に入らなかった等といった理由により、再度の背景置換処理が必要となった場合には、オペレータが、背景置換処理を続行する旨を伝える(ステップS111におけるNo判定)。この場合には、顧客の要望に応じて、現在の背景置換画像における背景とは別の背景が、サーバ40から読み出される(ステップS112)。そして、上述した、ステップS107〜ステップS110に至る処理が、再度実行される。ただし、この再度の処理では、初回の処理時に保存された順光撮影画像に付加されている合成比が、ステップS107での背景置換処理において使われ、この背景置換処理における合成比の決定処理が省略される。また、この再度の処理においては、上記の決定情報、合成比、および背景置換の元となる補正済みの順光撮影画像は、初回の処理の際に保存された保存用データをなす決定情報、合成比、および補正済みの順光撮影画像と同じであるので、ステップS110における保存処理が省略される。   When the process up to step S110 is completed, the operator is asked whether or not to end the background replacement process (step S111). At this time, for example, when the background replacement process is necessary again because the customer does not like the background of the currently displayed background replacement image, the operator continues the background replacement process. (No determination in step S111). In this case, a background different from the background in the current background replacement image is read from the server 40 according to the customer's request (step S112). Then, the processing from step S107 to step S110 described above is executed again. However, in this re-processing, the composition ratio added to the follow light photographed image stored at the first processing is used in the background replacement process in step S107, and the composition ratio determination process in this background replacement process is performed. Omitted. Further, in this re-processing, the above-described determination information, composition ratio, and corrected follow-light photographic image that is the source of background replacement are determination information that forms storage data stored in the first processing, Since it is the same as the composite ratio and the corrected follow light captured image, the storage process in step S110 is omitted.

このステップS107〜ステップS112の処理は、顧客が、表示用置換画像の背景を気に入り、オペレータが、背景置換処理を終了する旨を伝える(ステップS111におけるYes判定)まで繰り返される。   The processing from step S107 to step S112 is repeated until the customer likes the background of the replacement image for display and the operator informs that the background replacement processing is finished (Yes determination in step S111).

オペレータが、背景置換処理を終了する旨を伝えると、上記の確認用背景置換画像が既に作成済みであるか否かが判定される(ステップS113)。ここで、表示用置換画像の作成と表示による、置換用の背景の決定が終了した段階では、未だ確認用背景置換画像が作成されていないので、この段階ではステップS113において、確認用背景置換画像は作成済みではないと判定される(ステップS113におけるNo判定)。そして、この場合には、ステップS106まで処理が戻り、決定方法の選択が再度実行される。ただし、ステップS113からステップS106に処理が戻って決定方法の選択が実行される場合には、このステップS106では、上記の第2の決定方法が選択される。そして、ステップS107において、この第2の決定方法を用いた背景置換処理が実行され、確認用背景置換画像が作成され、ステップS109において表示画面220aに表示される。さらに、ステップS110における保存用データの保存処理では、初回の処理の際に保存された保存用データをなす決定情報、合成比、および補正済みの順光撮影画像のうち、決定情報と合成比とのそれぞれが、第2の決定方法を示す決定情報と、その決定方法で決定された合成比とに書き換えられる。   When the operator reports that the background replacement process is to be terminated, it is determined whether or not the confirmation background replacement image has already been created (step S113). Here, at the stage where the determination of the replacement background by the creation and display of the display replacement image has been completed, the confirmation background replacement image has not yet been generated. At this stage, in step S113, the confirmation background replacement image is created. Is determined not to have been created (No determination in step S113). In this case, the process returns to step S106, and the determination method is selected again. However, when the process returns from step S113 to step S106 to select the determination method, the second determination method is selected in step S106. In step S107, a background replacement process using the second determination method is executed to create a confirmation background replacement image, which is displayed on the display screen 220a in step S109. Further, in the storage process of the storage data in step S110, the determination information, the combination ratio, and the determination information, the combination ratio, and the corrected follow-light photographed image that form the storage data stored in the first process are determined. Are rewritten with determination information indicating the second determination method and the combination ratio determined by the determination method.

また、確認用背景置換画像の作成が終了した段階では、ステップS111において、オペレータによって過去になされた操作に応じて置換処理の終了が判定され(ステップS111におけるYes判定)、さらに、ステップS113において確認用背景置換画像が有ると判定される(ステップS113におけるYes判定)。すると、次には、最終的に顧客に提供するための上記の出力用置換画像が有るか否かが判定される(ステップS114)。ここで、確認用背景置換画像の作成が終了した段階では、未だ出力用置換画像が作成されていないので、この段階ではステップS114において、出力用置換画像は無いと判定される(ステップS114におけるNo判定)。そして、この場合には、ステップS106まで処理が戻り、決定方法の選択が再度実行される。ただし、ステップS114からステップS106に処理が戻って決定方法の選択が実行される場合には、上記の第3の決定方法が選択され、ステップS107において、第3の決定方法を用いた背景置換処理が実行されて出力用置換画像が作成される。そして、ステップS109においてその出力用置換画像が表示画面220aに表示された後、ステップS110において、既に保存されている決定情報が、第3の決定方法を示す決定情報に書き換えられ、さらに、出力用置換画像の作成時に決定された最終的な合成比が追加保存される。   At the stage where the creation of the confirmation background replacement image is completed, in step S111, the end of the replacement process is determined according to the operation performed in the past by the operator (Yes determination in step S111), and further, the confirmation is performed in step S113. It is determined that there is a background replacement image for use (Yes determination in step S113). Then, it is next determined whether or not there is the output replacement image to be finally provided to the customer (step S114). Here, at the stage where the creation of the confirmation background replacement image has been completed, the output replacement image has not yet been generated. At this stage, it is determined in step S114 that there is no output replacement image (No in step S114). Judgment). In this case, the process returns to step S106, and the determination method is selected again. However, when the process returns from step S114 to step S106 and the determination method is selected, the third determination method is selected. In step S107, the background replacement process using the third determination method is performed. Is executed to create an output replacement image. Then, after the output replacement image is displayed on the display screen 220a in step S109, in step S110, the already stored determination information is rewritten with the determination information indicating the third determination method, and further, for output. The final composition ratio determined when the replacement image is created is additionally stored.

以上説明した出力用置換画像の作成処理までが終了すると、ステップS111では置換処理の終了が判定され(ステップS111におけるYes判定)、ステップS113では確認用背景置換画像が有ると判定され(ステップS113におけるYes判定)、さらに、ステップS114では出力用置換画像が有ると判定される(ステップS114におけるYes判定)。   When the output replacement image creation process described above is completed, it is determined in step S111 that the replacement process is complete (Yes in step S111), and in step S113, it is determined that there is a confirmation background replacement image (in step S113). Further, in step S114, it is determined that there is an output replacement image (Yes determination in step S114).

そして、作成された出力用置換画像を表わす画像データが、プリンタ30と、顧客が希望する出力用記憶媒体とのうちの少なくとも1つに転送される(ステップS115)。そして、出力用置換画像を表わす画像データがプリンタ30に転送された場合に、プリンタ30において、その画像データに基づいて出力用置換画像がプリントされる(ステップS116)。   Then, the created image data representing the output replacement image is transferred to at least one of the printer 30 and the output storage medium desired by the customer (step S115). When the image data representing the output replacement image is transferred to the printer 30, the printer 30 prints the output replacement image based on the image data (step S116).

ここで、上記のステップS106の決定方法選択処理が、本発明の背景置換方法における決定方法選択過程の一例に相当し、上記のステップS107の背景置換処理が、本発明の背景置換方法における背景置換過程の一例に相当する。   Here, the determination method selection process in step S106 corresponds to an example of the determination method selection process in the background replacement method of the present invention, and the background replacement process in step S107 is the background replacement in the background replacement method of the present invention. It corresponds to an example of the process.

本発明の背景置換方法の一実施形態を含むステップS104〜ステップS115の処理は、パーソナルコンピュータ20において実行される処理であり、以下では、これらの処理を実行するパーソナルコンピュータ20と、それらの処理の詳細に注目して説明する。   The processes in steps S104 to S115 including an embodiment of the background replacement method of the present invention are processes executed in the personal computer 20. Hereinafter, the personal computer 20 that executes these processes and the processes of those processes will be described. This will be described with a focus on details.

まず、このパーソナルコンピュータ20の内部構成について説明する。   First, the internal configuration of the personal computer 20 will be described.

図3は、図1に示すパーソナルコンピュータのハードウェア構成図である。   FIG. 3 is a hardware configuration diagram of the personal computer shown in FIG.

この図3に示すように、本体装置210の内部には、各種プログラムを実行するCPU211、ハードディスク装置213に格納されたプログラムが読み出されCPU211での実行のために展開される主メモリ212、各種プログラムやデータ等が保存されたハードディスク装置213、FD520が装填され、その装填されたFD520をアクセスするFDドライブ214、CD−ROM510をアクセスするCD−ROMドライブ215、図1のサーバ40やデジタルカメラ11と接続され、これらの機器から置換用の背景や撮影画像等を受け取る入力インタフェース216、および、図1のプリンタ30と接続され、背景置換画像等を出力する出力インタフェース217が内蔵されており、これらの各種要素と、さらに図1にも示す画像表示装置220、キーボード230、マウス240、および、小型記憶メディア530をアクセスするメディアドライブ250は、バス260を介して相互に接続されている。   As shown in FIG. 3, inside the main body device 210, a CPU 211 that executes various programs, a main memory 212 that is read out by a program stored in the hard disk device 213 and developed for execution by the CPU 211, A hard disk device 213 in which programs and data are stored, an FD 520 are loaded, an FD drive 214 that accesses the loaded FD 520, a CD-ROM drive 215 that accesses a CD-ROM 510, the server 40 and the digital camera 11 in FIG. And an input interface 216 for receiving a replacement background, a photographed image and the like from these devices, and an output interface 217 for connecting the printer 30 of FIG. 1 and outputting the background replacement image and the like. And the various elements shown in Figure 1 Image display device 220, a keyboard 230, a mouse 240 and a media drive 250 for accessing a small storage medium 530 are connected to each other via a bus 260.

ここで、上記のCD−ROM510は、パーソナルコンピュータ20を、本発明の背景置換装置の一実施形態として動作させるための、本発明の背景置換プログラムの一実施形態が記憶されてなる、本発明の背景置換プログラム記憶媒体の一実施形態に相当する。   Here, the CD-ROM 510 described above stores one embodiment of the background replacement program of the present invention for causing the personal computer 20 to operate as one embodiment of the background replacement device of the present invention. This corresponds to an embodiment of the background replacement program storage medium.

そして、そのCD−ROM510がCD−ROMドライブ215に装填されると、そのCD−ROM510に記憶されたプログラムがこのパーソナルコンピュータ20にアップロードされてハードディスク装置213に書き込まれる。これにより、パーソナルコンピュータ20は背景置換装置として動作する。   When the CD-ROM 510 is loaded into the CD-ROM drive 215, the program stored in the CD-ROM 510 is uploaded to the personal computer 20 and written to the hard disk device 213. Thereby, the personal computer 20 operates as a background replacement device.

次に、本発明の背景置換プログラムの一実施形態、および、本発明の背景置換プログラム記憶媒体の一実施形態について説明する。   Next, an embodiment of the background replacement program of the present invention and an embodiment of the background replacement program storage medium of the present invention will be described.

図4は、本発明の背景置換プログラムの一実施形態が記憶された、本発明の背景置換プログラム記憶媒体の一実施形態を示す概念図である。   FIG. 4 is a conceptual diagram showing an embodiment of the background replacement program storage medium of the present invention in which an embodiment of the background replacement program of the present invention is stored.

図4に示すCD−ROM510は、本発明の背景置換プログラムの一実施形態である背景置換プログラム600が記憶されたものであり、本発明の背景置換プログラム記憶媒体の一実施形態に相当する。   A CD-ROM 510 shown in FIG. 4 stores a background replacement program 600, which is an embodiment of the background replacement program of the present invention, and corresponds to an embodiment of the background replacement program storage medium of the present invention.

この背景置換プログラム600は、画像取得部610、画像補正部620、決定方法選択部630、置換処理部640、画像保存部650、画像データ転送部660、および画像表示部670で構成されている。   The background replacement program 600 includes an image acquisition unit 610, an image correction unit 620, a determination method selection unit 630, a replacement processing unit 640, an image storage unit 650, an image data transfer unit 660, and an image display unit 670.

この背景置換プログラム600の各部の詳細については、本発明の背景置換装置の一実施形態の各部の作用と併せて説明する。尚、以下の説明では、図1、図3、および図4に示す要素については特に図番を断らずに各図中の符号を使って参照する。   The details of each part of the background replacement program 600 will be described together with the operation of each part of the embodiment of the background replacement device of the present invention. In the following description, the elements shown in FIGS. 1, 3, and 4 are referred to by using the reference numerals in the respective drawings without particularly referring to the figure numbers.

図5は、図4に示す背景置換プログラムが図1および図3に示すパーソナルコンピュータにインストールされ、このパーソナルコンピュータが本発明の背景置換装置の一実施形態として動作するときの機能を表わす機能ブロック図である。また、この図5には、図1にも示す、デジタルカメラ11、閃光発光装置12、およびELパネル130からなる撮影スタジオ10と、プリンタ30と、サーバ40と、図3にも示すハードディスク装置213も示されている。   FIG. 5 is a functional block diagram showing functions when the background replacement program shown in FIG. 4 is installed in the personal computer shown in FIGS. 1 and 3 and this personal computer operates as an embodiment of the background replacement device of the present invention. It is. Further, in FIG. 5, the photographing studio 10 including the digital camera 11, the flash light emitting device 12, and the EL panel 130, the printer 30, the server 40, and the hard disk device 213 also shown in FIG. Is also shown.

この図5に示す背景置換装置700は、上述したように、撮影スタジオ10のデジタルカメラ11によって順光および逆光それぞれの下で撮影された順光撮影画像と逆光撮影画像とを取得して、これらの2つの撮影画像のうち、逆光撮影画像に基づいて、順光撮影画像における被写体と背景とを区別して、その背景を所望の背景に置換するという背景置換処理を実行するものであり、画像取得部710、画像補正部720、決定方法選択部730、置換処理部740、画像保存部750、画像データ転送部760、および画像表示部770を備えている。   As described above, the background replacement device 700 shown in FIG. 5 acquires the follow-up photographed image and the backlight photographed image taken by the digital camera 11 of the photography studio 10 under the backlight and backlight, respectively. Of the two captured images is used to perform background replacement processing in which the subject and the background in the backlight image are distinguished based on the backlight image and the background is replaced with a desired background. A unit 710, an image correction unit 720, a determination method selection unit 730, a replacement processing unit 740, an image storage unit 750, an image data transfer unit 760, and an image display unit 770.

画像取得部710は、まず、デジタルカメラ11で撮影され、そのデジタルカメラ11から渡される2つの撮影画像を受け取る。また、この画像取得部710は、顧客が所望する背景を、サーバ40から、あるいは、CD−ROMや小型記憶メディア等といった入力用記憶媒体540から読み出す。この画像取得部710は、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の画像取得部610に従って、入力インタフェース216、FDドライブ214、CD−ROMドライブ215、およびメディアドライブ250を制御することによって構成される。この画像取得部710は、本発明の背景置換装置における画像取得部の一例に相当し、また、この画像取得部710によって、本発明の背景置換方法における画像取得過程の一例である、図2のフローチャートにおけるステップS104の画像取得処理が実行される。   The image acquisition unit 710 first receives two captured images captured by the digital camera 11 and delivered from the digital camera 11. The image acquisition unit 710 reads a background desired by the customer from the server 40 or from an input storage medium 540 such as a CD-ROM or a small storage medium. In this image acquisition unit 710, the CPU 211 of the personal computer 20 substantially controls the input interface 216, the FD drive 214, the CD-ROM drive 215, and the media drive 250 in accordance with the image acquisition unit 610 of the background replacement program 600. It is composed by doing. The image acquisition unit 710 corresponds to an example of an image acquisition unit in the background replacement device of the present invention, and is an example of an image acquisition process in the background replacement method of the present invention by the image acquisition unit 710 of FIG. The image acquisition process of step S104 in the flowchart is executed.

画像補正部720は、画像取得部710で受け取られた2つの撮影画像それぞれに、台形歪みについての補正を含む後述の画像補正処理を施すものであり、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の画像補正部620に従って動作することによって構成される。また、この画像補正部720によって、図2のフローチャートにおけるステップS105の画像補正処理が実行される。この画像補正部720の詳細については、画像補正処理の詳細とともに別図を参照して後述する。   The image correction unit 720 performs an image correction process including correction of trapezoidal distortion on each of the two captured images received by the image acquisition unit 710. In practice, the CPU 211 of the personal computer 20 The operation is performed according to the image correction unit 620 of the background replacement program 600. The image correction unit 720 executes the image correction process in step S105 in the flowchart of FIG. Details of the image correction unit 720 will be described later with reference to the accompanying drawings together with details of the image correction processing.

決定方法選択部730は、上記の表示用置換画像を作成するための第1の決定方法と、上記の確認用背景置換画像を作成するための第2の決定方法と、上記の出力用置換画像を作成するための第3の決定方法との3つの決定方法のうちから、いずれか1つの決定方法を選択するものである。ここで、決定方法選択部730が3つの決定方法のうちからどの決定方法を選択するかは、図2のフローチャートを参照して説明した処理の進行によって決まり、処理の進行応じて、第1の決定方法と第2の決定方法と第3の決定方法とが順次に選択される。決定方法選択部730は、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の決定方法選択部630に従って動作することによって構成されるものであり、本発明の背景置換装置における決定方法選択部の一例に相当する。また、この決定方法選択部730によって、本発明の背景置換方法における決定方法選択過程の一例である、図2のフローチャートにおけるステップS106の決定方法選択処理が実行される。   The determination method selection unit 730 includes a first determination method for generating the display replacement image, a second determination method for generating the confirmation background replacement image, and the output replacement image. One of the three determination methods is selected from among the three determination methods for generating the first and second determination methods. Here, which one of the three determination methods the determination method selection unit 730 selects is determined by the progress of the process described with reference to the flowchart of FIG. 2, and the first method is determined according to the progress of the process. The determination method, the second determination method, and the third determination method are sequentially selected. The determination method selection unit 730 is substantially configured by the CPU 211 of the personal computer 20 operating according to the determination method selection unit 630 of the background replacement program 600, and the determination method in the background replacement device of the present invention. This corresponds to an example of a selection unit. Further, the determination method selection unit 730 executes determination method selection processing in step S106 in the flowchart of FIG. 2, which is an example of a determination method selection process in the background replacement method of the present invention.

置換処理部740は、画像補正部720での画像補正処理を経た2つの撮影画像のうち、補正済みの順光撮影画像に対して、決定方法選択部730で選択された決定方法を用いた背景の置換処理を施すものであり、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の置換処理部640に従って動作することによって構成される。この置換処理部740は、本発明の背景置換装置における背景置換部の一例に相当し、また、この置換処理部740によって、本発明の背景置換方法における背景置換過程の一例に相当である、図2のフローチャートにおけるステップS107の背景置換処理が実行される。この置換処理部740の詳細については、上記の3つの決定方法の詳細とともに別図を参照して後述する。   The replacement processing unit 740 uses the determination method selected by the determination method selection unit 730 for the corrected follow light captured image out of the two captured images that have undergone the image correction processing by the image correction unit 720. The CPU 211 of the personal computer 20 operates substantially according to the replacement processing unit 640 of the background replacement program 600. The replacement processing unit 740 corresponds to an example of a background replacement unit in the background replacement device of the present invention, and the replacement processing unit 740 corresponds to an example of a background replacement process in the background replacement method of the present invention. The background replacement process of step S107 in the flowchart of 2 is executed. Details of the replacement processing unit 740 will be described later with reference to the accompanying drawings together with details of the above three determination methods.

画像保存部750は、補正済みの順光撮影画像に、決定方法選択部730で選択された決定方法を示す決定情報と、背景置換処理において決定された合成比とを付加して保存用データを作成し、その保存用データをハードディスク装置213に保存する。この画像保存部750は、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の画像保存部650に従って動作することによって構成され、本発明の背景置換装置における画像保存部の一例に相当する。また、この画像保存部750によって、図2のフローチャートにおけるステップS110の画像保存処理が実行される。この画像保存処理部750の詳細については、別図を参照して後述する。   The image storage unit 750 adds the storage information by adding determination information indicating the determination method selected by the determination method selection unit 730 and the composition ratio determined in the background replacement process to the corrected follow light image. The data for storage is created and stored in the hard disk device 213. The image storage unit 750 is substantially configured by the CPU 211 of the personal computer 20 operating in accordance with the image storage unit 650 of the background replacement program 600, and corresponds to an example of the image storage unit in the background replacement device of the present invention. To do. The image storage unit 750 executes the image storage process in step S110 in the flowchart of FIG. Details of the image storage processing unit 750 will be described later with reference to another drawing.

画像データ転送部760は、上記の置換処理部740で作成される背景置換画像を表わす画像データを画像表示部770に転送し、この背景置換画像のうち、上記の出力用置換画像については、その画像を表わす画像データをプリンタ30および顧客が希望する出力用記憶媒体550のうちの少なくとも一方に転送する。この画像データ転送部760は、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の画像データ転送部640に従って、出力インタフェース217、FDドライブ214、CD−ROMドライブ215、およびメディアドライブ250を制御することによって構成される。また、この画像データ転送部760によって、図2のフローチャートにおけるステップS115の画像データ転送処理が実行される。   The image data transfer unit 760 transfers the image data representing the background replacement image created by the replacement processing unit 740 to the image display unit 770. Among the background replacement images, the output replacement image The image data representing the image is transferred to at least one of the printer 30 and the output storage medium 550 desired by the customer. In the image data transfer unit 760, the CPU 211 of the personal computer 20 is substantially controlled by the output interface 217, the FD drive 214, the CD-ROM drive 215, and the media drive 250 in accordance with the image data transfer unit 640 of the background replacement program 600. It is configured by controlling. Further, the image data transfer unit 760 executes the image data transfer process of step S115 in the flowchart of FIG.

画像表示部770は、画像データ転送部760から転送されて来る画像データに基づいて各画像データが表わす画像を表示するものであり、実質的には、パーソナルコンピュータ20のCPU211が、背景置換プログラム600の画像表示部650に従って画像表示装置220を制御することによって構成される。また、この画像表示部770によって、図2のフローチャートにおけるステップS109の画像表示処理が実行される。   The image display unit 770 displays an image represented by each image data based on the image data transferred from the image data transfer unit 760. In practice, the CPU 211 of the personal computer 20 has the background replacement program 600. The image display device 220 is controlled according to the image display unit 650. Further, the image display unit 770 executes the image display process of step S109 in the flowchart of FIG.

また、上記の画像データ転送部760からプリンタ30に、再置換画像を表わす画像データが出力された場合には、プリンタ30において、この画像データに基づく再置換画像がプリントされ、上記の画像データ転送部760から何らかの出力用記憶媒体550に再置換画像を表わす画像データが出力された場合には、この画像データがその出力用記憶媒体550に書き込まれる。そして、再置換画像がプリントされたプリント紙と、再置換画像を表わす画像データが書き込まれた出力用記憶媒体550との両方、あるいは一方が、顧客の希望に応じて提供される。   When image data representing the replacement image is output from the image data transfer unit 760 to the printer 30, the printer 30 prints the replacement image based on the image data, and transfers the image data. When the image data representing the replacement image is output from the unit 760 to any output storage medium 550, the image data is written to the output storage medium 550. Then, both or one of the print paper on which the replacement image is printed and the output storage medium 550 on which the image data representing the replacement image is written are provided according to the customer's request.

次に、図5において、それぞれ1つのブロックで示されている画像補正部720および置換処理部740の詳細について以下に説明する。   Next, details of the image correction unit 720 and the replacement processing unit 740 shown in FIG. 5 each as one block will be described below.

図6は、図5に1つのブロックで示す画像補正部の詳細を示す図である。尚、以下の説明では、図5に示す要素については特に図番を断らずに図中の符号を使って参照する。   FIG. 6 is a diagram showing details of the image correction unit shown by one block in FIG. In the following description, the elements shown in FIG. 5 will be referred to by using the reference numerals in the figure without any special reference.

この図6に示す画像補正部720は、上述したように、画像取得部710で受け取られた順光撮影画像と逆光撮影画像とに、台形歪みについての補正を含む画像補正処理を実行するものであり、マーカ検出部721、台形補正処理部722、有効画像切出部723、および色補正部724を備えている。   As described above, the image correction unit 720 illustrated in FIG. 6 performs image correction processing including correction for trapezoidal distortion on the follow-up photographed image and the backlight photographed image received by the image acquisition unit 710. And a marker detection unit 721, a trapezoidal correction processing unit 722, an effective image cutout unit 723, and a color correction unit 724.

以下では、この画像補正部720の各要素の作用について、上記の台形歪みが生じた順光撮影画像を例として参照しながら説明する。   In the following, the operation of each element of the image correction unit 720 will be described with reference to an example of a follow-light photographed image in which the trapezoidal distortion has occurred.

図7は、台形歪みが生じた順光撮影画像の一例を示す模式図である。   FIG. 7 is a schematic diagram illustrating an example of a follow-light photographed image in which trapezoidal distortion has occurred.

この図7には、画像の幅が、下に向かうほど狭まる台形歪みが生じた撮影画像が模式的に示されている。   FIG. 7 schematically shows a captured image in which a trapezoidal distortion is generated such that the width of the image becomes narrower as it goes downward.

まず、マーカ検出部721が、撮影画像に写っている4つのマーカ131cを検出する。本来、これら4つのマーカ131bを結ぶと長方形が形成されるはずであるが、図7の例では台形歪みのために、4つのマーカ131bを結ぶと台形になってしまう。   First, the marker detection unit 721 detects four markers 131c shown in the captured image. Originally, when these four markers 131b are connected, a rectangle should be formed. However, in the example of FIG. 7, when the four markers 131b are connected, a trapezoid is formed due to trapezoidal distortion.

台形補正処理部722は、マーカ検出部721が検出した4つのマーカ131cを結んでできる図形が本来の長方形となるように、撮影画像全体に適当な変形を施すことで台形歪みを補正する。   The trapezoidal correction processing unit 722 corrects the trapezoidal distortion by appropriately deforming the entire captured image so that the figure formed by connecting the four markers 131c detected by the marker detection unit 721 becomes an original rectangle.

図8は、図7の順光撮影画像における台形歪みが補正された状態を示す模式図である。   FIG. 8 is a schematic diagram illustrating a state in which the trapezoidal distortion in the follow light photographed image of FIG.

背景置換処理に供する撮影画像としては、被写体と背景との区別の容易さ等の点から、背景がELパネル130における発光面のみであることが望ましい。しかしながら、本実施形態では、撮影スタジオ10について省スペース化が図られていることから、ELパネル130の大きさに限界があり、撮影画像には、図7や図8に示すように、ELパネル130の発光面以外の不要な部分が背景として写ってしまう。   The photographed image used for the background replacement process is desirably only the light emitting surface of the EL panel 130 in terms of ease of distinguishing between the subject and the background. However, in this embodiment, since the space is saved for the photographing studio 10, the size of the EL panel 130 is limited, and the photographed image has an EL panel as shown in FIGS. Unnecessary portions other than the light emitting surface 130 are reflected as a background.

有効画像作成部723は、台形補正処理部722による補正処理を経た撮影画像から、4つのマーカ131cで決まる有効範囲E1の外側の画像が削除された有効画像を作成する。   The effective image creation unit 723 creates an effective image in which images outside the effective range E1 determined by the four markers 131c are deleted from the captured image that has undergone the correction processing by the trapezoidal correction processing unit 722.

図9は、図8に示す、台形歪みが補正された順光撮影画像に基づいて作成された有効画像を示す模式図である。   FIG. 9 is a schematic diagram showing an effective image created based on the follow-light photographed image corrected for trapezoidal distortion shown in FIG.

有効画像作成部723によって、この図9に示すような、被写体Pの背景が、ELパネル130の発光面のみである有効画像が作成されると、次に、色補正部724が、この有効画像に対して、例えば人物の目についての赤目補正や、画像全体の色合いを好ましい色合いに補正する等といった色補正処理を施す。   When the effective image creation unit 723 creates an effective image in which the background of the subject P is only the light emitting surface of the EL panel 130 as shown in FIG. 9, the color correction unit 724 then creates the effective image. For example, color correction processing such as red-eye correction for a person's eyes or correction of a color tone of the entire image to a preferable color tone is performed.

以上、図7〜図9の順光撮影画像を参照して、画像補正部720で行なわれる画像補正処理について説明したが、本実施形態では、順光撮影画像とともに撮影された逆光撮影画像にも、順光撮影画像に施された画像補正処理と全く同じ処理が施される。ただし、この逆光撮影画像では、被写体は黒くつぶれて写ることとなるので、上記の色補正部724での処理は、この逆光撮影画像に対しては除外される。   The image correction processing performed by the image correction unit 720 has been described above with reference to the backlight photographed images in FIGS. 7 to 9. However, in the present embodiment, the backlight photographed image photographed together with the backlight photographed image is also used. The same process as the image correction process applied to the follow light photographed image is performed. However, in this backlight photographed image, the subject appears to be blacked out, so the processing in the color correction unit 724 is excluded for this backlight photographed image.

図10は、図6の画像補正部によって画像補正処理が施された、補正済みの逆光撮影画像を示す模式図である。   FIG. 10 is a schematic diagram illustrating a corrected backlight image that has been subjected to image correction processing by the image correction unit of FIG.

この図10に示すように、補正済みの逆光撮影画像は、被写体Pの領域がシャドウ側に偏り、背景としてELパネル130が写っている領域がハイライト側に偏った画像となっている。ここで、上記の図7〜図9の順光撮影画像では、ELパネル130の発光の輝度が閃光発光装置12が発する閃光の輝度よりも低いため、ELパネル130の発光面は実際の発光色よりも白っぽく写るのに対し、この図10に示す逆光撮影画像では、ELパネル130の実際の発光色である青緑色に写る。   As shown in FIG. 10, the corrected backlight image is an image in which the area of the subject P is biased toward the shadow side and the area where the EL panel 130 is reflected as the background is biased toward the highlight side. 7 to 9 described above, since the luminance of light emitted from the EL panel 130 is lower than the luminance of the flash emitted from the flash light emitting device 12, the light emitting surface of the EL panel 130 is the actual emission color. In contrast, in the backlight image shown in FIG. 10, the image appears in blue-green, which is the actual emission color of the EL panel 130.

このように、図10に示す補正済みの逆光撮影画像では、被写体Pの領域と、背景領域とでは、明るさが大きく異なるので両者を容易に区別することができる。また、補正済みの逆光撮影画像では、画像中の被写体Pの位置や輪郭は、補正済みの順光撮影画像における被写体の位置や輪郭とほぼ同じになる。そこで、本実施形態では、図5の置換処理部740において、まず、補正済みの逆光撮影画像について被写体Pと背景との区別を行ない、その区別を補正済みの順光撮影画像にそのまま適用することで、この順光撮影画像における被写体Pと背景とを区別する。そして、この置換処理部740では、順光撮影画像における背景を、顧客が所望する背景と置換して背景置換画像を作成する。   As described above, in the corrected backlight image shown in FIG. 10, the brightness of the subject P region and the background region are greatly different, so that both can be easily distinguished. In the corrected backlight image, the position and contour of the subject P in the image are substantially the same as the position and contour of the subject in the corrected backlight image. Therefore, in this embodiment, in the replacement processing unit 740 of FIG. 5, first, the corrected backlight image is distinguished from the subject P and the background, and the distinction is directly applied to the corrected backlight image. Thus, the subject P and the background in the follow light photographed image are distinguished. Then, the replacement processing unit 740 generates a background replacement image by replacing the background in the follow light photographed image with the background desired by the customer.

次に、この置換処理部740の詳細について、補正済みの逆光撮影画像における被写体と背景との区別から、背景置換画像の作成に至る背景置換処理に注目して説明する。   Next, the details of the replacement processing unit 740 will be described by focusing on the background replacement processing that leads to the creation of the background replacement image from the distinction between the subject and the background in the corrected backlight image.

ここで、この置換処理部740では、上述したように、上記の表示用置換画像を作成するための第1の決定方法と、上記の確認用背景置換画像を作成するための第2の決定方法と、上記の出力用置換画像を作成するための第3の決定方法との3つの決定方法それぞれを用いた3つの背景置換処理が順次に実行される。以下では、これら3つの背景置換処理のうち、まず、上記の合成比を時間をかけて精密に決定することにより画質の高い上記の出力用置換画像を作成する第3の決定方法を用いた背景置換処理について説明する。第1の決定方法および第2の決定方法は、いずれもこの第3の決定方法を簡略化することによって処理時間の短縮が図られたものであるので、これらの決定方法を用いた背景置換処理については、第3の決定方法を用いた背景置換処理の説明の後に説明する。   Here, in the replacement processing unit 740, as described above, the first determination method for generating the display replacement image and the second determination method for generating the confirmation background replacement image described above. And three background replacement processes using the three determination methods, ie, the third determination method for creating the output replacement image, are sequentially executed. In the following, among these three background replacement processes, first, the background using the third determination method for creating the above-described output replacement image with high image quality by accurately determining the above-described composition ratio over time. The replacement process will be described. Since the first determination method and the second determination method both reduce the processing time by simplifying the third determination method, the background replacement process using these determination methods. Will be described after the background replacement process using the third determination method.

以下の説明では、上記の補正済みの順光撮影画像および補正済みの逆光撮影画像それぞれの一例として、次の画像を参照する。   In the following description, the following images will be referred to as examples of the corrected follow-light photographed image and the corrected backlight photographed image.

図11は、補正済みの順光撮影画像の一例を示す図であり、図12は、補正済みの逆光撮影画像の一例を示す図である。   FIG. 11 is a diagram illustrating an example of a corrected backlight image, and FIG. 12 is a diagram illustrating an example of a corrected backlight image.

これら図11および図12には、人物の被写体P’が写っている。ただし、図12に示す撮影画像は、逆光で撮影されたものであるために、被写体P’の領域がシャドウ側に偏り、背景としてELパネル130が写っている領域がハイライト側に偏った画像となっている。ここで、被写体P’と背景との境界周辺の様子を、図11中のエリアA1と、この図11中のエリアA1に対応する図12中のエリアA2とについて別図に示す。   11 and 12 show a person's subject P '. However, since the photographed image shown in FIG. 12 was photographed by backlighting, the area of the subject P ′ is biased toward the shadow side, and the area where the EL panel 130 is reflected as the background is biased toward the highlight side. It has become. Here, the situation around the boundary between the subject P ′ and the background is shown in another figure for the area A1 in FIG. 11 and the area A2 in FIG. 12 corresponding to the area A1 in FIG.

図13は、図11中のエリアA1の拡大図であり、図14は、図12中のエリアA2の拡大図である。   13 is an enlarged view of area A1 in FIG. 11, and FIG. 14 is an enlarged view of area A2 in FIG.

これら図13および図14には、被写体P’の頭髪越しに背景のELパネル130が見えている様子が示されている。一般に、撮影画像中には、被写体の一部越しに背景が見えている部分がしばしば見られるが、このような部分は、図11〜図14の例に示すように、撮影画像中の被写体と背景との境界周辺に存在する。   FIG. 13 and FIG. 14 show a state in which the background EL panel 130 is visible over the hair of the subject P ′. In general, a portion where the background is visible over a part of the subject is often seen in the photographed image, but such a portion is separated from the subject in the photographed image as shown in the examples of FIGS. It exists around the boundary with the background.

ここで、図13および図14は、説明の便宜上、人物の頭髪の一本に至るまで詳細に見える理想的な状態で示されている。しかし、実際の撮影画像では、解像度の制約により、画像を構成する画素が一本の頭髪等といった微細な被写体よりも大きくなる。そのため、例えば、図13および図14に示す、頭髪越しに背景のELパネル130が見えている部分の画像等は、頭髪という微細な被写体の色と、その背後に見える背景の色とが合成された合成色を有する画素が集まって構成されることとなる。そのため、このような部分では、被写体と背景との単純な区別は不可能となっている。   Here, FIG. 13 and FIG. 14 are shown in an ideal state where details are shown up to one hair of a person for convenience of explanation. However, in an actual captured image, the pixels constituting the image are larger than a fine subject such as a single hair because of resolution limitations. Therefore, for example, in the image of the portion where the background EL panel 130 can be seen over the hair shown in FIGS. 13 and 14, the color of the fine subject called the hair and the background color visible behind it are synthesized. Thus, the pixels having the combined color are assembled. Therefore, in such a part, it is impossible to simply distinguish between the subject and the background.

図5の置換処理部740は、例えば図11に示すような、補正済みの順光撮影画像の背景を、顧客が所望する背景に置換する際には、まず、この補正済みの順光撮影画像を、被写体領域と、背景領域と、これら2つの領域に挟まれた境界領域とに区別する。置換処理部740は、この補正済みの順光撮影画像における被写体領域についてはそのまま残し、背景領域を、顧客が所望する別の背景と置換する。   The replacement processing unit 740 of FIG. 5 first replaces the background of the corrected follow-light photographed image as shown in FIG. 11, for example, with the background desired by the customer. Are classified into a subject area, a background area, and a boundary area sandwiched between these two areas. The replacement processing unit 740 leaves the subject area in the corrected follow-light photographed image as it is, and replaces the background area with another background desired by the customer.

このとき、図13に示すように被写体の一部越しに背景が見えていている部分、即ち、微細な被写体色と背景色とが合成された合成色を有する画素によって構成される部分は、上記のように被写体と背景とに単純に区別することが不可能であることから、置換処理部740によって上記の境界領域に区別される。   At this time, as shown in FIG. 13, the portion where the background is seen over a part of the subject, that is, the portion constituted by the pixels having the composite color obtained by synthesizing the fine subject color and the background color, As described above, since it is impossible to simply distinguish between the subject and the background, the replacement processing unit 740 distinguishes the boundary region.

置換処理部740は、補正済みの順光撮影画像における上記の境界領域内の全ての画素が、上記のような合成色を有しているという前提のもとに、各画素の色の合成の元となった被写体色と、背景色とを推定し、さらに両者の合成比を推定する。ただし、実際の境界領域には、合成色を有する画素の他にも、背景色のみを有する画素や、被写体色のみを有する画素も含まれる。置換処理部740では、処理対象の画素が、背景色のみを有する画素である場合には、その画素の色に占める被写体色の割合が「0」となる合成比が推定され、処理対象の画素が、被写体色のみを有する画素である場合には、その画素の色に占める被写体色の割合が「1」となる合成比が推定される。   The replacement processing unit 740 performs color synthesis of each pixel on the premise that all the pixels in the boundary region in the corrected follow light captured image have the composite color as described above. The original subject color and the background color are estimated, and the combination ratio of both is estimated. However, the actual boundary region includes pixels having only the background color and pixels having only the subject color in addition to the pixel having the composite color. When the pixel to be processed is a pixel having only the background color, the replacement processing unit 740 estimates a composition ratio at which the ratio of the subject color to the color of the pixel is “0”, and the pixel to be processed However, if the pixel has only the subject color, the composition ratio is estimated such that the ratio of the subject color to the pixel color is “1”.

そして、置換処理部740は、上記の境界領域内の各画素の色を、推定された被写体色と、上記の顧客が所望する別の背景色とが、推定された合成比で合成されてなる合成色に置き換える。この処理では、境界領域中の、背景色のみを有する画素の色は上記の別の背景色に置換され、被写体色のみを有する画素の色はそのまま維持され、さらに、被写体の一部越しに背景が見えていている部分の画素の色は上記の合成色に置換される。この処理の結果、境界領域中に、被写体の一部越しに背景が見えていている部分が含まれていたとしても、その被写体の一部越しに、上記の顧客が所望する別の背景が見えているという自然な背景置換画像が作成される。   Then, the replacement processing unit 740 combines the color of each pixel in the boundary area with the estimated subject color and another background color desired by the customer at the estimated synthesis ratio. Replace with composite color. In this process, the color of the pixel having only the background color in the boundary region is replaced with the other background color described above, the color of the pixel having only the subject color is maintained as it is, and the background over a part of the subject is further maintained. The color of the pixel in the portion where is visible is replaced with the above synthesized color. As a result of this processing, even if the boundary area includes a portion where the background is visible over a part of the subject, another background desired by the customer can be seen over a part of the subject. A natural background replacement image is created.

以下、この置換処理部740の詳細について説明する。   Details of the replacement processing unit 740 will be described below.

図15は、図5に1つのブロックで示す置換処理部の詳細を示す図である。尚、以下の説明でも、図5に示す要素については特に図番を断らずに図5中の符号を使って参照する。   FIG. 15 is a diagram showing details of the replacement processing unit shown by one block in FIG. In the following description, the elements shown in FIG. 5 are referred to by using the reference numerals in FIG.

この置換処理部740は、上述した背景置換処理を実行するものであり、マスク作成部741、色推定部742、および背景置換画像作成部743を備えている。   The replacement processing unit 740 executes the above-described background replacement processing, and includes a mask creation unit 741, a color estimation unit 742, and a background replacement image creation unit 743.

まず、これら各構成要素の概要について説明する。   First, an outline of each of these components will be described.

マスク作成部741は、上記の補正済みの逆光撮影画像において、この逆光撮影画像中で、被写体色の画素のみが存在する範囲を定義する被写体マスクと、背景色の画素のみが存在する範囲を定義する背景マスクとを作成する。ここで、これら2つのマスクは、それぞれのマスクが定義する範囲内に、例えば図14に示すような、被写体越しに背景が見えている部分の画素が含まれないように、互いに隙間を開けて作成される。   The mask creating unit 741 defines a subject mask that defines a range in which only subject-color pixels exist in the backlight photographed image and a range in which only background-color pixels exist in the backlight photographed image. Create a background mask. Here, these two masks are spaced from each other so that the pixels defined by the respective masks do not include the pixels of the portion where the background is visible over the subject as shown in FIG. 14, for example. Created.

色推定部742は、マスク作成部741が作成した被写体マスクと背景マスクとを、上記の補正済みの順光撮影画像に適用して、まず、この順光撮影画像において、これら2つのマスク間に開いた隙間、即ち、境界領域を認識する。そして、この境界領域内の全ての画素が合成色を有しているという前提のもとに、各画素の色の合成の元となった被写体色と、背景色とを推定し、さらに両者の合成比を推定する。   The color estimation unit 742 applies the subject mask and the background mask created by the mask creation unit 741 to the corrected follow-light photographed image, and first, in the follow-light photograph image, between these two masks. Open gaps, i.e. boundary regions, are recognized. Based on the premise that all the pixels in this boundary region have a composite color, the subject color and background color from which the color of each pixel is combined are estimated, and both Estimate the synthesis ratio.

背景置換画像作成部743は、まず、上記の補正済みの順光撮影画像において、被写体マスクで定義される領域についてはそのまま残し、背景マスクで定義される領域を、顧客が所望する別の背景と置換する。次に、境界領域内の各画素について、顧客が所望する背景の色と、上記の色推定部742で推定された被写体色とを、色推定部742で推定された合成比で合成して合成色を求め、各画素の色をその合成色に置換する。これにより、上記の補正済みの順光撮影画像の背景が、顧客が所望する別の背景に自然に置換された背景置換画像が作成される。   First, the background replacement image creation unit 743 leaves the area defined by the subject mask as it is in the corrected follow light photographed image, and sets the area defined by the background mask as another background desired by the customer. Replace. Next, for each pixel in the boundary region, the background color desired by the customer and the subject color estimated by the color estimation unit 742 are combined at a combination ratio estimated by the color estimation unit 742 and combined. Find the color and replace the color of each pixel with its composite color. As a result, a background replacement image is created in which the background of the corrected follow light image is naturally replaced with another background desired by the customer.

このように作成された背景置換画像を表わす画像データが、図5の画像データ転送部740から、各出力デバイスや出力用記憶媒体550(図5参照)に転送される。   The image data representing the background replacement image created in this way is transferred from the image data transfer unit 740 in FIG. 5 to each output device or output storage medium 550 (see FIG. 5).

次に、置換処理部740の各構成要素の詳細について説明する。   Next, details of each component of the replacement processing unit 740 will be described.

まず、マスク作成部741の詳細について説明する。   First, details of the mask creation unit 741 will be described.

図16は、図15に1つのブロックで示すマスク作成部の詳細を示す図である。   FIG. 16 is a diagram showing details of the mask creating unit shown by one block in FIG.

このマスク作成部741は、ヒストグラム作成部741a、閾値計算部741b、背景マスク設定部741c、被写体マスク設定部741d、背景マスク縮小部741e、および被写体マスク縮小部741fを備えている。   The mask creation unit 741 includes a histogram creation unit 741a, a threshold calculation unit 741b, a background mask setting unit 741c, a subject mask setting unit 741d, a background mask reduction unit 741e, and a subject mask reduction unit 741f.

ヒストグラム作成部741aは、上記の補正済みの逆光撮影画像を構成する各画素の明るさについてのヒストグラムを作成する。   The histogram creation unit 741a creates a histogram for the brightness of each pixel constituting the corrected backlight image.

図17は、補正済みの逆光撮影画像を構成する各画素の明るさについてのヒストグラムの様々な例を示す図である。   FIG. 17 is a diagram illustrating various examples of histograms regarding the brightness of each pixel constituting a corrected backlight image.

この図17のパート(a)には、逆光撮影画像を構成する各画素の輝度を、多数の輝度範囲に振り分け、各輝度範囲についてどれだけの画素が振り分けられたかを頻度で示した輝度ヒストグラムH1が示されており、この輝度ヒストグラムH1では、横軸H1_1に輝度がとられ、縦軸H1_2に頻度がとられている。   In part (a) of FIG. 17, a luminance histogram H <b> 1 showing the frequency of how many pixels are allocated to each luminance range and the luminance of each pixel constituting the backlight image is allocated to a number of luminance ranges. In this luminance histogram H1, the horizontal axis H1_1 represents the luminance, and the vertical axis H1_2 represents the frequency.

ここで、本実施形態では上記の順光撮影画像および逆光撮影画像は、R(レッド)、G(グリーン)、B(ブルー)の3色で色を定義するRGB色空間上の座標、即ち、このRGB色空間におけるR値、G値、およびB値で各画素の色が表わされている。各画素の色を表わすR値、G値、およびB値それぞれには、その画素の明るさが反映されているので、逆光撮影画像を構成する各画素の明るさについてのヒストグラムを、これらR値、G値、およびB値のうちのいずれかを用いて作成することもできる。   Here, in the present embodiment, the above-described backlight image and backlight image are coordinates in the RGB color space that defines colors with three colors of R (red), G (green), and B (blue), that is, The color of each pixel is represented by the R value, G value, and B value in the RGB color space. Since the R value, G value, and B value representing the color of each pixel reflect the brightness of that pixel, a histogram of the brightness of each pixel that constitutes the backlit photographed image is represented by these R values. , G value, and B value can be used.

図17のパート(b)には、逆光撮影画像を構成する各画素のR値を、R値の多数の範囲に振り分け、各範囲についてどれだけの画素が振り分けられたかを頻度で示したR値ヒストグラムH2が示されており、図17のパート(c)には、逆光撮影画像を構成する各画素のG値を、G値の多数の範囲に振り分け、各範囲についてどれだけの画素が振り分けられたかを頻度で示したG値ヒストグラムH3が示されており、図17のパート(d)には、逆光撮影画像を構成する各画素のB値を、B値の多数の範囲に振り分け、各範囲についてどれだけの画素が振り分けられたかを頻度で示したB値ヒストグラムH4が示されている。図17のパート(b)に示すR値ヒストグラムH2では、横軸H2_1にR値がとられ、図17のパート(c)に示すG値ヒストグラムH3では、横軸H3_1にG値がとられ、図17のパート(d)に示すB値ヒストグラムH4では、横軸H4_1にB値がとられている。また、これら3つのヒストグラムの縦軸H2_2,H3_2,H4_2には、頻度がとられている。   In part (b) of FIG. 17, the R value of each pixel constituting the backlight image is allocated to a large range of R values, and the R value indicating how many pixels are allocated for each range. A histogram H2 is shown, and in part (c) of FIG. 17, the G value of each pixel constituting the backlight image is allocated to a large range of G values, and how many pixels are allocated to each range. A G-value histogram H3 showing the frequency is shown. Part (d) of FIG. 17 distributes the B value of each pixel constituting the backlight image into a large range of B values. A B-value histogram H4 showing how many pixels have been distributed with respect to frequency is shown. In the R value histogram H2 shown in part (b) of FIG. 17, the R value is taken on the horizontal axis H2_1, and in the G value histogram H3 shown in part (c) of FIG. 17, the G value is taken on the horizontal axis H3_1. In the B value histogram H4 shown in Part (d) of FIG. 17, the B value is taken on the horizontal axis H4_1. In addition, frequencies are taken on the vertical axes H2_2, H3_2, and H4_2 of these three histograms.

本実施形態では、逆光撮影画像では、被写体の背景が、ELパネル130の発光色である青緑色に写ることから、この逆光撮影画像の各画素の明るさは、R値、G値、およびB値のうち、G値に最も良く反映される。そこで、図16のヒストグラム作成部741aは、図17に示す4つのヒストグラムのうち、図17のパート(c)に示すG値ヒストグラムH3を作成するように構成されている。   In the present embodiment, in the backlight image, the background of the subject appears in blue-green, which is the emission color of the EL panel 130. Therefore, the brightness of each pixel of the backlight image is the R value, G value, and B value. Of the values, it is best reflected in the G value. Therefore, the histogram creation unit 741a in FIG. 16 is configured to create a G-value histogram H3 shown in part (c) of FIG. 17 among the four histograms shown in FIG.

ここで、このG値ヒストグラムH3には、他の3つのヒストグラムと同様に、シャドウ側と、ハイライト側とに2つのピークPk1,Pk2が現れる。シャドウ側のピークPk1は、補正済みの逆光撮影画像における被写体領域の画素が振り分けられて現れるものであり、ハイライト側のピークPk2は、この逆光撮影画像における背景領域の画素が振り分けられて現れるものである。   Here, in the G value histogram H3, two peaks Pk1 and Pk2 appear on the shadow side and the highlight side as in the other three histograms. The shadow-side peak Pk1 appears after the pixels of the subject area in the corrected backlight image are distributed, and the highlight-side peak Pk2 appears when the pixels of the background area in the backlight image are distributed. It is.

図16に示す閾値計算部741bは、このヒストグラム作成部741aが作成したG値ヒストグラムにおける2つのピークPk1,Pk2それぞれに基づいて、次の2つの閾値を計算する。図17のパート(c)に示すようにシャドウ側のピークPk1からは、このピークPk1において、頻度が所定頻度以上となるG値の上限である第1の閾値Sr1が計算される。また、ハイライト側のピークPk2からは、このピークPk2において、頻度が所定頻度以上となるG値の下限である第2の閾値Sr2が計算される。   The threshold calculation unit 741b illustrated in FIG. 16 calculates the following two thresholds based on the two peaks Pk1 and Pk2 in the G value histogram created by the histogram creation unit 741a. As shown in part (c) of FIG. 17, from the shadow side peak Pk1, a first threshold value Sr1 that is the upper limit of the G value at which the frequency is equal to or higher than a predetermined frequency is calculated at the peak Pk1. Further, from the highlight-side peak Pk2, the second threshold value Sr2 that is the lower limit of the G value at which the frequency is equal to or higher than the predetermined frequency is calculated at the peak Pk2.

そして、図16に示す被写体マスク設定部741cは、上記の補正済みの逆光撮影画像を構成する複数の画素のうち、G値が第1の閾値Sr1以下となる画素からなる領域を初期被写体マスクに設定し、背景マスク設定部741dは、G値が第2の閾値Sr2以上となる画素からなる領域を初期背景マスクに設定する。   Then, the subject mask setting unit 741c shown in FIG. 16 uses, as an initial subject mask, an area composed of pixels having a G value equal to or smaller than the first threshold value Sr1 among the plurality of pixels constituting the corrected backlight image. Then, the background mask setting unit 741d sets, as an initial background mask, an area including pixels whose G value is equal to or greater than the second threshold value Sr2.

図18は、図14に示す逆光撮影画像の拡大図において、初期被写体マスクに設定された領域と初期背景マスクに設定された領域を示す図である。   FIG. 18 is a diagram illustrating an area set as the initial subject mask and an area set as the initial background mask in the enlarged view of the backlight image shown in FIG.

この図18における右側のハッチング部分は、図14の拡大図において被写体P’の頭髪が、背景が見えないほどに集まっていて、逆光撮影によってシャドウ側に大きく偏って写っている部分であり、その部分の画素のG値が上記の第1の閾値Sr1を下回っている。その結果、この図18における右側のハッチング部分は、被写体マスク設定部741cによって初期被写体マスクM1に設定される。   The hatched portion on the right side in FIG. 18 is a portion in which the hair of the subject P ′ is gathered so that the background cannot be seen in the enlarged view of FIG. The G value of the pixel in the portion is lower than the first threshold value Sr1. As a result, the hatched portion on the right side in FIG. 18 is set as the initial subject mask M1 by the subject mask setting unit 741c.

また、図18における左側のハッチング部分は、図14の拡大図において背景のELパネル130のみが写っている、ハイライト側に大きく偏った部分であり、その部分の画素のG値は上記の第2の閾値Sr2を上回っている。その結果、この図18における左側のハッチング部分は、背景マスク設定部741dによって初期背景マスクM2に設定される。   Further, the hatched portion on the left side in FIG. 18 is a portion that is largely biased toward the highlight side, in which only the background EL panel 130 is shown in the enlarged view of FIG. The threshold value Sr2 of 2 is exceeded. As a result, the left hatched portion in FIG. 18 is set as the initial background mask M2 by the background mask setting unit 741d.

一方、図18において左右いずれのハッチング部分にも属していない部分は、頭髪越しに背景が見えている部分であり、その部分のG値は、上記の第1の閾値Sr1を上回り、上記の第2の閾値Sr2を下回る。その結果、この図18において左右いずれのハッチング部分にも属していない部分は、初期被写体マスクM1と初期背景マスクM2との間にあって、両方のマスクの外側となる境界領域M3として残される。   On the other hand, in FIG. 18, the portion that does not belong to either the left or right hatched portion is a portion where the background is visible over the hair, and the G value of the portion exceeds the first threshold value Sr1 and Below a threshold Sr2 of 2. As a result, the portion that does not belong to either the left or right hatched portion in FIG. 18 is left between the initial subject mask M1 and the initial background mask M2, and is left as a boundary region M3 that is outside both masks.

図19は、図18に示す初期被写体マスクと初期背景マスクとを示す図であり、図20は、初期被写体マスクと初期背景マスクとを、図11に示す補正済みの順光撮影画像全体に重ねて示した図である。   FIG. 19 is a diagram showing the initial subject mask and the initial background mask shown in FIG. 18, and FIG. 20 is an overlay of the initial subject mask and the initial background mask on the entire corrected sequential light image shown in FIG. FIG.

図19および図20に示すように、初期被写体マスクM1と初期背景マスクM2とはかなり接近しており、境界領域M3が非常に狭くなっている。ここで、上述したように、補正済みの逆光撮影画像では、画像中の被写体の位置や輪郭は、補正済みの順光撮影画像における被写体の位置や輪郭とほぼ同じになる。しかし、撮影のタイミングが若干ずれているため、2つの撮影画像の間で、被写体の位置や輪郭が若干ずれる可能性もある。そのような場合には、境界領域M3が狭いと、補正済みの順光撮影画像において、図13に示すような、被写体の一部を透かして背景が見えている部分が境界領域M3に完全には含まれず、2つのマスクのいずれか一方に含まれてしまう恐れが生じる。このような初期被写体マスクM1と、初期背景マスクM2とに基づいて、背景の置換が行なわれると、被写体の一部を透かして背景が見えている部分に、古い背景が残ってしまったり、あるいは、そのような部分が全て新しい背景に置換されて、被写体の一部が欠けてしまったりするという問題が発生してしまう恐れがある。   As shown in FIGS. 19 and 20, the initial subject mask M1 and the initial background mask M2 are very close to each other, and the boundary region M3 is very narrow. Here, as described above, in the corrected backlight image, the position and contour of the subject in the image are substantially the same as the position and contour of the subject in the corrected backlight image. However, since the shooting timing is slightly shifted, the position and contour of the subject may be slightly shifted between the two shot images. In such a case, if the boundary region M3 is narrow, the portion of the corrected follow-light photographed image where the background is visible through a part of the subject as shown in FIG. 13 is completely in the boundary region M3. May not be included, and may be included in one of the two masks. When the background replacement is performed based on the initial subject mask M1 and the initial background mask M2, an old background remains in a portion where the background is visible through a part of the subject, or There is a possibility that such a part may be replaced with a new background and a part of the subject may be lost.

このような問題を回避するために、本実施形態では、図16に示す被写体マスク縮小部741eによって初期被写体マスクM1を境界領域M3から離れる方向に縮小し、背景マスク縮小部741fによって初期背景マスクM2を境界領域M3から離れる方向に縮小する。これにより、境界領域M3が広げられ、被写体の一部を透かして背景が見えている部分が境界領域M3に完全に含まれるようになる。   In order to avoid such a problem, in the present embodiment, the initial subject mask M1 is reduced in the direction away from the boundary region M3 by the subject mask reduction unit 741e shown in FIG. 16, and the initial background mask M2 is reduced by the background mask reduction unit 741f. Is reduced in a direction away from the boundary region M3. As a result, the boundary region M3 is widened, and a portion where the background is visible through a part of the subject is completely included in the boundary region M3.

図21は、図19に示す初期被写体マスクと初期背景マスクとが、それぞれ境界領域から離れる方向に縮小される様子を示す図である。   FIG. 21 is a diagram illustrating a state in which the initial subject mask and the initial background mask illustrated in FIG. 19 are each reduced in a direction away from the boundary region.

この図21に示すように、初期被写体マスクM1の輪郭L1が所定数の画素分だけ、境界領域M3から離れる方向に移動されることによって初期被写体マスクM1が縮小され、同様に、初期背景マスクM2の輪郭L2が所定数の画素分だけ、境界領域M3から離れる方向に移動されることによって初期背景マスクM2が縮小される。ここで、本実施形態では、2つのマスクの輪郭の移動量として5画素が採用されている。このようなマスクの縮小を経て、最終的な被写体マスクM1’および背景マスクM2’が完成される。   As shown in FIG. 21, the initial subject mask M1 is reduced by moving the contour L1 of the initial subject mask M1 by a predetermined number of pixels in a direction away from the boundary region M3. Similarly, the initial background mask M2 The initial background mask M2 is reduced by moving the outline L2 by a predetermined number of pixels in a direction away from the boundary region M3. Here, in the present embodiment, 5 pixels are employed as the movement amount of the contours of the two masks. After such reduction of the mask, the final subject mask M1 'and the background mask M2' are completed.

図22は、最終的に完成された被写体マスクと背景マスクとを、図11に示す補正済みの順光撮影画像全体に重ねて示した図である。   FIG. 22 is a diagram showing the finally completed subject mask and background mask superimposed on the entire corrected follow-light photographed image shown in FIG.

最終的に完成された被写体マスクM1’と背景マスクM2’との間、即ち、最終的な境界領域M3’は、図20に示す境界領域M3に比べて10画素分広くなっており、図22に示すように、この最終的な境界領域M3’に、被写体の一部を透かして背景が見えている部分が十分に含まれることとなる。   The final mask between the subject mask M1 ′ and the background mask M2 ′, that is, the final boundary region M3 ′, is 10 pixels wider than the boundary region M3 shown in FIG. As shown in FIG. 5, the final boundary region M3 ′ sufficiently includes a portion where the background is visible through a part of the subject.

以上で、図15の置換処理部740が備えるマスク作成部741についての説明を終了し、次に、この置換処理部740が備える色推定部742の詳細について説明する。   The description of the mask creation unit 741 included in the replacement processing unit 740 in FIG. 15 is finished. Next, details of the color estimation unit 742 included in the replacement processing unit 740 will be described.

図23は、図15に1つのブロックで示す色推定部の詳細を示す図である。   FIG. 23 is a diagram showing details of the color estimation unit shown by one block in FIG.

この色推定部742は、背景色推定部742a、被写体色推定部742b、および合成比推定部742cを備えている。   The color estimation unit 742 includes a background color estimation unit 742a, a subject color estimation unit 742b, and a synthesis ratio estimation unit 742c.

まず、背景色推定部742aについて説明する。   First, the background color estimation unit 742a will be described.

図24は、図23に1つのブロックで示す背景色推定部の詳細を示す図である。   FIG. 24 is a diagram showing details of the background color estimation unit shown by one block in FIG.

この背景色推定部742aは、補正済みの順光撮影画像における、上記の最終的な境界領域内の各画素について、その画素の色を構成している背景色を推定するものであり、探索範囲設定部742a_1、背景領域確認部742a_2、および背景色計算部742a_3を備えている。   The background color estimation unit 742a estimates the background color constituting the color of each pixel in the final boundary area in the corrected follow light captured image, and the search range A setting unit 742a_1, a background region confirmation unit 742a_2, and a background color calculation unit 742a_3 are provided.

この背景色推定部742aは、境界領域内のある画素について背景色を推定する際には、背景マスクで定義される領域内の画素の中から、ある程度その画素の近くに位置する複数の画素を探索し、探索された複数の画素の色の平均色を、その画素についての背景色として求める。   When estimating the background color for a certain pixel in the boundary area, the background color estimation unit 742a selects a plurality of pixels located near the pixel to some extent from the pixels in the area defined by the background mask. The average color of the searched pixels is obtained as the background color for the pixel.

探索範囲設定部742a_1は、背景色を推定する画素を中心とした正方形状の探索範囲を次のように設定する。   The search range setting unit 742a_1 sets a square search range centered on a pixel whose background color is estimated as follows.

図25は、ある画素について背景色を推定する際に、その画素を中心に探索範囲が設定される様子を示す図である。   FIG. 25 is a diagram illustrating how a search range is set around a pixel when a background color is estimated for the pixel.

境界領域内のある画素Gについて探索範囲を設定するに当たり、探索範囲設定部742a_1は、まず、この画素Gを中心とした正方形状の所定の初期範囲T1から出発して徐々に探索範囲を拡張する。そして、探索範囲設定部742a_1は、背景マスクM2’で定義される領域の画素が、所定数を超えて探索範囲に含まれるようになったところで拡張を止め、そのときの探索範囲T1’を、背景色推定のための探索範囲として設定する。   In setting the search range for a certain pixel G in the boundary region, the search range setting unit 742a_1 first starts from a predetermined square initial range T1 centered on the pixel G and gradually expands the search range. . Then, the search range setting unit 742a_1 stops the expansion when the pixels of the region defined by the background mask M2 ′ exceed the predetermined number and are included in the search range, and the search range T1 ′ at that time is Set as search range for background color estimation.

探索範囲が設定されると、図24に示す背景領域確認部742a_2が、画素Gについて背景色を推定するために用いる領域として、補正済みの順光撮影画像における次の領域を確認する。   When the search range is set, the background region confirmation unit 742a_2 illustrated in FIG. 24 confirms the next region in the corrected follow light image as the region used for estimating the background color for the pixel G.

図26は、ある画素について背景色を推定するために用いられる領域の一例を示す図である。   FIG. 26 is a diagram illustrating an example of a region used for estimating a background color for a certain pixel.

この図26に示すように、画素Gについて背景色を推定するために用いられる領域として、補正済みの順光撮影画像において、背景マスクで定義される領域であり、かつ探索範囲設定部742a_1によって設定された探索範囲T1’内となる領域B1が確認される。   As shown in FIG. 26, the region used to estimate the background color for the pixel G is a region defined by the background mask in the corrected follow light captured image, and is set by the search range setting unit 742a_1. A region B1 that is within the search range T1 ′ is confirmed.

このように、画素Gについて背景色を推定するために用いられる領域B1が確認されると、図24に示す背景色計算部742a_3が、この領域B1内の複数の画素の平均色、即ち、複数の画素のR値、G値、およびB値それぞれの平均値を計算する。そして、その計算結果が表わす色を、その画素Gについての背景色として採用する。   Thus, when the area B1 used for estimating the background color for the pixel G is confirmed, the background color calculation unit 742a_3 shown in FIG. 24 performs an average color of a plurality of pixels in the area B1, that is, a plurality of colors. The average value of each of the R value, the G value, and the B value of the pixels is calculated. Then, the color represented by the calculation result is adopted as the background color for the pixel G.

以上に説明した背景色推定部742aは、上記の探索範囲の設定から平均色の計算に至るまでの処理を、補正済みの順光撮影画像における境界領域内の全ての画素について実行する。   The background color estimation unit 742a described above executes the above-described processing from the setting of the search range to the calculation of the average color for all pixels in the boundary region in the corrected follow-light photographed image.

次に、図23に示す被写体色推定部742bについて説明する。   Next, the subject color estimation unit 742b shown in FIG. 23 will be described.

図27は、図23に1つのブロックで示す被写体色推定部の詳細を示す図である。   FIG. 27 is a diagram showing details of the subject color estimation unit shown by one block in FIG.

この被写体色推定部742bは、補正済みの順光撮影画像における、上記の最終的な境界領域内の各画素について、その画素の色を構成している被写体色を推定するものであり、探索範囲設定部742b_1、被写体領域確認部742b_2、画素色確認部742b_3、および被写体色探索部742b_4を備えている。   The subject color estimation unit 742b estimates the subject color that constitutes the color of each pixel in the final boundary region in the corrected continuous light captured image, and the search range. A setting unit 742b_1, a subject region confirmation unit 742b_2, a pixel color confirmation unit 742b_3, and a subject color search unit 742b_4 are provided.

この被写体色推定部742bは、境界領域内のある画素について被写体色を推定する際には、被写体マスクで定義される領域内の画素の中から、ある程度その画素の近くに位置する複数の画素を探索し、探索された複数の画素の色の中から、後述の探索方法によって、その画素についての被写体色を探索する。   When the subject color estimation unit 742b estimates the subject color for a certain pixel in the boundary region, the subject color estimation unit 742b selects a plurality of pixels located near the pixel to some extent from the pixels in the region defined by the subject mask. The subject color is searched for by the search method described later from the color of the searched plurality of pixels.

探索範囲設定部742b_1は、被写体色を推定する画素を中心とした正方形状の探索範囲を次のように設定する。   The search range setting unit 742b_1 sets a square search range centered on a pixel for estimating the subject color as follows.

図28は、ある画素について被写体色を推定する際に、その画素を中心に探索範囲が設定される様子を示す図である。   FIG. 28 is a diagram illustrating a state in which a search range is set around a pixel when the subject color is estimated for the pixel.

境界領域内のある画素Gについて探索範囲を設定するに当たり、探索範囲設定部742b_1は、まず、この画素Gを中心とした正方形状の所定の初期範囲T2から出発して徐々に探索範囲を拡張する。そして、探索範囲設定部742b_1は、被写体マスクM1’で定義される領域の画素が、所定数を超えて探索範囲に含まれるようになったところで拡張を止め、そのときの探索範囲T2’を、被写体色推定のための探索範囲として設定する。   In setting a search range for a certain pixel G in the boundary region, the search range setting unit 742b_1 first starts from a predetermined square initial range T2 centered on the pixel G and gradually expands the search range. . Then, the search range setting unit 742b_1 stops the expansion when the pixels in the region defined by the subject mask M1 ′ exceed the predetermined number and are included in the search range, and the search range T2 ′ at that time is Set as the search range for subject color estimation.

探索範囲が設定されると、図27に示す被写体領域確認部742b_2が、画素Gについて被写体色を推定するために用いる領域として、補正済みの順光撮影画像における次の領域を確認する。   When the search range is set, the subject region confirmation unit 742b_2 shown in FIG. 27 confirms the next region in the corrected continuous-light image as the region used for estimating the subject color for the pixel G.

図29は、ある画素について被写体色を推定するために用いられる領域の一例を示す図である。   FIG. 29 is a diagram illustrating an example of an area used for estimating a subject color for a certain pixel.

この図29に示すように、画素Gについて被写体色を推定するために用いられる領域として、補正済みの順光撮影画像において、被写体マスクで定義される領域であり、かつ探索範囲設定部742b_1によって設定された探索範囲T2’内となる領域B2が確認される。   As shown in FIG. 29, the region used for estimating the subject color for the pixel G is a region defined by the subject mask in the corrected follow light captured image, and is set by the search range setting unit 742b_1. A region B2 that is within the search range T2 ′ is confirmed.

このように、画素Gについて被写体色を推定するために用いられる領域B2が確認されると、まず、図27に示す画素色確認部742b_3が、その画素Gの色を確認し、次に、図27に示す被写体色探索部742b_4が、上記の領域B2内の複数の画素の色の中から、以下のような探索方法によって、その画素Gについての被写体色を探索する。   Thus, when the region B2 used for estimating the subject color for the pixel G is confirmed, first, the pixel color confirmation unit 742b_3 shown in FIG. 27 confirms the color of the pixel G, and then The subject color search unit 742b_4 shown in FIG. 27 searches for the subject color for the pixel G from the colors of the plurality of pixels in the region B2 by the following search method.

図30は、補正済みの順光撮影画像における境界領域内のある画素について被写体色を探索する際の探索方法を示す図である。   FIG. 30 is a diagram illustrating a search method when searching for a subject color for a certain pixel in a boundary region in a corrected continuous light captured image.

図30には、補正済みの順光撮影画像における境界領域内のある画素について、図23の背景色推定部742aで推定された背景色C1と、図27の画素色確認部742b_3で確認されたその画素の色C2とを、RGB色空間上で結ぶ直線CL1が示されている。   In FIG. 30, a certain pixel in the boundary region in the corrected continuous light image is confirmed by the background color C1 estimated by the background color estimation unit 742a of FIG. 23 and the pixel color confirmation unit 742b_3 of FIG. A straight line CL1 connecting the color C2 of the pixel in the RGB color space is shown.

上述したように、補正済みの順光撮影画像における境界領域内の画素の色は、撮影時に被写体の一部越しに背景が見えて、背景色と被写体色とが合成された合成色となっている可能性がある。仮に、今、被写体色を探索しようとしている画素の色がこのような合成色となっている場合には、合成色である画素の色C2と、その色C2の元となった背景色C1と被写体色とはRGB色空間上の直線上に並ぶ。   As described above, the color of the pixel in the boundary area in the corrected continuous-light image is a composite color in which the background is seen through a part of the subject at the time of shooting and the background color and the subject color are combined. There is a possibility. If the color of the pixel for which the subject color is to be searched for is a composite color, the color C2 of the pixel that is the composite color and the background color C1 that is the origin of the color C2 The subject color is arranged on a straight line in the RGB color space.

そこで、図27に示す被写体色探索部742b_4は、まず、上記の領域B2内の複数の画素の色の中から、上記の直線CL1の延長線上に並ぶ色C3を探索する。   Therefore, first, the subject color search unit 742b_4 shown in FIG. 27 searches for the color C3 arranged on the extended line of the straight line CL1 from the colors of the plurality of pixels in the region B2.

このような色C3が複数存在する場合には、この直線CL1の延長線上で、画素の色C2に最も近い色が、背景色C1とともにその画素の色C2の元となった可能性が最も高い。そこで、被写体色探索部742b_4は、上記の直線CL1の延長線上に並ぶ色C3が複数存在する場合には、これらの色C3の中から、画素の色C2に最も近い色を、この画素についての被写体色C4として採用する。   When there are a plurality of such colors C3, it is most likely that the color closest to the color C2 of the pixel on the extension line of the straight line CL1 is the origin of the color C2 of the pixel together with the background color C1. . Therefore, when there are a plurality of colors C3 arranged on the extension line of the straight line CL1, the subject color search unit 742b_4 selects a color closest to the pixel color C2 from these colors C3. Adopted as subject color C4.

以上に説明した被写体色推定部742bは、上記の探索範囲の設定から被写体色の探索に至るまでの処理を、補正済みの順光撮影画像における境界領域内の全ての画素について実行する。   The subject color estimation unit 742b described above executes the above-described processing from the setting of the search range to the search for the subject color for all pixels in the boundary region in the corrected continuous light captured image.

以上で、図23に示す被写体色推定部742bについての説明を終了し、次に、この図23に示す合成比推定部742cについて説明する。尚、この合成比推定部742cについての説明では上記の図30を参照する。   This is the end of the description of the subject color estimation unit 742b shown in FIG. 23. Next, the synthesis ratio estimation unit 742c shown in FIG. 23 will be described. Note that FIG. 30 is referred to in the description of the synthesis ratio estimation unit 742c.

この合成比推定部742cは、図30に示すように、背景色推定部742aで推定された背景色C1と、被写体色推定部742bで推定された被写体色C4とを、RGB色空間上で結ぶ線分の長さに対する、背景色C1と、その画素の色C2とを結ぶ線分の長さの割合を、背景色C1と被写体色C4とで画素の色C2を合成するときの合成比αとして算出する。また、この合成比推定部742cは、このような合成比αの算出を、補正済みの順光撮影画像における境界領域内の全ての画素について実行する。   As shown in FIG. 30, the composition ratio estimation unit 742c connects the background color C1 estimated by the background color estimation unit 742a and the subject color C4 estimated by the subject color estimation unit 742b in the RGB color space. The ratio of the length of the line segment connecting the background color C1 and the color C2 of the pixel to the length of the line segment is the composition ratio α when the color C2 of the pixel is synthesized with the background color C1 and the subject color C4. Calculate as In addition, the synthesis ratio estimation unit 742c executes such calculation of the synthesis ratio α for all the pixels in the boundary region in the corrected follow light captured image.

ここで、補正済みの順光撮影画像における境界領域内には、図22等からもわかるように、被写体の一部越しに背景が見えている部分以外にも、被写体のみで占められた部分や、背景のみで占められた部分も含まれる。被写体のみで占められた部分の画素の色は被写体そのものの色であり、背景が別の背景に置換されたとしても、その画素の色は維持される必要がある。また、背景のみで占められた部分の画素の色は背景そのものの色であり、背景が別の背景に置換されたときには、その画素の色は、その別の背景色に完全に置換される必要がある。   Here, as can be seen from FIG. 22 and the like, in the boundary region in the corrected continuous light image, a portion occupied only by the subject, in addition to a portion where the background is visible over a part of the subject, Also included is the part occupied only by the background. The color of the pixel in the portion occupied only by the subject is the color of the subject itself, and even if the background is replaced with another background, the color of the pixel needs to be maintained. Also, the color of the pixel that is occupied only by the background is the color of the background itself, and when the background is replaced with another background, the color of that pixel must be completely replaced with the other background color. There is.

この合成比推定部742cは、合成比の推定対象の画素が、被写体のみで占められた部分の画素であった場合には、その画素の色が被写体と同じ色となるので、合成比αを「1」と推定する。一方、背景色や被写体色や合成比の推定対象の画素が、背景のみで占められた部分の画素であった場合には、その画素の色が背景色と同じ色となるので、合成比αを「0」と推定する。   When the pixel for which the composition ratio is to be estimated is a part of the pixel occupied only by the subject, the composition ratio estimation unit 742c sets the composition ratio α to the same color as the subject. Estimated as “1”. On the other hand, if the pixel for which the background color, the subject color, or the composition ratio is to be estimated is a pixel of a portion occupied only by the background, the color of the pixel is the same color as the background color, so the composition ratio α Is estimated to be “0”.

このように補正済みの順光撮影画像における境界領域内の全画素について合成比が推定されると、本実施形態では、この合成比推定部742cは、まず、この順光撮影画像において上記の被写体マスクM1’で定義される領域内の全画素に「1」の合成比αを割り当て、さらに、この順光撮影画像において上記の背景マスクM2’で定義される領域内の全画素に「0」の合成比αを割り当てる。そして、これら2つの領域内の全画素についての合成比αと、境界領域内の全画素についての合成比αとを合わせて、補正済みの順光撮影画像全画素についての合成比αからなる合成比群が作成される。この合成比群は、以下に説明する背景置換画像作成部743での処理に用いられる。   When the composite ratio is estimated for all the pixels in the boundary region in the corrected continuous light photographed image in this way, in the present embodiment, the composite ratio estimation unit 742c first selects the subject in the followlight captured image. A composite ratio α of “1” is assigned to all the pixels in the area defined by the mask M1 ′, and “0” is assigned to all the pixels in the area defined by the background mask M2 ′ in the follow light image. Is assigned a composite ratio α. Then, the composition ratio α for all the pixels in these two regions and the composition ratio α for all the pixels in the boundary region are combined to form a composition composed of the composition ratio α for all the pixels in the corrected follow light image. A ratio group is created. This combination ratio group is used for processing in the background replacement image creation unit 743 described below.

以上で、図15の置換処理部740が備える色推定部742の詳細についての説明を終了し、次に、この置換処理部740が備える背景置換画像作成部743の詳細について説明する。   Above, the description about the detail of the color estimation part 742 with which the replacement process part 740 of FIG. 15 is provided is complete | finished, Next, the detail of the background replacement image preparation part 743 with which this replacement process part 740 is provided is demonstrated.

この背景置換画像作成部743は、補正済みの順光撮影画像を構成する全画素について、上記の合成比群に基づく次のような合成処理を行なう。   The background replacement image creation unit 743 performs the following combining process based on the above-described combination ratio group for all the pixels constituting the corrected follow-light photographed image.

まず、これらの全画素のうち、合成比群において「1」の合成比αが割り当てられている画素については、その画素の色がそのまま維持される。これにより、上記の被写体マスクM1’で定義される領域、および、境界領域内で被写体のみで占められた部分の画像がそのまま残される。また、上記の全画素のうち、合成比群において「0」の合成比αが割り当てられている画素については、その画素の色が、置換用の背景を表わす画像において対応する位置の画素の色に完全に置換される。これにより、上記の背景マスクM2’で定義される領域、および、境界領域内で背景のみで占められた部分の画像が置換用の背景を表わす画像に置換される。   First, among all of these pixels, for the pixel to which the synthesis ratio α of “1” is assigned in the synthesis ratio group, the color of the pixel is maintained as it is. As a result, the image defined by the subject mask M1 'and the image of the portion occupied only by the subject within the boundary region are left as they are. In addition, among all the above-described pixels, for a pixel to which a composite ratio α of “0” is assigned in the composite ratio group, the color of the pixel is the color of the pixel at the corresponding position in the image representing the replacement background. Is completely replaced. As a result, the area defined by the background mask M2 'and the image of the portion occupied only by the background in the boundary area are replaced with the image representing the replacement background.

次に、上記の全画素のうち、合成比群において「0」と「1」以外の合成比αが割り当てられている画素、即ち、上記の境界領域内で「0」と「1」以外の合成比αが推定された画素については、上記の色推定部742で推定された被写体色と、置換用の背景を表わす画像において対応する位置の画素の色とが、色推定部742で推定された合成比で合成されて合成色が求められる。   Next, out of all the pixels described above, a pixel to which a synthesis ratio α other than “0” and “1” is assigned in the synthesis ratio group, that is, other than “0” and “1” in the boundary region. For the pixels for which the composition ratio α is estimated, the color estimation unit 742 estimates the subject color estimated by the color estimation unit 742 and the color of the pixel at the corresponding position in the image representing the replacement background. A synthesized color is obtained by synthesizing at a synthesis ratio.

図31は、補正済みの順光撮影画像における境界領域内のある画素について合成色が求められる様子を示す図である。   FIG. 31 is a diagram illustrating a state in which a composite color is obtained for a certain pixel in a boundary region in a corrected continuous light captured image.

この図31には、RGB色空間上で、推定された背景色C1と、その画素の色C2と、推定された被写体色C4とを結ぶ、図30にも示した直線CL1が示されている。ここで、画素の色C2は、背景色C1と被写体色C4とを結ぶ直線を、合成比α:(1−合成比α)で分割する点であるといえる。そこで、背景置換画像作成部743は、この図31に示すように、別の背景色C5と、推定された被写体色C4とを結ぶ直線CL2を、合成比α:(1−合成比α)で分割する点を合成色C6として採用する。   FIG. 31 shows a straight line CL1 shown in FIG. 30 that connects the estimated background color C1, the color C2 of the pixel, and the estimated subject color C4 in the RGB color space. . Here, it can be said that the pixel color C2 is a point that divides a straight line connecting the background color C1 and the subject color C4 at a composition ratio α: (1−composition ratio α). Therefore, as shown in FIG. 31, the background replacement image creating unit 743 generates a straight line CL2 connecting another background color C5 and the estimated subject color C4 at a composition ratio α: (1−composition ratio α). A point to be divided is adopted as the composite color C6.

この図31を参照して説明した方法で、上記の全画素のうち、合成比群において「0」と「1」以外の合成比αが割り当てられている全ての画素について合成色が求められると、背景置換画像作成部743は、これらの画素の色を、各画素について求められた合成色に置換することにより、補正済みの順光撮影画像の背景が、顧客が所望する別の背景に置換された背景置換画像を完成させる。   With the method described with reference to FIG. 31, among all the pixels described above, the composite color is obtained for all the pixels to which the composite ratio α other than “0” and “1” is assigned in the composite ratio group. The background replacement image creation unit 743 replaces the color of these pixels with the composite color obtained for each pixel, so that the background of the corrected follow-light photographed image is replaced with another background desired by the customer. The completed background replacement image is completed.

図32は、背景置換画像の一例を示す図である。   FIG. 32 is a diagram illustrating an example of the background replacement image.

この図32には、図11に示す補正済みの順光撮影画像の背景を別の背景に置換して作成された背景置換画像における、図11中のエリアA1と同じ部分が拡大された拡大図が示されている。   FIG. 32 is an enlarged view in which the same portion as the area A1 in FIG. 11 is enlarged in the background replacement image created by replacing the background of the corrected follow light image shown in FIG. 11 with another background. It is shown.

背景置換画像作成部743で作成される背景置換画像は、境界領域内の画素の色が上記の合成色に置換された画像であり、この背景置換画像から、観賞者は、この図32に示すような、被写体P’の頭髪越しに、置換された別の背景TBが透けている状態を認識することとなる。   The background replacement image created by the background replacement image creation unit 743 is an image in which the color of the pixel in the boundary region is replaced with the above composite color. From this background replacement image, the viewer shows this in FIG. Thus, a state in which another replaced background TB is seen through the hair of the subject P ′ is recognized.

以上に説明した背景置換処理は、補正済みの順光撮影画像を構成する全ての画素について合成比を精密に決定するという上記の第3の決定方法を用いた背景置換処理である。本実施形態では、この第3の決定方法を用いた背景置換処理で作成される画質の高い背景置換画像が、顧客に提供される上記の出力用置換画像として採用されている。   The background replacement process described above is a background replacement process using the above third determination method in which the composition ratio is accurately determined for all the pixels constituting the corrected follow light captured image. In the present embodiment, a high-quality background replacement image created by the background replacement process using the third determination method is adopted as the output replacement image provided to the customer.

次に、この第3の決定方法が簡略化されて処理時間の短縮が図られた第1の決定方法および第2の決定方法を用いた背景置換処理ついて説明する。   Next, background replacement processing using the first determination method and the second determination method in which the third determination method is simplified and the processing time is shortened will be described.

まず、第1の決定方法を用いた背景置換処理ついて説明する。   First, the background replacement process using the first determination method will be described.

この背景置換処理では、まず、上記の補正済みの順光撮影画像が所定の表示用サイズまで縮小されて縮小画像が作成され、その縮小画像に対して次のような処理が施される。始めに、上記の被写体マスクM1’と背景マスクM2’とを作成し、前者のマスクで定義される領域内の全画素に「1」の合成比を割り当て、後者のマスクで定義される領域内の全画素に「0」の合成比を割り当てるところまでは、第3の決定方法を用いた背景置換処理と同様に行なわれる。その後、この第1の決定方法を用いた背景置換処理では、境界領域内の画素についての上記の被写体色や合成比の推定処理が省略され、この領域内の全画素に「0.5」という値の合成比が一律に割り当てられる。   In this background replacement process, first, the corrected follow light captured image is reduced to a predetermined display size to create a reduced image, and the reduced image is subjected to the following processing. First, the subject mask M1 ′ and the background mask M2 ′ are created, and a composite ratio of “1” is assigned to all the pixels in the area defined by the former mask, and within the area defined by the latter mask. The process up to assigning a composite ratio of “0” to all the pixels is performed in the same manner as the background replacement process using the third determination method. Thereafter, in the background replacement process using the first determination method, the estimation process of the subject color and the synthesis ratio for the pixels in the boundary area is omitted, and “0.5” is applied to all the pixels in the area. The composition ratio of values is assigned uniformly.

上記の第3の決定方法を用いた背景置換処理では、被写体色や合成比の推定処理に要する時間が、背景置換処理全体の処理時間の大部分を占める。そして、この第3の決定方法を用いた背景置換処理では、この推定処理を精密に行なうために背景置換処理全体の処理時間が長いものとなっている。第1の決定方法を用いた背景置換処理は、まず、補正済みの順光撮影画像を縮小することで、取り扱う画像データのデータ量を削減し、さらに、上記の推定処理を省略することにより処理時間が大幅に短縮された処理である。反面、上記の境界領域内の画素の色が、「0.5」という値の合成比に基づく合成色に一律に置換されるので、背景置換画像は、見る者に多少の違和感を与える画質の低い画像となる。本実施形態では、図2を参照して説明したように、撮影後、直ぐに顧客に提示され、画質よりも即時性が要求される表示用置換画像を作成するための処理として、この第1の決定方法を用いた背景置換処理が採用されている。   In the background replacement process using the third determination method, the time required for the subject color and synthesis ratio estimation process occupies most of the processing time of the entire background replacement process. In the background replacement process using the third determination method, the processing time of the entire background replacement process is long in order to accurately perform the estimation process. The background replacement process using the first determination method is performed by reducing the amount of image data to be handled by reducing the corrected follow-light photographed image, and further omitting the above estimation process. This is a time-saving process. On the other hand, the color of the pixels in the boundary area is uniformly replaced with a composite color based on a composite ratio of “0.5”, so that the background replacement image has an image quality that gives the viewer some discomfort. Lower image. In the present embodiment, as described with reference to FIG. 2, this first processing is performed as a process for creating a display replacement image that is presented to the customer immediately after shooting and requires immediacy rather than image quality. Background replacement processing using a determination method is employed.

次に、第2の決定方法を用いた背景置換処理ついて説明する。   Next, background replacement processing using the second determination method will be described.

この背景置換処理では、上記の第1の決定方法を用いた背景置換処理と同様に、まず、上記の補正済みの順光撮影画像が、所定の表示用サイズまで縮小される。そして、この第2の決定方法を用いた背景置換処理では、縮小画像に対して、上記の第3の決定方法を用いた背景置換処理と同じ処理が施される。つまり、この第2の決定方法を用いた背景置換処理は、取り扱う画像データのデータ量を削減することで、上記の第3の決定方法を用いた背景置換処理よりも処理時間が短縮された処理である。また、この処理で作成される背景置換画像の画質は、表示用サイズで見る分には特に違和感のない画質となる。そこで、本実施形態では、背景置換画像を最終的にプリンタ30等で出力する前に、顧客に画像の出来具合を表示画面220a(図1参照)上で確認してもらうための上記の確認用置換画像を作成するための処理として、この第2の決定方法を用いた背景置換処理が採用されている。   In this background replacement process, as in the background replacement process using the first determination method, first, the corrected follow-light photographed image is reduced to a predetermined display size. In the background replacement process using the second determination method, the same process as the background replacement process using the third determination method is performed on the reduced image. In other words, the background replacement process using the second determination method is a process in which the processing time is shortened compared to the background replacement process using the third determination method by reducing the amount of image data to be handled. It is. Further, the image quality of the background replacement image created by this processing is not particularly uncomfortable when viewed in the display size. Therefore, in the present embodiment, before the background replacement image is finally output by the printer 30 or the like, the above confirmation for allowing the customer to confirm the image quality on the display screen 220a (see FIG. 1). As a process for creating a replacement image, a background replacement process using the second determination method is employed.

以上に説明した3つの決定方法それぞれに従った背景置換処理が行なわれると、上述したように、図5に示す画像保存部750による保存処理が実行される。この保存処理では、まず、背景置換処理の処理対象となった補正済みの順光撮影画像に、その背景置換処理おける合成比の決定方法を示す決定情報と、その置換処理において決定された合成比とを付加して保存用データが作成され、その保存用データがハードディスク装置213に保存される。以下では、この画像保存部750で作成される保存用データについて説明する。   When the background replacement process according to each of the three determination methods described above is performed, the storage process by the image storage unit 750 shown in FIG. 5 is executed as described above. In this storage process, first, determination information indicating a method for determining a composition ratio in the background replacement process and a composition ratio determined in the replacement process are applied to the corrected follow-light photographed image that has been subjected to the background replacement process. Are added to create storage data, and the storage data is stored in the hard disk device 213. Hereinafter, the storage data created by the image storage unit 750 will be described.

図33は、図5に示す画像保存部で作成される保存用データを示す模式図である。   FIG. 33 is a schematic diagram showing storage data created by the image storage unit shown in FIG.

この図33に示す保存用データDは、ヘッダ部D1と、表示用/確認用合成比群格納部D2と、出力用合成比群格納部D3と、撮影画像格納部D4とからなる。   The storage data D shown in FIG. 33 includes a header part D1, a display / confirmation composite ratio group storage part D2, an output composite ratio group storage part D3, and a captured image storage part D4.

ヘッダ部D1には、まず、作成された背景置換画像の画像サイズを示すサイズ情報が記載される。即ち、表示用置換画像や確認用置換画像が作成された際には、表示用サイズを示すサイズ情報が記載され、出力用置換画像が作成された際には、出力用サイズを示すサイズ情報が記載される。ところで、上記では、この出力用サイズについては特に触れなかったが、本実施形態では、撮影画像のサイズがそのまま出力用サイズとして採用されている。また、このヘッダ部D1には、合成比の決定方法を示す決定情報として、表示用置換画像が作成された際には第1の決定方法を示す情報が記載され、確認用置換画像が作成された際には第2の決定方法を示す情報が記載され、出力用置換画像が作成された際には第3の決定方法を示す情報が記載される。   In the header part D1, first, size information indicating the image size of the created background replacement image is described. That is, when the display replacement image or the confirmation replacement image is created, the size information indicating the display size is described. When the output replacement image is created, the size information indicating the output size is displayed. be written. By the way, in the above, this output size is not particularly mentioned, but in the present embodiment, the size of the photographed image is directly adopted as the output size. In addition, in the header part D1, information indicating the first determination method when the display replacement image is generated is described as determination information indicating the determination method of the composite ratio, and the confirmation replacement image is generated. Information indicating the second determination method is described, and information indicating the third determination method is described when the output replacement image is created.

表示用/確認用合成比群格納部D2には、表示用置換画像あるいは確認用置換画像が作成された際に決定された、上記の合成比群が格納される。   The display / confirmation composite ratio group storage unit D2 stores the composite ratio group determined when the display replacement image or the confirmation replacement image is created.

また、出力用合成比群格納部D3には、出力用置換画像が作成された際に決定された、上記の合成比群が格納される。   Further, the above-described combination ratio group determined when the output replacement image is created is stored in the output combination ratio group storage unit D3.

撮影画像格納部D4には、背景置換画像の元となった補正済みの順光撮影画像が格納される。   The captured image storage unit D4 stores a corrected follow-light captured image that is a source of the background replacement image.

本実施形態では、図5に示したように、このような保存データがハードディスク装置213に保存される。そして、例えば、表示用置換画像の作成が、置換用の背景を変更しながら繰り返される場合には、初回の処理時に作成され保存された保存データが、2回目以降の処理時に利用される。   In the present embodiment, as shown in FIG. 5, such saved data is saved in the hard disk device 213. For example, when the creation of the replacement image for display is repeated while changing the background for replacement, the saved data created and saved during the first process is used during the second and subsequent processes.

また、背景置換に関する再注文があった場合には、まず、過去に保存された保存データにおける決定情報が確認され、決定情報が第3の決定方法を示す情報となっているか否かが判定される。そして、決定情報が第3の決定方法を示す情報となっている場合には、その保存データ中の出力用合成比群と順光撮影画像とが利用される。また、決定情報が第1あるいは第2の決定方法を示す情報となっている場合には、過去の処理が、表示用置換画像あるいは確認用置換画像の作成までで中断していたものと判断され、出力用合成比群の決定から処理が行なわれる。   When there is a reorder regarding background replacement, first, the decision information in the saved data saved in the past is confirmed, and it is determined whether or not the decision information is information indicating the third decision method. The When the determination information is information indicating the third determination method, the output combination ratio group and the follow light image in the stored data are used. When the determination information is information indicating the first or second determination method, it is determined that the past processing has been interrupted until the creation of the display replacement image or the confirmation replacement image. The processing is performed from the determination of the composite ratio group for output.

以上、図1〜図33を用いて説明した背景置換装置700によれば、背景置換画像の顧客への提示を素早く行ない、かつ、最終的には、画質の良好な背景置換画像を顧客に提供でき、運用性に優れている。   As described above, according to the background replacement device 700 described with reference to FIGS. 1 to 33, the background replacement image is quickly presented to the customer, and finally, the background replacement image with good image quality is provided to the customer. It is easy to operate.

尚、上記では、本発明にいう背景置換部の一例として、表示用置換画像を作成する第1の決定方法を用いた背景置換処理と、確認用置換画像を作成する第2の決定方法を用いた背景置換処理と、出力用置換画像を作成する第3の決定方法を用いた背景置換処理との3つの背景置換処理を実行する置換処理部740を挙げて説明したが、本発明はこれに限るものではない。本発明の背景置換部は、例えば、上記の第3の決定方法を用いた背景置換処理のような高画質の背景置換画像を作成する背景置換処理と、その背景置換処理よりも決定時間が短い合成比の決定方法を用いる背景置換処理との2つの背景置換処理と実行するものであっても良い。   In the above description, as an example of the background replacement unit according to the present invention, the background replacement process using the first determination method for creating a display replacement image and the second determination method for generating a confirmation replacement image are used. The replacement processing unit 740 that executes the three background replacement processes of the background replacement process and the background replacement process using the third determination method for creating the output replacement image has been described. It is not limited. The background replacement unit of the present invention, for example, generates a high-quality background replacement image such as the background replacement process using the third determination method described above, and the determination time is shorter than the background replacement process. Two background replacement processes, that is, a background replacement process using a method for determining a composition ratio, may be executed.

また、上記では、本発明にいう背景置換部の一例として、顧客への提示用の背景置換画像を、補正済みの順光撮影画像を縮小して作成する置換処理部740を挙げて説明したが、本発明はこれに限るものではない。本発明の背景置換部は、例えば、顧客への提示用の背景置換画像のうち、上記の表示用置換画像については、もとのままのサイズの順光撮影画像を使って作成するものであっても良い。   In the above description, as an example of the background replacement unit according to the present invention, the replacement processing unit 740 that creates a background replacement image for presentation to the customer by reducing the corrected follow light image is described. However, the present invention is not limited to this. The background replacement unit of the present invention, for example, creates the above-described display replacement image among the background replacement images for presentation to the customer using a direct-light image having the original size. May be.

本発明の背景置換装置の一実施形態が適用された撮影システムを示す図である。It is a figure which shows the imaging | photography system with which one Embodiment of the background replacement apparatus of this invention was applied. 図1の撮影システムで実行される、本発明の背景置換方法の一実施形態が適用された作業の流れを示すフローチャートである。It is a flowchart which shows the flow of the operation | work to which one Embodiment of the background replacement method of this invention performed with the imaging | photography system of FIG. 1 was applied. 図1に示すパーソナルコンピュータのハードウェア構成図である。It is a hardware block diagram of the personal computer shown in FIG. 本発明の背景置換プログラムの一実施形態が記憶された、本発明の背景置換プログラム記憶媒体の一実施形態を示す概念図である。It is a conceptual diagram which shows one Embodiment of the background replacement program storage medium of this invention in which one Embodiment of the background replacement program of this invention was memorize | stored. 図4に示す背景置換プログラムが図1および図3に示すパーソナルコンピュータにインストールされ、このパーソナルコンピュータが本発明にいう背景置換装置の一実施形態として動作するときの機能を表わす機能ブロック図である。FIG. 4 is a functional block diagram showing functions when the background replacement program shown in FIG. 4 is installed in the personal computer shown in FIGS. 1 and 3 and this personal computer operates as an embodiment of the background replacement device according to the present invention. 図5に1つのブロックで示す画像補正部の詳細を示す図である。It is a figure which shows the detail of the image correction part shown by one block in FIG. 台形歪みが生じた順光撮影画像の一例を示す模式図である。It is a schematic diagram which shows an example of the follow light imaging | photography image which the trapezoid distortion produced. 図7の順光撮影画像における台形歪みが補正された状態を示す模式図である。It is a schematic diagram which shows the state by which the trapezoid distortion in the follow light photography image of FIG. 7 was correct | amended. 図8に示す、台形歪みが補正された順光撮影画像に基づいて作成された有効画像を示す模式図である。It is a schematic diagram which shows the effective image produced based on the follow light imaging | photography image by which the trapezoid distortion was correct | amended shown in FIG. 図6の画像補正部によって画像補正処理が施された、補正済みの逆光撮影画像を示す模式図である。FIG. 7 is a schematic diagram illustrating a corrected backlight image that has been subjected to image correction processing by the image correction unit of FIG. 6. 補正済みの順光撮影画像の一例を示す図である。It is a figure which shows an example of the corrected follow light imaging | photography image. 補正済みの逆光撮影画像の一例を示す図である。It is a figure which shows an example of the backlit image after correction | amendment. 図11中のエリアA1の拡大図である。It is an enlarged view of area A1 in FIG. 図12中のエリアA2の拡大図である。It is an enlarged view of area A2 in FIG. 図5に1つのブロックで示す置換処理部の詳細を示す図である。It is a figure which shows the detail of the replacement process part shown by one block in FIG. 図15に1つのブロックで示すマスク作成部の詳細を示す図である。It is a figure which shows the detail of the mask preparation part shown by one block in FIG. 補正済みの逆光撮影画像を構成する各画素の明るさについてのヒストグラムの様々な例を示す図である。It is a figure which shows the various examples of the histogram about the brightness of each pixel which comprises the corrected backlight photo image. 図14に示す逆光撮影画像の拡大図において、初期被写体マスクに設定された領域と初期背景マスクに設定された領域を示す図である。FIG. 15 is a diagram illustrating an area set as an initial subject mask and an area set as an initial background mask in the enlarged view of the backlight image shown in FIG. 14. 図18に示す初期被写体マスクと初期背景マスクとを示す図である。FIG. 19 is a diagram showing an initial subject mask and an initial background mask shown in FIG. 18. 初期被写体マスクと初期背景マスクとを、図11に示す補正済みの順光撮影画像全体に重ねて示した図である。FIG. 12 is a diagram showing an initial subject mask and an initial background mask superimposed on the entire corrected follow-light photographed image shown in FIG. 11. 図19に示す初期被写体マスクと初期背景マスクとが、それぞれ境界領域から離れる方向に縮小される様子を示す図である。FIG. 20 is a diagram illustrating how the initial subject mask and the initial background mask illustrated in FIG. 19 are reduced in a direction away from the boundary region. 最終的に完成された被写体マスクと背景マスクとを、図11に示す補正済みの順光撮影画像全体に重ねて示した図である。FIG. 12 is a diagram showing the finally completed subject mask and background mask superimposed on the entire corrected follow-light photographed image shown in FIG. 11. 図15に1つのブロックで示す色推定部の詳細を示す図である。It is a figure which shows the detail of the color estimation part shown by one block in FIG. 図23に1つのブロックで示す背景色推定部の詳細を示す図である。It is a figure which shows the detail of the background color estimation part shown with one block in FIG. ある画素について背景色を推定する際に、その画素を中心に探索範囲が設定される様子を示す図である。It is a figure which shows a mode that a search range is set centering on the pixel when estimating a background color about a certain pixel. ある画素について背景色を推定するために用いられる領域の一例を示す図である。It is a figure which shows an example of the area | region used in order to estimate a background color about a certain pixel. 図23に1つのブロックで示す被写体色推定部の詳細を示す図である。It is a figure which shows the detail of the to-be-photographed color estimation part shown with one block in FIG. ある画素について被写体色を推定する際に、その画素を中心に探索範囲が設定される様子を示す図である。It is a figure which shows a mode that a search range is set centering on the pixel, when a subject color is estimated about a certain pixel. ある画素について被写体色を推定するために用いられる領域の一例を示す図である。It is a figure which shows an example of the area | region used in order to estimate a to-be-photographed object about a certain pixel. 補正済みの順光撮影画像における境界領域内のある画素について被写体色を探索する際の探索方法を示す図である。It is a figure which shows the search method at the time of searching a to-be-photographed object about a certain pixel in the boundary area | region in the corrected follow light image. 補正済みの順光撮影画像における境界領域内のある画素について合成色が求められる様子を示す図である。It is a figure which shows a mode that a synthetic | combination color is calculated | required about a certain pixel in the boundary area | region in the corrected follow light image. 背景置換画像の一例を示す図である。It is a figure which shows an example of a background replacement image. 図5に示す画像保存部で作成される保存用データを示す模式図である。It is a schematic diagram which shows the data for a preservation | save produced by the image preservation | save part shown in FIG.

符号の説明Explanation of symbols

1 撮影システム
10 撮影スタジオ
11 デジタルカメラ
12 閃光発光装置
130 ELパネル
131 筐体
131a 載置面
131b 背後の面
131c マーカ
132 分散型EL素子
14 電源
20 パーソナルコンピュータ
210 本体装置
211 CPU
212 主メモリ
213 ハードディスク装置
213a 背景置換画像保管フォルダ
213b 撮影画像保管フォルダ
213b_1,213b_2,213b_3 サブフォルダ
214 FDドライブ
215 CD−ROMドライブ
216 入力インタフェース
217 出力インタフェース
220 画像表示装置
220a 表示画面
220a_1 スクロールボタン
220a_2 置換開始指示ボタン
220a_3 承認ボタン
230 キーボード
240 マウス
250 メディアドライブ
260 バス
30 プリンタ
40 サーバ
510 CD−ROM
520 FD
530 小型記憶メディア
540 入力用記憶媒体
550 出力用記憶媒体
600 背景置換プログラム
610 画像取得部
620 画像補正部
630 決定方法選択部
640 置換処理部
650 画像保存部
660 画像データ転送部
670 画像表示部
700 背景置換装置
710 画像取得部
720 画像補正部
721 マーカ検出部
722 台形補正処理部
723 有効画像切出部
724 色補正部
730 決定方法選択部
740 置換処理部
741 マスク作成部
741a ヒストグラム作成部
741b 閾値計算部
741c 背景マスク設定部
741d 被写体マスク設定部
741e 背景マスク縮小部
741f 被写体マスク縮小部
742 色推定部
742a 背景色推定部
742a_1 探索範囲設定部
742a_2 背景領域確認部
742a_3 背景色計算部
742b 被写体色推定部
742b_1 探索範囲設定部
742b_2 被写体領域確認部
742b_3 画素色確認部
742b_4 被写体色探索部
742c 合成比推定部
743 背景置換画像作成部
750 画像保管部
760 画像データ転送部
770 画像表示部
DESCRIPTION OF SYMBOLS 1 Shooting system 10 Shooting studio 11 Digital camera 12 Flash light emitting device 130 EL panel 131 Case 131a Mounting surface 131b Back surface 131c Marker 132 Dispersion type EL element 14 Power supply 20 Personal computer 210 Main body device 211 CPU
212 Main memory 213 Hard disk device 213a Background replacement image storage folder 213b Captured image storage folder 213b_1, 213b_2, 213b_3 Subfolder 214 FD drive 215 CD-ROM drive 216 Input interface 217 Output interface 220 Image display device 220a Display screen 220a_1 Scroll button 220a_2 Start replacement Instruction button 220a_3 Approve button 230 Keyboard 240 Mouse 250 Media drive 260 Bus 30 Printer 40 Server 510 CD-ROM
520 FD
530 Small storage medium 540 Input storage medium 550 Output storage medium 600 Background replacement program 610 Image acquisition unit 620 Image correction unit 630 Determination method selection unit 640 Replacement processing unit 650 Image storage unit 660 Image data transfer unit 670 Image display unit 700 Background Replacement device 710 Image acquisition unit 720 Image correction unit 721 Marker detection unit 722 Trapezoid correction processing unit 723 Effective image cropping unit 724 Color correction unit 730 Determination method selection unit 740 Replacement processing unit 741 Mask generation unit 741a Histogram generation unit 741b Threshold calculation unit 741c Background mask setting unit 741d Subject mask setting unit 741e Background mask reduction unit 741f Subject mask reduction unit 742 Color estimation unit 742a Background color estimation unit 742a_1 Search range setting unit 742a_2 Background region confirmation unit 742a_ Background color calculation unit 742b Subject color estimation unit 742b_1 Search range setting unit 742b_2 Subject region confirmation unit 742b_3 Pixel color confirmation unit 742b_4 Subject color search unit 742c Composition ratio estimation unit 743 Background replacement image creation unit 750 Image storage unit 760 Image data transfer unit 770 Image display

Claims (8)

複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
前記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、前記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを備えたことを特徴とする背景置換装置。
An image acquisition unit for acquiring a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing A background replacement device comprising a background replacement unit that replaces the background of a captured image with another background using a ratio.
前記所定の撮影条件下で撮影された撮影画像に、前記決定方法選択部で選択された決定方法を示す決定情報と、その決定方法で決定された混合比とを付加して保存する画像保存部を備え、
前記背景置換部が、前記画像保存部によって保存された撮影画像についての再度の背景の置換処理も実行するものであり、その再度の背景の置換処理の際には、該撮影画像に付加されている決定情報が示す決定方法における混合比の決定時間以下の決定時間の決定方法が前記決定方法選択部で選択された場合には、該撮影画像に付加されている混合比を用いて背景の置換処理を実行し、該撮影画像に付加されている決定情報が示す決定方法における混合比の決定時間よりも長い決定時間の決定方法が前記決定方法選択部で選択された場合には、その選択された決定方法で混合比を決定し、決定した混合比を用いて背景の置換処理を実行するものであることを特徴とする請求項1記載の背景置換装置。
An image storage unit for adding the determination information indicating the determination method selected by the determination method selection unit and the mixture ratio determined by the determination method to the captured image captured under the predetermined imaging condition and storing With
The background replacement unit also executes a background replacement process for the captured image stored by the image storage unit, and is added to the captured image when the background replacement process is performed again. If a determination method of a determination time equal to or less than the determination time of the mixture ratio in the determination method indicated by the determination information is selected by the determination method selection unit, the background replacement is performed using the mixture ratio added to the photographed image. When the determination method selection unit selects a determination time that is longer than the determination time of the mixture ratio in the determination method indicated by the determination information added to the captured image, the selected method is selected. 2. The background replacement apparatus according to claim 1, wherein the mixing ratio is determined by the determination method and the background replacement processing is executed using the determined mixing ratio.
前記複数の決定方法のうちの1つの決定方法が、撮影画像中の色は真の被写体色と背景色が前記混合比で混合した混合色であるという前提で真の被写体色と混合比とを決定する決定方法であることをことを特徴とする請求項1記載の背景置換装置。   One of the plurality of determination methods is to determine the true subject color and the mixing ratio on the assumption that the color in the captured image is a mixed color obtained by mixing the true subject color and the background color at the mixing ratio. The background replacement device according to claim 1, wherein the background replacement device is a determination method for determination. 前記複数の決定方法のうちの1つの決定方法が、前記画像取得部で取得された撮影画像を縮小した縮小画像を用いて前記混合比を決定する決定方法であることを特徴とする請求項1記載の背景置換装置。   2. The determination method according to claim 1, wherein one of the plurality of determination methods is a determination method that determines the mixture ratio using a reduced image obtained by reducing a captured image acquired by the image acquisition unit. The background replacement device described. 前記画像取得部で取得された撮影画像に基づいて、撮影画像中の被写体領域と背景領域と境界領域とを区別する領域区別部を備え、
前記複数の決定方法のうちの1つの決定方法が、前記背景領域、前記被写体領域、および前記境界領域に対し、それぞれ、純粋な背景色を表わす混合比、純粋な被写体色を表わす混合比、および一定の混合比を割り当てるという混合比の決定方法であることを特徴とする請求項1記載の背景置換装置。
Based on the captured image acquired by the image acquisition unit, an area distinguishing unit that distinguishes a subject region, a background region, and a boundary region in the captured image,
One of the plurality of determination methods includes a mixing ratio representing a pure background color, a mixing ratio representing a pure subject color, and a mixing ratio representing a pure subject color with respect to the background region, the subject region, and the boundary region, respectively. 2. The background replacement device according to claim 1, wherein the mixing ratio is determined by assigning a constant mixing ratio.
コンピュータに組み込まれ、該コンピュータ上で、
複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
前記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、前記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを構築することを特徴とする背景置換プログラム。
Embedded in a computer, on the computer,
An image acquisition unit for acquiring a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing A background replacement program that constructs a background replacement unit that replaces the background of a captured image with another background using a ratio.
コンピュータに組み込まれ、該コンピュータ上で、
複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得部と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択部と、
前記画像取得部によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、前記決定方法選択部で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換部とを構築する背景置換プログラムが記憶されてなることを特徴とする背景置換プログラム記憶媒体。
Embedded in a computer, on the computer,
An image acquisition unit for acquiring a plurality of photographed images obtained by photographing a common subject under each of a plurality of photographing conditions;
A determination method selection unit that determines a mixing ratio between the subject color and the background color, and selects any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected by the determination method selection unit for a captured image captured under a predetermined capturing condition among a plurality of captured images acquired by the image acquisition unit, and the determined mixing A background replacement program storage medium storing a background replacement program for constructing a background replacement unit that replaces a background of a captured image with another background using a ratio.
複数の撮影条件それぞれの下で共通の被写体が撮影されて得られた複数の撮影画像を取得する画像取得過程と、
被写体色と背景色との混合比を決定する、互いに決定時間が異なる複数の決定方法のうちいずれか1つの決定方法を選択する決定方法選択過程と、
前記画像取得過程によって取得された複数の撮影画像のうち所定の撮影条件下で撮影された撮影画像に対して、前記決定方法選択過程で選択された決定方法で混合比を決定し、決定した混合比を用いて撮影画像の背景を別の背景に置換する背景置換過程とを備えたことを特徴とする背景置換方法。
An image acquisition process for acquiring a plurality of captured images obtained by shooting a common subject under each of a plurality of shooting conditions;
A determination method selection process for determining a mixing ratio between the subject color and the background color and selecting any one of a plurality of determination methods having different determination times;
A mixture ratio is determined by a determination method selected in the determination method selection process with respect to a captured image captured under a predetermined imaging condition among a plurality of captured images acquired in the image acquisition process, and the determined mixing A background replacement method comprising a background replacement step of replacing a background of a captured image with another background using a ratio.
JP2005091461A 2005-03-28 2005-03-28 Background replacement device, background replacement program, background replacement program storage medium, and background replacement method Expired - Fee Related JP4303696B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005091461A JP4303696B2 (en) 2005-03-28 2005-03-28 Background replacement device, background replacement program, background replacement program storage medium, and background replacement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005091461A JP4303696B2 (en) 2005-03-28 2005-03-28 Background replacement device, background replacement program, background replacement program storage medium, and background replacement method

Publications (2)

Publication Number Publication Date
JP2006279206A JP2006279206A (en) 2006-10-12
JP4303696B2 true JP4303696B2 (en) 2009-07-29

Family

ID=37213537

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005091461A Expired - Fee Related JP4303696B2 (en) 2005-03-28 2005-03-28 Background replacement device, background replacement program, background replacement program storage medium, and background replacement method

Country Status (1)

Country Link
JP (1) JP4303696B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7834894B2 (en) 2007-04-03 2010-11-16 Lifetouch Inc. Method and apparatus for background replacement in still photographs
JP6194692B2 (en) * 2013-08-22 2017-09-13 大日本印刷株式会社 Trimap generation device, Trimap generation method, and program

Also Published As

Publication number Publication date
JP2006279206A (en) 2006-10-12

Similar Documents

Publication Publication Date Title
JP4689662B2 (en) Shooting system
US7835571B2 (en) Background replacing apparatus, background replacing program, and background replacing method
JP4006347B2 (en) Image processing apparatus, image processing system, image processing method, storage medium, and program
US20040095478A1 (en) Image-capturing apparatus, image-processing apparatus, image-recording apparatus, image-processing method, program of the same and recording medium of the program
US7375848B2 (en) Output image adjustment method, apparatus and computer program product for graphics files
JP4642764B2 (en) Background replacement device, background replacement program, and background replacement method
KR20030022072A (en) Image processing apparatus for print process of photographed image
JP4303696B2 (en) Background replacement device, background replacement program, background replacement program storage medium, and background replacement method
JP5305937B2 (en) Image processing apparatus, image processing method, and program
JP4012079B2 (en) Image processing apparatus, image processing method, and program
US11042972B2 (en) Image processing apparatus, and non-transitory computer readable medium for reducing undesirable effect during image capturing
JP4638260B2 (en) Background replacement device, background replacement program, background replacement program storage medium, and background replacement method
JP2006277303A (en) Photographic system
JP5045808B2 (en) Output image adjustment for image files
JP2004112756A (en) Output image adjustment of image file
JP4292440B2 (en) Photo processing device
JP2006202091A (en) Image processing method, apparatus, and program, and image pickup device
JP2003348343A (en) Output image adjustment method for image file
JP2010251971A (en) Image processing apparatus, image storing method and program for executing image processing
JP2013232951A (en) Image processing apparatus, image processing method and program
JP2005148294A (en) Image processor, image processing method and image processing program
JP2008029013A (en) Image processing apparatus, image processing method, program and storage medium
JP2006345460A (en) Information processor, image evaluation method, image evaluation program and recording medium
JP2006344183A (en) Information processor, image display print method, image display print control program, and recording medium
JP2005051333A (en) Image output using image data subjected to image processing

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061215

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070706

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090120

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090424

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120501

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4303696

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130501

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140501

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees