JP3382536B2 - Image generation method, image generation device, and recording medium recording image generation program - Google Patents

Image generation method, image generation device, and recording medium recording image generation program

Info

Publication number
JP3382536B2
JP3382536B2 JP14635598A JP14635598A JP3382536B2 JP 3382536 B2 JP3382536 B2 JP 3382536B2 JP 14635598 A JP14635598 A JP 14635598A JP 14635598 A JP14635598 A JP 14635598A JP 3382536 B2 JP3382536 B2 JP 3382536B2
Authority
JP
Japan
Prior art keywords
buffer
image
value
defocus
plane
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
JP14635598A
Other languages
Japanese (ja)
Other versions
JPH11120377A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP14635598A priority Critical patent/JP3382536B2/en
Publication of JPH11120377A publication Critical patent/JPH11120377A/en
Application granted granted Critical
Publication of JP3382536B2 publication Critical patent/JP3382536B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は画像生成装置および
方法に関し、特に、自然な被写界深度をもった画像を高
速に生成できる、あるいは、被写界深度を制御できる画
像生成装置および方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image generating apparatus and method, and more particularly to an image generating apparatus and method capable of generating an image having a natural depth of field at high speed or controlling the depth of field. ..

【0002】[0002]

【従来の技術】従来、コンピュータグラフィクスにより
画像を生成する際に実写と同じような被写界深度を得る
ためには、大きく分けて (1)従来の方法で生成された絵(画面の全ての領域で
ピントが合っている)を生成した後デフォーカスフィル
タでぼかしを入れる方法(Potmesil,Michael etal."A L
ens and Aperture Camera Model for Synthetic Image
Genaration", Computer Graphics, vol.17, no.3, pp13
7-145, 1981.) (2)分散光線追跡法(Cook,R.L. et al."Distributed
Ray Tracing", Computer Graphics, vol18, no.3, pp1
37-145, 1984.)による方法 がある。
2. Description of the Related Art Conventionally, in order to obtain a depth of field similar to that in actual shooting when an image is generated by computer graphics, it is roughly divided into (1) a picture generated by a conventional method How to add blur with defocus filter after generating (focus in area) (Potmesil, Michael et al. "AL
ens and Aperture Camera Model for Synthetic Image
Genaration ", Computer Graphics, vol.17, no.3, pp13
7-145, 1981.) (2) Distributed ray tracing method (Cook, RL et al. "Distributed
Ray Tracing ", Computer Graphics, vol18, no.3, pp1
37-145, 1984.).

【0003】[0003]

【発明が解決しようとする課題】ところで、実写に見ら
れる自然な被写界深度が持つ最も重要な性格のひとつ
に、ピントを合わせた距離により手前に存在する大きく
ぼけた物体の像はぼけると同時にエッジから透けて見え
る、がある。上記(1)の方法では完全に陰面消去され
て生成された絵をぼかすため、そのような手前の物体を
いくら大きくぼかしてもその向こうの物体が透けて見え
ることは基本的にありえず、結果的に不自然な絵ができ
てしまうという問題があった。また上記(2)の方法で
はそのような問題は基本的に生じないのであるが、元々
時間のかかる光線追跡法を基本としながらさらに最低で
も数十本の分散された光線を追跡せねばならず、したが
って所望とする画像が生成されるまで非常に長い時間が
かかるという問題があった。また、一般に生成手段を問
わず複数の画像を生成後合成するためには、従来技術に
よれば合成される境界を明確にしておかなければなら
ず、手前に合成される物体にピントを合わせた状態で生
成しておきその物体の像のエッジを明確にしておかなく
てはならなかった。手前に合成された物体をデフォーカ
ス状態としたい場合には熟練された手作業によって合成
しなくてはならず、したがって動画における作業量は非
常に大きかった。それを避けるためには一般的には予め
実写の撮影時に全て手前から奥までピントが合うように
(以下パンフォーカスと書く)撮影せねばならず、それ
による撮影条件への制限が大きかった。
By the way, one of the most important characteristics of the natural depth of field found in live-action images is that the image of a large blurred object in front of the subject is blurred due to the distance at which the subject is focused. At the same time, it can be seen through the edge. In the method of (1) above, since the picture generated by completely removing the hidden surface is blurred, it is basically impossible that the object beyond it can be seen through, no matter how much the object in front is blurred. There was a problem that it made an unnatural picture. Although the method of (2) above basically does not cause such a problem, it is necessary to trace at least tens of dispersed rays based on the ray tracing method which originally takes time. Therefore, there is a problem that it takes a very long time to generate a desired image. Further, in general, in order to combine a plurality of images after generation regardless of the generation means, it is necessary to clarify the boundary to be combined according to the conventional technique, and the object to be combined is focused in front. It had to be generated in the state and the edge of the image of the object had to be made clear. When it is desired to put the object synthesized in the foreground in the defocused state, it has to be synthesized by a skilled manual work, and therefore the amount of work in the moving image is very large. In order to avoid this, in general, when shooting a live-action image, it is necessary to shoot in advance so that everything is in focus from the front to the back (hereinafter referred to as "pan focus"), which greatly limits the shooting conditions.

【0004】本発明は、このような事情に鑑みてなされ
たもので、自然な被写界深度をもった画像を高速に生成
できる画像生成装置および方法を提供することを目的と
する。また、本発明は、実際のカメラを用いて撮影する
同じ指定の仕方(レンズの焦点距離、F値、ピントを合
わせる距離)で被写界深度を制御できる画像生成装置お
よび方法を提供することを目的とする。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an image generating apparatus and method capable of rapidly generating an image having a natural depth of field. Further, the present invention provides an image generating apparatus and method capable of controlling the depth of field in the same specified manner (focal length of lens, F value, distance for focusing) of shooting with an actual camera. To aim.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するため
に、本発明のうち請求項1に記載の発明は、ピントを合
わせたその前後に実用上ピントが合っている範囲である
被写界深度を利用して視点に対する前後関係を表現した
い複数のオブジェクトをそれぞれオブジェクトモデルデ
ータとし、一つのオブジェクトモデルデータの画素毎に
少なくとも座標変換、オブジェクト自身の陰面処理、デ
フォーカス処理を施したデフォーカスデータを複数入力
して画像を生成する画像生成装置であって、画素値とし
てR,G,B,A,Zの値を記憶でき複数プレーンから
なるマルチプレンバッファと、画素毎にR,G,B,
A,Zの値を有する複数のデフォーカスデータを、画素
毎に視点からの距離の近い順になるように並べ替えて前
記マルチプレーンバッファに格納するマルチプレーンバ
ッファ処理部と、全てのデフォーカスデータについて前
記マルチプレーンバッファ処理部による処理が終了した
後、前記マルチプレーンバッファの各プレーンの内容を
合成して目的とする画像を生成し、出力する出力イメー
ジ作成処理部とを備えたことを特徴とする。また、請求
項2に記載の発明は、ピントを合わせたその前後に実用
上ピントが合っている範囲である被写界深度を利用して
視点に対する前後関係を表現したい複数のオブジェクト
をそれぞれオブジェクトモデルデータとし、この複数の
オブジェクトモデルデータを入力して画像を生成する画
像生成装置であって、画素値としてR,G,B,A,Z
の値を記憶できるデフォーカスバッファと、画素値とし
てR,G,B,A,Zの値を記憶でき複数プレーンから
なるマルチプレンバッファと、一つのオブジェクトモデ
ルデータの画素毎に座標変換、オブジェクト自身の陰面
処理、シェーディング処理が行われ、画素値としてR,
G,B,Zの値を有するシェーディングデータから、実
際のカメラと同じレンズの焦点距離と絞り値および被写
体との距離からなる関数にしたがってピントを外したデ
フォーカス像を表現するための画素毎にR,G,B,
A,Zの値を有する複数のデフォーカスデータを生成
し、前記デフォーカスバッファに格納するデフォーカス
処理部と、前記デフォーカスバッファから前記デフォー
カスデータを読み出して、画素毎に視点からの距離の近
い順になるように並べ替えながら前記マルチプレーンバ
ッファに格納するマルチプレーンバッファ処理部と、全
てのデフォーカスデータについて前記マルチプレーンバ
ッファ処理部による処理が終了した後、前記マルチプレ
ーンバッファの各プレーンの内容を合成して目的とする
画像を生成し、出力する出力イメージ作成処理部とを備
えたことを特徴とする。また、請求項3に記載の発明
は、前記マルチプレーンバッファ処理部は、前記マルチ
プレーンバッファのプレーン数をnとした場合、デフォ
ーカスデータ上の画素位置(X,Y)におけるZ値Z
(X,Y)とnプレーン目のマルチプレーンバッフ
ァ上の対応する画素位置のZ値Z(X、Y)#n
を比較し、前者の方が小さければ前記マルチプレーンバ
ッファの各プレーンの対応する画像のZ値Z(X、
Y)#1からZ(X,Y)#nまで順にZ(X,
Y)と比較し、Z(X,Y)<Z(X,Y)#N
を満たすNプレーン目の対応する画像位置のZ値が見つ
かった時点でマルチプレーンバッファ上のNプレーン以
降の対応する画素の画素値を1つずつ後のプレーンの対
応する画素にシフトし、前記デフォーカスデータの画素
値を前記マルチプレーンバッファのNプレーン目の画素
値とすることで、前記複数のデフォーカスデータを、視
点からの距離の近い順に前記マルチプレーンバッファに
格納する処理を行うことを特徴とする。また、請求項4
に記載の発明は、前記マルチプレーンバッファは、初期
段階で必要最低限数のプレーンを備え、前記マルチプレ
ーンバッファ処理部は、前記複数のデフォーカスデータ
を視点からの距離の近い順に前記マルチプレーンバッフ
ァに格納する処理を行う際、前記マルチプレーンバッフ
ァのプレーンが足りなくなる毎に必要なプレーンを新た
に確保することを特徴とする。
In order to achieve the above object, the invention according to claim 1 of the present invention is an object field which is a range in which the focus is practically in front of and behind the focus. Defocus data that uses at least coordinate conversion for each pixel of one object model data, hidden surface processing of the object itself, defocus processing as object model data Is an image generation apparatus for generating a plurality of images by inputting a plurality of planes, and is capable of storing R, G, B, A, and Z values as pixel values, and a multi-plane buffer including a plurality of planes, and R, G, and B for each pixel. ,
A plurality of defocus data having the values of A and Z are set as pixels.
For each defocus data, the multi-plane buffer processing unit that rearranges the data so that the distance from the viewpoint is closer to the multi-plane buffer and stores the data in the multi-plane buffer. An output image creation processing unit for synthesizing the contents of the planes of the plane buffer to generate a target image and outputting the image is provided. Further, the invention according to claim 2 is an object model for each of a plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by using a depth of field which is a range in which the focus is practically in focus before and after the focus. An image generation device for generating an image by inputting a plurality of object model data as data, and R, G, B, A, Z as pixel values.
Defocus buffer that can store the values of R, G, B, A, and Z as pixel values, and a multiple buffer that consists of multiple planes, coordinate conversion for each pixel of one object model data, and the object itself. Hidden surface processing and shading processing are performed, and R,
From the shading data having the values of G, B, and Z, for each pixel for expressing a defocused image that is out of focus according to a function that is the same as the focal length of the actual camera, the aperture value, and the distance to the subject. R, G, B,
A defocus processing unit that generates a plurality of defocus data having values of A and Z and stores the defocus data in the defocus buffer, and reads the defocus data from the defocus buffer to determine the distance from the viewpoint for each pixel . The contents of each plane of the multi-plane buffer after the processing by the multi-plane buffer processing unit that stores in the multi-plane buffer while rearranging so as to be closer to each other and the processing by the multi-plane buffer processing unit for all defocus data And an output image creation processing unit that generates a target image by combining the two and outputs the combined image. Further, in the invention according to claim 3, the multi-plane buffer processing unit, when the number of planes of the multi-plane buffer is n, is a Z value Z at a pixel position (X, Y) on defocus data.
Z value Z m (X, Y) #n of the pixel position corresponding to d (X, Y) and the n-th plane multi-plane buffer
If the former is smaller, the Z value Z m (X, X, X) of the corresponding image of each plane of the multi-plane buffer is compared.
Y) # 1 to Z m (X, Y) #n in order of Z d (X,
Y) as compared to, Z d (X, Y) <Z m (X, Y) #N
When the Z value at the corresponding image position of the N-th plane that satisfies the above condition is found, the pixel values of the corresponding pixels on the N-plane and subsequent planes on the multi-plane buffer are shifted one by one to the corresponding pixels on the subsequent plane, By making the pixel value of the focus data the pixel value of the N-th plane of the multi-plane buffer, a process of storing the plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint is performed. And In addition, claim 4
In the invention described in paragraph 1, the multi-plane buffer is provided with a minimum number of planes in an initial stage, and the multi-plane buffer processing unit includes the plurality of defocus data in the order of decreasing distance from the viewpoint. When performing the processing of storing in the above, a required plane is newly secured every time the plane of the multi-plane buffer becomes insufficient.

【0006】また、請求項5に記載の発明は、前記関数
は、パラメータとしてAを含むことを特徴とする。ま
た、請求項6に記載の発明は、前記デフォーカス処理部
は、前記シェーディングデータをスキャンし、点光源を
ぼかしたときの該点光源像の直径Φを計算し、該直径の
円内における点光源像の強度比を求め、該直径の円内に
おける強度比の和が1.0になるように強度比係数Mを
求め、前記強度比係数Mを利用して前記直径Φの円内に
おけるR,G,Bの値,アルファ値Aの値を求めて前記
デフォーカスバッファに保存されている値に加え、前記
デフォーカスバッファ上の前記直径Φの円内画素位置
(a,b)におけるZ値と前記シェーディングデータの
同じ画素位置(X,Y)におけるZ値を比べ、該シェー
ディングデータのZ値の方が小さければ前記シェーディ
ングデータの画素位置(X,Y)におけるZ値を前記デ
フォーカスバッファ上の前記直径Φの円内画素位置
(a,b)におけるZ値に移すことによりデフォーカス
データの生成を行うことを特徴とする。また、請求項7
に記載の発明は、前記デフォーカス処理部は、前記直径
の円内における点光源像の強度比を、コサインを用いた
近似計算により求めることを特徴とする。また、請求項
8に記載の発明は、前記画像生成装置は、画素値として
R,G,B,Zの値を記憶できるZバッファと、前記オ
ブジェクトモデルデータに座標変換、陰面処理、シェー
ディング処理をし、結果を前記Zバッファに格納する座
標変換および陰面消去処理部とをさらに備え、前記デフ
ォーカス処理部は、前記Zバッファに格納されたデータ
を前記シェーディングデータとして処理することを特徴
とする。
Further, the invention according to claim 5 is characterized in that the function includes A as a parameter. Further, in the invention according to claim 6, the defocus processing unit scans the shading data, calculates a diameter Φ of the point light source image when the point light source is blurred, and calculates a point within a circle of the diameter. The intensity ratio of the light source image is obtained, the intensity ratio coefficient M is obtained so that the sum of the intensity ratios in the circle of the diameter becomes 1.0, and R in the circle of the diameter Φ is utilized by using the intensity ratio coefficient M. , G, B values and alpha value A values are added to the values stored in the defocus buffer, and Z values at pixel positions (a, b) within the circle of the diameter Φ on the defocus buffer are calculated. And the Z value at the same pixel position (X, Y) of the shading data are compared, and if the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is set to the defocus buffer. Circle pixel position of said diameter Φ of (a, b) defocus by transferring the Z value in
The feature is that data is generated. In addition, claim 7
In the invention described in (3), the defocus processing unit obtains the intensity ratio of the point light source image within the circle of the diameter by approximate calculation using cosine. Further, in the invention according to claim 8, the image generating apparatus is configured to perform a Z buffer capable of storing R, G, B, and Z values as pixel values, and coordinate conversion, hidden surface processing, and shading processing in the object model data. The defocus processing unit further includes a coordinate conversion and hidden surface removal processing unit that stores the result in the Z buffer, and the defocus processing unit processes the data stored in the Z buffer as the shading data.

【0007】また、請求項9に記載の発明は、前記画像
生成装置は、画素値としてR,G,B,A,Zの値を記
憶できるZバッファと、前記オブジェクトモデルデータ
に座標変換、陰面処理、シェーディング処理をし、結果
を前記Zバッファに格納する座標変換および陰面消去処
理部とをさらに備え、前記デフォーカス処理部は、前記
Zバッファに格納されたデータを前記シェーディングデ
ータとして処理することを特徴とする。 また、請求項1
0に記載の発明は、前記オブジェクトは、パンフォーカ
スにより生成され、Z値として無限遠が与えられた背景
画像を含むことを特徴とする。 また、請求項11に記載
の発明は、前記オブジェクトは、自然画像を利用して、
画像合成時に使用しない領域であるクロマキー領域を、
利用者から与えられる閾値をもって抽出し、該抽出され
たクロマキー領域に無限遠のZ値と色情報としてR,
G,B各々に0を与え、それ以外の領域についてはR,
G,B値はそのままで、利用者が与えるZ値を与えたフ
ォアグラウンド画像を含むことを特徴とする。 また、請
求項12に記載の発明は、前記画像生成装置は、画素値
としてR,G,B,Zの値を記憶できる背景画像用バッ
ファと、背景画像を、Z値として無限遠を与えることに
よりRGBZ変換処理し、前記背景画像がオブジェクト
と同じ撮影パラメータで生成されている場合、前記RG
BZ変換処理の結果を前記背景画像用バッファに書き込
み、前記背景画像がパンフォーカスにより生成されてい
る場合、前記RGBZ変換処理の結果を前記Zバッファ
に書き込みその後前記デフォーカス処理部によりデフォ
ーカス処理されたデータを前記背景画像用バッファに書
き込む処理部とをさらに備え、前記出力イメージ作成処
理部は、前記背景画像用バッファと前記マルチプレーン
バッファの値を読み込み、イメージを生成し、出力する
ことを特徴とする。
According to a ninth aspect of the present invention, the image
The generator records the values of R, G, B, A, and Z as pixel values.
Z buffer that can be stored and the object model data
Coordinate conversion, hidden surface processing, shading processing to
Transformation and hidden surface removal processing for storing
And a defocus processing unit,
The data stored in the Z buffer is converted into the shading data.
It is characterized by processing as a data. In addition, claim 1
In the invention described in 0, the object is a pan focus
The background generated by S and given infinity as Z value
It is characterized by including an image. Also, in claim 11.
The invention uses a natural image for the object,
Chroma key area that is not used at the time of image composition,
Extracted with a threshold value given by the user, and extracted
Z value at infinity in the chroma key area and R as color information,
0 is given to each of G and B, and R and
The G and B values remain the same, and the Z value given by the user is given.
It is characterized by including a foreground image. Also, the contract
In the invention according to claim 12, the image generating device is configured so that the pixel value is
The background image bag that can store the values of R, G, B, and Z as
To give infinity as the Z value of the background image
More RGBZ conversion processing, the background image is an object
If it is generated with the same shooting parameters as
Write the result of BZ conversion processing to the background image buffer
Only the background image is generated by pan focus.
If the result of the RGBZ conversion process is
After that, the defocus processing unit
Write the processed data to the background image buffer.
And an output image creation process.
The processing unit includes the background image buffer and the multi-plane.
Read buffer values, generate image, output
It is characterized by

【0008】また、請求項13に記載の発明は、前記画
像生成装置は、自然画像を利用して合成時に使用しない
領域であるクロマキー領域を、利用者から与えられる閾
値をもって抽出するクロマキー領域処理部と、抽出され
たクロマキー領域に無限遠のZ値と色情報としてR,
G,B各々に0を与え、それ以外の領域についてはR,
G,B値はそのままで、利用者が与えるZ値を与え、前
記Zバッファに書き送むRGBZ変換処理部とをさらに
備えたことを特徴とする。また、請求項14に記載の発
明は、前記画像生成装置は、自然画像を利用して合成時
に使用しない領域であるクロマキー領域を、利用者から
与えられる閾値をもって抽出し、該抽出した領域と接す
る他の領域との境界領域においてなだらかに変化するA
を算出するクロマキー領域処理部と、抽出されたクロマ
キー領域に無限遠のZ値と色情報としてR,G,B,A
各々に0を与え、それ以外の領域についてはR,G,B
はそのままで、前記算出されたA値と、利用者が指定
したZ値を与え、前記Zバッファに書き込むRGBAZ
変換処理部とをさらに備えたことを特徴とする。
According to a thirteenth aspect of the present invention, the image generating apparatus extracts a chroma key area which is an area which is not used at the time of composition using a natural image with a threshold value given by a user. And Z value at infinity and R as color information in the extracted chromakey area.
0 is given to each of G and B, and R and
It is characterized by further comprising an RGBZ conversion processing unit for giving the Z value given by the user while writing the G and B values as they are and writing them to the Z buffer. According to a fourteenth aspect of the present invention, the image generation apparatus extracts a chroma key area, which is an area that is not used at the time of composition, by using a natural image, with a threshold value given by the user, and contacts the extracted area. A that changes gently in the boundary area with other areas
And a chroma key region processing section for calculating the Z value at infinity and R, G, B, A as color information in the extracted chroma key region.
Give 0 to each, and R, G, B for other areas
Value as it gives the A value the calculated, the Z value designated by the user is written into the Z buffer RGBAZ
A conversion processing unit is further provided.

【0009】また、請求項15に記載の発明は、ピント
を合わせたその前後に実用上ピントが合っている範囲で
ある被写界深度を利用して視点に対する前後関係を表現
したい複数のオブジェクトをそれぞれオブジェクトモデ
ルデータとし、一つのオブジェクトモデルデータの画素
毎に少なくとも座標変換、オブジェクト自身の陰面処
理、デフォーカス処理を施したデフォーカスデータを複
数入力して画像を生成する画像生成方法であって、画素
毎にR,G,B,A,Zの値を有する複数のデフォーカ
スデータを、画素毎に視点からの距離の近い順になるよ
うに並べ替えて画素値としてR,G,B,A,Zの値を
記憶でき複数プレーンからなるマルチプレンバッファに
格納するマルチプレーンバッファ処理ステップと、全て
のデフォーカスデータについて前記マルチプレーンバッ
ファ処理ステップによる処理が終了した後、前記マルチ
プレーンバッファの各プレーンの内容を合成して目的と
する画像を生成し、出力する出力イメージ作成処理ステ
ップとを含むことを特徴とする。また、請求項16に記
載の発明は、ピントを合わせたその前後に実用上ピント
が合っている範囲である被写界深度を利用して視点に対
する前後関係を表現したい複数のオブジェクトをそれぞ
れオブジェクトモデルデータとし、この複数のオブジェ
クトモデルデータを入力して画像を生成する画像生成方
法であって、一つのオブジェクトモデルデータの画素毎
に座標変換、オブジェクト自身の陰面処理、シェーディ
ング処理が行われ、画素値としてR,G,B,Zの値を
有するシェーディングデータから、実際のカメラと同じ
レンズの焦点距離と絞り値および被写体との距離からな
る関数にしたがってピントを外したデフォーカス像を表
現するための画素毎にR,G,B,A,Zの値を有する
複数のデフォーカスデータを生成し、画素値としてR,
G,B,A,Zの値を記憶できるデフォーカスバッファ
に格納するデフォーカス処理ステップと、前記デフォー
カスバッファから前記デフォーカスデータを読み出し
て、画素毎に視点からの距離の近い順になるように並べ
替えながら、画素値としてR,G,B,A,Zの値を記
憶でき複数プレーンからなるマルチプレンバッファに格
納するマルチプレーンバッファ処理ステップと、全ての
デフォーカスデータについて前記マルチプレーンバッフ
ァ処理ステップによる処理が終了した後、前記マルチプ
レーンバッファの各プレーンの内容を合成して目的とす
る画像を生成し、出力する出力イメージ作成処理ステッ
プとを含むことを特徴とする。また、請求項17に記載
の発明は、前記マルチプレーンバッファ処理ステップ
は、前記マルチプレーンバッファのプレーン数をnとし
た場合、デフォーカスデータ上の画素位置(X,Y)に
おけるZ値Z(X,Y)とnプレーン目のマルチプレ
ーンバッファ上の対応する画素位置のZ値Z(X、
Y)#nを比較し、前者の方が小さければ前記マルチプ
レーンバッファの各プレーンの対応する画像のZ値Z
(X、Y)#1からZ(X,Y)#nまで順にZ
(X,Y)と比較し、Z(X,Y)<Z(X,
Y)#Nを満たすNプレーン目の対応する画像位置のZ
値が見つかった時点でマルチプレーンバッファ上のNプ
レーン以降の対応する画素の画素値を1つずつ後のプレ
ーンの対応する画素にシフトし、前記デフォーカスデー
タの画素値を前記マルチプレーンバッファのNプレーン
目の画素値とすることで、前記複数のデフォーカスデー
タを、視点からの距離の近い順に前記マルチプレーンバ
ッファに格納する処理を行うことを特徴とする。また、
請求項18に記載の発明は、前記マルチプレーンバッフ
ァは、初期段階で必要最低限数のプレーンを備え、前記
マルチプレーンバッファ処理ステップは、前記複数のデ
フォーカスデータを視点からの距離の近い順に前記マル
チプレーンバッファに格納する処理を行う際、前記マル
チプレーンバッファのプレーンが足りなくなる毎に必要
なプレーンを新たに確保することを特徴とする。
Further, in the invention described in claim 15, a plurality of objects for which an anteroposterior relationship with respect to a viewpoint is expressed by utilizing the depth of field which is a range in which the focus is practically in focus before and after the focus is achieved. An image generation method for generating an image by inputting at least coordinate conversion for each pixel of one object model data, a hidden surface processing of the object itself, and a plurality of defocus data subjected to defocus processing as object model data, A plurality of defocus data having R, G, B, A, and Z values for each pixel are rearranged in order of decreasing distance from the viewpoint for each pixel, and R, G, B, A, and The multi-plane buffer processing step of storing the value of Z in the multi-plane buffer consisting of multiple planes and all defocus data After the processing by the multi-plane buffer processing step is completed, the contents of each plane of the multi-plane buffer are combined to generate a target image, and an output image creation processing step is output. . The invention according to claim 16 is an object model for each of a plurality of objects for which a front-back relation with respect to a viewpoint is expressed by utilizing a depth of field which is a range in which the focus is practically in focus before and after the focus. This is an image generation method for generating an image by inputting a plurality of object model data as data, and coordinate conversion, hidden surface processing of the object itself, shading processing are performed for each pixel of one object model data, and pixel value For expressing defocused image defocused according to a function consisting of the same focal length of the camera, aperture value and distance to the subject from the shading data having R, G, B and Z values as A plurality of defocus data having R, G, B, A, and Z values for each pixel is generated and used as a pixel value. ,
A defocus processing step of storing the values of G, B, A, and Z in a defocus buffer, and reading the defocus data from the defocus buffer so that the distance from the viewpoint is closer to each pixel. A multi-plane buffer processing step in which the values of R, G, B, A, and Z can be stored as pixel values while rearranging and stored in a multi-plane buffer composed of a plurality of planes; and the multi-plane buffer processing step for all defocus data. After completion of the processing according to (1), the contents of the planes of the multi-plane buffer are combined to generate a target image, and an output image generation processing step of outputting the target image is output. Further, in the invention according to claim 17, in the multi-plane buffer processing step, when the number of planes in the multi-plane buffer is n, a Z value Z d (at a pixel position (X, Y) on defocus data is set. X, Y) and the Z value Z m (X,
Y) #n is compared, and if the former is smaller, Z value Z m of the corresponding image of each plane of the multi-plane buffer
Z from (X, Y) # 1 to Z m (X, Y) #n in order
compared to d (X, Y), Z d (X, Y) <Z m (X,
Y) Z of the corresponding image position of the N-th plane that satisfies #N
When the value is found, the pixel values of the corresponding pixels on the N plane and subsequent planes on the multi-plane buffer are shifted one by one to the corresponding pixels on the subsequent plane, and the pixel value of the defocus data is changed to N on the multi-plane buffer. By using the pixel value of the plane eye, a process of storing the plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint is performed. Also,
In the invention according to claim 18, the multi-plane buffer is provided with a minimum number of planes in an initial stage, and in the multi-plane buffer processing step, the plurality of defocus data are arranged in the order of decreasing distance from a viewpoint. When performing the process of storing in the multi-plane buffer, a required plane is newly secured every time the plane of the multi-plane buffer becomes insufficient.

【0010】また、請求項19に記載の発明は、前記関
数は、パラメータとしてAを含むことを特徴とする。ま
た、請求項20に記載の発明は、前記デフォーカス処理
ステップは、前記シェーディングデータをスキャンし、
点光源をぼかしたときの該点光源像の直径Φを計算し、
該直径の円内における点光源像の強度比を求め、該直径
の円内における強度比の和が1.0になるように強度比
係数Mを求め、 前記強度比係数Mを利用して前記直径
Φの円内におけるR,G,Bの値,アルファ値Aの値を
求めて前記デフォーカスバッファに保存されている値に
加え、前記デフォーカスバッファ上の前記直径Φの円内
画素位置(a,b)におけるZ値と前記シェーディング
データの同じ画素位置(X,Y)におけるZ値を比べ、
該シェーディングデータのZ値の方が小さければ前記シ
ェーディングデータの画素位置(X,Y)におけるZ値
を前記デフォーカスバッファ上の前記直径Φの円内画素
位置(a,b)におけるZ値に移すことによりデフォー
カスデータの生成を行うことを特徴とする。また、請求
項21に記載の発明は、前記デフォーカス処理ステップ
は、前記直径の円内における点光源像の強度比を、コサ
インを用いた近似計算により求めることを特徴とする。
また、請求項22に記載の発明は、前記画像生成方法
は、前記オブジェクトモデルデータに座標変換、陰面処
理、シェーディング処理をし、結果を画素値としてR,
G,B,Zの値を記憶できるZバッファに格納する座標
変換および陰面消去処理ステップとをさらに含み、前記
デフォーカス処理ステップは、前記Zバッファに格納さ
れたデータを前記シェーディングデータとして処理する
ことを特徴とする。
The invention according to claim 19 is characterized in that the function includes A as a parameter. In the invention according to claim 20, the defocus processing step scans the shading data,
Calculate the diameter Φ of the point light source image when blurring the point light source,
The intensity ratio of the point light source image in the circle of the diameter is calculated, the intensity ratio coefficient M is calculated so that the sum of the intensity ratios in the circle of the diameter becomes 1.0, and the intensity ratio coefficient M is used to The values of R, G, B and the alpha value A in the circle of the diameter Φ are calculated and added to the values stored in the defocus buffer, and the pixel position within the circle of the diameter Φ on the defocus buffer ( comparing the Z value at a, b) with the Z value at the same pixel position (X, Y) of the shading data,
If the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is moved to the Z value at the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer. Thus, the defocus data is generated. Further, the invention according to claim 21 is characterized in that, in the defocus processing step, an intensity ratio of a point light source image within a circle of the diameter is obtained by an approximate calculation using a cosine.
Further, in the invention according to claim 22, in the image generation method, coordinate conversion, hidden surface processing, and shading processing are performed on the object model data, and the result is set to R,
Further comprising a coordinate conversion and hidden surface removal processing step of storing the G, B, and Z values in a Z buffer, wherein the defocus processing step processes the data stored in the Z buffer as the shading data. Is characterized by.

【0011】また、請求項23に記載の発明は、前記画
像生成方法は、前記オブジェクトモデルデータに座標変
換、陰面処理、シェーディング処理をし、結果を画素値
としてR,G,B,A,Zの値を記憶できるZバッファ
に格納する座標変換および陰面消去処理ステップとをさ
らに含み、前記デフォーカス処理ステップは、前記Zバ
ッファに格納されたデータを前記シェーディングデータ
として処理することを特徴とする。 また、請求項24に
記載の発明は、前記オブジェクトは、パンフォーカスに
より生成され、Z値として無限遠が与えられた背景画像
を含むことを特徴とする。 また、請求項25に記載の発
明は、前記オブジェクトは、自然画像を利用して、画像
合成時に使用しない領域であるクロマキー領域を、利用
者から与えられる閾値をもって抽出し、該抽出されたク
ロマキー領域に無限遠のZ値と色情報としてR,G,B
各々に0を与え、それ以外の領域についてはR,G,B
値はそのままで、利用者が与えるZ値を与えたフォアグ
ラウンド画像を含むことを特徴とする。また、請求項2
6に記載の発明は、前記画像生成方法は、背景画像を、
Z値として無限遠を与えることによりRGBZ変換処理
するステップと、前記背景画像がオブジェクトと同じ撮
影パラメータで生成されている場合、前記RGBZ変換
処理の結果を画素値としてR,G,B,Zの値を記憶で
きる背景画像用バッファに書き込むステップと、前記背
景画像がパンフォーカスにより生成されている場合、前
記RGBZ変換処理の結果を前記Zバッファに書き込み
その後前記デフォーカス処理ステップによりデフォーカ
ス処理されたデータを前記背景画像用バッファに書き込
む処理ステップとをさらに含み、前記出力イメージ作成
処理ステップは、前記背景画像用バッファと前記マルチ
プレーンバッファの値を読み込み、イメージを生成し、
出力することを特徴とする。
According to a twenty-third aspect of the present invention, the image
The image generation method is based on the coordinate transformation of the object model data.
Conversion, hidden surface processing, shading processing, and the result is the pixel value
Z buffer that can store R, G, B, A and Z values as
The coordinate transformation and hidden surface removal processing steps to be stored in
In addition, the defocus processing step includes
Data stored in the buffer
It is characterized by processing as. In addition, in claim 24
According to the invention described above, the object is pan-focused.
A background image generated by Z and given infinity as the Z value
It is characterized by including. In addition, according to claim 25,
Ming said the object is a natural image,
Use the chroma key area that is not used during composition
Extracted with a threshold value given by
Z value at infinity in the Romakey area and R, G, B as color information
Give 0 to each, and R, G, B for other areas
The value is left as it is, and the foreground with the Z value given by the user is given.
It is characterized by including a round image. In addition, claim 2
In the invention described in 6, the background image is generated by the image generation method.
RGBZ conversion processing by giving infinity as Z value
And the background image is the same as the object.
If it is generated with shadow parameters, the RGBZ conversion
The values of R, G, B, and Z can be stored with the result of processing as a pixel value.
The background image buffer and the spine
If the scene image was generated by pan focus,
Write the result of RGBZ conversion processing to the Z buffer
After that, the defocus process is performed by the defocus processing step.
Write the processed data to the background image buffer
And an output image creation process.
The processing step includes the background image buffer and the multi-image buffer.
Read the values in the plane buffer, generate an image,
It is characterized by outputting.

【0012】また、請求項27に記載の発明は、前記画
像生成方法は、自然画像を利用して合成時に使用しない
領域であるクロマキー領域を、利用者から与えられる閾
値をもって抽出するクロマキー領域処理ステップと、抽
出されたクロマキー領域に無限遠のZ値と色情報として
R,G,B各々に0を与え、それ以外の領域については
R,G,B値はそのままで、利用者が与えるZ値を与
え、前記Zバッファに書き送むRGBZ変換処理ステッ
プとをさらに含むことを特徴とする。また、請求項28
に記載の発明は、前記画像生成方法は、自然画像を利用
して合成時に使用しない領域であるクロマキー領域を、
利用者から与えられる閾値をもって抽出し、該抽出した
領域と接する他の領域との境界領域においてなだらかに
変化するAを算出するクロマキー領域処理ステップと、
抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B,A各々に0を与え、それ以外の領域につ
いてはR,G,Bはそのままで、前記算出されたA値
と、利用者が指定したZ値を与え、前記Zバッファに書
き込むRGBAZ変換処理ステップとをさらに含むこと
を特徴とする。
According to the 27th aspect of the present invention, in the image generation method, a chromakey region processing step of extracting a chromakey region, which is a region that is not used at the time of synthesis, using a natural image, with a threshold value given by a user. And Z value at infinity in the extracted chroma key area and 0 for each of R, G, B as color information, and R, G, B values as they are for other areas, Z value given by the user. And an RGBZ conversion processing step of writing the data to the Z buffer and writing the data to the Z buffer. In addition, claim 28
The invention according to, in the image generation method, a chroma key area that is an area that is not used during composition using a natural image,
A chroma key region processing step of extracting with a threshold value given by the user, and calculating A that changes gently in a boundary region between the extracted region and another region in contact with the region;
The Z value at infinity is given to the extracted chroma key area and 0 is given to each of R, G, B, and A as color information, and the R, G, and B values remain unchanged for the other areas, and the calculated A value is used. And an RGBAZ conversion processing step of giving a Z value specified by the user and writing the Z value in the Z buffer.

【0013】また、請求項29に記載の発明は、ピント
を合わせたその前後に実用上ピントが合っている範囲で
ある被写界深度を利用して視点に対する前後関係を表現
したい複数のオブジェクトをそれぞれオブジェクトモデ
ルデータとし、一つのオブジェクトモデルデータの画素
毎に少なくとも座標変換、オブジェクト自身の陰面処
理、デフォーカス処理を施したデフォーカスデータを複
数入力して画像を生成する画像生成プログラムを記録し
たコンピュータ読み取り可能な記録媒体であって、画素
毎にR,G,B,A,Zの値を有する複数のデフォーカ
スデータを、画素毎に視点からの距離の近い順になるよ
うに並べ替えて画素値としてR,G,B,A,Zの値を
記憶でき複数プレーンからなるマルチプレンバッファに
格納するマルチプレーンバッファ処理ステップと、全て
のデフォーカスデータについて前記マルチプレーンバッ
ファ処理ステップによる処理が終了した後、前記マルチ
プレーンバッファの各プレーンの内容を合成して目的と
する画像を生成し、出力する出力イメージ作成処理ステ
ップとをコンピュータに実現させることを特徴とする。
また、請求項30に記載の発明は、ピントを合わせたそ
の前後に実用上ピントが合っている範囲である被写界深
度を利用して視点に対する前後関係を表現したい複数の
オブジェクトをそれぞれオブジェクトモデルデータと
し、この複数のオブジェクトモデルデータを入力して画
像を生成する画像生成プログラムを記録したコンピュー
タ読み取り可能な記録媒体であって、一つのオブジェク
トモデルデータの画素毎に座標変換、オブジェクト自身
の陰面処理、シェーディング処理が行われ、画素値とし
てR,G,B,Zの値を有するシェーディングデータか
ら、実際のカメラと同じレンズの焦点距離と絞り値およ
び被写体との距離からなる関数にしたがってピントを外
したデフォーカス像を表現するための画素毎にR,G,
B,A,Zの値を有する複数のデフォーカスデータを生
成し、画素値としてR,G,B,A,Zの値を記憶でき
るデフォーカスバッファに格納するデフォーカス処理ス
テップと、前記デフォーカスバッファから前記デフォー
カスデータを読み出して、画素毎に視点からの距離の近
い順になるように並べ替えながら、画素値としてR,
G,B,A,Zの値を記憶でき複数プレーンからなるマ
ルチプレンバッファに格納するマルチプレーンバッファ
処理ステップと、全てのデフォーカスデータについて前
記マルチプレーンバッファ処理ステップによる処理が終
了した後、前記マルチプレーンバッファの各プレーンの
内容を合成して目的とする画像を生成し、出力する出力
イメージ作成処理ステップとをコンピュータに実現させ
ることを特徴とする。また、請求項31に記載の発明
は、前記マルチプレーンバッファ処理ステップは、前記
マルチプレーンバッファのプレーン数をnとした場合、
デフォーカスデータ上の画素位置(X,Y)におけるZ
値Z(X,Y)とnプレーン目のマルチプレーンバッ
ファ上の対応する画素位置のZ値Z(X、Y)#n
を比較し、前者の方が小さければ前記マルチプレーンバ
ッファの各プレーンの対応する画像のZ値Z(X、
Y)#1からZ(X,Y)#nまで順にZ(X,
Y)と比較し、Z(X,Y)<Z(X,Y)#N
満たすNプレーン目の対応する画像位置のZ値が見つか
った時点でマルチプレーンバッファ上のNプレーン以降
の対応する画素の画素値を1つずつ後のプレーンの対応
する画素にシフトし、前記デフォーカスデータの画素値
を前記マルチプレーンバッファのNプレーン目の画素値
とすることで、前記複数のデフォーカスデータを、視点
からの距離の近い順に前記マルチプレーンバッファに格
納する処理を行うことを特徴とする。また、請求項32
に記載の発明は、前記マルチプレーンバッファは、初期
段階で必要最低限数のプレーンを備え、前記マルチプレ
ーンバッファ処理ステップは、前記複数のデフォーカス
データを視点からの距離の近い順に前記マルチプレーン
バッファに格納する処理を行う際、前記マルチプレーン
バッファのプレーンが足りなくなる毎に必要なプレーン
を新たに確保することを特徴とする。
Further, the invention according to claim 29 is characterized in that a plurality of objects for which an anteroposterior relationship with respect to a viewpoint is expressed by utilizing a depth of field which is a range in which the focus is practically in focus before and after the focus. A computer in which an image generation program for generating an image by inputting a plurality of defocus data that has been subjected to at least coordinate conversion, hidden surface processing of the object itself, and defocus processing for each pixel of object model data This is a readable recording medium, and a plurality of defocus data having R, G, B, A, and Z values for each pixel are rearranged in order of decreasing distance from the viewpoint for each pixel, and pixel values are arranged. R, G, B, A, and Z values can be stored as a multiplex buffer that is stored in a multiple plane buffer composed of multiple planes. Buffer processing step and after the processing by the multi-plane buffer processing step for all defocus data is completed, the contents of each plane of the multi-plane buffer are combined to generate a target image and output And processing steps are realized by a computer.
Further, the invention according to claim 30 is an object model for each of a plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by utilizing a depth of field which is a range in which the focus is practically in focus before and after the focus. A computer-readable recording medium in which an image generation program for inputting a plurality of object model data and generating an image is recorded as data, coordinate conversion for each pixel of one object model data, and hidden surface processing of the object itself. , Shading processing is performed, and out of focus from shading data having R, G, B, and Z values as pixel values according to a function consisting of the same focal length and aperture value of the camera and the distance to the object. R, G, for each pixel for expressing the defocused image
A defocus processing step of generating a plurality of defocus data having values of B, A and Z and storing the defocus data in a defocus buffer capable of storing the values of R, G, B, A and Z as pixel values; The defocus data is read from the buffer and rearranged so that the distance from the viewpoint is closer to each pixel, and the pixel values R,
The multi-plane buffer processing step of storing the values of G, B, A, and Z in a multi-plane buffer composed of a plurality of planes, and the multi-plane buffer processing step for all defocus data, It is characterized in that the contents of each plane of the plane buffer are combined to generate a target image, and an output image generation processing step of outputting the image is realized by a computer. Further, in the invention according to claim 31, in the multi-plane buffer processing step, when the number of planes in the multi-plane buffer is n,
Z at pixel position (X, Y) on defocus data
The value Z d (X, Y) and the Z value Z m (X, Y) #n of the corresponding pixel position on the n-th multi-plane buffer
If the former is smaller, the Z value Z m (X, X, X) of the corresponding image of each plane of the multi-plane buffer is compared.
Y) # 1 to Z m (X, Y) #n in order of Z d (X,
Y), and at the time when the Z value of the corresponding image position of the N-th plane that satisfies Z d (X, Y) <Z m (X, Y) #N is found, the N-plane and subsequent N-planes on the multi-plane buffer are detected. By shifting the pixel value of the corresponding pixel one by one to the corresponding pixel of the subsequent plane and setting the pixel value of the defocus data as the pixel value of the Nth plane of the multiplane buffer, It is characterized in that the data is stored in the multi-plane buffer in the ascending order of the distance from the viewpoint. In addition, claim 32
In the invention described in the above, the multi-plane buffer is provided with a minimum number of planes in an initial stage, and the multi-plane buffer processing step includes the plurality of defocus data in the order of decreasing distance from a viewpoint. When performing the processing of storing in the above, a required plane is newly secured every time the plane of the multi-plane buffer becomes insufficient.

【0014】また、請求項33に記載の発明は、前記関
数は、パラメータとしてAを含むことを特徴とする。ま
た、請求項34に記載の発明は、前記デフォーカス処理
ステップは、前記シェーディングデータをスキャンし、
点光源をぼかしたときの該点光源像の直径Φを計算し、
該直径の円内における点光源像の強度比を求め、該直径
の円内における強度比の和が1.0になるように強度比
係数Mを求め、前記強度比係数Mを利用して前記直径Φ
の円内におけるR,G,Bの値,アルファ値Aの値を求
めて前記デフォーカスバッファに保存されている値に加
え、前記デフォーカスバッファ上の前記直径Φの円内画
素位置(a,b)におけるZ値と前記シェーディングデ
ータの同じ画素位置(X,Y)におけるZ値を比べ、該
シェーディングデータのZ値の方が小さければ前記シェ
ーディングデータの画素位置(X,Y)におけるZ値を
前記デフォーカスバッファ上の前記直径Φの円内画素位
置(a,b)におけるZ値に移すことによりデフォーカ
データの生成を行うことを特徴とする。また、請求項
35に記載の発明は、前記デフォーカス処理ステップ
は、前記直径の円内における点光源像の強度比を、コサ
インを用いた近似計算により求めることを特徴とする。
また、請求項36に記載の発明は、前記画像生成プログ
ラムは、前記オブジェクトモデルデータに座標変換、陰
面処理、シェーディング処理をし、結果を画素値として
R,G,B,Zの値を記憶できるZバッファに格納する
座標変換および陰面消去処理ステップとをさらに含み、
前記デフォーカス処理ステップは、前記Zバッファに格
納されたデータを前記シェーディングデータとして処理
することを特徴とする。
The invention described in Item 33 is characterized in that the function includes A as a parameter. In the invention according to claim 34, the defocus processing step scans the shading data,
Calculate the diameter Φ of the point light source image when blurring the point light source,
The intensity ratio of the point light source image within the circle of the diameter is determined, the intensity ratio coefficient M is determined so that the sum of the intensity ratios within the circle of the diameter becomes 1.0, and the intensity ratio coefficient M is used to Diameter Φ
The values of R, G, B and the alpha value A in the circle are calculated and added to the values stored in the defocus buffer, and pixel positions (a, b) comparing the Z value at the same pixel position (X, Y) of the shading data, and if the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is calculated. The defocus data is generated by shifting to the Z value at the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer. In the thirty-fifth aspect of the invention, the defocus processing step is characterized in that the intensity ratio of the point light source image within the circle of the diameter is obtained by approximate calculation using a cosine.
According to a thirty-sixth aspect of the present invention, the image generation program can perform coordinate conversion, hidden surface processing, and shading processing on the object model data, and can store the values of R, G, B, and Z as a pixel value. Further comprising coordinate transformation and hidden surface removal processing steps for storing in a Z buffer,
In the defocus processing step, the data stored in the Z buffer is processed as the shading data.

【0015】また、請求項37に記載の発明は、前記画
像生成プログラムは、前記オブジェクトモデルデータに
座標変換、陰面処理、シェーディング処理をし、結果を
画素値としてR,G,B,A,Zの値を記憶できるZバ
ッファに格納する座標変換および陰面消去処理ステップ
とをさらに含み、前記デフォーカス処理ステップは、前
記Zバッファに格納されたデータを前記シェーディング
データとして処理することを特徴とする。また、請求項
38に記載の発明は、前記オブジェクトは、パンフォー
カスにより生成され、Z値として無限遠が与えられた背
景画像を含むことを特徴とする。また、請求項39に記
載の発明は、前記オブジェクトは、自然画像を利用し
て、画像合成時に使用しない領域であるクロマキー領域
を、利用者から与えられる閾値をもって抽出し、該抽出
されたクロマキー領域に無限遠のZ値と色情報として
R,G,B各々に0を与え、それ以外の領域については
R,G,B値はそのままで、利用者が与えるZ値を与え
たフォアグラウンド画像を含むことを特徴とする。ま
た、請求項40に記載の発明は、前記画像生成プログラ
ムは、背景画像を、Z値として無限遠を与えることによ
りRGBZ変換処理するステップと、前記背景画像がオ
ブジェクトと同じ撮影パラメータで生成されている場
合、前記RGBZ変換処理の結果を画素値としてR,
G,B,Zの値を記憶できる背景画像用バッファに書き
込むステップと、前記背景画像がパンフォーカスにより
生成されている場合、前記RGBZ変換処理の結果を前
記Zバッファに書き込みその後前記デフォーカス処理ス
テップによりデフォーカス処理されたデータを前記背景
画像用バッファに書き込む処理ステップとをさらに含
み、前記出力イメージ作成処理ステップは、前記背景画
像用バッファと前記マルチプレーンバッファの値を読み
込み、イメージを生成し、出力することを特徴とする。
According to a thirty-seventh aspect of the present invention, the image generation program performs coordinate conversion, hidden surface processing, and shading processing on the object model data, and R, G, B, A, and Z are used as the pixel values. Further comprising a coordinate transformation and hidden surface removal processing step of storing the value in the Z buffer, and the defocus processing step processes the data stored in the Z buffer as the shading data. Further, the invention according to claim 38, wherein the object is generated by the pan-focus, characterized in that it comprises a background image infinity is given as the Z value. According to a thirty-ninth aspect of the present invention, the object uses a natural image to extract a chroma key area, which is an area that is not used during image composition, with a threshold value given by a user, and the extracted chroma key area. To the Z value at infinity and 0 as R, G, and B as color information, and for the other areas, the R, G, and B values remain unchanged, and the foreground image including the Z value given by the user is included. It is characterized by According to a forty-fourth aspect of the present invention, the image generation program performs a step of performing RGBZ conversion processing on the background image by giving infinity as a Z value, and the background image is generated with the same shooting parameter as the object. If the result of the RGBZ conversion processing is R,
Writing to a background image buffer capable of storing G, B, and Z values; and, if the background image is generated by pan focus, writing the result of the RGBZ conversion processing to the Z buffer, and then performing the defocus processing step. Further including a processing step of writing the defocused data to the background image buffer, the output image creation processing step, read the values of the background image buffer and the multi-plane buffer, to generate an image, It is characterized by outputting.

【0016】また、請求項41に記載の発明は、前記画
像生成プログラムは、自然画像を利用して合成時に使用
しない領域であるクロマキー領域を、利用者から与えら
れる閾値をもって抽出するクロマキー領域処理ステップ
と、抽出されたクロマキー領域に無限遠のZ値と色情報
としてR,G,B各々に0を与え、それ以外の領域につ
いてはR,G,B値はそのままで、利用者が与えるZ値
を与え、前記Zバッファに書き送むRGBZ変換処理ス
テップとをさらにコンピュータに実現させることを特徴
とする。また、請求項42に記載の発明は、前記画像生
成プログラムは、自然画像を利用して合成時に使用しな
い領域であるクロマキー領域を、利用者から与えられる
閾値をもって抽出し、該抽出した領域と接する他の領域
との境界領域においてなだらかに変化するAを算出する
クロマキー領域処理ステップと、抽出されたクロマキー
領域に無限遠のZ値と色情報としてR,G,B,A各々
に0を与え、それ以外の領域についてはR,G,B
そのままで、前記算出されたA値と、利用者が指定した
Z値を与え、前記Zバッファに書き込むRGBAZ変換
処理ステップとをさらにコンピュータに実現させること
を特徴とする。
The image forming program according to the present invention is a chroma key area processing step for extracting a chroma key area which is an area which is not used at the time of composition using a natural image with a threshold value given by a user. And Z value at infinity in the extracted chroma key area and 0 for each of R, G, B as color information, and R, G, B values as they are for other areas, Z value given by the user. And an RGBZ conversion processing step of writing the data to the Z buffer and writing the data to the Z buffer. Further, in the invention according to claim 42, the image generation program extracts a chroma key area, which is an area that is not used at the time of composition, by using a natural image, with a threshold value given by a user, and contacts the extracted area. A chroma key region processing step of calculating A that changes gently in a boundary region with another region, Z value of infinity to the extracted chroma key region, and 0 is given to each of R, G, B, A as color information, For the other areas, the R, G, and B values are left unchanged, and the computer further implements the calculated A value and the Z value specified by the user, and the RGBAZ conversion processing step of writing in the Z buffer. It is characterized by

【0017】[0017]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments of the present invention will be described with reference to the drawings.

【0018】(第1の実施の形態)図1は本発明の第l
の実施形態の画像生成装置の構成図である。本実施形態
の画像生成装置はオブジェクトモデルデータ読み出し処
理部1と座標変換および陰面消去処理部2とZバッファ
3とシェーディング・マッピング等処理部4とデフォー
カス処理部5とデフォーカスバッファ6とマルチプレー
ンバッファ処理部7とマルチプレーンバッファ8と出力
イメージ作成処理部9とディスク書き込み処理部10と
記憶装置11で構成される。
(First Embodiment) FIG. 1 shows the first embodiment of the present invention.
It is a block diagram of the image generation apparatus of the embodiment. The image generation apparatus according to the present embodiment includes an object model data read processing unit 1, a coordinate conversion / hidden surface removal processing unit 2, a Z buffer 3, a shading / mapping processing unit 4, a defocus processing unit 5, a defocus buffer 6, and a multiplane. It comprises a buffer processing unit 7, a multi-plane buffer 8, an output image creation processing unit 9, a disk writing processing unit 10 and a storage device 11.

【0019】オブジェクトモデルデータ読み出し処理部
1は記憶装置11から、被写界深度を利用して前後関係
を表現したい物体(オブジェクト)毎にオブジェクトモ
デルデータを読み出し、次の座標変換および陰面消去処
理部2に渡す。オブジェクトの概念を図2に示す。オブ
ジェクトは通常複数のポリゴンや複数の基本形状(以下
プリミティブと書く)の組み合わせ(オブジェクトモデ
ルデータ)で表現される。図2のようにA、B、Cの3
つのオブジェクトが存在し、A、B、Cの前後関係を被
写界深度によって表現したい場合、ここでA、B、C毎
にオブジェクトモデルデータを読み出し、座標変換およ
び陰面消去処理部2に渡す。読み出された各々の物体に
関して以下に説明する処理が進み、マルチプレーンバッ
ファ処理が終了したら次のオブジェクトを読み出す、と
いう処理をオブジェクトが無くなるまで続ける。なお、
ここでいう”被写界深度”とは、ピントを合わせたその
前後に実用上ピントがあっている範囲のことをいう。
The object model data read processing unit 1 reads the object model data from the storage device 11 for each object (object) whose front-to-back relationship is desired to be expressed by using the depth of field, and the next coordinate conversion and hidden surface removal processing unit. Pass to 2. The concept of an object is shown in FIG. An object is usually represented by a combination of a plurality of polygons and a plurality of basic shapes (hereinafter referred to as primitives) (object model data). As shown in FIG. 2, 3 of A, B, C
When one object exists and it is desired to express the context of A, B, and C by the depth of field, the object model data is read out for each of A, B, and C and passed to the coordinate conversion and hidden surface removal processing unit 2. The process described below proceeds for each read object, and the process of reading the next object when the multi-plane buffer process is completed is continued until there are no more objects. In addition,
The term "depth of field" as used herein refers to a range in which there is practical focus before and after focusing.

【0020】座標変換および陰面消去処理部2はオブジ
ェクトモデルデータ読み出し処理部1から渡されたオブ
ジェクト毎に座標変換、陰面消去やシェーディング等を
行う。この座標変換および陰面消去処理部2は一般的な
コンピュータグラフィックス画像生成装置と同じものが
使われる。
The coordinate conversion / hidden surface removal processing section 2 performs coordinate conversion, hidden surface removal, shading, etc. for each object passed from the object model data read processing section 1. As the coordinate conversion and hidden surface removal processing unit 2, the same one as a general computer graphics image generation device is used.

【0021】座標変換とは、処理対処となるオブジェク
トモデルデータを各処理に適した座標系に変換する処理
のことをいう。一例としてボディ座標系で表わされたオ
ブジェクをその処理過程に応じて、ワールド座標系、視
点座標系、スクリーン座標系といった座標へ変換する処
理のことをいう。ここで、”ボディ座標系”とは、座標
系を各オブジェクトに関するデータの入力しやすい座標
原点および座標軸としたもののことをいう。なお、この
ボディ座標系はオブジェクト座標系もしくはモデル座標
系と呼ばれる場合もある。”ワールド座標系”とは、ボ
ディ座標系で表現されたオブジェクトを運動モデルに従
って配置するための座標系のことをいう。また、”視点
座標系”とは、ワールド座標系に対し視点の位置を原点
とし、視線の方向をZ軸の正の方向とした座標系のこと
をいう。そして、”スクリーン座標系”とは視点座標系
に置かれたデータを画面に投影するための座標系をい
う。これら、座標変換は主にアフィン変換により行われ
る。
The coordinate conversion is a process of converting the object model data to be processed into a coordinate system suitable for each process. As an example, it is a process of converting an object represented by a body coordinate system into coordinates such as a world coordinate system, a viewpoint coordinate system, and a screen coordinate system in accordance with the process. Here, the "body coordinate system" means that the coordinate system is used as a coordinate origin and a coordinate axis where data regarding each object can be easily input. The body coordinate system may be called an object coordinate system or a model coordinate system. The "world coordinate system" refers to a coordinate system for arranging an object represented by a body coordinate system according to a motion model. The “viewpoint coordinate system” refers to a coordinate system in which the position of the viewpoint is the origin with respect to the world coordinate system and the direction of the line of sight is the positive direction of the Z axis. The "screen coordinate system" means a coordinate system for projecting the data placed in the viewpoint coordinate system on the screen. These coordinate transformations are mainly performed by affine transformation.

【0022】また、陰面消去とは、視点から見てオブジ
ェクトの重なり等により見えない部分を消去する処理の
ことをいう。陰面消去の方法としては、Zバッファ法、
スキャンライン法、レイ・トレーシング法等がある。な
お、実施の形態ではZバッファ法による陰面消去を例に
している。ここで、”Zバッファ法”とは視点からの距
離に関するZ値を記憶可能なZバッファを用いて、視点
から各オブジェクトの各点までの距離と対応するZバッ
ファ内の画素のZ値とを比較し、オブジェクトの点まで
の距離がZバッファ内のZ値より小さい(視点に近い)
場合に、Zバッファの対応する画素の色データおよびZ
値を書き換えることで陰面消去を行う方法である。
The hidden surface erasing is a process of erasing a portion that cannot be seen from the viewpoint due to overlapping of objects or the like. As a hidden surface erasing method, a Z buffer method,
There are scan line method, ray tracing method and the like. In the embodiment, hidden surface removal by the Z buffer method is taken as an example. Here, the "Z-buffer method" uses a Z-buffer capable of storing Z-values related to the distance from the viewpoint, and calculates the distance from the viewpoint to each point of each object and the Z-value of the corresponding pixel in the Z-buffer. Compared, the distance to the object point is smaller than the Z value in the Z buffer (closer to the viewpoint)
, The color data of the corresponding pixel in the Z buffer and Z
This is a method to erase the hidden surface by rewriting the value.

【0023】また、シェーディング・マッピング等処理
部4は座標変換・陰面消去されたオブジェクトにシェー
ディングやマッピング等処理を行う。シェーディング・
マッピング等処理部4は一般的なコンピュータグラフィ
ックス画像生成装置と同じものが使われる。
The shading / mapping processing unit 4 performs shading, mapping and the like on the object whose coordinates have been converted and hidden. shading·
The same processing unit 4 as a general computer graphics image generation device is used as the mapping processing unit 4.

【0024】ここで、”シェーディング”とは、目に見
えるオブジェクトの色を構成するさまざまな要素、つま
りオブジェクト本来の色や表面の状態、表面上の点の向
いている方向、光源の位置や色、視点の位置、視線の方
向、それに周囲のオブジェクトの映り込みなどを考慮し
て画素に付ける色を決定する処理のことをいう。このシ
ェーディング・アルゴリズムのことを一般にシェーディ
ングモデルと呼ぶが、このシェーディング・モデルとし
て、ランバートモデル、フォン・シェーディングモデ
ル、ブリン・シェーディングモデル等がある。また、”
マッピング”とは平面的なマッピングデータを3次元形
状を有するオブジェクト表面上へ写像することでオブジ
ェクトの表面の模様等を表わす処理のことをいう。マッ
ピング方法としては表面マッピング、ソリッドマッピン
グ等がある。なお、シェーディング・マッピング等処理
部4は、座標変換・陰面消去されたオブジェクトに対し
シェーディング処理を行う。さらにマッピング等の処理
が必要な場合、シェーディング・マッピング等処理部4
はそれらの処理も行う。
Here, "shading" means various elements that make up the color of the visible object, that is, the original color of the object, the state of the surface, the direction in which the points on the surface are facing, the position and color of the light source. , A process of determining a color to be applied to a pixel in consideration of the position of the viewpoint, the direction of the line of sight, the reflection of surrounding objects, and the like. This shading algorithm is generally called a shading model, and as this shading model, there are a Lambert model, a von shading model, a Bryn shading model, and the like. Also,"
The term "mapping" refers to a process of expressing a pattern on the surface of an object by mapping planar mapping data onto the surface of an object having a three-dimensional shape. The mapping method includes surface mapping and solid mapping. The shading / mapping etc. processing unit 4 performs a shading process on the object whose coordinate conversion / hidden surface removal has been performed.
Also handles them.

【0025】オブジェクト毎に生成されたイメージは図
3に示す一般的なフォーマットのZバッファ3に格納さ
れ、次のデフォーカス処理部5に渡される。Zバッファ
3は処理の開始時に全ての(x,y)が図3の初期値に
初期化される。図3において結果として得たい画像のサ
イズとして横xmax画素、縦ymax画素としている。
The image generated for each object is stored in the Z buffer 3 of the general format shown in FIG. 3 and passed to the next defocus processing section 5. In the Z buffer 3, all (x, y) are initialized to the initial values in FIG. 3 at the start of processing. In FIG. 3, the size of the image to be obtained as a result is horizontal x max pixels and vertical y max pixels.

【0026】デフォーカスバッファ6のフォーマットを
図4に、デフォーカス処理を図7に示す。xmax ,y
max は結果として得たい画像のサイズを横方向、縦方向
各々画素数で表したものである。処理の開始時には初期
値としてR=0.0,G=0.0,B=0.0,視点か
ら対応する点までの距離Z=∞,アルファ値A=0.0
が全ての(x,y)に与えられる。なお、アルファ値A
は、0から1の間の値を取り、別途詳細に説明する演算
方法によりその値が求められる。
The format of the defocus buffer 6 is shown in FIG. 4, and the defocus processing is shown in FIG. x max , y
max represents the size of an image to be obtained as a result in the number of pixels in the horizontal and vertical directions. At the start of the process, R = 0.0, G = 0.0, B = 0.0 as initial values, the distance Z = ∞ from the viewpoint to the corresponding point, and the alpha value A = 0.0.
Is given to all (x, y). The alpha value A
Takes a value between 0 and 1, and the value is obtained by a calculation method described in detail later.

【0027】デフォーカス処理部5は、Zバッファ3上
の該当するオブジェクトが含まれているある座標(X,
Y)の画素をデフォーカス像に広げるのだが、その広が
った像は円形であるとし、その直径Φを画素を単位とし
て幾何光学的アプローチによって求める(ステップ21
〜24)。
The defocus processing section 5 coordinates (X, X) containing the corresponding object on the Z buffer 3.
The pixels of Y) are spread in the defocused image, and the spread image is assumed to be circular, and the diameter Φ is obtained by the geometrical optical approach in units of pixels (step 21).
~ 24).

【0028】図5(a)〜(c)を使ってその方法を説
明する。図5(a)〜(c)は二次元で表しているが、
以下に説明するとおり二次元で考えて問題ない。本実施
形態では図5(a)〜(c)に示すとおりレンズ面と絞
り輪面は同一としている。幾何光学の一般論として図5
(a)に示すように、(z,y)=(a,b)に位置す
る点光源が結像する座標(α,β)は次のように表され
る(必ずa>f)。
The method will be described with reference to FIGS. Although FIGS. 5A to 5C are shown two-dimensionally,
As explained below, there is no problem in thinking in two dimensions. In this embodiment, the lens surface and the diaphragm ring surface are the same as shown in FIGS. Figure 5 as a general theory of geometrical optics
As shown in (a), the coordinates (α, β) on which the point light source located at (z, y) = (a, b) forms an image are expressed as follows (always a> f).

【数1】 [Equation 1]

【0029】次に、結像点(α,β)がフィルム面より
前にあるか後ろにあるかについて別々に図にしたのが図
5(b)と図5(c)である。sはカメラからある距離
0にある点光源の結像点がフィルム面上になるように
調整された距離である。つまりカメラからa0 の距離に
ある点光源にピントを合わせるように利用者が指定した
距離である。a0 は必ずfより大きいので、
Next, FIGS. 5 (b) and 5 (c) separately show whether the image forming point (α, β) is in front of or behind the film surface. s is a distance adjusted so that the image forming point of the point light source at a certain distance a 0 from the camera is on the film surface. That is, it is the distance designated by the user so as to focus on the point light source located at the distance a 0 from the camera. Since a 0 is always larger than f,

【数2】 である。[Equation 2] Is.

【0030】図5(b)と図5(c)から3角形の相似
関係を使うと、
Using the triangle similarity from FIGS. 5 (b) and 5 (c),

【数3】 が得られる。ここにおいて、Fは絞り値、fはレンズの
焦点距離、φirisは絞り輪の直径、φimageはフィルム
上に現れる点光源の像の直径である。
[Equation 3] Is obtained. Here, F is the aperture value, f is the focal length of the lens, φ iris is the diameter of the aperture ring, and φ image is the diameter of the image of the point light source that appears on the film.

【0031】ここで得られた直径φimage は実際の大き
さであるので単位を画素に変換し、実際に利用する像の
直径Φを求める(ステップ23)。
Since the diameter φ image obtained here is the actual size, the unit is converted into pixels, and the diameter Φ of the image actually used is obtained (step 23).

【数4】 [Equation 4]

【0032】ここにおいて、a0 はピントを合わす点光
源のカメラからの距離、aは目的とする画素のカメラか
らの距離(Zバッファ3上のZ値)、fはレンズの焦点
距離、Fは絞り値、φfilmはフィルムの撮像される有効
な長方形に外接する円の直径、xmax とymax は生成し
ようとする画像を構成する横方向の画素数と縦方向の画
素数である。
Here, a 0 is the distance of the point light source for focusing from the camera, a is the distance of the target pixel from the camera (Z value on the Z buffer 3), f is the focal length of the lens, and F is Aperture value, φ film is the diameter of a circle circumscribing an effective rectangle of a film, and x max and y max are the number of pixels in the horizontal direction and the number of pixels in the vertical direction which form the image to be generated.

【0033】次に、(4)式で求まった直径がΦの円形
の像内での強度比分布を求める。一般に、波動光学では
強度比分布は、
Next, the intensity ratio distribution in the circular image having the diameter Φ obtained by the equation (4) is obtained. Generally, in wave optics, the intensity ratio distribution is

【数5】 に従う(Potmesil,Michael et al."A Lens and Apertur
e Camera Model for Synthetic Image Genaration", Co
mputer Graphics, vol.17, no.3, pp137-145, 198
1.)。ここで、(l,m)は原点(0,0)が円形の像
の中心であるように座標がとられている。また、J
l(a)はベッセル関数の第1次級数である。この式に
よって強度比分布を求めてもよいが、本発明では干渉を
考慮する必要が無く、また処理量の削減のために近似式
として次式を用いて強度比分布を求める。
[Equation 5] (Potmesil, Michael et al. "A Lens and Apertur
e Camera Model for Synthetic Image Genaration ", Co
mputer Graphics, vol.17, no.3, pp137-145, 198
1.). Here, the coordinates of (l, m) are set so that the origin (0,0) is the center of the circular image. Also, J
l (a) is the first series of the Bessel function. Although the intensity ratio distribution may be obtained by this equation, it is not necessary to consider interference in the present invention, and the intensity ratio distribution is obtained by using the following equation as an approximate equation in order to reduce the processing amount.

【数6】 (5)式と(6)式の関数形を(l2+m21/2=rと
して図6に示す。
[Equation 6] The function forms of the equations (5) and (6) are shown in FIG. 6 as (l 2 + m 2 ) 1/2 = r.

【0034】(6)式では円形の像が原点を中心として
直径が2πであるので、デフォーカスバッファ6上で実
際に使用する形、すなわち直径がΦ、中心が(X,Y)
に変換して用いることになる。すなわち、
In the equation (6), since the circular image has a diameter of 2π around the origin, the shape actually used on the defocus buffer 6, that is, the diameter is Φ and the center is (X, Y).
It will be converted into and used. That is,

【数7】 として利用する。[Equation 7] To use as.

【0035】次に、(7)式により中心が(X,Y)
で、直径がΦの円形の像内の全ての画素における強度比
の和を求め、その和が1.0となるように強度比係数M
を決める(ステップ25)。
Next, according to equation (7), the center is (X, Y)
Then, the sum of the intensity ratios in all the pixels in the circular image with the diameter Φ is obtained, and the intensity ratio coefficient M is set so that the sum becomes 1.0.
Is determined (step 25).

【数8】 [Equation 8]

【0036】以上求められた値を用いて、Zバッファ3
上の該当するオブジェクト内のある座標(X,Y)の画
素のデフォーカス処理によって得られる、中心が(X,
Y)で、直径がΦである円形の像(Rd,Gd,Bd) は
次式によって求められる。なお、以降R,G,B,A,
Z,R(x,y)に付されたサフィックスz,d,mは
それぞれZバッファ3、デフォーカスバッファ6、マル
チプレーンバッファ8上の値であることを示している。
Using the values thus obtained, the Z buffer 3
The center obtained by defocusing the pixel at a certain coordinate (X, Y) in the corresponding object above is (X, Y).
In Y), a circular image (R d , G d , B d ) having a diameter Φ is obtained by the following equation. After that, R, G, B, A,
Suffixes z, d, and m attached to Z, R (x, y) indicate values on the Z buffer 3, the defocus buffer 6, and the multi-plane buffer 8, respectively.

【数9】 [Equation 9]

【0037】また、同時に出力イメージ作成処理部9で
使用するアルファ値Aを求める。
At the same time, the alpha value A used in the output image creation processing section 9 is obtained.

【0038】なお、(9),(10),(11)式は最
初Rd(x,y),Gd(x,y),Bd(x,y) の初
期値が与えられて、右辺の計算値を左辺に代入すること
を繰り返すことを示している。
In the equations (9), (10) and (11), initial values of R d (x, y), G d (x, y) and B d (x, y) are given, It indicates that substitution of the calculated value on the right side to the left side is repeated.

【数10】 [Equation 10]

【0039】以上のようにR,G,B,Aの値をZバッ
ファ3上の該当するオブジェクト内の全ての座標におい
て求め、結果をデフォーカスバッファ6の対応する座標
の該当する値に加える(ステップ26)。
As described above, the values of R, G, B and A are obtained at all the coordinates in the corresponding object on the Z buffer 3, and the result is added to the corresponding value of the corresponding coordinates in the defocus buffer 6 ( Step 26).

【0040】デフォーカスバッファ6上(x,y)にお
けるZ値については、Zバッファ3上の(X,Y)にお
けるZ値がデフォーカスバッファ6上の(x,y)にお
けるZ値より小さければZバッファ3上の(X,Y)に
おけるZ値をデフォーカスバッファ6上(x,y)のZ
値に移す(ステップ27)。
Regarding the Z value in (x, y) on the defocus buffer 6, if the Z value in (X, Y) on the Z buffer 3 is smaller than the Z value in (x, y) on the defocus buffer 6. The Z value at (X, Y) on the Z buffer 3 is set to the Z value at (x, y) on the defocus buffer 6.
Value (step 27).

【0041】マルチプレーンバッファ8のフォーマット
を図8、マルチプレーンバッファ処理を図10に示す。
max ,ymax は結果として得たい画像のサイズを横方
向、縦方向各々画素数で表したものである。nはマルチ
プレーンバッファ8の枚数であり、出力画像上重なって
見えるデフォーカスされたオブジェクトの数に依存して
決定される値である。マルチプレーンバッファ8には任
意の座標(x,y),((0≦x<xmax ),(0≦y
<ymax ))について各々n個のRm (x,y),Gm
(x,y),Bm(x,y),Zm(x,y),A
m(x,y)が保持される。マルチプレーンバッファ8
の初期値として処理開始時に全ての(x,y)の全ての
nについてRm=0.0,Gm=0.0,Bm=0.0,
m=∞,Am =0.0が与えられる。
The format of the multi-plane buffer 8 is shown in FIG. 8, and the multi-plane buffer processing is shown in FIG.
x max and y max represent the size of the image to be obtained as a result by the number of pixels in each of the horizontal and vertical directions. n is the number of multi-plane buffers 8 and is a value that is determined depending on the number of defocused objects that appear to overlap on the output image. The multi-plane buffer 8 has arbitrary coordinates (x, y), ((0 ≦ x <x max ), (0 ≦ y
<Y max )) for each n R m (x, y), G m
(X, y), B m (x, y), Z m (x, y), A
m (x, y) is retained. Multiplane buffer 8
As an initial value of R m = 0.0, G m = 0.0, B m = 0.0, for all n of all (x, y) at the start of processing.
Z m = ∞ and Am = 0.0 are given.

【0042】デフォーカスバッファ6上の処理中のオブ
ジェクトに含まれるある座標(X,Y)からマルチプレ
ーンバッファ8の対応する座標(X,Y)に全ての情報
R(X,Y),G(X,Y),B(X,Y),Z(X,
Y),A(X,Y)が移される。その際の処理の概略を
図9に示す。
All information R (X, Y), G (from the coordinate (X, Y) included in the object being processed on the defocus buffer 6 to the corresponding coordinate (X, Y) in the multi-plane buffer 8). X (Y,), B (X, Y), Z (X,
Y) and A (X, Y) are transferred. The outline of the processing in that case is shown in FIG.

【0043】図9は処理中のオブジェクトに含まれるあ
る座標(X,Y)についての処理を説明している。既に
説明したようにマルチプレーンバッファ8のある座標
(X,Y)についてn個のRm(X,Y),Gm(X,
Y),Bm(X,Y),Zm(X,Y),Am(X,Y)
が保持されており、各々Rm(X,Y)#n,Gm(X,
Y)# n,Bm(X,Y)#n,Zm(X,Y)#n,A
m(X,Y)#nと表している。マルチプレーンバッファ
処理部7はマルチプレーンバッファ8を(X,Y)につ
いて常にZm(X,Y)#1≦Zm(X,Y)#2≦Z
m(X,Y)#3 ・・・ ≦Zm(X,Y)#nとなるように
制御する。デフォーカスバッファ6の(X,Y)につい
て、マルチプレーンバッファ処理部7はまずデフォーカ
スバッファ6上の(X,Y)におけるZd(X,Y)と
マルチプレーンバッファ8上のZm(X,Y)#nを比較
する(ステップ33)。その結果Zd(X,Y)>Z
m(X,Y)#nであればマルチプレーンバッファ処理部
7はデフォーカスバッファ6からの(X,Y)に関する
情報のマルチプレーンバッファ8への移送を行わない。
d(X,Y)≦Zm(X,Y)#nであればマルチプレー
ンバッファ処理部7はZm(X,Y)#1からZm(X,
Y)#nまで順にZd(X,Y)との比較を行う(ステッ
プ34,35)。Zd(X,Y) < Zm(X,Y)#N 、
(1≦N≦n)であるNが見つかった時点でマルチプレ
ーンバッファ処理部7はN以降の(R,G,B,Z,
A)をひとつづつ後ろにシフトさせ(ステップ36)、
最後にデフォーカスバッファ6のRd (X,Y),Gd
(X,Y),Bd(X,Y),Zd(X,Y),A
d(X,Y)をN番目のマルチプレーンバッファ8のRm
(X,Y)#N,Gm(X,Y)#N,Bm(X,Y)#N,Z
m(X,Y)#N,Am(X,Y)#Nに移す(ステップ3
7)。この作業を該当するオブジェクトが含まれる全て
の(X,Y)で行う(ステップ31,32)。
FIG. 9 explains the processing for a certain coordinate (X, Y) included in the object being processed. As described above, n R m (X, Y), G m (X, Y) coordinates (X, Y) of the multi-plane buffer 8 are present.
Y), B m (X, Y), Z m (X, Y), A m (X, Y)
Are held, and R m (X, Y) #n and G m (X,
Y) # n, B m ( X, Y) #n, Z m (X, Y) #n, A
It is expressed as m (X, Y) #n . The multi-plane buffer processing unit 7 causes the multi-plane buffer 8 to always store Z m (X, Y) # 1 ≤ Z m (X, Y) # 2 ≤ Z for (X, Y).
m (X, Y) # 3 ··· ≦ Z m (X, Y) is controlled so as to #n. Regarding (X, Y) of the defocus buffer 6, the multi-plane buffer processing unit 7 first sets Z d (X, Y) in (X, Y) on the defocus buffer 6 and Z m (X in the multi-plane buffer 8). , Y) #n are compared (step 33). As a result Z d (X, Y)> Z
If m (X, Y) #n , the multi-plane buffer processing unit 7 does not transfer the information regarding (X, Y) from the defocus buffer 6 to the multi-plane buffer 8.
If Z d (X, Y) ≤ Z m (X, Y) #n , the multi-plane buffer processing unit 7 outputs Z m (X, Y) # 1 to Z m (X, Y).
Y) Up to #n are sequentially compared with Z d (X, Y) (steps 34 and 35). Z d (X, Y) <Z m (X, Y) #N,
When N that is (1 ≦ N ≦ n) is found, the multi-plane buffer processing unit 7 performs (R, G, B, Z,
Shift A) backwards one by one (step 36),
Finally, R d (X, Y) and G d of the defocus buffer 6
(X, Y), B d (X, Y), Z d (X, Y), A
d (X, Y) is R m of the Nth multi-plane buffer 8
(X, Y) #N , G m (X, Y) #N , B m (X, Y) #N , Z
m (X, Y) #N, A m (X, Y) is transferred to #N (Step 3
7). This work is performed for all (X, Y) including the corresponding object (steps 31, 32).

【0044】該当するオブジェクトの処理が終了した場
合(ステップ38)、そのオブジェクトが最後のオブジ
ェクトであれば次の出力イメージ作成処理部9に移り、
そうでない場合はオブジェクトモデルデータ読み出し処
理部1に戻って次のオブジェクトモデルデータを読み出
し、ここまで説明してきた各処理を行う。
When the processing of the corresponding object is completed (step 38), if the object is the last object, the process proceeds to the next output image creation processing section 9,
If not, the process returns to the object model data read processing unit 1 to read the next object model data, and the processes described so far are performed.

【0045】ここでは、マルチプレーンバッファ8の枚
数nは、出力画像上重なって見えるデフォーカスされた
オブジェクトの数に依存して決定される値であり、予め
n枚のマルチプレーンバッファ8が確保されているもの
として説明した。しかし、マルチプレーンバッファ8を
動的に確保できるようであれば、初期段階で最低限のマ
ルチプレーンバッファ8の数(例えば1枚)のみを確保
し、図10のステップS36のN番目のプレーン以降の
プレーンの情報をひとつづつ後ろに下げる処理でマルチ
プレーバッファ8の数が足りなくなったとき、マルチプ
レーンバッファ8用のプレーンバッファを新たに確保す
るようにしても良い。すなわち、現在マルチプレーンバ
ッファ8のプレーン数がαで、ステップS36の処理の
ためにプレーン数が(α+1)必要になった場合、新た
に1プレーン分のバッファを初期化して確保し、マルチ
プレーンバッファ8のプレーン数を(α+1)とした
後、N番目のプレーン以降のプレーンの情報をひとつづ
つ後ろに下げる処理を行うとよい。なお、マルチプレー
ンバッファ8の必要枚数は、最大で処理するオブジェク
トの数となる。
Here, the number n of the multi-plane buffers 8 is a value determined depending on the number of defocused objects that appear to overlap on the output image, and n multi-plane buffers 8 are secured in advance. I explained that it is. However, if the multi-plane buffer 8 can be dynamically secured, at the initial stage, only the minimum number of multi-plane buffers 8 (for example, one) is secured, and the N-th plane and subsequent planes in step S36 of FIG. When the number of the multi-play buffers 8 becomes insufficient in the process of lowering the information of each plane one by one backward, a new plane buffer for the multi-plane buffer 8 may be secured. That is, when the number of planes in the multi-plane buffer 8 is currently α and the number of planes is required to be (α + 1) for the processing in step S36, a buffer for one plane is newly initialized and secured, and the multi-plane buffer is After setting the number of 8 planes to (α + 1), it is preferable to perform a process of lowering the information of the Nth and subsequent planes one by one. The required number of multi-plane buffers 8 is the maximum number of objects to be processed.

【0046】出力イメージ作成処理部9は0≦x<x
max , 0≦y<ymaxの全ての(x,y)について、次
式の計算を行い出力イメージ作成する。
The output image creation processor 9 has 0 ≦ x <x.
For all (x, y) of max , 0 ≦ y <y max , the following formula is calculated to create an output image.

【数11】 [Equation 11]

【0047】以上の第1の実施形態では、Zバッファ3
からR,G,B,Zの値を読み込み、実際のカメラと同
じレンズの焦点距離と絞り値および被写体との距離から
なる関数(式(12))にしたがってピントを外したデ
フォーカス像を生成したが、Zバッファ3からR,G,
B,A,Zの値を読み込み、実際のカメラと同じレンズ
と同じ焦点距離と絞り値および被写体との距離からな
り、パラメータとしてAを含む関数
In the above first embodiment, the Z buffer 3
The values of R, G, B, and Z are read from, and a defocused image that is out of focus is generated according to the function (equation (12)) that is composed of the same focal length and aperture value of the camera and the distance to the subject. However, from the Z buffer 3, R, G,
A function that reads B, A, and Z values, consists of the same lens as the actual camera, the same focal length, aperture value, and distance to the subject, and includes A as a parameter

【数12】 にしたがってピントを外したデフォーカス像を生成して
もよい。この場合、Zバッファ3のフォーマットおよび
初期値は図11のようになる。ここで、(16)式は右
辺の値を左辺に代入することを意味し、最初Ad(x,
y)の値として初期値が与えられる。
[Equation 12] A defocused image that is out of focus may be generated according to. In this case, the format and initial values of the Z buffer 3 are as shown in FIG. Here, the expression (16) means substituting the value on the right side into the left side, and first, A d (x,
An initial value is given as the value of y).

【0048】(第2の実施の形態)図12は本発明の第
2の実施形態の画像生成装置の構成図である。
(Second Embodiment) FIG. 12 is a block diagram of an image generating apparatus according to a second embodiment of the present invention.

【0049】本実施形態では、背景画像読み出し処理部
12とRGBZ変換処理部13とスイッチ14と背景画
像用バッファ15が第1の実施形態(図1)に付加され
て構成されている。ここで、RGBZ変換処理部13は
R,G,Bの情報にZの値を加える処理を行う。
In this embodiment, a background image read processing unit 12, an RGBZ conversion processing unit 13, a switch 14 and a background image buffer 15 are added to the first embodiment (FIG. 1). Here, the RGBZ conversion processing unit 13 performs processing for adding the Z value to the R, G, B information.

【0050】背景画像読み出し処理部12は背景画像を
記憶装置11から読み出し、記憶装置11に格納されて
いる画像ファイルフォーマットがRGB形式でなけれ
ば、まず画像ファイルフォーマットをRGB形式に変換
する。変換方法については一般的なものと同じであるた
め説明は省略する。生成しようとしている画像サイズx
max, ymax と同じ大きさであればそのままRGBZ変
換処理部13に渡し、そうでない場合には xmax,y
max に合わせる処理をここで行う。その際の処理方法は
一般的なものと同じであるので説明は省略する。
The background image read processing unit 12 displays the background image.
Read from the storage device 11 and stored in the storage device 11
The image file format must be RGB format
First, convert the image file format to RGB format
To do. The conversion method is the same as the general one.
Therefore, the explanation is omitted. Image size to be generated x
max, YmaxIf the size is the same as
It is passed to the conversion processing unit 13, otherwise xmax, Y
maxThe process of adjusting to is performed here. The processing method at that time is
The description is omitted because it is the same as a general one.

【0051】背景画像は生成画像内で無限遠に論理的に
置かれる。そのため背景画像の全ての座操におけるZ値
として無限遠を発生して、R,G,Bの情報に加える。
記憶装置11に格納されている背景画像が第1の実施形
態により生成されるときに指定する撮影パラメータ(レ
ンズの焦点距離とF値とピントを合わせる距離)と同じ
ものを用いて生成されている場合と、パンフォーカスで
生成している場合によってこの後の流れが若干異なる。
The background image is logically placed at infinity in the generated image. Therefore, infinity is generated as the Z value in all seat motions of the background image and added to the R, G, B information.
The background image stored in the storage device 11 is generated using the same photographing parameters (distance for focusing the lens and the F value and the focus) designated when the background image is generated according to the first embodiment. The flow after this is slightly different depending on the case and the case where the pan focus is used.

【0052】[背景画像が同じ撮影パラメータで生成さ
れている場合]RGBZ変換処理部13の出力はスイッ
チ14を経て全て背景画像用バッファ15に移される。
背景画像用バッファ15のフォーマットを図13に示
す。
[When Background Image is Generated with the Same Shooting Parameter] All outputs of the RGBZ conversion processing unit 13 are transferred to the background image buffer 15 via the switch 14.
The format of the background image buffer 15 is shown in FIG.

【0053】背景画像用バッファ15に移された後、第
1の実施形態による画像生成が開始される。全てのオブ
ジェクトに関してマルチプレーンバッファ処理が終了し
た後、出力イメージ作成処理部9における処理が第1の
実施形態と異なる。(13)式〜(15)式の代わりに
第2の実施形態では次式によって出力画像を作成する。
After being transferred to the background image buffer 15, the image generation according to the first embodiment is started. After the multi-plane buffer processing is completed for all objects, the processing in the output image creation processing unit 9 is different from that of the first embodiment. Instead of equations (13) to (15), the output image is created by the following equation in the second embodiment.

【数13】 ここで、R(x,y)back,G(x,y)back,B
(x,y)backは背景画像用バッファ15上の座標
(x,y)におけるR,G,B値である。
[Equation 13] Where R (x, y) back , G (x, y) back , B
(X, y) back is the R, G, B value at the coordinates (x, y) on the background image buffer 15.

【0054】[背景画像がパンフォーカスにより生成さ
れている場合]RGBZ変換処理部13の出力はスイッ
チ14を径てZバッファ3に移される。完了後、第1の
実施形態と同じデフォーカス処理がZバッファ3に移さ
れた背景画像全体に対して行われる。第2の実施形態で
は背景画像にアルファ値Aは必要無いので(12)式に
よるアルファ値Aは計算しない。デフォーカス処理の結
果はデフォーカスバッファ6ではなく背景画像用バッフ
ァ15に移される。
[When Background Image is Generated by Pan Focus] The output of the RGBZ conversion processing unit 13 is transferred to the Z buffer 3 through the switch 14. After completion, the same defocus processing as in the first embodiment is performed on the entire background image transferred to the Z buffer 3. In the second embodiment, the alpha value A is not necessary for the background image, so the alpha value A according to the equation (12) is not calculated. The result of the defocus processing is moved to the background image buffer 15 instead of the defocus buffer 6.

【0055】背景画像に関してデフォーカス処理が終
り、結果が背景画像用バッファ15に格納された後、第
1の実施形態による画像生成が開始される。全てのオブ
ジェクトに関してマルチプレーンバッファ処理が終了し
た後、出力イメージ作成処理部9における処理が行われ
る。これは背景画像が同じ撮影パラメータで生成されて
いる場合と同じく(17)式〜(19)式に従って行わ
れる。
After the defocusing process for the background image is finished and the result is stored in the background image buffer 15, the image generation according to the first embodiment is started. After the multi-plane buffer processing is completed for all the objects, the processing in the output image creation processing unit 9 is performed. This is performed according to the equations (17) to (19) as in the case where the background image is generated with the same shooting parameter.

【0056】なお、本実施例において画像処理装置は背
景画像用バッファ15を備え、出力イメージ作成処理部
9が背景画像用バッファ15およびマルチプレーンバッ
ファ8内のデータを用いて式(17)〜(19)によっ
て出力画像を作成するものとして説明した。しかし、上
述の背景処理バッファ15への出力データにさらにZ値
=∞およびアルファ値A=1.0を付加してデフォーカ
スバッファ6に移し、マルチプレーンバッファ処理部7
によりデフォーカスされた背景画像をマルチプレーンバ
ッファ8に納めさせることで、出力イメージ処理部9の
処理は、第1の実施の形態で説明した処理と同じく(1
3)式〜(15)式により処理することができる。ま
た、これにより背景画像用バッファ15を省くことがで
きる。
In the present embodiment, the image processing apparatus is provided with the background image buffer 15, and the output image creation processing unit 9 uses the data in the background image buffer 15 and the data in the multi-plane buffer 8 to obtain equations (17) to (17). 19) to create an output image. However, Z value = ∞ and alpha value A = 1.0 are further added to the output data to the background processing buffer 15 and the data is transferred to the defocus buffer 6, and the multi-plane buffer processing unit 7
By storing the defocused background image in the multi-plane buffer 8, the processing of the output image processing unit 9 is the same as the processing described in the first embodiment (1
It can be processed by the equations (3) to (15). In addition, this makes it possible to omit the background image buffer 15.

【0057】(第3の実施の形態)図14は本発明の第
3の実施形態の画像生成装置の構成図である。本実施形
態では、フォアグラウンド画像読み出し処理部16とク
ロマキー領域抽出処理部17とRGBZ変換処理部18
が第2の実施形態(図12)に付加されて構成されてい
る。
(Third Embodiment) FIG. 14 is a block diagram of an image generating apparatus according to a third embodiment of the present invention. In the present embodiment, the foreground image reading processing unit 16, the chroma key area extraction processing unit 17, and the RGBZ conversion processing unit 18 are performed.
Is added to the second embodiment (FIG. 12).

【0058】第3の実施形態は第1の実施形態において
最初にオブジェクトのオブジェクトモデルデータ読み出
し処理前に実行してもよいし、あるオブジェクトのマル
チプレーンバッファ処理終了後次のオブジェクトのオブ
ジェクトモデルデータ読み出し処理開始前の間の任意の
タイミングで行うこともできるし、最後のオブジェクト
のマルチプレーンバッファ処理終了後で出力イメージ作
成処理前でもよい。
The third embodiment may be executed before the object model data read processing of the object in the first embodiment, or may be executed after the multi-plane buffer processing of an object is finished and the object model data read of the next object. It may be performed at any timing before the start of the process, or after the end of the multi-plane buffer process of the last object and before the output image creation process.

【0059】フォアグラウンド画像読み出し処理部16
は、ブルーバック等を用いて撮影された画像(以下フォ
アグラウンド画像と書く)を記憶装置11から読み出
す。記憶装置11に格納されている画像ファイルフォー
マットがRGB形式でなければ、ここでまず画像ファイ
ルフォーマットをRGB形式に変換する。変換方法につ
いては一般的なものと同じであるため説明は省略する。
生成しようとしている画像サイズ xmax,ymax と同じ
大きさであればそのままRGBZ変換処理部18に渡
し、そうでない場合には xmax,ymax に合わせる処理
をここで行う。その際の処理方法は一般的なものと同じ
であるので説明は省略する。
Foreground image read processing unit 16
Reads from the storage device 11 an image captured using a blue background or the like (hereinafter referred to as a foreground image). If the image file format stored in the storage device 11 is not the RGB format, the image file format is first converted to the RGB format here. The conversion method is the same as a general method, and therefore its explanation is omitted.
If it is the same as the image size x max , y max to be generated, the image size is passed to the RGBZ conversion processing unit 18 as it is, and if not, a process of adjusting to x max , y max is performed here. Since the processing method at that time is the same as a general method, the description thereof will be omitted.

【0060】クロマキー領域抽出処理部17は、読み出
されたフォアグラウンド画像からクロマキー領域を抽出
する。その際の処理については一般的なものと同じであ
るため詳細な説明は省略する。その処理の概要として
は、例えば、R,G,B各々について閾値 Rmin, R
max, Gmin,Gmax, Bmin, Bmax が利用者から与
えられ、フォアグラウンド画像からR,G,B各々全て
その範囲に含まれる画素をクロマキー領域とみなすこと
によりクロマキー処理をする。
The chroma key area extraction processing section 17 extracts a chroma key area from the read foreground image. Since the processing at that time is the same as general processing, detailed description will be omitted. The outline of the processing is, for example, threshold values R min , R for R, G, B respectively.
The user is given max , G min , G max , B min , and B max , and the chroma key processing is performed by regarding the pixels included in each range of R, G, and B from the foreground image as the chroma key area.

【0061】RGBZ変換処理部18は、記憶装置11
から読み出され、フォアグラウンド画像読み出し処理部
16で大きさ がxmax, ymax,フォーマットがRGB
フォーマットに変換されたフォアグラウンド画像が第1
の実施形態の説明で述べたZバッファ3に書き込まれ
る。このときクロマキー領域抽出処理部17によって抽
出されたクロマキー領域内の画素の座標について(R,
G,B)=(0,0,0)としまたZ値に無限遠を与
え、その他の領域の座標についてはR,G,B値はその
ままで利用者が与えるZ値を与えZバッファ3に書き込
む。これを図15に示す。終了後デフォーカス処理以降
は第1の実施形態で述べたあるオブジェクトに関する処
理と同じ処理が行われる。
The RGBZ conversion processing section 18 includes a storage device 11
And the size is x max , y max and the format is RGB in the foreground image read processing unit 16.
First foreground image converted to format
It is written in the Z buffer 3 described in the description of the embodiment. At this time, the coordinates of the pixels in the chroma key area extracted by the chroma key area extraction processing unit 17 (R,
G, B) = (0, 0, 0) and give Z value infinity. For the coordinates of the other areas, give Z value given by the user with R, G, B values unchanged, and give to Z buffer 3. Write. This is shown in FIG. After the defocusing process after the end, the same process as the process for a certain object described in the first embodiment is performed.

【0062】(第4の実施の形態)図16は本発明の第
4の実施形態の画像生成装置の構成図である。本実施形
態では、フォアグラウンド画像読み出し処理部16とク
ロマキー領域抽出処理部17とRGBAZ変換処理部1
8’が第2の実施形態(図12)に付加されて構成され
ている。
(Fourth Embodiment) FIG. 16 is a block diagram of an image generating apparatus according to a fourth embodiment of the present invention. In the present embodiment, the foreground image reading processing unit 16, the chroma key area extraction processing unit 17, and the RGBAZ conversion processing unit 1
8'is added to the second embodiment (FIG. 12).

【0063】第4の実施形態は第2の実施形態において
最初にオブジェクトのオブジェクトモデルデータ読み出
し処理前に実行してもよいし、あるオブジェクトのマル
チプレーンバッファ処理終了後次のオブジェクトのオブ
ジェクトモデルデータ読み出し処理開始前の間の任意の
タイミングで行うこともできるし、最後のオブジェクト
のマルチプレーンバッファ処理終了後で出力イメージ作
成処理前でもよい。
The fourth embodiment may be executed before the object model data read processing of the object in the second embodiment, or may be executed after the multi-plane buffer processing of an object is finished and the object model data read of the next object. It may be performed at any timing before the start of the processing, or after the end of the multi-plane buffer processing of the last object and before the output image creation processing.

【0064】フォアグラウンド画像読み出し処理部16
は、ブルーバック等を用いて撮影された画像(以下フォ
アグラウンド画像と書く)を記憶装置11から読み出
す。記憶装置11に格納されている画像ファイルフォー
マットがRGB形式でなければ、ここでまず画像ファイ
ルフォーマットをRGB形式に変換する。変換方法につ
いては一般的なものと同じであるため説明は省略する。
生成しようとしている画像サイズxmax, ymax と同じ
大きさであればそのままRGBAZ変換処理部18’に
渡し、そうでない場合にはxmax, ymax に合わせる処
理をここで行う。その際の処理方法は一般的なものと同
じであるので説明は省略する。
Foreground image read processing unit 16
Reads from the storage device 11 an image captured using a blue background or the like (hereinafter referred to as a foreground image). If the image file format stored in the storage device 11 is not the RGB format, the image file format is first converted to the RGB format here. The conversion method is the same as a general method, and therefore its explanation is omitted.
Image size x max trying to generate, passing the same if the size as it RGBAZ conversion processing unit 18 'and y max, performed here a process to match the x max, y max otherwise. Since the processing method at that time is the same as a general method, the description thereof will be omitted.

【0065】クロマキー領域抽出処理部17は、読み出
されたフォアグラウンド画像からクロマキー領域を抽出
し、A値を算出する。ここで、クロマキー領域抽出処理
部17は、クロマキー領域において0、クロマキー領域
以外の領域において1とし、クロマキー領域に接するク
ロマキー領域以外の領域との境界領域においてなだらか
に変化するA値を算出する。なお、クロマキー領域の抽
出、A値の算出処理については一般的なものと同じであ
るため詳細な説明を省略する。ここで、クロマキー領域
の抽出処理の概要としては、例えば、R,G,B各々に
ついて閾値Rmi n, Rmax, Gmin,Gmax, Bmin
max が利用者から与えられ、フォアグラウンド画像か
らR,G,B各々全てその範囲に含まれる画素をクロマ
キー領域とみなすことによりクロマキー処理をする。
The chroma key area extraction processing section 17 extracts the chroma key area from the read foreground image and calculates the A value. Here, the chroma key area extraction processing unit 17 sets 0 in the chroma key area and 1 in areas other than the chroma key area, and calculates an A value that changes gently in the boundary area with the area other than the chroma key area that is in contact with the chroma key area. Note that the chroma key area extraction and A value calculation processing are the same as general ones, and thus detailed description thereof is omitted. Here, the outline extraction process of the chroma key region, for example, R, G, B For each threshold R mi n, R max, G min, G max, B min,
B max is given by the user, and the chroma key processing is performed by regarding all the R, G, and B pixels included in the range from the foreground image as the chroma key area.

【0066】RGBAZ変換処理部18’は、記憶装置
11から読み出され、フォアグラウンド画像読み出し処
理部16で大きさがxmax, ymax, フォーマットが
RGBフォーマットに変換されたフォアグラウンド画像
が第1の実施形態の説明で述べたZバッファ3に書き込
まれる。このときクロマキー領域抽出処理部17によっ
て抽出されたクロマキー領域内の画素の座標について
(R,G,B,A)=(0,0,0,0)としまたZ値
に無限遠を与え、その他の領域の座標についてはR,
G,B値はそのままで、クロマキー領域抽出処理部17
により算出されたA値および利用者が与えるZ値を図1
1に示す構成のZバッファ3に書き込む。これを図17
に示す。
[0066] RGBAZ conversion processing unit 18 'is read from the storage device 11, the foreground image reading processing unit 16 with a size of x max, y max, format the foreground image converted to RGB format first embodiment It is written in the Z buffer 3 described in the description of the form. At this time, the coordinates of the pixels in the chroma key area extracted by the chroma key area extraction processing unit 17 are set to (R, G, B, A) = (0, 0, 0, 0), and the Z value is set to infinity. For the coordinates of the region of R,
Chroma key area extraction processing unit 17 with G and B values unchanged
Fig. 1 shows the A value calculated by and the Z value given by the user.
The data is written in the Z buffer 3 having the structure shown in FIG. This is shown in FIG.
Shown in.

【0067】終了後デフォーカス処理以降は第1の実施
形態で述べたあるオブジェクトに関する処理と同じ処理
が行われる。
After the defocusing process after the end, the same process as the process for a certain object described in the first embodiment is performed.

【0068】(第5の実施の形態)本発明の第5の実施
形態は、第1の実施形態(図1)に、第3の実施形態
(図14)のフォアグラウンド画像読み出し処理部1
6、クロマキー領域抽出処理部17、RGBZ変換処理
部18を付加したものである。その説明は図1と図14
の説明から容易に類推できるので、省略する。
(Fifth Embodiment) In the fifth embodiment of the present invention, the foreground image read-out processing unit 1 of the third embodiment (FIG. 14) is added to the first embodiment (FIG. 1).
6, a chroma key area extraction processing unit 17, and an RGBZ conversion processing unit 18 are added. The explanation is shown in FIG. 1 and FIG.
Since it can be easily inferred from the description of, the description is omitted.

【0069】(第6の実施の形態)本発明の第6の実施
形態は、第1の実施形態(図1)に、第4の実施形態
(図16)のフォアグラウンド画像読み出し処理部1
6、クロマキー領域抽出処理部17、RGBAZ変換処
理部18’を付加したものである。その説明は図1と図
16の説明から容易に類推できるので、省略する。
(Sixth Embodiment) The sixth embodiment of the present invention is the same as the first embodiment (FIG. 1) except that the foreground image read-out processing unit 1 of the fourth embodiment (FIG. 16) is used.
6, a chroma key area extraction processing unit 17, and an RGBAZ conversion processing unit 18 'are added. The description thereof will be omitted because it can be easily inferred from the description of FIGS. 1 and 16.

【0070】(第7の実施の形態)図18は本発明の第
7の実施形態の画像生成装置の構成図である。図18に
おいて、記憶装置11には、ピントを合わせたその前後
に実用上ピントが合っている範囲である被写界深度を利
用して視点に対する前後関係を表現したいオブジェクト
をオブジェクトモデルデータとし、このオブジェクトモ
デルデータ毎に少なくとも座標変換、陰面処理、デーフ
ォーカス処理をしたデータであって、画素毎にR,G,
B,A,Zの値をする複数のデフォーカスデータが記憶
されている。
(Seventh Embodiment) FIG. 18 is a block diagram of an image generating apparatus according to a seventh embodiment of the present invention. In FIG. 18, in the storage device 11, an object for which a front-back relation with respect to a viewpoint is expressed by using the depth of field, which is a range in which the focus is practically focused before and after the focus, is used as object model data. It is data that has been subjected to at least coordinate conversion, hidden surface processing, and day focus processing for each object model data, and has R, G, and
A plurality of defocus data having values of B, A and Z are stored.

【0071】デフォーカスデータ読み出し処理部31
は、記憶装置11に記憶されているデフォーカスデータ
を順次読み出し、マルチプレーンバッファ処理部7に渡
す。マルチプレンバッファ処理部7は、画素値として
R,G,B,A,Zの値を記憶でき複数プレーンからな
るマルチプレンバッファ8を利用して、渡されたデフォ
ーカスデータを、視点からの距離の近い順にマルチプレ
ーンバッファ8に格納する。
Defocus data read processing unit 31
Sequentially reads the defocus data stored in the storage device 11 and passes it to the multi-plane buffer processing unit 7. The multi-plane buffer processing unit 7 uses a multi-plane buffer 8 that can store R, G, B, A, and Z values as pixel values and that is composed of a plurality of planes, and then passes the defocus data that has been passed to the distance from the viewpoint. The data are stored in the multi-plane buffer 8 in the order close to.

【0072】ディスク書き込み処理部32は、処理対象
となるデフォーカスデータがすべて処理された後、マル
チプレーンバッファ8に記憶されたデータを記憶装置に
書き込む。
The disk write processing unit 32 writes the data stored in the multi-plane buffer 8 in the storage device after all the defocus data to be processed has been processed.

【0073】以上により、複数のデフォーカスデータか
らピントを合わせた距離により手前に存在する大きくぼ
けた物体の像はぼけると同時にエッジから透けて見える
自然な被写界深度をもった画像を高速に生成することが
可能となる。
As described above, an image of a large blurred object existing in front of a plurality of defocus data depending on a focused distance is blurred, and at the same time, an image having a natural depth of field can be seen through an edge at high speed. It becomes possible to generate.

【0074】なお、図18において図1の各部に対応す
る部分には同一の符号を付けている。
In FIG. 18, parts corresponding to those in FIG. 1 are designated by the same reference numerals.

【0075】ここでいう、オブジェクトは、パンフォー
カスにより生成され、Z値として無限遠が与えられた背
景画像を含むものであってもよい。また、オブジェクト
は、自然画像を利用して、画像合成時に使用しない領域
であるクロマキー領域を、利用者から与えられる閾値を
もって抽出し、該抽出されたクロマキー領域に無限遠の
Z値と色情報としてR,G,B各々に0を与え、それ以
外の領域についてはR,G,B値はそのままで、利用者
が与えるZ値を与えたフォアグラウンド画像を含むもの
であってもよい。
The object referred to here may include a background image generated by pan focus and having an infinity as a Z value. Also, the object extracts a chroma key area, which is an area that is not used at the time of image composition, by using a natural image with a threshold value given by the user, and outputs Z value and color information at infinity to the extracted chroma key area. It is also possible to include a foreground image in which 0 is given to each of R, G, and B, R, G, and B values are left unchanged for other regions, and Z values given by the user are given.

【0076】図18において、マルチプレーバッファ処
理部8の動作は、第1の実施の形態で説明した通りであ
る。すなわち、マルチプレーンバッファ8のプレーン数
をnとした場合、デフォーカスデータ上の画素位置
(X,Y)におけるZ値Zd (X,Y)とnプレーン目
のマルチプレーンバッファ8上の対応する画素位置のZ
値Zm (X、Y)#n を比較する。そして、Zd (X,
Y)≦Zm (X、Y)#nであればマルチプレーンバッフ
ァ8の各プレーンの対応する画像のZ値Zm(X、Y)1
からZm(X,Y)#nまで順にZd(X,Y)と比較し、
d(X,Y)<Zm(X,Y)#N を満たすNプレーン
目の対応する画像位置のZ値を見つける。
In FIG. 18, the operation of the multi-play buffer processing section 8 is as described in the first embodiment. That is, when the number of planes of the multi-plane buffer 8 is n, the Z value Z d (X, Y) at the pixel position (X, Y) on the defocus data corresponds to the n-th multi-plane buffer 8. Z of pixel position
The values Z m (X, Y) #n are compared. And Z d (X,
If Y) ≦ Z m (X, Y) #n , Z value Z m (X, Y) 1 of the image corresponding to each plane of the multi-plane buffer 8
From Z m (X, Y) #n to Z d (X, Y),
Find the Z value of the corresponding image position of the N-th plane that satisfies Z d (X, Y) <Z m (X, Y) #N .

【0077】条件を満たすNプレーン目の対応する画像
位置のZ値が見つかった時点でマルチプレーンバッファ
8上のNプレーン以降の対応する画素の画素値を1つづ
つ後のプレーンの対応する画素にシフトし、デフォーカ
スデータの画素値をマルチバッファ8のNプレーン目の
画素値とする。以上により複数のデフォーカスデータ
を、視点からの距離の近い順にマルチプレーンバッファ
8に格納する処理を行う。なお、マルチプレーンバッフ
ァ8は、初期段階で必要最低限のプレーン数を備え、マ
ルチプレーンバッファ処理部7は、複数のデフォーカス
データを視点からの距離の近い順に前記マルチプレーン
バッファに格納する処理を行う際、マルチプレーンバッ
ファ8のプレーンが足りなくなる毎に必要なプレーンを
新たに確保するようにしてもよい。
At the time when the Z value at the corresponding image position of the N-th plane satisfying the condition is found, the pixel values of the corresponding pixels on the N-plane and subsequent planes on the multi-plane buffer 8 are set to the corresponding pixels on the subsequent plane. The pixel value of the defocus data is shifted to be the pixel value of the N-th plane of the multi-buffer 8. As described above, a process of storing a plurality of defocus data in the multi-plane buffer 8 in the order of decreasing distance from the viewpoint is performed. It should be noted that the multi-plane buffer 8 has a minimum required number of planes in the initial stage, and the multi-plane buffer processing unit 7 performs a process of storing a plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint. At the time of execution, a necessary plane may be newly secured every time the number of planes in the multi-plane buffer 8 becomes insufficient.

【0078】また、図18の画像生成装置において、図
1で説明したデフォーカスバッファ6と、デフォーカス
処理部5とをさらに備えるようにしても良い。なお、こ
のとき、記憶装置11には、オブジェクトモデルデータ
に座標変換、陰面処理、シェーディング処理が行われ、
画素値としてR,G,B,Zの値を有するシェーディン
グデータが記憶され、これに対する処理が行われること
になり、マルチプレーンバッファ処理部7は、デフォー
カスバッファ6に格納されたデータをデフォーカスデー
タとして処理することになる。
The image generating apparatus of FIG. 18 may further include the defocus buffer 6 and the defocus processing section 5 described with reference to FIG. At this time, in the storage device 11, coordinate conversion, hidden surface processing, and shading processing are performed on the object model data,
Shading data having R, G, B, and Z values as pixel values is stored, and processing for the shading data is performed. The multi-plane buffer processing unit 7 defocuses the data stored in the defocus buffer 6. It will be processed as data.

【0079】これに加え、さらに、図1で説明した座標
変換および陰面消去処理部2やZバッファ、必要に応じ
てシェーディング・マッピング等処理部を備えても良
い。この時、記憶装置に記憶される処理対象となるデー
タは、第1の実施の形態で説明した通りとなる。
In addition to this, the coordinate conversion and hidden surface removal processing unit 2 and the Z buffer described in FIG. 1 may be further provided, and a shading / mapping processing unit and the like may be provided if necessary. At this time, the data to be processed stored in the storage device is as described in the first embodiment.

【0080】また、図18の記画像生成装置は、さら
に、第2の実施の形態から第6の実施形態で説明した背
景画像やフォアグランド画像を処理するための処理部を
さらに備えるものであっても良い。
The image forming apparatus shown in FIG. 18 further includes a processing section for processing the background image and the foreground image described in the second to sixth embodiments. May be.

【0081】(第8の実施の形態)図19は本発明の第
8の実施形態の画像生成装置の構成図である。本実施形
態では、図18と比較し、本実施形態の画像生成装置
は、出力イメージ作成処理部9が付加され、図18のデ
ィスク書き込み処理部32が第1の実施形態で説明した
ディスク書き込み処理部10となっている点が異なる。
ここで、図19において図18の各部に対応する部分に
は同一の符号を付け、その説明を省略する。なお、出力
イメージ作成処理部9、ディスク書き込み処理部10の
動作は、第1の実施形態で説明した通りであり、その説
明を省略する。以上により、複数のデフォーカスデータ
からピントを合わせた距離により手前に存在する大きく
ぼけた物体の像はぼけると同時にエッジから透けて見え
る自然な被写界深度をもった画像を高速に生成すること
が可能となる。
(Eighth Embodiment) FIG. 19 is a block diagram of an image generating apparatus according to an eighth embodiment of the present invention. In the present embodiment, as compared with FIG. 18, the image generation apparatus of the present embodiment is provided with an output image creation processing unit 9, and the disc writing processing unit 32 of FIG. 18 is the disc writing processing described in the first embodiment. Part 10 is different.
Here, in FIG. 19, parts corresponding to the respective parts of FIG. 18 are designated by the same reference numerals, and description thereof will be omitted. The operations of the output image creation processing unit 9 and the disk writing processing unit 10 are the same as those described in the first embodiment, and the description thereof is omitted. From the above, it is possible to rapidly generate an image with a natural depth of field that is visible from the edge while blurring the image of a large blurred object that exists in the foreground depending on the focused distance from multiple defocus data. Is possible.

【0082】(第9の実施の形態)図20は本発明の第
9の実施形態の画像生成装置の構成図である。図20の
画像生成装置において、記憶装置11には、デフォーカ
ス処理の対象のモデルデータに対し座標変換、陰面処
理、シェーディング処理が行われ、画素値としてR,
G,B,Zの値を有するシェーディングデータが記憶さ
れている。そして、シェーディングデータ読み出し処理
部41は、記憶装置11から処理対象のシェーディング
データを読み出し、デフォーカス処理部5に引き渡す。
デフォーカス処理部5は、引き渡されたシェーディング
データから、実際のカメラと同じレンズの焦点距離と絞
り値および被写体との距離からなる関数にしたがってピ
ントを外したデフォーカス像をデフォーカスバッファ6
を利用して生成する。ディスク書き込み処理部42は、
デフォーカスバッファ6上に生成されたデフォーカス画
像を記憶装置11に書き込み。以上により、デフォーカ
スされた画像を生成することができる。なお、図18に
おいて図1の各部に対応する部分には同一の符号を付け
ている。
(Ninth Embodiment) FIG. 20 is a block diagram of an image generating apparatus according to a ninth embodiment of the present invention. In the image generating apparatus of FIG. 20, the storage device 11 performs coordinate conversion, hidden surface processing, and shading processing on the model data to be defocused, and outputs R, P as pixel values.
Shading data having G, B, and Z values is stored. Then, the shading data read processing unit 41 reads the shading data to be processed from the storage device 11 and delivers it to the defocus processing unit 5.
The defocus processing unit 5 defocuses the defocused image from the passed shading data according to a function consisting of the same focal length and aperture value of the lens of the camera and the distance to the subject.
Generate using. The disk writing processing unit 42
The defocus image generated in the defocus buffer 6 is written in the storage device 11. As described above, a defocused image can be generated. Note that, in FIG. 18, portions corresponding to the respective portions in FIG. 1 are designated by the same reference numerals.

【0083】デフォーカス処理部6は、第1の実施の形
態で説明した通りであるが、その動作を再度説明すると
以下のようになる。引き渡されたシェーディングデータ
をスキャンする。そして、点光源をぼかしたときの該点
光源像の直径Φを計算する。求めた直径の円内における
点光源像の強度比を求め、直径Φの円内における強度比
の和が1.0になるように強度比係数Mを求める。そし
て、強度比係数Mを利用して直径Φの円内におけるR,
G,Bの値,アルファ値Aの値を求めてデフォーカスバ
ッファ6に保存されている値に加える。このとき、デフ
ォーカスバッファ6上の前記直径Φの円内画素位置
(a,b)におけるZ値とシェーディングデータ上の同
じ画素位置(X,Y)におけるZ値を比べ、前記、シェ
ーディングデータのZ値の方が小さければシェーディン
グデータ上の画素位置(X,Y)におけるZ値をデフォ
ーカスバッファ6上の直径Φの円内画素位置(a,b)
におけるZ値に移す。以上により、デフォーカス画像の
生成を行う。なお、デフォーカス処理部5は、直径Φの
円内における点光源像の強度比を、コサインを用いた近
似計算により求めることで、高速演算が可能となる。
The defocus processing unit 6 is as described in the first embodiment, but its operation will be described below again. Scan the passed shading data. Then, the diameter Φ of the point light source image when the point light source is blurred is calculated. The intensity ratio of the point light source image in the circle of the obtained diameter is obtained, and the intensity ratio coefficient M is obtained so that the sum of the intensity ratios in the circle of the diameter Φ becomes 1.0. Then, using the intensity ratio coefficient M, R in the circle of diameter Φ,
The G and B values and the alpha value A are calculated and added to the values stored in the defocus buffer 6. At this time, the Z value at the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer 6 and the Z value at the same pixel position (X, Y) on the shading data are compared, and the Z value of the shading data is compared. If the value is smaller, the Z value at the pixel position (X, Y) on the shading data is set to the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer 6.
To the Z value at. As described above, the defocus image is generated. Note that the defocus processing unit 5 can perform high-speed calculation by obtaining the intensity ratio of the point light source image within the circle of diameter Φ by approximate calculation using the cosine.

【0084】(第10の実施の形態)図21は本発明の
第10の実施形態の画像生成装置の構成図である。本実
施形態では、図20と比較し、本実施形態の画像生成装
置は、座標変換および陰面消去処理部2、Zバッファ
3、および必要に応じてシェーディング・マッピング等
処理部4が付加されている点が異なる。ここで、図21
において図20の各部に対応する部分には同一の符号を
付け、その説明を省略する。なお、モデルデータ読み出
し処理部43は、図1のオブジェクトモデルデータ読み
出し処理部1に対応する。なお、座標変換および陰面消
去処理部2、Zバッファ3、シェーディング・マッピン
グ等処理部4については、第1の実施形態で説明した通
りであり、その説明を省略する。
(Tenth Embodiment) FIG. 21 is a block diagram of an image generating apparatus according to a tenth embodiment of the present invention. In this embodiment, as compared with FIG. 20, the image generation apparatus of this embodiment additionally includes a coordinate conversion and hidden surface removal processing unit 2, a Z buffer 3, and a shading / mapping processing unit 4 as necessary. The points are different. Here, FIG.
In FIG. 20, parts corresponding to the respective parts in FIG. 20 are designated by the same reference numerals, and the description thereof will be omitted. The model data read processing unit 43 corresponds to the object model data read processing unit 1 in FIG. The coordinate conversion / hidden surface removal processing unit 2, the Z buffer 3, and the shading / mapping processing unit 4 are the same as those described in the first embodiment, and a description thereof will be omitted.

【0085】なお、第1〜第10の実施の形態で説明し
た画像生成装置により生成された画像は、記憶装置11
に納められるものとして説明したがこれに限定されるも
のではない。例えば、順次表示装置に表示されるもので
あっても良い。また、第1〜第10の実施の形態で説明
した各処理部の機能は、専用のハードウェアによりその
機能が実現されるものであっても、プログラムとして提
供され画像生成装置内の図示しないメモリを利用しCP
U(中央演算装置)により実行されることにより、その
機能が実現されるものであってもよい。
The image generated by the image generating apparatus described in the first to tenth embodiments is stored in the storage device 11
However, the present invention is not limited to this. For example, it may be sequentially displayed on the display device. Further, the functions of the respective processing units described in the first to tenth embodiments are provided as programs even if the functions are realized by dedicated hardware, and are provided as a memory in the image generating apparatus (not shown). Use CP
The function may be realized by being executed by U (central processing unit).

【0086】なお、図1、図7、図10、図12、図1
4、図16、図18、図19、図20、図21に示した
手順はプログラムで実行され、該プログラムはフロッピ
ーディスク、CDROM、ROMテープなどのコンピュ
ータ読み取り可能な記録媒体に記録されて提供され、コ
ンピュータシステムは該プログラムを実行し、画面を生
成する。なお、ここでいう「コンピュータシステム」と
は、OSや周辺機器等のハードウェアを含むものとす
る。また、「コンピュータ読み取り可能な記録媒体」と
は、上述したフロッピーディスク、CD−ROM等の可
般媒体のほか、コンピュータシステムに内蔵されるハー
ドディスク等の記憶装置も含むものとする。さらに「コ
ンピュータ読み取り可能な記録媒体」とは、インターネ
ット等のネットワークや電話回線等の通信回線を介して
プログラムを送信する場合の通信線のように、短時間の
間、動的にプログラムを保持するもの、その場合のサー
バやクライアントとなるコンピュータシステム内部の揮
発性メモリのように、一定時間プログラムを保持してい
るものも含むものとする。また上記プログラムは、前述
した機能の一部を実現するためのものであっても良く、
さらに前述した機能をコンピュータシステムにすでに記
録されているプログラムとの組み合わせて実現できるも
のであっても良い。
Incidentally, FIG. 1, FIG. 7, FIG. 10, FIG.
The procedure shown in FIG. 4, FIG. 16, FIG. 18, FIG. 19, FIG. 20, and FIG. 21 is executed by a program, and the program is provided by being recorded in a computer-readable recording medium such as a floppy disk, a CDROM, a ROM tape. The computer system executes the program and generates a screen. The “computer system” mentioned here includes an OS and hardware such as peripheral devices. Further, the "computer-readable recording medium" includes not only the above-mentioned portable medium such as a floppy disk and a CD-ROM but also a storage device such as a hard disk built in a computer system. Further, the "computer-readable recording medium" means to hold a program dynamically for a short time like a communication line when transmitting the program through a network such as the Internet or a communication line such as a telephone line. In this case, a volatile memory inside a computer system that serves as a server or a client in that case holds a program for a certain period of time. Further, the program may be for realizing a part of the functions described above,
Further, the functions described above may be realized by combining with the program already recorded in the computer system.

【0087】以上説明したように、本発明は、実際のカ
メラと同じやり方により実写と同様の自然な被写界深度
を持った画像を高速に生成することができ、また透明/
半透明のオブジェクトも扱える。また、実写等予め別に
生成された画像を被写界深度上自然に背景として合成し
利用でき、また透明/半透明のオブジェクトも扱える。
また、A値も与えることによりブルーバック等で撮影さ
れた人物画像等の自然画像を被写界深度上自然に合成で
き、また透明/半透明のオブジェクトも扱える。
As described above, according to the present invention, an image having a natural depth of field similar to that of a real image can be generated at high speed by the same method as that of an actual camera, and the transparency /
It can handle translucent objects. Further, an image generated separately in advance such as a real shot can be naturally combined and used as a background in the depth of field, and a transparent / translucent object can also be handled.
Also, by giving an A value, a natural image such as a person image taken in a blue background or the like can be naturally combined in the depth of field, and a transparent / semi-transparent object can be handled.

【0088】[0088]

【発明の効果】以上説明したように、本発明による画像
生成装置および方法およびそのプログラムを記録した記
録媒体によれば、下記の効果を得ることができる。画素
値としてR,G,B,A,Zの値を記憶でき複数プレー
ンからなるマルチプレンバッファを利用し、ブジェ
クトモデルデータ毎に少なくとも座標変換、陰面処理、
デフォーカス処理をし複数のデフォーカスデータを、視
点からの距離の近い順にマルチプレーンバッファに格納
している。これにより、複数のデフォーカスデータから
ピントを合わせた距離により手前に存在する大きくぼけ
た物体の像はぼけると同時にエッジから透けて見えるよ
うになり、自然な被写界深度をもった画像を高速に生成
することが可能となる。また、デフォーカス処理の対象
のモデルデータに対し座標変換、陰面処理が行われたシ
ェーディングデータから、実際のカメラと同じレンズの
焦点距離と絞り値および被写体との距離からなる関数に
したがってピントを外したデフォーカス像をデフォーカ
スバッファを利用して生成している。これにより、実際
のカメラと同じ指定の仕方(レンズの焦点距離、F値、
ピントを合わる距離)により実写と同様の自然な被写
界深度をもった画像を、実際のカメラと同じ指定の仕方
で制御することができるよになる。
As described above, according to the image generating apparatus and method and the recording medium recording the program thereof according to the present invention, the following effects can be obtained. R as the pixel <br/> value, G, B, A, utilizing Maruchipure over Nbaffa comprising a plurality planes can store the values of Z, at least the coordinate transformation for each O Buje <br/> transfected model data, hidden surface processing,
A plurality of defocus data def Okasu process, are stored in the multi-plane buffer sequentially close in distance from the viewpoint. As a result, the image of a large blurred object existing in the foreground is blurred at the same time as it is seen through the edge depending on the focus distance from multiple defocus data, and images with a natural depth of field can be displayed at high speed. Can be generated. Also, from the shading data that has been subjected to coordinate conversion and hidden surface processing on the model data to be defocused, the focus is defocused according to the same function as the focal length of the actual camera, the aperture value, and the distance to the subject. The defocused image is generated using the defocus buffer. As a result, the same designation method (focal length of lens, F value,
An image with a natural depth of field similar to the photographed by distance) of Ru focus the subject, the earthenware pots by can be controlled by the same specified manner the actual camera.

【図面の簡単な説明】[Brief description of drawings]

【図1】 本発明の第1の実施形態の画像生成装置の構
成図である。
FIG. 1 is a configuration diagram of an image generation apparatus according to a first embodiment of the present invention.

【図2】 オブジェクトの概念を示す図である。FIG. 2 is a diagram showing a concept of an object.

【図3】 Zバッファ3のフォーマットおよび初期値を
示す図である。
FIG. 3 is a diagram showing a format and initial values of a Z buffer 3.

【図4】 デフォーカスバッファ6のフォーマットおよ
び初期値を示す図である。
FIG. 4 is a diagram showing a format and initial values of a defocus buffer 6.

【図5】 幾何光学によるデフォーカス処理の説明図で
ある。
FIG. 5 is an explanatory diagram of defocus processing by geometrical optics.

【図6】 波動光学によるデフォーカス処理の関数形を
示す図である。
FIG. 6 is a diagram showing a functional form of defocus processing by wave optics.

【図7】 デフォーカス処理部5の処理を示す流れ図で
ある。
FIG. 7 is a flowchart showing the processing of the defocus processing unit 5.

【図8】 マルチプレーンバッファ8のフォーマットお
よび初期値を示す図である。
FIG. 8 is a diagram showing a format and an initial value of a multi-plane buffer 8.

【図9】 マルチプレーンバッファ処理の概念を示す図
である。
FIG. 9 is a diagram showing the concept of multi-plane buffer processing.

【図10】 マルチプレーンバッファ処理部7の処理を
示す流れ図である。
FIG. 10 is a flowchart showing the processing of the multi-plane buffer processing unit 7.

【図11】 Zバッファ3からR,G,B,A,Zの値
を読み込み、デフォーカス画像を生成する場合のZバッ
ファ3のフォーマットと初期値を示す図である。
FIG. 11 is a diagram showing a format and initial values of the Z buffer 3 when reading R, G, B, A, and Z values from the Z buffer 3 to generate a defocused image.

【図12】 本発明の第2の実施形態の画像生成装置の
構成図である。
FIG. 12 is a configuration diagram of an image generation apparatus according to a second embodiment of the present invention.

【図13】 図11における背景画像用バッファ15の
フォーマットおよび初期値を示す図である。
13 is a diagram showing the format and initial values of the background image buffer 15 in FIG.

【図14】 本発明の第3の実施形態の画像生成装置の
構成図である。
FIG. 14 is a configuration diagram of an image generation apparatus according to a third embodiment of the present invention.

【図15】 第3の実施形態におけるクロマキー領域抽
出処理とRGBZ変換処理の概要を示す図である。
FIG. 15 is a diagram illustrating an outline of chroma key area extraction processing and RGBZ conversion processing according to the third embodiment.

【図16】 本発明の第4の実施形態の画像形成装置の
構成図である。
FIG. 16 is a configuration diagram of an image forming apparatus according to a fourth embodiment of the present invention.

【図17】 第4の実施形態におけるクロマキー領域抽
出処理とRGBAZ変換処理の概要を示す図である。
FIG. 17 is a diagram showing an outline of chroma key region extraction processing and RGBAZ conversion processing according to the fourth embodiment.

【図18】 本発明の第7の実施形態の画像生成装置の
構成図である。
FIG. 18 is a configuration diagram of an image generation apparatus according to a seventh embodiment of the present invention.

【図19】 本発明の第8の実施形態の画像生成装置の
構成図である。
FIG. 19 is a configuration diagram of an image generation apparatus according to an eighth embodiment of the present invention.

【図20】 本発明の第9の実施形態の画像生成装置の
構成図である。
FIG. 20 is a configuration diagram of an image generation apparatus according to a ninth embodiment of the present invention.

【図21】 本発明の第10の実施形態の画像生成装置
の構成図である。
FIG. 21 is a configuration diagram of an image generation apparatus according to a tenth embodiment of the present invention.

【符号の説明】[Explanation of symbols]

1 オブジェクトモデルデータ読み出し処理部 2 座標変換および陰面消去処理部 3 Zバッファ 4 シェーディング・マッピング等処理部 5 デフォーカス処理部 6 デフォーカスバッファ 7 マルチプレーンバッファ処理部 8 マルチプレーンバッファ 9 出力イメージ作成処理部 10 ディスク書き込み処理部 11 記憶装置 12 背景画像読み出し処理部 13 RGBZ変換処理部 14 スイッチ 15 背景画像用バッファ 16 フォアグラウンド画像読み出し処理部 17 クロマキー領域抽出処理部 18 RGBZ変換処理部 18’ RGBAZ変換処理部 31 デフォーカスデータ読み出し処理部 32、42 ディスク書き込み処理部 41 シェーディングデータ読み出し処理部 43 モデルデータ読み出し処理部 21〜27,31〜38 ステップ 1 Object model data read processing unit 2 Coordinate conversion and hidden surface removal processing section 3 Z buffer 4 Shading / mapping processing section 5 Defocus processing section 6 defocus buffer 7 Multi-plane buffer processing unit 8 multi-plane buffer 9 Output image creation processing unit 10 Disc writing processor 11 Storage device 12 Background image read processing unit 13 RGBZ conversion processing unit 14 switch 15 Background image buffer 16 Foreground image readout processor 17 Chromakey region extraction processing unit 18 RGBZ conversion processing unit 18 'RGBAZ conversion processing unit 31 Defocus data read processing unit 32, 42 Disc write processing unit 41 Shading data read processing unit 43 Model data read processing unit 21-27, 31-38 steps

フロントページの続き (56)参考文献 特開 昭63−259778(JP,A) 特開 平8−202869(JP,A) 特開 平6−231273(JP,A) 特開 平6−119462(JP,A) 特開 平6−89090(JP,A) 特開 平6−83977(JP,A) 特開 平6−83955(JP,A) 特開 平4−372079(JP,A) 特開 平4−367083(JP,A) 特開 平4−362794(JP,A) 特表 平9−507935(JP,A) 浅田尚紀ほか,逆投影ぼけモデルを用 いた遮へいエッジの光学的性質の解析, 電子情報通信学会論文誌,日本,電子情 報通信学会,1995年 2月25日,Vo l.J78−DII No.2,p.248 −262 (58)調査した分野(Int.Cl.7,DB名) G06T 15/40 200 G06T 15/00 100 JICSTファイル(JOIS)Continuation of the front page (56) Reference JP-A 63-259778 (JP, A) JP-A 8-202869 (JP, A) JP-A 6-231273 (JP, A) JP-A 6-119462 (JP , A) JP 6-89090 (JP, A) JP 6-83977 (JP, A) JP 6-83955 (JP, A) JP 4-372079 (JP, A) JP 4-367083 (JP, A) Japanese Patent Laid-Open No. 4-362794 (JP, A) Special Table 9-507935 (JP, A) Naoki Asada et al., Analysis of optical properties of shield edge using back projection blur model, The Institute of Electronics, Information and Communication Engineers, Japan, The Institute of Electronics, Information and Communication Engineers, February 25, 1995, Vol. J78-DII No. 2, p. 248-262 (58) Fields surveyed (Int.Cl. 7 , DB name) G06T 15/40 200 G06T 15/00 100 JISST file (JOIS)

Claims (42)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ピントを合わせたその前後に実用上ピン
トが合っている範囲である被写界深度を利用して視点に
対する前後関係を表現したい複数のオブジェクトをそれ
ぞれオブジェクトモデルデータとし、一つのオブジェク
トモデルデータの画素毎に少なくとも座標変換、オブジ
ェクト自身の陰面処理、デフォーカス処理を施したデフ
ォーカスデータを複数入力して画像を生成する画像生成
装置であって、 画素値としてR,G,B,A,Zの値を記憶でき複数プ
レーンからなるマルチプレンバッファと、 画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを、画素毎に視点からの距離の近い順にな
るように並べ替えて前記マルチプレーンバッファに格納
するマルチプレーンバッファ処理部と、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理部による処理が終了した後、前記マルチプ
レーンバッファの各プレーンの内容を合成して目的とす
る画像を生成し、出力する出力イメージ作成処理部とを
備えたことを特徴とする画像生成装置。
1. A plurality of objects, each of which is intended to represent a front-back relationship with respect to a viewpoint by utilizing a depth of field, which is a range in which the focus is practically focused before and after the focus, are used as object model data. An image generating apparatus for generating an image by inputting a plurality of defocus data that has undergone at least coordinate conversion, hidden surface processing of an object itself, and defocus processing for each pixel of model data, and has R, G, B, and A multi-plane buffer that can store A and Z values and consists of multiple planes, and multiple defocus data that has R, G, B, A, and Z values for each pixel, in order of decreasing distance from the viewpoint for each pixel. The multi-plane buffer processing unit that rearranges the data so that it is stored in the multi-plane buffer, and all the defocus data. After the processing by the multi-plane buffer processing unit is finished, the contents of the planes of the multi-plane buffer are combined to generate a target image, and an output image creation processing unit is provided. Image generating device.
【請求項2】 ピントを合わせたその前後に実用上ピン
トが合っている範囲である被写界深度を利用して視点に
対する前後関係を表現したい複数のオブジェクトをそれ
ぞれオブジェクトモデルデータとし、この複数のオブジ
ェクトモデルデータを入力して画像を生成する画像生成
装置であって、 画素値としてR,G,B,A,Zの値を記憶できるデフ
ォーカスバッファと、画素値としてR,G,B,A,Z
の値を記憶でき複数プレーンからなるマルチプレンバッ
ファと、 一つのオブジェクトモデルデータの画素毎に座標変換、
オブジェクト自身の陰面処理、シェーディング処理が行
われ、画素値としてR,G,B,Zの値を有するシェー
ディングデータから、実際のカメラと同じレンズの焦点
距離と絞り値および被写体との距離からなる関数にした
がってピントを外したデフォーカス像を表現するための
画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを生成し、前記デフォーカスバッファに格
納するデフォーカス処理部と、 前記デフォーカスバッファから前記デフォーカスデータ
を読み出して、画素毎に視点からの距離の近い順になる
ように並べ替えながら前記マルチプレーンバッファに格
納するマルチプレーンバッファ処理部と、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理部による処理が終了した後、前記マルチプ
レーンバッファの各プレーンの内容を合成して目的とす
る画像を生成し、出力する出力イメージ作成処理部とを
備えたことを特徴とする画像生成装置。
2. A plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by using the depth of field, which is a range in which the focus is practically in focus before and after the focus, are used as object model data. An image generation device for inputting object model data to generate an image, comprising a defocus buffer capable of storing R, G, B, A, and Z values as pixel values, and R, G, B, and A as pixel values. , Z
The multi-plane buffer consisting of multiple planes that can store the value of and the coordinate conversion for each pixel of one object model data,
The hidden surface processing and shading processing of the object itself are performed, and from the shading data having the R, G, B, and Z values as pixel values, the function consisting of the same focal length of the lens as the actual camera, the aperture value, and the distance to the object. A defocus processing unit that generates a plurality of defocus data having R, G, B, A, and Z values for each pixel for expressing a defocused image in accordance with the above, and stores the defocus data in the defocus buffer. And a multi-plane buffer processing unit that reads the defocus data from the defocus buffer and stores the defocus data in the multiplane buffer while rearranging the pixels so that the distance from the viewpoint is closer to each pixel , and all the defocus data. After the processing by the multi-plane buffer processing unit is completed, The contents of each plane of lane buffers synthesized to generate the image of interest, the image generating apparatus being characterized in that an output image creation processing unit for outputting.
【請求項3】 前記マルチプレーンバッファ処理部は、 前記マルチプレーンバッファのプレーン数をnとした場
合、デフォーカスデータ上の画素位置(X,Y)におけ
るZ値Z(X,Y)とnプレーン目のマルチプレーン
バッファ上の対応する画素位置のZ値Z(X、Y)
#nを比較し、前者の方が小さければ前記マルチプレー
ンバッファの各プレーンの対応する画像のZ値Z
(X、Y)#1からZ(X,Y)#nまで順にZ
(X,Y)と比較し、Z(X,Y)<Z(X,Y)
#Nを満たすNプレーン目の対応する画像位置のZ値が
見つかった時点でマルチプレーンバッファ上のNプレー
ン以降の対応する画素の画素値を1つずつ後のプレーン
の対応する画素にシフトし、前記デフォーカスデータの
画素値を前記マルチプレーンバッファのNプレーン目の
画素値とすることで、前記複数のデフォーカスデータ
を、視点からの距離の近い順に前記マルチプレーンバッ
ファに格納する処理を行うことを特徴とする請求項1ま
たは2に記載の画像生成装置。
3. The multi-plane buffer processing unit, where n is the number of planes of the multi-plane buffer, Z value Z d (X, Y) and n at a pixel position (X, Y) on defocus data. Z value Z m (X, Y) of the corresponding pixel position on the multi-plane buffer of the plane
#N is compared, and if the former is smaller, the Z value Z of the image corresponding to each plane of the multi-plane buffer
Z d from m (X, Y) # 1 to Z m (X, Y) #n
Compared with (X, Y), Z d (X, Y) <Z m (X, Y)
When the Z value of the corresponding image position of the N-th plane that satisfies #N is found, the pixel values of the corresponding pixels on the N-plane and later on the multi-plane buffer are shifted one by one to the corresponding pixels on the subsequent plane, The pixel value of the defocus data is set to the pixel value of the N-th plane of the multi-plane buffer, thereby performing a process of storing the plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint. The image generation apparatus according to claim 1, wherein
【請求項4】 前記マルチプレーンバッファは、初期段
階で必要最低限数のプレーンを備え、 前記マルチプレーンバッファ処理部は、 前記複数のデフォーカスデータを視点からの距離の近い
順に前記マルチプレーンバッファに格納する処理を行う
際、前記マルチプレーンバッファのプレーンが足りなく
なる毎に必要なプレーンを新たに確保することを特徴と
する請求項1または2に記載の画像生成装置。
4. The multi-plane buffer includes a minimum number of planes required in an initial stage, and the multi-plane buffer processing unit stores the plurality of defocus data in the multi-plane buffer in ascending order of distance from a viewpoint. 3. The image generation apparatus according to claim 1, wherein a necessary plane is newly secured every time the plane of the multi-plane buffer runs out when the storing process is performed.
【請求項5】 前記関数は、パラメータとしてAを含む
ことを特徴とする請求項に記載の画像生成装置。
5. The image generating apparatus according to claim 2 , wherein the function includes A as a parameter.
【請求項6】 前記デフォーカス処理部は、 前記シェーディングデータをスキャンし、 点光源をぼかしたときの該点光源像の直径Φを計算し、 該直径の円内における点光源像の強度比を求め、 該直径の円内における強度比の和が1.0になるように
強度比係数Mを求め、 前記強度比係数Mを利用して前記直径Φの円内における
R,G,Bの値,アルファ値Aの値を求めて前記デフォ
ーカスバッファに保存されている値に加え、 前記デフォーカスバッファ上の前記直径Φの円内画素位
置(a,b)におけるZ値と前記シェーディングデータ
の同じ画素位置(X,Y)におけるZ値を比べ、該シェ
ーディングデータのZ値の方が小さければ前記シェーデ
ィングデータの画素位置(X,Y)におけるZ値を前記
デフォーカスバッファ上の前記直径Φの円内画素位置
(a,b)におけるZ値に移すことによりデフォーカス
データの生成を行うことを特徴とする請求項に記載の
画像生成装置。
6. The defocus processing unit scans the shading data, calculates a diameter Φ of the point light source image when the point light source is blurred, and calculates an intensity ratio of the point light source image within a circle of the diameter. The strength ratio coefficient M is calculated so that the sum of the strength ratios in the circle of the diameter becomes 1.0, and the values of R, G, B in the circle of the diameter Φ are utilized by using the strength ratio coefficient M. , The value of the alpha value A is added to the value stored in the defocus buffer, and the Z value at the pixel position (a, b) in the circle of the diameter Φ on the defocus buffer is equal to the shading data. The Z values at the pixel position (X, Y) are compared, and if the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is set to the diameter Φ on the defocus buffer. Defocus by moving the Z value in the circle within the pixel position (a, b)
The image generating apparatus according to claim 2, characterized in that for generating the data.
【請求項7】 前記デフォーカス処理部は、 前記直径の円内における点光源像の強度比を、コサイン
を用いた近似計算により求めることを特徴とする請求項
6記載の画像生成装置。
7. The image generation apparatus according to claim 6, wherein the defocus processing unit obtains the intensity ratio of the point light source image within the circle of the diameter by approximate calculation using cosine.
【請求項8】 前記画像生成装置は、 画素値としてR,G,B,Zの値を記憶できるZバッフ
ァと、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を前記Zバッファに格納
する座標変換および陰面消去処理部とをさらに備え、 前記デフォーカス処理部は、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項に記
載の画像生成装置。
8. The image generating device comprises a Z buffer capable of storing R, G, B, and Z values as pixel values, coordinate conversion into the object model data, hidden surface processing,
It further comprises a coordinate conversion and hidden surface removal processing unit that performs shading processing and stores the result in the Z buffer, and the defocus processing unit processes the data stored in the Z buffer as the shading data. The image generation apparatus according to claim 2 .
【請求項9】 前記画像生成装置は、 画素値としてR,G,B,A,Zの値を記憶できるZバ
ッファと、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を前記Zバッファに格納
する座標変換および陰面消去処理部とをさらに備え、 前記デフォーカス処理部は、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項に記
載の画像生成装置。
9. The image generating device includes a Z buffer capable of storing R, G, B, A, and Z values as pixel values, coordinate conversion into the object model data, hidden surface processing,
It further comprises a coordinate conversion and hidden surface removal processing unit that performs shading processing and stores the result in the Z buffer, and the defocus processing unit processes the data stored in the Z buffer as the shading data. The image generation apparatus according to claim 2 .
【請求項10】 前記オブジェクトは、 パンフォーカスにより生成され、Z値として無限遠が与
えられた背景画像を含むことを特徴とする請求項1また
は2に記載の画像生成装置。
Wherein said object is generated by the pan-focus, also claim 1, characterized in that it comprises a background image infinity is given as Z value
Is an image generating apparatus described in 2 .
【請求項11】 前記オブジェクトは、 自然画像を利用して、画像合成時に使用しない領域であ
るクロマキー領域を、利用者から与えられる閾値をもっ
て抽出し、該抽出されたクロマキー領域に無限遠のZ値
と色情報としてR,G,B各々に0を与え、それ以外の
領域についてはR,G,B値はそのままで、利用者が与
えるZ値を与えたフォアグラウンド画像を含むことを特
徴とする請求項1または2に記載の画像生成装置。
11. The object extracts a chroma key area, which is an area not used during image composition, with a threshold value given by a user, using a natural image, and extracts an infinite Z value in the extracted chroma key area. And 0 is given to each of R, G, and B as color information, and the R, G, and B values remain unchanged for other regions, and a foreground image given a Z value given by the user is included. The image generation device according to item 1 or 2 .
【請求項12】 前記画像生成装置は、 画素値としてR,G,B,Zの値を記憶できる背景画像
用バッファと、 背景画像を、Z値として無限遠を与えることによりRG
BZ変換処理し、前記背景画像がオブジェクトと同じ撮
影パラメータで生成されている場合、前記RGBZ変換
処理の結果を前記背景画像用バッファに書き込み、前記
背景画像がパンフォーカスにより生成されている場合、
前記RGBZ変換処理の結果を前記Zバッファに書き込
みその後前記デフォーカス処理部によりデフォーカス処
理されたデータを前記背景画像用バッファに書き込む処
理部と、 をさらに備え、 前記出力イメージ作成処理部は、 前記背景画像用バッファと前記マルチプレーンバッファ
の値を読み込み、イメージを生成し、出力することを特
徴とする請求項8または9に記載の画像生成装置。
12. The image generation apparatus comprises a background image buffer capable of storing R, G, B, and Z values as pixel values, and an infinite distance as a Z value for the background image.
When the BZ conversion processing is performed and the background image is generated with the same shooting parameter as the object, the result of the RGBZ conversion processing is written in the background image buffer, and when the background image is generated by pan focus,
The output image creation processing unit further includes: a processing unit that writes the result of the RGBZ conversion processing to the Z buffer, and then writes the data that has been defocused by the defocus processing unit, to the background image buffer. The image generation apparatus according to claim 8 or 9, wherein the values of the background image buffer and the multi-plane buffer are read to generate an image, and the image is output.
【請求項13】 前記画像生成装置は、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
するクロマキー領域処理部と、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B各々に0を与え、それ以外の領域について
はR,G,B値はそのままで、利用者が与えるZ値を与
え、前記Zバッファに書き送むRGBZ変換処理部とを
さらに備えたことを特徴とする請求項8に記載の画像生
成装置。
13. The image generation device includes a chroma key area processing unit that extracts a chroma key area, which is an area that is not used during composition using a natural image, with a threshold value provided by a user, and an infinite number of extracted chroma key areas. 0 is given to each of R, G, and B as the far Z value and color information, and the R, G, and B values are left unchanged for the other areas, and the Z value given by the user is given and written to the Z buffer. The image generation apparatus according to claim 8, further comprising an RGBZ conversion processing unit.
【請求項14】 前記画像生成装置は、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
し、該抽出した領域と接する他の領域との境界領域にお
いてなだらかに変化するAを算出するクロマキー領域処
理部と、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B,A各々に0を与え、それ以外の領域につ
いてはR,G,Bはそのままで、前記算出されたA値
と、利用者が指定したZ値を与え、前記Zバッファに書
き込むRGBAZ変換処理部とをさらに備えたことを特
徴とする請求項9に記載の画像生成装置。
14. The image generation apparatus extracts a chroma key area, which is an area not used at the time of composition, using a natural image, with a threshold value given by a user, and a boundary between the extracted area and another area in contact with the extracted area. Chroma key region processing unit that calculates A that changes gently in the region, and Z value at infinity to the extracted chroma key region and 0 is given to each of R, G, B, A as color information, and for other regions 10. An R, G, B value as it is, further comprising an RGBAZ conversion processing unit for giving the calculated A value and a Z value specified by a user and writing the Z value in the Z buffer. The image generation device according to 1.
【請求項15】 ピントを合わせたその前後に実用上ピ
ントが合っている範囲である被写界深度を利用して視点
に対する前後関係を表現したい複数のオブジェクトをそ
れぞれオブジェクトモデルデータとし、一つのオブジェ
クトモデルデータの画素毎に少なくとも座標変換、オブ
ジェクト自身の陰面処理、デフォーカス処理を施したデ
フォーカスデータを複数入力して画像を生成する画像生
成方法であって、 画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを、画素毎に視点からの距離の近い順にな
るように並べ替えて画素値としてR,G,B,A,Zの
値を記憶でき複数プレーンからなるマルチプレンバッフ
ァに格納するマルチプレーンバッファ処理ステップと、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理ステップによる処理が終了した後、前記マ
ルチプレーンバッファの各プレーンの内容を合成して目
的とする画像を生成し、出力する出力イメージ作成処理
ステップとを含むことを特徴とする画像生成方法。
15. A plurality of objects, each of which is desired to represent a front-back relationship with respect to a viewpoint by using a depth of field, which is a range in which the focus is practically in focus before and after the focus, are set as object model data, and one object is used. An image generation method for generating an image by inputting a plurality of defocus data subjected to at least coordinate conversion, hidden surface processing of an object itself, and defocus processing for each pixel of model data. A plurality of defocus data having A and Z values are rearranged so that the distance from the viewpoint is closer to each pixel, and R, G, B, A, and Z values can be stored as pixel values. Multi-plane buffer processing step to store in the multi-plane buffer and the multi-plane buffer for all defocus data After treatment with Ffa process step has been completed, the synthesized contents of each plane of multi-plane buffer to generate an image of interest, the image generation method characterized by comprising an output image creation processing step of outputting.
【請求項16】 ピントを合わせたその前後に実用上ピ
ントが合っている範囲である被写界深度を利用して視点
に対する前後関係を表現したい複数のオブジェクトをそ
れぞれオブジェクトモデルデータとし、この複数のオブ
ジェクトモデルデータを入力して画像を生成する画像生
成方法であって、 一つのオブジェクトモデルデータの画素毎に座標変換、
オブジェクト自身の陰面処理、シェーディング処理が行
われ、画素値としてR,G,B,Zの値を有するシェー
ディングデータから、実際のカメラと同じレンズの焦点
距離と絞り値および被写体との距離からなる関数にした
がってピントを外したデフォーカス像を表現するための
画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを生成し、画素値としてR,G,B,A,
Zの値を記憶できるデフォーカスバッファに格納するデ
フォーカス処理ステップと、 前記デフォーカスバッファから前記デフォーカスデータ
を読み出して、画素毎に視点からの距離の近い順になる
ように並べ替えながら、画素値としてR,G,B,A,
Zの値を記憶でき複数プレーンからなるマルチプレンバ
ッファに格納するマルチプレーンバッファ処理ステップ
と、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理ステップによる処理が終了した後、前記マ
ルチプレーンバッファの各プレーンの内容を合成して目
的とする画像を生成し、出力する出力イメージ作成処理
ステップとを含むことを特徴とする画像生成方法。
16. A plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by using the depth of field, which is a range in which the focus is practically in focus before and after the focus, are used as object model data. An image generation method for inputting object model data to generate an image, in which coordinate conversion is performed for each pixel of one object model data,
The hidden surface processing and shading processing of the object itself are performed, and from the shading data having R, G, B, and Z values as pixel values, a function consisting of the same lens focal length, aperture value, and object distance as the actual camera. According to the above, a plurality of defocus data having values of R, G, B, A, and Z for expressing a defocused defocused image is generated, and R, G, B, A, and P are set as pixel values.
A defocus processing step of storing the value of Z in a defocus buffer, reading the defocus data from the defocus buffer, and rearranging the pixels so that the distance from the viewpoint is closer to each pixel value. As R, G, B, A,
A multi-plane buffer processing step of storing the value of Z in a multi-plane buffer composed of a plurality of planes, and after the processing by the multi-plane buffer processing step for all defocus data is completed, An image generation method comprising: an output image creation processing step of synthesizing contents to generate a target image and outputting the image.
【請求項17】 前記マルチプレーンバッファ処理ステ
ップは、 前記マルチプレーンバッファのプレーン数をnとした場
合、デフォーカスデータ上の画素位置(X,Y)におけ
るZ値Z(X,Y)とnプレーン目のマルチプレーン
バッファ上の対応する画素位置のZ値Z(X、Y)
#nを比較し、前者の方が小さければ前記マルチプレー
ンバッファの各プレーンの対応する画像のZ値Z
(X、Y)#1からZ(X,Y)#nまで順にZ
(X,Y)と比較し、Z(X,Y)<Z(X,Y)
#Nを満たすNプレーン目の対応する画像位置のZ値が
見つかった時点でマルチプレーンバッファ上のNプレー
ン以降の対応する画素の画素値を1つずつ後のプレーン
の対応する画素にシフトし、前記デフォーカスデータの
画素値を前記マルチプレーンバッファのNプレーン目の
画素値とすることで、前記複数のデフォーカスデータ
を、視点からの距離の近い順に前記マルチプレーンバッ
ファに格納する処理を行うことを特徴とする請求項15
または16に記載の画像生成方法。
17. In the multi-plane buffer processing step, when the number of planes in the multi-plane buffer is n, Z values Z d (X, Y) and n at a pixel position (X, Y) on the defocus data are set. Z value Z m (X, Y) of the corresponding pixel position on the multi-plane buffer of the plane
#N is compared, and if the former is smaller, the Z value Z of the image corresponding to each plane of the multi-plane buffer
Z d from m (X, Y) # 1 to Z m (X, Y) #n
Compared with (X, Y), Z d (X, Y) <Z m (X, Y)
When the Z value of the corresponding image position of the N-th plane that satisfies #N is found, the pixel values of the corresponding pixels on the N-plane and later on the multi-plane buffer are shifted one by one to the corresponding pixels on the subsequent plane, The pixel value of the defocus data is set to the pixel value of the N-th plane of the multi-plane buffer, thereby performing a process of storing the plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint. 16. The method according to claim 15,
Alternatively, the image generation method according to Item 16.
【請求項18】 前記マルチプレーンバッファは、初期
段階で必要最低限数のプレーンを備え、 前記マルチプレーンバッファ処理ステップは、 前記複数のデフォーカスデータを視点からの距離の近い
順に前記マルチプレーンバッファに格納する処理を行う
際、前記マルチプレーンバッファのプレーンが足りなく
なる毎に必要なプレーンを新たに確保することを特徴と
する請求項15または16に記載の画像生成方法。
18. The multi-plane buffer comprises a minimum number of planes required in an initial stage, and the multi-plane buffer processing step stores the plurality of defocus data in the multi-plane buffer in ascending order of distance from a viewpoint. 17. The image generation method according to claim 15, wherein when performing the storing process, a necessary plane is newly secured every time the plane of the multi-plane buffer runs out.
【請求項19】 前記関数は、パラメータとしてAを含
むことを特徴とする請求項16に記載の画像生成方法。
19. The image generation method according to claim 16 , wherein the function includes A as a parameter.
【請求項20】 前記デフォーカス処理ステップは、 前記シェーディングデータをスキャンし、 点光源をぼかしたときの該点光源像の直径Φを計算し、 該直径の円内における点光源像の強度比を求め、 該直径の円内における強度比の和が1.0になるように
強度比係数Mを求め、 前記強度比係数Mを利用して前記直径Φの円内における
R,G,Bの値,アルファ値Aの値を求めて前記デフォ
ーカスバッファに保存されている値に加え、 前記デフォーカスバッファ上の前記直径Φの円内画素位
置(a,b)におけるZ値と前記シェーディングデータ
の同じ画素位置(X,Y)におけるZ値を比べ、該シェ
ーディングデータのZ値の方が小さければ前記シェーデ
ィングデータの画素位置(X,Y)におけるZ値を前記
デフォーカスバッファ上の前記直径Φの円内画素位置
(a,b)におけるZ値に移すことによりデフォーカス
データの生成を行うことを特徴とする請求項16に記載
の画像生成方法。
20. The defocus processing step scans the shading data, calculates a diameter Φ of the point light source image when the point light source is blurred, and calculates an intensity ratio of the point light source image within a circle of the diameter. The strength ratio coefficient M is calculated so that the sum of the strength ratios in the circle of the diameter becomes 1.0, and the values of R, G, B in the circle of the diameter Φ are utilized by using the strength ratio coefficient M. , The value of the alpha value A is added to the value stored in the defocus buffer, and the Z value at the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer is the same as the shading data. The Z value at the pixel position (X, Y) is compared, and if the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is set to the previous value on the defocus buffer. Defocus by shifting to the Z value at the pixel position (a, b) within the circle of the diameter Φ
Image generating method according to claim 16, characterized in that for generating the data.
【請求項21】 前記デフォーカス処理ステップは、 前記直径の円内における点光源像の強度比を、コサイン
を用いた近似計算により求めることを特徴とする請求項
20記載の画像生成方法。
21. The image generation method according to claim 20, wherein in the defocusing step, the intensity ratio of the point light source image within the circle of the diameter is obtained by approximate calculation using cosine.
【請求項22】 前記画像生成方法は、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を画素値としてR,G,
B,Zの値を記憶できるZバッファに格納する座標変換
および陰面消去処理ステップとをさらに含み、 前記デフォーカス処理ステップは、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項16
記載の画像生成方法。
22. The image generating method, the object model data, coordinate conversion, hidden surface processing,
Shading processing is performed, and the result is used as pixel values for R, G,
The method further comprises a coordinate conversion and hidden surface removal processing step of storing values of B and Z in a Z buffer, wherein the defocus processing step processes the data stored in the Z buffer as the shading data. The image generation method according to claim 16 .
【請求項23】 前記画像生成方法は、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を画素値としてR,G,
B,A,Zの値を記憶できるZバッファに格納する座標
変換および陰面消去処理ステップとをさらに含み、 前記デフォーカス処理ステップは、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項16
記載の画像生成方法。
23. The image generating method, the object model data, coordinate conversion, hidden surface processing,
Shading processing is performed, and the result is used as pixel values for R, G,
The method further comprises coordinate conversion and hidden surface removal processing step of storing the values of B, A, and Z in a Z buffer, wherein the defocus processing step processes the data stored in the Z buffer as the shading data. The image generation method according to claim 16 , wherein:
【請求項24】 前記オブジェクトは、 パンフォーカスにより生成され、Z値として無限遠が与
えられた背景画像を含むことを特徴とする請求項15
たは16に記載の画像生成方法。
24. The object is generated by the pan-focus, claim 15, characterized in that it comprises a background image infinity is given as the Z value or
Or the image generation method described in 16 .
【請求項25】 前記オブジェクトは、 自然画像を利用して、画像合成時に使用しない領域であ
るクロマキー領域を、利用者から与えられる閾値をもっ
て抽出し、該抽出されたクロマキー領域に無限遠のZ値
と色情報としてR,G,B各々に0を与え、それ以外の
領域についてはR,G,B値はそのままで、利用者が与
えるZ値を与えたフォアグラウンド画像を含むことを特
徴とする請求項15または16に記載の画像生成方法。
25. Using the natural image, the object extracts a chroma key region, which is a region not used at the time of image composition, with a threshold value given by the user, and the Z value at infinity in the extracted chroma key region. And 0 is given to each of R, G, and B as color information, and the R, G, and B values remain unchanged for other regions, and a foreground image given a Z value given by the user is included. Item 15. The image generation method according to Item 15 or 16 .
【請求項26】 前記画像生成方法は、 背景画像を、Z値として無限遠を与えることによりRG
BZ変換処理するステップと、 前記背景画像がオブジェクトと同じ撮影パラメータで生
成されている場合、前記RGBZ変換処理の結果を画素
値としてR,G,B,Zの値を記憶できる背景画像用バ
ッファに書き込むステップと、 前記背景画像がパンフォーカスにより生成されている場
合、前記RGBZ変換処理の結果を前記Zバッファに書
き込みその後前記デフォーカス処理ステップによりデフ
ォーカス処理されたデータを前記背景画像用バッファに
書き込む処理ステップと、 をさらに含み、 前記出力イメージ作成処理ステップは、 前記背景画像用バッファと前記マルチプレーンバッファ
の値を読み込み、イメージを生成し、出力することを特
徴とする請求項22または23に記載の画像生成方法。
26. The image generation method according to claim 1, wherein the background image is given an infinity as a Z value,
BZ conversion processing step, and when the background image is generated with the same shooting parameters as the object, a background image buffer that can store R, G, B, and Z values with the result of the RGBZ conversion processing as pixel values Writing step, and if the background image is generated by pan focus, the result of the RGBZ conversion processing is written in the Z buffer, and then the data defocused in the defocus processing step is written in the background image buffer. 24. A processing step, further comprising: wherein the output image creation processing step reads values of the background image buffer and the multi-plane buffer, generates an image, and outputs the image. Image generation method.
【請求項27】 前記画像生成方法は、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
するクロマキー領域処理ステップと、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B各々に0を与え、それ以外の領域について
はR,G,B値はそのままで、利用者が与えるZ値を与
え、前記Zバッファに書き送むRGBZ変換処理ステッ
プとをさらに含むことを特徴とする請求項22に記載の
画像生成方法。
27. The image generation method comprises a chroma key region processing step of extracting a chroma key region, which is a region that is not used at the time of composition, using a natural image, with a threshold value given by a user, and the extracted chroma key region is infinite. 0 is given to each of R, G, and B as the far Z value and color information, and the R, G, and B values are left unchanged for the other areas, and the Z value given by the user is given and written to the Z buffer. The image generation method according to claim 22, further comprising an RGBZ conversion processing step.
【請求項28】 前記画像生成方法は、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
し、該抽出した領域と接する他の領域との境界領域にお
いてなだらかに変化するAを算出するクロマキー領域処
理ステップと、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B,A各々に0を与え、それ以外の領域につ
いてはR,G,Bはそのままで、前記算出されたA値
と、利用者が指定したZ値を与え、前記Zバッファに書
き込むRGBAZ変換処理ステップとをさらに含むこと
を特徴とする請求項23に記載の画像生成方法。
28. The image generating method extracts a chroma key area, which is an area not used at the time of composition, using a natural image, with a threshold value given by a user, and a boundary between the extracted area and another area in contact with the area. Chromakey region processing step to calculate A that changes gently in the region, and give Z value at infinity to the extracted chromakey region and give 0 to each of R, G, B and A as color information, and for other regions 24. The method according to claim 23, further comprising an RGBAZ conversion processing step of giving the calculated A value and the Z value specified by a user and writing the Z value in the Z buffer while keeping the R, G, and B values as they are. The described image generation method.
【請求項29】 ピントを合わせたその前後に実用上ピ
ントが合っている範囲である被写界深度を利用して視点
に対する前後関係を表現したい複数のオブジェクトをそ
れぞれオブジェクトモデルデータとし、一つのオブジェ
クトモデルデータの画素毎に少なくとも座標変換、オブ
ジェクト自身の陰面処理、デフォーカス処理を施したデ
フォーカスデータを複数入力して画像を生成する画像生
成プログラムを記録したコンピュータ読み取り可能な記
録媒体であって、 画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを、画素毎に視点からの距離の近い順にな
るように並べ替えて画素値としてR,G,B,A,Zの
値を記憶でき複数プレーンからなるマルチプレンバッフ
ァに格納するマルチプレーンバッファ処理ステップと、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理ステップによる処理が終了した後、前記マ
ルチプレーンバッファの各プレーンの内容を合成して目
的とする画像を生成し、出力する出力イメージ作成処理
ステップとをコンピュータに実現させることを特徴とす
る画像生成プログラムを記録した記録媒体。
29. A plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by using the depth of field, which is a range in which the focus is practically in focus before and after the focus, are object model data, and one object is used. A computer-readable recording medium that records an image generation program that generates an image by inputting a plurality of defocus data that has undergone at least coordinate conversion for each pixel of model data, hidden surface processing of the object itself, and defocus processing. A plurality of defocus data having R, G, B, A, and Z values for each pixel are rearranged in order of decreasing distance from the viewpoint for each pixel, and R, G, B, A, and A multi-plane buffer processing step of storing the value of Z in a multi-plane buffer composed of a plurality of planes; After the processing by the multi-plane buffer processing step for all the defocus data is completed, the contents of each plane of the multi-plane buffer are combined to generate a target image, and an output image creation processing step is output. A recording medium storing an image generation program, which is realized by
【請求項30】 ピントを合わせたその前後に実用上ピ
ントが合っている範囲である被写界深度を利用して視点
に対する前後関係を表現したい複数のオブジェクトをそ
れぞれオブジェクトモデルデータとし、この複数のオブ
ジェクトモデルデータを入力して画像を生成する画像生
成プログラムを記録したコンピュータ読み取り可能な記
録媒体であって、 一つのオブジェクトモデルデータの画素毎に座標変換、
オブジェクト自身の陰面処理、シェーディング処理が行
われ、画素値としてR,G,B,Zの値を有するシェー
ディングデータから、実際のカメラと同じレンズの焦点
距離と絞り値および被写体との距離からなる関数にした
がってピントを外したデフォーカス像を表現するための
画素毎にR,G,B,A,Zの値を有する複数のデフォ
ーカスデータを生成し、画素値としてR,G,B,A,
Zの値を記憶できるデフォーカスバッファに格納するデ
フォーカス処理ステップと、 前記デフォーカスバッファから前記デフォーカスデータ
を読み出して、画素毎に視点からの距離の近い順になる
ように並べ替えながら、画素値としてR,G,B,A,
Zの値を記憶でき複数プレーンからなるマルチプレンバ
ッファに格納するマルチプレーンバッファ処理ステップ
と、 全てのデフォーカスデータについて前記マルチプレーン
バッファ処理ステップによる処理が終了した後、前記マ
ルチプレーンバッファの各プレーンの内容を合成して目
的とする画像を生成し、出力する出力イメージ作成処理
ステップとをコンピュータに実現させることを特徴とす
る画像生成プログラムを記録した記録媒体。
30. A plurality of objects for which a front-back relationship with respect to a viewpoint is expressed by using the depth of field, which is a range in which the focus is practically in focus before and after the focus, are set as object model data, and the plurality of objects are set. A computer-readable recording medium recording an image generation program for inputting object model data and generating an image, in which coordinate conversion is performed for each pixel of one object model data,
The hidden surface processing and shading processing of the object itself are performed, and from the shading data having R, G, B, and Z values as pixel values, a function consisting of the same lens focal length, aperture value, and object distance as the actual camera. According to the above, a plurality of defocus data having values of R, G, B, A, and Z for expressing a defocused defocused image is generated, and R, G, B, A, and P are set as pixel values.
A defocus processing step of storing the value of Z in a defocus buffer, reading the defocus data from the defocus buffer, and rearranging the pixels so that the distance from the viewpoint is closer to each pixel value. As R, G, B, A,
A multi-plane buffer processing step of storing the value of Z in a multi-plane buffer composed of a plurality of planes, and after the processing by the multi-plane buffer processing step for all defocus data is completed, A recording medium recording an image generation program, which causes a computer to realize an output image generation processing step of synthesizing contents to generate a target image and outputting the image.
【請求項31】 前記マルチプレーンバッファ処理ステ
ップは、 前記マルチプレーンバッファのプレーン数をnとした場
合、デフォーカスデータ上の画素位置(X,Y)におけ
るZ値Z(X,Y)とnプレーン目のマルチプレーン
バッファ上の対応する画素位置のZ値Z(X、Y)
#nを比較し、前者の方が小さければ前記マルチプレー
ンバッファの各プレーンの対応する画像のZ値Z
(X、Y)#1からZ(X,Y)#nまで順にZ
(X,Y)と比較し、Z(X,Y)<Z(X,Y)
#Nを満たすNプレーン目の対応する画像位置のZ値が
見つかった時点でマルチプレーンバッファ上のNプレー
ン以降の対応する画素の画素値を1つずつ後のプレーン
の対応する画素にシフトし、前記デフォーカスデータの
画素値を前記マルチプレーンバッファのNプレーン目の
画素値とすることで、前記複数のデフォーカスデータ
を、視点からの距離の近い順に前記マルチプレーンバッ
ファに格納する処理を行うことを特徴とする請求項29
または30に記載の画像生成プログラムを記録した記録
媒体。
31. In the multi-plane buffer processing step, when the number of planes in the multi-plane buffer is n, Z values Z d (X, Y) and n at a pixel position (X, Y) on the defocus data are set. Z value Z m (X, Y) of the corresponding pixel position on the multi-plane buffer of the plane
#N is compared, and if the former is smaller, the Z value Z of the image corresponding to each plane of the multi-plane buffer
Z d from m (X, Y) # 1 to Z m (X, Y) #n
Compared with (X, Y), Z d (X, Y) <Z m (X, Y)
When the Z value of the corresponding image position of the N-th plane that satisfies #N is found, the pixel values of the corresponding pixels on the N-plane and later on the multi-plane buffer are shifted one by one to the corresponding pixels on the subsequent plane, The pixel value of the defocus data is set to the pixel value of the N-th plane of the multi-plane buffer, thereby performing a process of storing the plurality of defocus data in the multi-plane buffer in ascending order of distance from the viewpoint. 30. The method according to claim 29,
A recording medium having the image generation program described in 30 recorded therein.
【請求項32】 前記マルチプレーンバッファは、初期
段階で必要最低限数のプレーンを備え、 前記マルチプレーンバッファ処理ステップは、 前記複数のデフォーカスデータを視点からの距離の近い
順に前記マルチプレーンバッファに格納する処理を行う
際、前記マルチプレーンバッファのプレーンが足りなく
なる毎に必要なプレーンを新たに確保することを特徴と
する請求項29または30に記載の画像生成プログラム
を記録した記録媒体。
32. The multi-plane buffer includes a minimum number of planes required in an initial stage, and the multi-plane buffer processing step stores the plurality of defocus data in the multi-plane buffer in ascending order of distance from a viewpoint. The recording medium recording the image generation program according to claim 29 or 30, wherein a necessary plane is newly secured each time the plane of the multi-plane buffer runs out when the processing of storing is performed.
【請求項33】 前記関数は、パラメータとしてAを含
ことを特徴とする請求項30に記載の画像生成プログ
ラムを記録した記録媒体。
33. The function contains the A as a parameter
Recording medium recording an image generating program according to claim 30, wherein no possible.
【請求項34】 前記デフォーカス処理ステップは、 前記シェーディングデータをスキャンし、 点光源をぼかしたときの該点光源像の直径Φを計算し、 該直径の円内における点光源像の強度比を求め、 該直径の円内における強度比の和が1.0になるように
強度比係数Mを求め、 前記強度比係数Mを利用して前記直径Φの円内における
R,G,Bの値,アルファ値Aの値を求めて前記デフォ
ーカスバッファに保存されている値に加え、 前記デフォーカスバッファ上の前記直径Φの円内画素位
置(a,b)におけるZ値と前記シェーディングデータ
の同じ画素位置(X,Y)におけるZ値を比べ、該シェ
ーディングデータのZ値の方が小さければ前記シェーデ
ィングデータの画素位置(X,Y)におけるZ値を前記
デフォーカスバッファ上の前記直径Φの円内画素位置
(a,b)におけるZ値に移すことによりデフォーカス
データの生成を行うことを特徴とする請求項30に記載
の画像生成プログラムを記録した記録媒体。
34. The defocus processing step scans the shading data, calculates a diameter Φ of the point light source image when the point light source is blurred, and calculates an intensity ratio of the point light source image within a circle of the diameter. The strength ratio coefficient M is calculated so that the sum of the strength ratios in the circle of the diameter becomes 1.0, and the values of R, G, B in the circle of the diameter Φ are utilized by using the strength ratio coefficient M. , The value of the alpha value A is added to the value stored in the defocus buffer, and the Z value at the pixel position (a, b) within the circle of the diameter Φ on the defocus buffer is the same as the shading data. The Z value at the pixel position (X, Y) is compared, and if the Z value of the shading data is smaller, the Z value at the pixel position (X, Y) of the shading data is set to the previous value on the defocus buffer. Defocus by shifting to the Z value at the pixel position (a, b) within the circle of the diameter Φ
The recording medium recording the image generation program according to claim 30 , wherein the recording medium records data.
【請求項35】 前記デフォーカス処理ステップは、 前記直径の円内における点光源像の強度比を、コサイン
を用いた近似計算により求めることを特徴とする請求項
34記載の画像生成プログラムを記録した記録媒体。
35. The image generation program according to claim 34, wherein in the defocus processing step, an intensity ratio of a point light source image within a circle of the diameter is obtained by an approximate calculation using a cosine. recoding media.
【請求項36】 前記画像生成プログラムは、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を画素値としてR,G,
B,Zの値を記憶できるZバッファに格納する座標変換
および陰面消去処理ステップとをさらに含み、 前記デフォーカス処理ステップは、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項30
記載の画像生成プログラムを記録した記録媒体。
36. The image generation program, the object model data, coordinate conversion, hidden surface processing,
Shading processing is performed, and the result is used as pixel values for R, G,
The method further comprises a coordinate conversion and hidden surface removal processing step of storing values of B and Z in a Z buffer, wherein the defocus processing step processes the data stored in the Z buffer as the shading data. A recording medium recording the image generation program according to claim 30 .
【請求項37】 前記画像生成プログラムは、 前記オブジェクトモデルデータに座標変換、陰面処理、
シェーディング処理をし、結果を画素値としてR,G,
B,A,Zの値を記憶できるZバッファに格納する座標
変換および陰面消去処理ステップとをさらに含み、 前記デフォーカス処理ステップは、 前記Zバッファに格納されたデータを前記シェーディン
グデータとして処理することを特徴とする請求項30
記載の画像生成プログラムを記録した記録媒体。
37. The image generation program, the object model data, coordinate conversion, hidden surface processing,
Shading processing is performed, and the result is used as pixel values for R, G,
The method further comprises coordinate conversion and hidden surface removal processing step of storing the values of B, A, and Z in a Z buffer, wherein the defocus processing step processes the data stored in the Z buffer as the shading data. A recording medium recording the image generation program according to claim 30 .
【請求項38】 前記オブジェクトは、 パンフォーカスにより生成され、Z値として無限遠が与
えられた背景画像を含むことを特徴とする請求項29
たは30に記載の画像生成プログラムを記録した記録媒
体。
38. The object is generated by the pan-focus, claim 29, characterized in that it comprises a background image infinity is given as the Z value or
Or a recording medium recording the image generation program described in 30 .
【請求項39】 前記オブジェクトは、 自然画像を利用して、画像合成時に使用しない領域であ
るクロマキー領域を、利用者から与えられる閾値をもっ
て抽出し、該抽出されたクロマキー領域に無限遠のZ値
と色情報としてR,G,B各々に0を与え、それ以外の
領域についてはR,G,B値はそのままで、利用者が与
えるZ値を与えたフォアグラウンド画像を含むことを特
徴とする請求項29または30に記載の画像生成プログ
ラムを記録した記録媒体。
39. The object extracts a chroma key area, which is an area not used at the time of image composition, with a threshold value given by a user, using a natural image, and extracts a Z value at infinity from the extracted chroma key area. And 0 is given to each of R, G, and B as color information, and the R, G, and B values remain unchanged for other regions, and a foreground image given a Z value given by the user is included. A recording medium recording the image generation program according to Item 29 or 30 .
【請求項40】 前記画像生成プログラムは、 背景画像を、Z値として無限遠を与えることによりRG
BZ変換処理するステップと、 前記背景画像がオブジェクトと同じ撮影パラメータで生
成されている場合、前記RGBZ変換処理の結果を画素
値としてR,G,B,Zの値を記憶できる背景画像用バ
ッファに書き込むステップと、 前記背景画像がパンフォーカスにより生成されている場
合、前記RGBZ変換処理の結果を前記Zバッファに書
き込みその後前記デフォーカス処理ステップによりデフ
ォーカス処理されたデータを前記背景画像用バッファに
書き込む処理ステップと、 をさらに含み、 前記出力イメージ作成処理ステップは、 前記背景画像用バッファと前記マルチプレーンバッファ
の値を読み込み、イメージを生成し、出力することを特
徴とする請求項36または37に記載の画像生成プログ
ラムを記録した記録媒体。
40. The image generation program sets the background image to RG by giving infinity as a Z value.
BZ conversion processing step, and when the background image is generated with the same shooting parameters as the object, a background image buffer that can store R, G, B, and Z values with the result of the RGBZ conversion processing as pixel values Writing step, and if the background image is generated by pan focus, the result of the RGBZ conversion processing is written in the Z buffer, and then the data defocused in the defocus processing step is written in the background image buffer. 38. The output image creation processing step further includes a processing step, wherein the output image creation processing step reads values of the background image buffer and the multi-plane buffer, generates an image, and outputs the image. Recording medium recording the image generation program of.
【請求項41】 前記画像生成プログラムは、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
するクロマキー領域処理ステップと、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B各々に0を与え、それ以外の領域について
はR,G,B値はそのままで、利用者が与えるZ値を与
え、前記Zバッファに書き送むRGBZ変換処理ステッ
プとをさらにコンピュータに実現させることを特徴とす
る請求項36に記載の画像生成プログラムを記録した記
録媒体。
41. The image generation program includes a chroma key region processing step of extracting a chroma key region, which is a region not used at the time of composition, using a natural image, with a threshold value given by a user, and the extracted chroma key region is infinite. 0 is given to each of R, G, and B as the far Z value and color information, and the R, G, and B values are left unchanged for the other areas, and the Z value given by the user is given and written to the Z buffer. The recording medium storing the image generation program according to claim 36, further comprising: a RGBZ conversion processing step.
【請求項42】 前記画像生成プログラムは、 自然画像を利用して合成時に使用しない領域であるクロ
マキー領域を、利用者から与えられる閾値をもって抽出
し、該抽出した領域と接する他の領域との境界領域にお
いてなだらかに変化するAを算出するクロマキー領域処
理ステップと、 抽出されたクロマキー領域に無限遠のZ値と色情報とし
てR,G,B,A各々に0を与え、それ以外の領域につ
いてはR,G,Bはそのままで、前記算出されたA値
と、利用者が指定したZ値を与え、前記Zバッファに書
き込むRGBAZ変換処理ステップとをさらにコンピュ
ータに実現させることを特徴とする請求項37に記載の
画像生成プログラムを記録した記録媒体。
42. The image generation program extracts a chroma key area, which is an area that is not used at the time of composition, by using a natural image, with a threshold value given by a user, and a boundary between the extracted area and another area in contact with the area. Chromakey region processing step to calculate A that changes gently in the region, and give Z value at infinity to the extracted chromakey region and give 0 to each of R, G, B and A as color information, and for other regions The computer is further allowed to implement the RGBAZ conversion processing step of giving the calculated A value and the Z value specified by the user and writing the Z value in the Z buffer while keeping the R, G, and B values as they are. A recording medium recording the image generation program according to Item 37.
JP14635598A 1997-06-02 1998-05-27 Image generation method, image generation device, and recording medium recording image generation program Expired - Fee Related JP3382536B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14635598A JP3382536B2 (en) 1997-06-02 1998-05-27 Image generation method, image generation device, and recording medium recording image generation program

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP14402497 1997-06-02
JP9-144024 1997-06-02
JP9-217725 1997-08-12
JP21772597 1997-08-12
JP14635598A JP3382536B2 (en) 1997-06-02 1998-05-27 Image generation method, image generation device, and recording medium recording image generation program

Publications (2)

Publication Number Publication Date
JPH11120377A JPH11120377A (en) 1999-04-30
JP3382536B2 true JP3382536B2 (en) 2003-03-04

Family

ID=27318751

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14635598A Expired - Fee Related JP3382536B2 (en) 1997-06-02 1998-05-27 Image generation method, image generation device, and recording medium recording image generation program

Country Status (1)

Country Link
JP (1) JP3382536B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3448536B2 (en) 1999-12-31 2003-09-22 株式会社スクウェア・エニックス Computer-readable recording medium storing a three-dimensional computer image processing program, blur rendering processing method, and video game apparatus
JP2001204964A (en) 2000-01-28 2001-07-31 Square Co Ltd Computer-readable recording medium wherein program of game for ball game is recorded, method of displaying and processing image of game for ball game, and video game apparatus
JP3404347B2 (en) 2000-01-28 2003-05-06 株式会社スクウェア Computer-readable recording medium recording a three-dimensional computer image processing program and blur rendering processing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
浅田尚紀ほか,逆投影ぼけモデルを用いた遮へいエッジの光学的性質の解析,電子情報通信学会論文誌,日本,電子情報通信学会,1995年 2月25日,Vol.J78−DII No.2,p.248−262

Also Published As

Publication number Publication date
JPH11120377A (en) 1999-04-30

Similar Documents

Publication Publication Date Title
US9934562B2 (en) Method for dynamic range editing
JP3052681B2 (en) 3D video generation device
US6717586B2 (en) Apparatus, method, program code, and storage medium for image processing
US7961970B1 (en) Method and apparatus for using a virtual camera to dynamically refocus a digital image
US8953905B2 (en) Rapid workflow system and method for image sequence depth enhancement
US6157387A (en) Image generating apparatus and method
JPH0636040A (en) Method of forming electric signal of video image frame
US11328437B2 (en) Method for emulating defocus of sharp rendered images
Zhang et al. Depth of field rendering using multilayer-neighborhood optimization
US7133052B1 (en) Morph map based simulated real-time rendering
US20010016082A1 (en) Process for making images defocused
JP3382536B2 (en) Image generation method, image generation device, and recording medium recording image generation program
JP7352374B2 (en) Virtual viewpoint conversion device and program
JP3629243B2 (en) Image processing apparatus and method for rendering shading process using distance component in modeling
US11308586B2 (en) Method for applying a vignette effect to rendered images
JP2002092625A (en) Image processor, its method, and storage medium
AU2011348121A1 (en) System and method for minimal iteration workflow for image sequence depth enhancement
JP3392078B2 (en) Image processing method, image processing device, and storage medium
JP3387856B2 (en) Image processing method, image processing device, and storage medium
US20220215512A1 (en) Method for Emulating Defocus of Sharp Rendered Images
JP2000306118A (en) Tree texture generating device
JP2005107463A (en) Integral photography
JPH11213136A (en) Device and method for generating nonuniform resolution picture data, and image processor using nonuniform resolution picture data
JP2001134778A (en) Three-dimensional shape generator for tree
JP6823984B2 (en) Image generator and program

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071220

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20081220

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20091220

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20101220

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees