JPH07200816A - Image drawing method and apparatus - Google Patents
Image drawing method and apparatusInfo
- Publication number
- JPH07200816A JPH07200816A JP5337192A JP33719293A JPH07200816A JP H07200816 A JPH07200816 A JP H07200816A JP 5337192 A JP5337192 A JP 5337192A JP 33719293 A JP33719293 A JP 33719293A JP H07200816 A JPH07200816 A JP H07200816A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- sampling
- defocus
- pixels
- focus
- 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.)
- Pending
Links
Landscapes
- Image Processing (AREA)
Abstract
(57)【要約】
【目的】 被写界深度を表現した画像を高速に描画す
る。
【構成】 物体5,物体6,物体7が表示されている画
像においてデフォーカスの程度が小さい画素領域10は
正確に輝度値を算出するためにサンプリングレートを小
さく取り、デフォーカスの程度が大きい画素領域12に
おいてはサンプリングレートを大きく取って、サンプリ
ング画素の輝度値を算出する。このようにデフォーカス
の程度に対応してサンプリングレートを設定し、サンプ
リングした画素の輝度だけを分散レイトレーシングによ
り計算し、サンプリング画素の間の画素の輝度値は線形
補間により求めることにより、実質的な画像品質を低下
させることなく、デフォーカス領域の輝度計算時間を大
幅に短縮する。
(57) [Summary] [Purpose] Draw images expressing depth of field at high speed. [Configuration] In an image in which an object 5, an object 6, and an object 7 are displayed, a pixel region 10 having a small degree of defocus has a small sampling rate and a pixel having a large degree of defocus in order to accurately calculate a luminance value. In the area 12, the sampling rate is set large and the luminance value of the sampling pixel is calculated. In this way, the sampling rate is set according to the degree of defocus, only the brightness of the sampled pixels is calculated by distributed ray tracing, and the brightness value of the pixels between the sampling pixels is obtained by linear interpolation. The brightness calculation time of the defocus area is significantly reduced without deteriorating the image quality.
Description
【0001】[0001]
【産業上の利用分野】この発明は、画像描画方法および
その装置に関し、さらに詳細にいえば、所定レンズ特性
を想定して被写界深度を表現した画像を描画する画像描
画方法およびその装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image drawing method and an apparatus therefor, and more particularly to an image drawing method and an apparatus therefor for drawing an image expressing a depth of field assuming a predetermined lens characteristic. .
【0002】[0002]
【従来の技術】通常のコンピュータグラッフィックス
(以下、CGと称する)で採用されるカメラモデルはピ
ンホールカメラモデルである。このピンホールカメラモ
デルで生成される画像は、画像の全ての部分においてピ
ントが合った画像となっている。しかし、肉眼や通常の
カメラは有効なレンズ口径を持ち、ピントが合った領域
が有限の深さを持つ被写界となる。いくつかの物体には
ピントが合って見えるが、その他の物体はピンボケの状
態の画像を被写界深度を表現した画像と言い、現実感、
臨場感のある画像を表現するには被写界深度を表現した
画像を生成することが必要となる。写真のような高品位
な画質を要求される近年のCGにおいては、上記被写界
深度のような特種効果も望まれるようになっており、特
に、各種プレゼンテーションに使用される景観シュミレ
ーションや、映画に使用されるCGにおいては実際にこ
のような技術が使用されつつある。2. Description of the Related Art A camera model adopted in a general computer graphics (hereinafter referred to as CG) is a pinhole camera model. The image generated by this pinhole camera model is an image in focus in all parts of the image. However, the naked eye and a normal camera have an effective lens aperture, and a focused area is a field having a finite depth. Some objects appear to be in focus, while other objects are called out-of-focus images that represent the depth of field.
In order to express an image with a sense of reality, it is necessary to generate an image expressing the depth of field. In recent years, CG, which requires high-quality images such as photographs, is required to have a special effect such as the depth of field. Especially, landscape simulations and movies used for various presentations. Such a technique is actually being used in the CG used in the CG.
【0003】被写界深度を表現する従来のCG技法とし
ては、画像生成後に画像処理するポストプロセス方法
(Potmesil,"A LENS AND APERTURE CAMERA MODEL FOR S
YNTHETIC IMAGE GENERATION",Computer Graphics 81 )
や、画像生成中に被写界深度計算に必要な計算も同時に
行なう方法(Robert L.Cook,"Distributed Ray Tracin
g",Computer Graphics 84)が提案されている。As a conventional CG technique for expressing the depth of field, a post-process method (Potmesil, "A LENS AND APERTURE CAMERA MODEL FOR S" for image processing after image generation is used.
YNTHETIC IMAGE GENERATION ", Computer Graphics 81)
Alternatively, the method required to calculate the depth of field during image generation can be performed simultaneously (Robert L. Cook, "Distributed Ray Tracin
g ", Computer Graphics 84) has been proposed.
【0004】[0004]
【発明が解決しようとする課題】しかしながら、CGに
おいて被写界深度を表現すためには、上記2つの方法と
も非常に計算負荷が大きく、十分な画質を得ようとすれ
ば被写界深度を表現しない場合に比べて画像描画時間が
10数倍以上かかる問題があった。さらに詳細に説明す
ると、CGにおいて被写界深度を表現すためには、ピン
ボケの状態の画像領域における画素全てにおいて、適当
なフィルタを採用し対象画素を中心にして多数画素で畳
み込み積分を行なうことが必要になるのであるから、一
般に計算量が膨大になり、画像描画時間が著しくかかっ
てしまうのである。However, in order to express the depth of field in CG, both of the above two methods have a very large calculation load, and if the sufficient image quality is to be obtained, the depth of field is reduced. There is a problem that the image drawing time is ten or more times longer than that in the case of not expressing. More specifically, in order to express the depth of field in CG, an appropriate filter is adopted for all the pixels in the image area in the out-of-focus state, and convolution integration is performed with a large number of pixels centering on the target pixel. Therefore, the amount of calculation is generally enormous, and the image drawing time is extremely long.
【0005】[0005]
【発明の目的】この発明は上記の問題点に鑑みてなされ
たものであり、実質的な画像品質の低下を抑制するとと
もに、被写界深度を表現した画像を高速に描画する画像
描画方法およびその装置を提供することを目的としてい
る。SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and suppresses substantial deterioration of image quality, and an image drawing method for drawing an image expressing the depth of field at high speed. The purpose is to provide the device.
【0006】[0006]
【課題を解決するための手段】上記の目的を達成するた
めの、請求項1の画像描画方法は、所定レンズ特性を想
定して被写界深度を表現した画像を描画する画像描画方
法であって、所定レンズ特性および画素の奥行き値に基
づいて、画素がフォーカス状態であるのか、デフォーカ
ス状態であるのかを判別し、フォーカス状態であると判
別されたことに応答して、全ての画素についてサンプリ
ングを行なうようにサンプリングレートを決定して画素
をサンプリングし、サンプリング画素の輝度値をピンホ
ールカメラモデルにより算出して描画するとともに、デ
フォーカス状態であると判別されたことに応答してデフ
ォーカスの程度を算出し、算出されたデフォーカスの程
度に基づいて画素のサンプリングレートを決定し、決定
されたサンプリングレートに基づいて画素をサンプリン
グし、サンプリング画素に対応する散乱円内の画素をフ
ィルタリングすることによりサンプリング画素の輝度値
を算出し、サンプリング画素間の画素の輝度値を所定補
間法により算出し、サンプリング画素および補間した画
素をそれぞれの輝度値に基づいて描画する。In order to achieve the above object, an image drawing method according to claim 1 is an image drawing method for drawing an image expressing a depth of field on the assumption of a predetermined lens characteristic. Then, based on the predetermined lens characteristic and the depth value of the pixel, it is determined whether the pixel is in the focused state or the defocused state, and in response to the determination that the pixel is in the focused state, all the pixels are determined. The pixel is sampled by determining the sampling rate so that sampling is performed, the brightness value of the sampling pixel is calculated by the pinhole camera model and drawn, and the defocusing is performed in response to the determination that the defocusing state is set. Is calculated, the pixel sampling rate is determined based on the calculated defocus degree, and the determined sampling rate is determined. Sampling pixels based on the rate, filtering the pixels in the scattering circle corresponding to the sampling pixel to calculate the luminance value of the sampling pixel, calculating the luminance value of the pixel between the sampling pixels by a predetermined interpolation method, and sampling The pixel and the interpolated pixel are drawn based on the respective brightness values.
【0007】上記の目的を達成するための請求項2の画
像描画装置は、所定レンズ特性および画素の奥行き値に
基づいて、画素がフォーカス状態であるのか、デフォー
カス状態であるのかを判別するフォーカス/デフォーカ
ス判別手段と、フォーカス/デフォーカス判別手段がフ
ォーカス状態であると判別したことに応答して、全ての
画素についてサンプリングを行なうようにサンプリング
レートを決定し、そのサンプリングレートに基づいて画
素をサンプリングするサンプリング手段と、サンプリン
グされた画素の輝度値をピンホールカメラモデルにより
算出して描画するフォーカス画素描画手段と、フォーカ
ス/デフォーカス判別手段がデフォーカス状態であると
判別したことに応答してデフォーカスの程度を算出する
デフォーカス程度算出手段と、算出されたデフォーカス
の程度に基づいて画素のサンプリングレートを決定し、
そのサンプリングレートに基づいて画素をサンプリング
するサンプリング手段と、サンプリングされた画素に対
応する散乱円内の画素をフィルタリングすることにより
サンプリング画素の輝度値を算出するサンプリング画素
輝度算出手段と、サンプリング画素間の画素の輝度値を
所定補間法により算出する補間画素輝度算出手段と、サ
ンプリング画素および補間した画素をそれぞれの輝度値
に基づいて描画するデフォーカス画素描画手段とを有す
る。According to another aspect of the image drawing apparatus for achieving the above object, a focus determining unit determines whether a pixel is in a focused state or a defocused state based on a predetermined lens characteristic and a depth value of the pixel. In response to the / defocus determination means and the focus / defocus determination means determining that the pixel is in focus, the sampling rate is determined so that all pixels are sampled, and the pixels are determined based on the sampling rate. In response to the sampling means for sampling, the focus pixel drawing means for calculating and drawing the brightness value of the sampled pixel by the pinhole camera model, and the focus / defocus judging means judging that the defocus state is set. Defocus degree to calculate the degree of defocus Means out to determine the sampling rate of the pixels based on the degree of the calculated defocus,
Sampling means for sampling pixels based on the sampling rate, sampling pixel brightness calculating means for calculating the brightness value of the sampling pixel by filtering the pixels in the scattering circle corresponding to the sampled pixel, and between the sampling pixels It has an interpolated pixel brightness calculation means for calculating the brightness value of the pixel by a predetermined interpolation method, and a defocus pixel drawing means for drawing the sampling pixel and the interpolated pixel based on the respective brightness values.
【0008】[0008]
【作用】請求項1の画像描画方法であれば、画素がデフ
ォーカス状態であると判別された場合はデフォーカスの
程度を算出し、算出されたデフォーカスの程度に基づい
て画素のサンプリングレートを決定し、決定されたサン
プリングレートに基づいて画素をサンプリングし、サン
プリング画素に対応する散乱円内の画素をフィルタリン
グすることによりサンプリング画素の輝度値を算出する
のであるから、デフォーカスの程度が大きい場合は正確
に画素の輝度を算出することは画像の性質上、意味がな
いのでサンプリングレートを大きくして計算時間のかか
るフィルタリングの回数を減らすようにし、また、デフ
ォーカスの程度が小さい場合は、画像の性質上、ある程
度の精度が要求されるので、サンプリングレートを小さ
くして画像品質を極度に落とすことなく比較的精度良く
画素の輝度を算出するようにできる。そして、サンプリ
ングされた画素の間の画素の輝度値は計算時間が短縮で
きる補間演算によって算出することにより、画像中のデ
フォーカス領域の描画速度を大幅に向上することができ
る。したがって、実質的な画像品質の低下を抑制して、
被写界深度を表現した画像を高速に描画することができ
る。According to the image drawing method of claim 1, when it is determined that the pixel is in the defocused state, the degree of defocusing is calculated, and the sampling rate of the pixel is determined based on the calculated degree of defocusing. When the degree of defocus is large, the brightness value of the sampling pixel is calculated by determining and sampling the pixel based on the determined sampling rate and filtering the pixels in the scattering circle corresponding to the sampling pixel. Since it is meaningless to accurately calculate the pixel brightness due to the nature of the image, increase the sampling rate to reduce the number of filtering operations that require calculation time.If the degree of defocus is small, Due to the nature of, some accuracy is required, so reduce the sampling rate to improve image quality. Possible to calculate the luminance of the relatively high precision pixel without reducing the time. Then, the brightness value of the pixel between the sampled pixels is calculated by the interpolation calculation that can reduce the calculation time, and thus the drawing speed of the defocus area in the image can be significantly improved. Therefore, by suppressing the substantial deterioration of image quality,
An image expressing the depth of field can be drawn at high speed.
【0009】請求項2の画像描画装置であれば、フォー
カス/デフォーカス判別手段が所定レンズ特性および画
素の奥行き値に基づいて、画素がフォーカス状態である
のか、デフォーカス状態であるのかを判別し、フォーカ
ス/デフォーカス判別手段がフォーカス状態であると判
別したことに応答して、サンプリング手段が全ての画素
についてサンプリングを行なうようにサンプリングレー
トを設定し、フォーカス画素描画手段がそのサンプリン
グレートに基づいてフォーカス状態の画素の輝度値をピ
ンホールカメラモデルにより算出して描画する。これら
の処理により画像中のフォーカス領域において画像品質
を落とすことなく、正確な輝度値による描画が可能とな
る。According to another aspect of the image drawing apparatus, the focus / defocus determining means determines whether the pixel is in the focused state or the defocused state based on the predetermined lens characteristic and the depth value of the pixel. In response to the focus / defocus determining means determining that the pixel is in focus, the sampling means sets the sampling rate so that all pixels are sampled, and the focus pixel drawing means determines the sampling rate based on the sampling rate. The brightness value of the pixel in focus is calculated by the pinhole camera model and drawn. By these processes, it is possible to draw with an accurate luminance value without degrading the image quality in the focus area in the image.
【0010】また、フォーカス/デフォーカス判別手段
がデフォーカス状態であると判別したことに応答して、
デフォーカス程度算出手段がデフォーカスの程度を算出
し、サンプリング手段が算出されたデフォーカスの程度
に基づいて画素のサンプリングレートを決定するととも
に、そのサンプリングレートに基づいて画素をサンプリ
ングする。そして、サンプリング画素輝度算出手段がサ
ンプリングされた画素に対応する散乱円内の画素をフィ
ルタリングすることによりサンプリング画素の輝度値を
算出し、補間画素輝度算出手段がサンプリング画素の間
の画素の輝度値を所定補間法により算出し、デフォーカ
ス画素描画手段がサンプリング画素および補間画素をそ
れぞれの輝度値に基づいて描画する。これらの処理によ
り、デフォーカスの程度が大きい場合はサンプリングレ
ートを大きくして計算時間のかかるフィルタリングの回
数を減らすようにし、また、デフォーカスの程度が小さ
い場合はサンプリングレートを小さくして画像品質を極
度に落とすことなく比較的精度良く画素の輝度を算出す
ることができる。また、サンプリングされた画素の間の
画素の輝度値は、計算時間が短縮できる補間演算によっ
て算出することにより、画像中のデフォーカス領域の描
画速度を大幅に向上することができる。したがって、実
質的な画像品質の低下を抑制して、被写界深度を表現し
た画像を高速に描画することができる。Further, in response to the focus / defocus determining means determining that the focus is defocused,
The defocus degree calculation unit calculates the degree of defocus, the sampling unit determines the sampling rate of the pixel based on the calculated degree of defocus, and samples the pixel based on the sampling rate. Then, the sampling pixel brightness calculation means calculates the brightness value of the sampling pixel by filtering the pixels in the scattering circle corresponding to the sampled pixel, and the interpolation pixel brightness calculation means calculates the brightness value of the pixel between the sampling pixels. It is calculated by a predetermined interpolation method, and the defocus pixel drawing means draws the sampling pixel and the interpolation pixel based on the respective brightness values. By these processes, when the degree of defocus is large, the sampling rate is increased to reduce the number of filtering operations that require calculation time, and when the degree of defocus is small, the sampling rate is reduced to improve the image quality. It is possible to calculate the luminance of the pixel with relatively high precision without dropping it extremely. In addition, the brightness value of the pixels between the sampled pixels is calculated by the interpolation calculation that can reduce the calculation time, so that the drawing speed of the defocus area in the image can be significantly improved. Therefore, it is possible to draw an image expressing the depth of field at high speed while suppressing a substantial decrease in image quality.
【0011】[0011]
【実施例】以下、実施例を示す添付図面によって詳細に
説明する。図1および図2はこの発明の画像描画方法の
一実施例を示すフローチャートである。まず、ステップ
SP1において奥行き値(z値)を含む図形データを得
て、ステップSP2において視点位置を考慮した座標変
換、光源位置設定などの所定の図形処理を行ない、ステ
ップSP3において採用するレンズ特性を設定し、ステ
ップSP4において画像中の画素を選択し、ステップS
P5において選択された画素がフォーカス状態の画素で
あるか、デフォーカス状態の画素であるかを判別る。そ
して、ステップSP5においてフォーカス状態の画素で
あると判別された場合はステップSP6において、全て
の画素をサンプリングするサンプリングレートを設定
し、ステップSP7においてそのサンプリングレートに
より画素の輝度値をピンホールカメラモデルでレイトレ
ーシング法に基づいて算出して描画する。Embodiments will be described in detail below with reference to the accompanying drawings showing embodiments. 1 and 2 are flow charts showing an embodiment of the image drawing method of the present invention. First, in step SP1, graphic data including a depth value (z value) is obtained, and in step SP2, predetermined graphic processing such as coordinate conversion considering the viewpoint position and light source position setting is performed, and the lens characteristics adopted in step SP3 are set. Set, select the pixel in the image in step SP4, and
It is determined whether the pixel selected in P5 is a focused pixel or a defocused pixel. If it is determined in step SP5 that the pixel is in focus, a sampling rate for sampling all the pixels is set in step SP6, and the brightness value of the pixel is determined by the pinhole camera model in step SP7 according to the sampling rate. It is calculated and drawn based on the ray tracing method.
【0012】一方、ステップSP5においてデフォーカ
ス状態の画素であると判別された場合は図2に示すよう
に、ステップSP8においてその画素の散乱円半径を算
出し、ステップSP9において算出された散乱円半径に
基づいてサンプリングレートを決定し、ステップSP1
0においてそのサンプリングレートにより画素をサンプ
リングし、ステップSP11においてサンプリングした
画素の輝度値を所定フィルタを採用した畳み込み積分に
より算出し、ステップSP12においてサンプリング画
素の間の画素の輝度値を線形補間により算出し、ステッ
プSP13においてサンプリングした画素および補間し
た画素のそれぞれの輝度値に基づいて描画する。そして
ステップSP7あるいはステップSP13の処理が終了
した場合は、ステップSP14において選択した画素が
画像中の最後の画素であるか否かを判別し、最後の画素
でないと判別された場合はステップSP15において画
素を1つ進めてステップSP4の画素の選択処理を行な
う。一方、ステップSP14において選択された画素が
最後の画素であると判別された場合は一連の処理を終了
する。On the other hand, when it is determined in step SP5 that the pixel is in the defocused state, as shown in FIG. 2, the scattering circle radius of the pixel is calculated in step SP8, and the scattering circle radius calculated in step SP9. Sampling rate is determined based on step SP1
At 0, the pixel is sampled at the sampling rate, and the brightness value of the sampled pixel is calculated by convolution integration using a predetermined filter at step SP11. At step SP12, the brightness value of the pixel between the sampling pixels is calculated by linear interpolation. , Drawing is performed based on the respective luminance values of the pixel sampled and the interpolated pixel in step SP13. When the processing in step SP7 or step SP13 is completed, it is determined whether or not the pixel selected in step SP14 is the last pixel in the image. If it is determined that the pixel is not the last pixel, the pixel is determined in step SP15. Is incremented by 1, and the pixel selection processing in step SP4 is performed. On the other hand, if it is determined in step SP14 that the selected pixel is the last pixel, then the series of processes ends.
【0013】この実施例の画像描画方法について、さら
に詳細に説明する。被写界深度を考慮した画像は幾つか
の物体にはピントがあって見えるが、その他の物体はピ
ンボケである画像となるが、この現象は光学的機能によ
るものではなく、肉眼での認識能力と像を写している媒
体の機能が原因で引き起こるものである。図3は被写界
深度を説明するための図であり、レンズ1からの距離が
Uの位置に肉眼で判別できる最小の直径(MN)を持つ
面2(すなわちこの直径より少しでも大きければ点では
なくエリアとして観測される)が配置されており、この
面2の位置に焦点が合っている光学系を示している。L
Dは焦点距離Fをレンズ口径nで割った値(F/n)と
して定義される有効レンズ直径である。光軸3上の点A
から点Bまでの範囲において面2を動かしても、その直
径はMNよりも小さくなるため、この範囲にある物体に
はピントが合い、点群を点群として認識できることとな
る。この点Aから点Bまでの距離を被写界深度(焦点深
度)といい、点Aから点Bまでの間の範囲をフォーカス
範囲、それ以外の範囲をデフォーカス範囲と称する。図
3において比例関係から、レンズ1に最も近い側のピン
トの合う距離U-、レンズ1に最も遠い側のピントの合
う距離U+はそれぞれ下記式で表される。The image drawing method of this embodiment will be described in more detail. An image that considers the depth of field is an image in which some objects appear to be in focus but other objects are out of focus.This phenomenon is not due to an optical function, but is recognized by the naked eye. It is caused by the function of the medium in which the image is shown. FIG. 3 is a diagram for explaining the depth of field. The surface 2 having the smallest diameter (MN) at the position U from the lens 1 that can be discriminated by the naked eye (that is, the point if the diameter is a little larger than this diameter). Is observed as an area, not an area), and shows the optical system in which the position of this surface 2 is in focus. L
D is an effective lens diameter defined as a value (F / n) obtained by dividing the focal length F by the lens aperture n. Point A on optical axis 3
Even if the surface 2 is moved in the range from to the point B, its diameter is smaller than MN, so that an object in this range is in focus and the point group can be recognized as a point group. The distance from the point A to the point B is called the depth of field (depth of focus), the range from the point A to the point B is called the focus range, and the other range is called the defocus range. From the proportional relationship in FIG. 3, the focusing distance U − on the side closest to the lens 1 and the focusing distance U + on the side farthest from the lens 1 are respectively expressed by the following equations.
【0014】[0014]
【数1】 [Equation 1]
【0015】但し、Xは判別できる最小直径である。However, X is the minimum diameter that can be discriminated.
【0016】[0016]
【数2】 [Equation 2]
【0017】ここで上記焦点の合うフォーカス範囲を外
れると、点はどのような大きさの円として現れるかを考
える。図4はレンズ1からの距離Pの点Eにおいて焦点
が合っており、レンズ1からこの点Eに対応する像平面
Iまでの距離がVpである光学系を示している。この状
態では距離Vpでの像はピントがあった像となってい
る。しかし、焦点距離Pより遠い点Gのレンズ1までの
距離がDであるとすると、この遠い点Gは距離Vdの像
平面Hにおいてピントが合うことになる。したがって、
距離D上にある物体は距離Vpに対応する像平面Iの上
では円の集合体として投影される。つまり、シーンのデ
フォーカスな各点は像平面I上では円に見える。この円
は散乱円と呼ばれ、散乱円の大きさCは散乱円のある位
置の像がどれほどデフォーカスであるかの程度を表すこ
とになる。この散乱円はレンズ1から像平面Hまでの距
離とレンズの光学的特性によって決まる。図4において
散乱円の大きさ(直径)Cは、Now, let us consider what size of a circle appears when the point is out of the focused range. FIG. 4 shows an optical system in which a point E at a distance P from the lens 1 is in focus and a distance from the lens 1 to an image plane I corresponding to the point E is Vp. In this state, the image at the distance Vp is a focused image. However, if the distance G to the lens 1 at the point G farther than the focal length P is D, the far point G is focused on the image plane H at the distance Vd. Therefore,
Objects on the distance D are projected as a set of circles on the image plane I corresponding to the distance Vp. That is, each defocused point of the scene looks like a circle on the image plane I. This circle is called a scattering circle, and the size C of the scattering circle represents the degree of defocus of an image at a position where the scattering circle is present. This scattering circle is determined by the distance from the lens 1 to the image plane H and the optical characteristics of the lens. In FIG. 4, the size (diameter) C of the scattering circle is
【0018】[0018]
【数3】 [Equation 3]
【0019】で求めることができる。次に、本実施例に
おける被写界深度を考慮した画像を高速に生成する基本
的原理について説明する。所定のレンズ特性を設定した
ときにおいて、被写界深度を表現した画像を観察する
と、図5に示すように物体の位置(奥行き位置)に応じ
て焦点位置近辺のデフォーカス領域にある物体5はシャ
ープな輪郭を持ち、焦点距離から前方のデフォーカス領
域にある物体6、あるいは焦点距離から後方のデフォー
カス領域にある物体7はそれぞれ焦点距離から遠くなる
にしたがって輪郭等が曖昧になってくる。このデフォー
カス領域(ピンボケ領域)での輝度計算処理はその部分
の像の性質から特に正確に輝度を計算する必要がないと
考えられる。It can be obtained by Next, the basic principle of rapidly generating an image in consideration of the depth of field in this embodiment will be described. When the image expressing the depth of field is observed when the predetermined lens characteristic is set, the object 5 in the defocus area near the focus position is detected according to the position (depth position) of the object as shown in FIG. The object 6 having a sharp contour and located in the front defocus region from the focal length, or the object 7 in the rear defocus region from the focal length, respectively, has a contour that becomes ambiguous as the distance from the focal length increases. It is considered that the brightness calculation processing in the defocus area (out-of-focus area) does not need to calculate the brightness particularly accurately due to the characteristics of the image in that portion.
【0020】そこで、正確に輝度を計算する必要のある
フォーカス領域と正確に輝度を計算する必要のないデフ
ォーカス領域を所定方法、例えば、前記数1と数2、あ
るいは数3に基づいて判別するとともに、フォーカス領
域においては全ての画素を1つずつ描画するピンホール
カメラモデルに対応するレイトレーシング法に基づいて
正確な輝度計算を行ない、デフォーカス領域においては
デフォーカスの程度に応じて、輝度計算を行なうサンプ
リング点の数を増減させるとともに、散乱円内の画素を
対象として所定フィルタリング法を利用した分散レイト
レーシングによりサンプリング画素の輝度計算を行な
う。そしてサンプリング画素の間の画素を線形補間して
輝度値を計算することにより、デフォーカス領域の計算
負荷を軽減して、高速な描画を実行するようにしてい
る。Therefore, the focus area where the brightness needs to be calculated accurately and the defocus area where the brightness does not need to be calculated accurately are discriminated based on a predetermined method, for example, the formula 1 and the formula 2 or the formula 3. At the same time, accurate brightness calculation is performed based on the ray tracing method corresponding to the pinhole camera model that draws all pixels one by one in the focus area, and brightness calculation is performed in the defocus area according to the degree of defocus. In addition to increasing or decreasing the number of sampling points to perform, the brightness of the sampling pixels is calculated by distributed ray tracing using the predetermined filtering method for the pixels in the scattering circle. The pixels between the sampling pixels are linearly interpolated to calculate the luminance value, thereby reducing the calculation load of the defocus area and performing high-speed drawing.
【0021】つまり、焦点距離付近では密にサンプリン
グ数をとって輝度を計算し、焦点距離から遠くなり、ピ
ンボケの度合いが大きな所ほどサンプリング数を疎にし
て輝度を計算することと、サンプリング画素間の画素の
輝度をサンプリング画素の輝度値で線形補間することに
より、時間のかかる分散トレーシングの処理回数を減じ
て、描画時間を短縮するのである。That is, the luminance is calculated by densely sampling the number near the focal length, and the luminance is calculated by making the sampling number sparser as the distance from the focal length increases and the degree of out-of-focus increases. By linearly interpolating the luminance of the pixel of 1 with the luminance value of the sampling pixel, the number of time-consuming distributed tracing processes is reduced, and the drawing time is shortened.
【0022】この場合、画像の特性(例えば、非常に細
かい画像、粗い画像など)、図形データの奥行き情報、
およびレンズ特性を考慮に入れ、適切なサンプリングレ
ート(補間間隔)を決定すれば、描画処理速度と画像の
質とを制御することができる。例えば、サンプリングレ
ートを小さく設定しておけば、描画される画像の質は高
くなるが、描画速度は遅くなる。逆にサンプリングレー
トを大きくとれば、サンプリングレートに応じて描画時
間は短縮されるが画質もある程度低下する。このように
利用目的に応じて適切なサンプリングレートを選定する
ことにより、画像描画速度と画質を制御することができ
る。In this case, the characteristics of the image (for example, very fine image, rough image, etc.), depth information of graphic data,
If the appropriate sampling rate (interpolation interval) is determined in consideration of the lens characteristics and the lens characteristics, the drawing processing speed and the image quality can be controlled. For example, if the sampling rate is set low, the quality of the drawn image is high, but the drawing speed is low. Conversely, if the sampling rate is increased, the drawing time is shortened according to the sampling rate, but the image quality is also lowered to some extent. By thus selecting an appropriate sampling rate according to the purpose of use, the image drawing speed and the image quality can be controlled.
【0023】図6は物体5,物体6,物体7が表示され
ている画像においてFナンバーおよび画素の奥行き値に
基づいてデフォーカスの程度が小さい画素領域10と、
デフォーカスの程度が中ぐらいの画素領域11と、デフ
ォーカスの程度が大きい画素領域12を示した図、図7
は画素領域10においてはサンプリングレートを小さく
して画素のサンプリングを行なった状態、画像領域11
においてはサンプリングレートを中ぐらいに設定して画
素のサンプリングを行った状態、画像領域12において
はサンプリングレートを大きく設定して画素のサンプリ
ングを行った状態をそれぞれ示した図である。このよう
にデフォーカスの程度に対応してサンプリングレートを
設定し、サンプリングした画素の輝度だけを分散レイト
レーシングにより計算し、サンプリング画素の間の画素
の輝度値は線形補間して求めることにより、デフォーカ
ス領域の輝度計算時間を大幅に短縮することができる。FIG. 6 shows a pixel area 10 in which the degree of defocus is small based on the F number and the depth value of the pixel in the image in which the object 5, the object 6, and the object 7 are displayed.
FIG. 7 is a diagram showing a pixel region 11 having a medium degree of defocus and a pixel region 12 having a large degree of defocus.
Is a state where the sampling rate is reduced in the pixel area 10 to sample pixels, and the image area 11
6A and 6B are diagrams showing a state in which the sampling rate is set to a medium level and pixel sampling is performed, and a state in which the sampling rate is set to a high value in the image region 12 and pixel sampling is performed. In this way, the sampling rate is set according to the degree of defocus, only the brightness of the sampled pixels is calculated by distributed ray tracing, and the brightness values of the pixels between the sampling pixels are obtained by linear interpolation, It is possible to significantly reduce the brightness calculation time of the focus area.
【0024】[0024]
【実施例2】図8および図9はこの発明の画像描画方法
の他の実施例を示すフローチャートである。この実施例
はこの発明の画像描画方法をラスタスキャン方式に採用
した一例を示すフローチャートである。図8において、
まず、ステップSP1において奥行き値(z値)を含む
図形データを得て、ステップSP2において座標変換、
光源位置設定などの所定の図形処理を行ない、ステップ
SP3において採用するレンズ特性を設定し、ステップ
SP4において画像中の画素を選択し、ステップSP5
において選択した画素がデフォーカスであるか否かを判
別し、デフォーカスでない、すなわちフォーカスである
と判別され場合はステップSP6においてスキャンライ
ン方向において選択した画素より1つ前の画素はデフォ
ーカスであるか否かを判別し、デフォーカスでないと判
別された場合はステップSP7において選択した画素の
輝度を算出する。一方、ステップSP6において前の画
素がデフォーカスであると判別された場合はステップS
P8においてその前の画素の状態をフォーカスとし、ス
テップSP9において散乱円の半径に応じてx方向(ラ
スタスキャン方向)へn個、処理対象画素を戻す。Second Embodiment FIGS. 8 and 9 are flowcharts showing another embodiment of the image drawing method of the present invention. This embodiment is a flow chart showing an example in which the image drawing method of the present invention is adopted in a raster scan system. In FIG.
First, graphic data including a depth value (z value) is obtained in step SP1, and coordinate conversion is performed in step SP2.
Predetermined graphic processing such as light source position setting is performed, lens characteristics used in step SP3 are set, pixels in the image are selected in step SP4, and step SP5
It is determined whether or not the selected pixel is defocused. If it is determined that the pixel is not defocused, that is, the pixel is defocused, the pixel immediately before the pixel selected in the scan line direction is defocused in step SP6. If it is determined that the focus is not defocused, the brightness of the pixel selected in step SP7 is calculated. On the other hand, if it is determined in step SP6 that the previous pixel is defocused, step S
In P8, the state of the previous pixel is set as the focus, and in step SP9, n processing target pixels are returned in the x direction (raster scan direction) according to the radius of the scattering circle.
【0025】また、ステップSP5においてデフォーカ
スであると判別された場合はステップSP10において
選択した画素より1つ前の画素はデフォーカスであるか
否かを判別し、デフォーカスでないと判別された場合は
ステップSP11において選択した画素の輝度を算出
し、ステップSP12において散乱円の半径に応じてx
方向へ処理対象画素をn個、進める。一方、ステップS
P10において、デフォーカスであると判別された場合
はステップSP13において選択した画素および散乱円
の半径に応じてn個前までの画素において線形補間を行
なって各画素の輝度を算出し、ステップSP14におい
て散乱円の半径に応じてX方向へ処理対象画素をn個、
進める。When it is determined that the pixel is defocused in step SP5, it is determined whether the pixel immediately before the pixel selected in step SP10 is defocused, and when it is determined that the pixel is not defocused. Calculates the brightness of the selected pixel in step SP11, and x is calculated according to the radius of the scattering circle in step SP12.
N pixels to be processed are advanced in the direction. On the other hand, step S
If it is determined that the focus is defocused in P10, the brightness of each pixel is calculated by performing linear interpolation in the pixels up to the nth pixel in accordance with the selected pixel and the radius of the scattering circle in step SP13, and in step SP14. N pixels to be processed in the X direction according to the radius of the scattering circle,
Proceed.
【0026】そして、ステップSP7、ステップSP
9、ステップSP12、またはステップSP14の処理
が終了した場合は、ステップSP15において選択され
た画素が最後の画素であるか否かを判別し、最後の画素
でないと判別された場合は、ステップSP16において
x方向へ対象画素を1個、進めて、ステップSP4の画
素選択処理を再び行なう。一方、ステップSP15にお
いて最後の画素であると判別された場合は一連の処理を
終了する。Then, step SP7 and step SP
When the processing of step 9, step SP12, or step SP14 is completed, it is determined whether or not the pixel selected in step SP15 is the last pixel. If it is determined that the pixel is not the last pixel, in step SP16. The target pixel is advanced by one in the x direction, and the pixel selection process of step SP4 is performed again. On the other hand, if it is determined in step SP15 that the pixel is the last pixel, the series of processes ends.
【0027】この実施例の画像描画方法について図10
を参照しつつ、さらに詳細に説明する。なお、図10に
おいて○はデフォーカスの画素、×はフォーカスの画素
を示し、スキャンライン方向がx方向(図10において
画素配列方向)である場合を想定している。まず、図1
0(a)に示すようにフォーカスである画素から移動し
た次の画素がフォーカスである場合は、1画素ずつx方
向に移動する毎に輝度を計算して決定する。この処理に
対応するフローチャートの箇所はステップSP5→ステ
ップSP6→ステップSP7の処理に相当する。The image drawing method of this embodiment is shown in FIG.
Will be described in more detail with reference to. In FIG. 10, ◯ indicates a defocused pixel and x indicates a focused pixel, and it is assumed that the scan line direction is the x direction (pixel arrangement direction in FIG. 10). First, Fig. 1
As shown in 0 (a), when the next pixel moved from the focus pixel is the focus, the brightness is calculated and determined for each pixel in the x direction. The part of the flowchart corresponding to this process corresponds to the process of step SP5 → step SP6 → step SP7.
【0028】次に、図10(b)に示すようにフォーカ
スである画素から移動した次の画素がデフォーカスであ
る場合は、デフォーカスである画素の輝度値を算出して
(図10(b)において斜線で示す)、次のサンプリン
グ画素をデフォーカスの程度(具体的には散乱円の半径
によって定まるサンプリングレート)に対応してジャン
プする。この処理に対応するフローチャートの箇所はス
テップSP5→ステップSP10→ステップSP11→
ステップSP12である。Next, as shown in FIG. 10B, when the next pixel moved from the focused pixel is defocused, the brightness value of the defocused pixel is calculated (see FIG. 10B. ), The next sampling pixel is jumped according to the degree of defocus (specifically, the sampling rate determined by the radius of the scattering circle). The part of the flowchart corresponding to this process is step SP5 → step SP10 → step SP11 →
That is step SP12.
【0029】次に、図10(c)に示すようにデフォー
カスである画素から移動した次の画素がデフォーカスで
ある場合は、前の画素の輝度とジャンプした画素の輝度
値に基づいて間の画素の輝度値を線形補間によって算出
した後、再びn個、進んだサンプリング画素にジャンプ
する。この処理に対応するフローチャートの箇所はステ
ップSP5→ステップSP10→ステップSP13→ス
テップSP14である。Next, as shown in FIG. 10C, when the next pixel moved from the defocused pixel is defocused, an interval is calculated based on the brightness of the previous pixel and the brightness value of the jumped pixel. After calculating the luminance value of the pixel by linear interpolation, the pixel jumps to the sampling pixel advanced by n. The part of the flowchart corresponding to this process is step SP5 → step SP10 → step SP13 → step SP14.
【0030】また、図10(d)に示すようにデフォー
カスである画素から移動した次の画素がフォーカスであ
る場合は、前の画素をフォーカスとするとともに、前の
画素の次の画素(すなわち、n個前の画素)まで処理対
称を戻す。この処理に対応するフローチャートの箇所は
ステップSP5→ステップSP6→ステップSP8→ス
テップSP9である。なお、図10(d)において、戻
った画素がフォーカスである場合には図10(a)と同
じように1個、画素を進め(図10(d1)参照)、戻
った画素がデフォーカスである場合には図10(b)と
同じようにそのデフォーカスの画素の輝度を算出した
後、n個、進んだ画素へジャンプする(図10(d2)
参照)。When the next pixel moved from the defocused pixel is the focus as shown in FIG. 10D, the previous pixel is made the focus and the pixel next to the previous pixel (that is, , Nth previous pixel). The part of the flowchart corresponding to this process is step SP5 → step SP6 → step SP8 → step SP9. Note that in FIG. 10D, when the returned pixel is in focus, the pixel is advanced by one as in FIG. 10A (see FIG. 10D1), and the returned pixel is defocused. In some cases, the brightness of the pixel of the defocus is calculated in the same manner as in FIG. 10B, and then the pixel is jumped to n pixels ahead (FIG. 10D2).
reference).
【0031】このように、この実施例の画像描画方法に
よれば、ラスタスキャンにおいて、スキャンライン方向
にフォーカス、デフォーカスの画素が混在していても、
順次、レイトレーシング法、分散トレーシング法あるい
は線形補間法に基づいて画素の輝度を決定することがで
きるので、最も広く使用されるラスタスキャン型表示装
置においても、この発明の画像描画方法を適用すること
ができる。As described above, according to the image drawing method of this embodiment, even if focus and defocus pixels are mixed in the scan line direction in raster scanning,
Since the luminance of pixels can be sequentially determined based on the ray tracing method, the distributed tracing method, or the linear interpolation method, the image drawing method of the present invention is applied even to the most widely used raster scan display device. be able to.
【0032】[0032]
【実施例3】図11および図12はこの発明の画像描画
装置の一実施例を示すブロック図である。この画像描画
装置は、図11に示すように被写界深度を決める所定レ
ンズ特性を設定するレンズ特性設定部31と、図形デー
タの座標変換などを行なう図形データ処理部32と、図
形処理されたデータを保持するデータ保持部33と、デ
ータ保持部33のデータとレンズ特性設定部31のデー
タに基づいて画素の散乱円半径を算出する散乱円半径算
出部34と、画素がフォーカスであるかデフォーカスで
あるかを判別するフォーカス/デフォーカス判別部35
と、フォーカス/デフォーカス判別部35の判別信号と
散乱円半径算出部34からの散乱円半径値によりサンプ
リングレートを決定するサンプリングレート決定部36
と、サンプリングを行なうサンプリング部37と、画素
の輝度を計算するとともに描画する輝度算出描画部38
と、画像メモリ39とを有している。なお、画像メモリ
39には表示装置としてのCRT40が接続されてい
る。Third Embodiment FIGS. 11 and 12 are block diagrams showing an embodiment of the image drawing apparatus of the present invention. As shown in FIG. 11, this image drawing apparatus has a lens characteristic setting unit 31 that sets a predetermined lens characteristic that determines the depth of field, a graphic data processing unit 32 that performs coordinate conversion of graphic data, and a graphic processing. A data holding unit 33 that holds data, a scattering circle radius calculation unit 34 that calculates the scattering circle radius of a pixel based on the data of the data holding unit 33 and the data of the lens characteristic setting unit 31, and whether the pixel is in focus or not. Focus / defocus determination unit 35 that determines whether the focus is set
And a sampling rate determination unit 36 that determines the sampling rate based on the discrimination signal of the focus / defocus discrimination unit 35 and the scattering circle radius value from the scattering circle radius calculation unit 34.
A sampling section 37 for sampling, and a brightness calculation / drawing section 38 for calculating and drawing the brightness of pixels.
And an image memory 39. A CRT 40 as a display device is connected to the image memory 39.
【0033】輝度算出描画部38は図12に示すよう
に、1つ1つの画素をレイトレーシング法により輝度を
決定するレイトレーシング部41と、サンプリングされ
た画素の輝度を所定フィルタにより畳み込み積分を行な
うことにより、サンプリング画素の輝度値を算出するフ
ィルタリング輝度算出部42と、サンプリング画素の輝
度値に基づいて描画するサンプリング画素描画部43
と、サンプリング画素の間の画素の輝度値を線形補間に
より算出する補間輝度算出部44と、補間された画素の
輝度値に基づいて描画する補間画素描画部45とを含ん
でいる。なお、サンプリング画素描画部43と補間画素
描画部45は一体化したデフォーカス画素描画部46を
構成しており、各種描画方法に対応してサンプリング画
素と補間画素の描画順序が適宜変更できるようになって
いる。As shown in FIG. 12, the brightness calculation / drawing unit 38 performs a convolution integration of a ray tracing unit 41 for determining the brightness of each pixel by the ray tracing method, and a brightness of each sampled pixel by a predetermined filter. Thus, the filtering brightness calculation unit 42 that calculates the brightness value of the sampling pixel and the sampling pixel drawing unit 43 that draws based on the brightness value of the sampling pixel
And an interpolated luminance calculation unit 44 that calculates the luminance value of the pixel between the sampling pixels by linear interpolation, and an interpolated pixel drawing unit 45 that draws based on the luminance value of the interpolated pixel. Note that the sampling pixel drawing unit 43 and the interpolation pixel drawing unit 45 form a defocus pixel drawing unit 46 that is integrated so that the drawing order of the sampling pixels and the interpolation pixels can be appropriately changed according to various drawing methods. Has become.
【0034】上記構成の画像描画装置の作用について簡
単に説明する。まず、レンズ特性設定部31により、被
写体深度の程度、例えば広角レンズ、望遠レンズのよう
な所望の被写界深度を表現するレンズ特性を設定する。
また、サンプリングレート決定部36に散乱円半径域に
対応した複数のサンプリングレートを予め設定してお
く。そして、奥行き情報を含む図形データが図形データ
処理部32により視点位置、光源の配置が考慮されたデ
ータに変化され、データ保持部33に保持されると、散
乱円半径算出部34はレンズ特性設定部31のレンズ特
性と画素の奥行き値に基づいて像平面上の散乱円半径を
算出する。そしてフォーカス/デフォーカス判別部35
ではフォーカス、デフォーカスの判別の基準となる半径
値が予め設定してあり、フォーカス/デフォーカス判別
部35は算出された散乱円半径と基準半径値の大小を比
較して、フォーカスである画素、デフォーカスである画
素を判別する。The operation of the image drawing apparatus having the above configuration will be briefly described. First, the lens characteristic setting unit 31 sets a lens characteristic that expresses a degree of subject depth, for example, a desired depth of field such as a wide-angle lens and a telephoto lens.
In addition, a plurality of sampling rates corresponding to the scattering circle radius range are set in advance in the sampling rate determining unit 36. Then, the graphic data including the depth information is changed by the graphic data processing unit 32 into data in which the viewpoint position and the arrangement of the light source are taken into consideration and held in the data holding unit 33, and the scattering circle radius calculation unit 34 sets the lens characteristic setting. The radius of the scattering circle on the image plane is calculated based on the lens characteristic of the unit 31 and the depth value of the pixel. Then, the focus / defocus determination unit 35
Then, a radius value serving as a reference for discriminating between focus and defocus is set in advance, and the focus / defocus discrimination unit 35 compares the calculated scattering circle radius with the reference radius value to determine which pixel is the focus. A pixel that is defocused is determined.
【0035】そして、フォーカスであると判別された場
合はサンプリリングレート決定部36がフォーカスであ
るという判別信号に応答して、全ての画素をサンプリン
グするサンプリングレートを決定して、サンプリング部
37がサンプリングして、レイトレーシング部41が1
画素ずつ輝度値を決定して画像メモリ41に描画する。
一方、デフォーカスであると判別された場合は、デフォ
ーカスであるという判別信号は、散乱円半径算出部34
に入力され、サンプリングレート決定部36が散乱円半
径に対応したサンプリングレートを決定する。そして、
サンプリング部37が画素をサンプリングして、フィル
タリング輝度算出部42が輝度を算出する。また、サン
プリング画素の間の画素の輝度は補間輝度算出部44が
線形補間により算出する。そして、サンプリング画素描
画部43および補間画素描画部45がサンプリング画素
および補間した画素を画像メモリ39に描画する。な
お、フォーカス/デフォーカス判別部35は散乱円の大
きさだけでなく、上記数1,数2などに基づいてフォー
カス、デフォーカスを判別することも可能である。When it is determined that the pixel is in focus, the sampling rate determining unit 36 determines the sampling rate for sampling all pixels in response to the determination signal that the pixel is in focus, and the sampling unit 37 performs sampling. Then, the ray tracing section 41 is 1
The brightness value is determined for each pixel and drawn in the image memory 41.
On the other hand, when it is determined that the focus is defocused, the determination signal that the focus is defocused indicates that the scattering circle radius calculation unit 34
The sampling rate determining unit 36 determines the sampling rate corresponding to the radius of the scattering circle. And
The sampling unit 37 samples the pixels, and the filtering brightness calculation unit 42 calculates the brightness. Further, the luminance of the pixels between the sampling pixels is calculated by the interpolation luminance calculation unit 44 by linear interpolation. Then, the sampling pixel drawing unit 43 and the interpolation pixel drawing unit 45 draw the sampling pixel and the interpolated pixel in the image memory 39. It should be noted that the focus / defocus determination unit 35 can also determine focus and defocus based on not only the size of the scattering circle but also the above equations 1 and 2.
【0036】この画像描画装置によれば、デフォーカス
の程度に対応したサンプリングレートに基づいてデフォ
ーカス領域の画素をサンプリングするので、分散レイト
レーシングを行なう画素を少なくして計算時間を短縮し
ても、実質的な画質の低下を抑制することができ、描画
速度の向上の効果のみを享受することができる。この発
明は上記実施例に限定されるものではなく、この発明の
要旨を変更しない範囲内において種々の設計変更を施す
ことが可能である。例えば、前記実施例ではサンプリン
グされた画素の間の画素の輝度値を線形補間により求め
たが、その他の各種補間方法を採用することも可能であ
る。According to this image drawing apparatus, since the pixels in the defocus area are sampled based on the sampling rate corresponding to the degree of defocus, even if the number of pixels to be subjected to distributed ray tracing is reduced and the calculation time is shortened. In addition, it is possible to suppress substantial deterioration of the image quality and to enjoy only the effect of improving the drawing speed. The present invention is not limited to the above embodiments, and various design changes can be made without departing from the scope of the present invention. For example, although the luminance value of the pixel between the sampled pixels is obtained by linear interpolation in the above-mentioned embodiment, other various interpolation methods can be adopted.
【0037】[0037]
【発明の効果】以上のように、請求項1の発明は、デフ
ォーカス状態の画素のデフォーカスの程度に対応して、
サンプリングレートを設定するとともに、サンプリング
画素の間の画素の輝度値を補間して描画するので、実質
的な画像品質の低下を招くことなく、デフォーカス画素
の畳み込み積分回数を減らすことができ、被写界深度を
表現した画像を高速に描画することができるという特有
の効果を奏する。As described above, the invention of claim 1 corresponds to the degree of defocus of a pixel in the defocus state,
Since the sampling rate is set and the luminance values of pixels between sampling pixels are interpolated and drawn, the number of convolution integrations of defocused pixels can be reduced without causing a substantial deterioration in image quality. It has a unique effect that an image expressing the depth of field can be drawn at high speed.
【0038】請求項2の発明も、デフォーカス状態の画
素のデフォーカスの程度に対応して、サンプリングレー
トを設定するとともに、サンプリング画素の間の画素の
輝度値を補間して描画するので、実質的な画像品質の低
下を招くことなく、デフォーカス画素の畳み込み積分回
数を減らすことができ、被写界深度を表現した画像を高
速に描画することができるという特有の効果を奏する。According to the second aspect of the invention, the sampling rate is set in accordance with the degree of defocus of the pixel in the defocused state, and the luminance value of the pixel between the sampling pixels is interpolated and drawn. It is possible to reduce the number of times of defocus pixel convolution integration without causing a general decrease in image quality, and it is possible to draw an image expressing the depth of field at high speed.
【図1】この発明の画像描画方法の一実施例を示すフロ
ーチャートである。FIG. 1 is a flowchart showing an embodiment of an image drawing method of the present invention.
【図2】この発明の画像描画方法の一実施例を示すフロ
ーチャートである。FIG. 2 is a flow chart showing an embodiment of the image drawing method of the present invention.
【図3】被写界深度を説明するための図である。FIG. 3 is a diagram for explaining a depth of field.
【図4】散乱円の大きさの算出方法を説明するための図
である。FIG. 4 is a diagram for explaining a method of calculating the size of a scattering circle.
【図5】被写界深度を考慮した画像を高速に生成する基
本的原理について説明するための図である。FIG. 5 is a diagram for explaining a basic principle of generating an image at high speed in consideration of a depth of field.
【図6】デフォーカスの程度の異なる領域を示した図で
ある。FIG. 6 is a diagram showing regions having different degrees of defocus.
【図7】デフォーカスの程度に応じてサンプリングレー
トを変えた場合のサンプリングされた画素を概略的に示
した図である。FIG. 7 is a diagram schematically showing sampled pixels when a sampling rate is changed according to the degree of defocus.
【図8】この発明の画像描画方法の他の実施例を示すフ
ローチャートである。FIG. 8 is a flowchart showing another embodiment of the image drawing method of the present invention.
【図9】この発明の画像描画方法の他の実施例を示すフ
ローチャートである。FIG. 9 is a flowchart showing another embodiment of the image drawing method of the present invention.
【図10】図8および図9に示す画像描画方法を説明す
るための図である。10 is a diagram for explaining the image drawing method shown in FIGS. 8 and 9. FIG.
【図11】この発明の画像描画装置の一実施例を示すブ
ロック図である。FIG. 11 is a block diagram showing an embodiment of an image drawing apparatus of the present invention.
【図12】輝度算出描画部の詳細構成を示すブロック図
である。FIG. 12 is a block diagram showing a detailed configuration of a luminance calculation drawing unit.
34 散乱円半径算出部 35 フォーカス/デフォ
ーカス判別部 36 サンプリングレート決定部 37 サンプリン
グ部 41 レイトレーシング部 42 フィルタリング輝
度算出部 43 サンプリング画素描画部 44 補間輝度算出
部 45 補間画素描画部 46 デフォーカス画素描画
部34 Scattering circle radius calculation unit 35 Focus / defocus determination unit 36 Sampling rate determination unit 37 Sampling unit 41 Ray tracing unit 42 Filtering brightness calculation unit 43 Sampling pixel drawing unit 44 Interpolation brightness calculation unit 45 Interpolation pixel drawing unit 46 Defocus pixel drawing Department
Claims (2)
表現した画像を描画する画像描画方法であって、所定レ
ンズ特性および画素の奥行き値に基づいて、画素がフォ
ーカス状態であるのか、デフォーカス状態であるのかを
判別し、フォーカス状態であると判別されたことに応答
して、全ての画素についてサンプリングを行なうように
サンプリングレートを決定して画素をサンプリングし、
サンプリング画素の輝度値をピンホールカメラモデルに
より算出して描画するとともに、デフォーカス状態であ
ると判別されたことに応答してデフォーカスの程度を算
出し、算出されたデフォーカスの程度に基づいて画素の
サンプリングレートを決定し、決定されたサンプリング
レートに基づいて画素をサンプリングし、サンプリング
画素に対応する散乱円内の画素をフィルタリングするこ
とによりサンプリング画素の輝度値を算出し、サンプリ
ング画素間の画素の輝度値を所定補間法により算出し、
サンプリング画素および補間した画素をそれぞれの輝度
値に基づいて描画することを特徴とする画像描画方法。1. An image drawing method for drawing an image expressing a depth of field assuming a predetermined lens characteristic, wherein whether the pixel is in a focus state based on the predetermined lens characteristic and the depth value of the pixel. It is determined whether or not it is in the defocus state, and in response to the determination that it is in the focus state, the sampling rate is determined so that sampling is performed for all the pixels, and the pixels are sampled.
The brightness value of the sampling pixel is calculated by the pinhole camera model and drawn, and the degree of defocus is calculated in response to the determination that the state is defocused, and based on the calculated degree of defocus. The pixel sampling rate is determined, the pixel is sampled based on the determined sampling rate, the pixels in the scattering circle corresponding to the sampling pixel are filtered to calculate the luminance value of the sampling pixel, and the pixel between the sampling pixels is calculated. Calculate the luminance value of by a predetermined interpolation method,
An image drawing method, which draws a sampling pixel and an interpolated pixel based on respective luminance values.
基づいて、画素がフォーカス状態であるのか、デフォー
カス状態であるのかを判別するフォーカス/デフォーカ
ス判別手段(35)と、フォーカス/デフォーカス判別
手段(35)がフォーカス状態であると判別したことに
応答して、全ての画素についてサンプリングを行なうよ
うにサンプリングレートを決定し、そのサンプリングレ
ートに基づいて画素をサンプリングするサンプリング手
段(36)(37)と、サンプリングされた画素の輝度
値をピンホールカメラモデルにより算出して描画するフ
ォーカス画素描画手段(41)と、フォーカス/デフォ
ーカス判別手段(35)がデフォーカス状態であると判
別したことに応答してデフォーカスの程度を算出するデ
フォーカス程度算出手段(34)と、算出されたデフォ
ーカスの程度に基づいて画素のサンプリングレートを決
定し、そのサンプリングレートに基づいて画素をサンプ
リングするサンプリング手段(36)(37)と、サン
プリングされた画素に対応する散乱円内の画素をフィル
タリングすることによりサンプリング画素の輝度値を算
出するサンプリング画素輝度算出手段(42)と、サン
プリング画素間の画素の輝度値を所定補間法により算出
する補間画素輝度算出手段(44)と、サンプリング画
素および補間した画素をそれぞれの輝度値に基づいて描
画するデフォーカス画素描画手段(43)(45)(4
6)とを有することを特徴とする画像描画装置。2. A focus / defocus determination means (35) for determining whether a pixel is in a focus state or a defocus state based on a predetermined lens characteristic and a depth value of the pixel, and a focus / defocus determination. In response to the means (35) determining that the pixel is in the focus state, the sampling rate is determined so that all pixels are sampled, and the pixels are sampled based on the sampling rate (36) (37). ), The focus pixel drawing means (41) for calculating and drawing the luminance value of the sampled pixel by the pinhole camera model, and the focus / defocus judging means (35) are judged to be in the defocused state. Defocus degree calculation that calculates the degree of defocus in response Means (34), sampling means (36) (37) for determining the sampling rate of the pixel based on the calculated degree of defocus, and sampling the pixel based on the sampling rate, and corresponding to the sampled pixel Sampling pixel brightness calculating means (42) for calculating the brightness value of the sampling pixel by filtering the pixels in the scattering circle, and interpolation pixel brightness calculating means (42) for calculating the brightness value of the pixel between the sampling pixels by a predetermined interpolation method. 44), and defocus pixel drawing means (43) (45) (4) for drawing the sampling pixel and the interpolated pixel based on the respective brightness values.
6) An image drawing device comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5337192A JPH07200816A (en) | 1993-12-28 | 1993-12-28 | Image drawing method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5337192A JPH07200816A (en) | 1993-12-28 | 1993-12-28 | Image drawing method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH07200816A true JPH07200816A (en) | 1995-08-04 |
Family
ID=18306315
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5337192A Pending JPH07200816A (en) | 1993-12-28 | 1993-12-28 | Image drawing method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07200816A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008029625A1 (en) * | 2006-09-08 | 2008-03-13 | Sony Corporation | Image processing device, image processing method, and program |
| JP2009505104A (en) * | 2005-08-15 | 2009-02-05 | ソニー エレクトロニクス インク | Arithmetic method, machine-readable medium, arithmetic device and arithmetic system for creating depth map |
-
1993
- 1993-12-28 JP JP5337192A patent/JPH07200816A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009505104A (en) * | 2005-08-15 | 2009-02-05 | ソニー エレクトロニクス インク | Arithmetic method, machine-readable medium, arithmetic device and arithmetic system for creating depth map |
| WO2008029625A1 (en) * | 2006-09-08 | 2008-03-13 | Sony Corporation | Image processing device, image processing method, and program |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7638290B2 (en) | Characteristics of computational photography using depth | |
| US7961970B1 (en) | Method and apparatus for using a virtual camera to dynamically refocus a digital image | |
| US6157387A (en) | Image generating apparatus and method | |
| US7760932B2 (en) | Method for reconstructing three-dimensional structure using silhouette information in two-dimensional image | |
| JP3718472B2 (en) | Image display method and apparatus | |
| US9412151B2 (en) | Image processing apparatus and image processing method | |
| US20250014162A1 (en) | Point cloud quality evaluation method, and device and storage medium | |
| US20230063939A1 (en) | Electro-hydraulic varifocal lens-based method for tracking three-dimensional trajectory of object by using mobile robot | |
| Riguer et al. | Real-time depth of field simulation | |
| WO2018129692A1 (en) | Image refocusing | |
| JP2001243500A (en) | Three-dimensional dot group data processor | |
| KR101714759B1 (en) | Wide angle camera image processing apparatus and method | |
| JPH07200816A (en) | Image drawing method and apparatus | |
| AU2022200296A1 (en) | Method for simulating an optical image | |
| EP1008954A1 (en) | Image processing method, image processing device and recording medium containing stored image processing program | |
| JP4137923B2 (en) | Image display method and apparatus | |
| JP3058769B2 (en) | 3D image generation method | |
| CN107534729A (en) | Image processing device and image processing method | |
| JPH0772915B2 (en) | Graphic shading device | |
| JP2718784B2 (en) | Drawing method of contour and / or edge | |
| WO2012049022A1 (en) | Method and device for digital image processing | |
| US7956911B2 (en) | Digital photographing apparatus, and method and program for controlling the same | |
| JPH07200817A (en) | Image drawing method and apparatus | |
| JP3382536B2 (en) | Image generation method, image generation device, and recording medium recording image generation program | |
| JPH0636025A (en) | Defocus processing device |