JP4369951B2 - Image generation method, image generation apparatus, and image generation program - Google Patents
Image generation method, image generation apparatus, and image generation program Download PDFInfo
- Publication number
- JP4369951B2 JP4369951B2 JP2006320138A JP2006320138A JP4369951B2 JP 4369951 B2 JP4369951 B2 JP 4369951B2 JP 2006320138 A JP2006320138 A JP 2006320138A JP 2006320138 A JP2006320138 A JP 2006320138A JP 4369951 B2 JP4369951 B2 JP 4369951B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- gray value
- grid point
- interpolation
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Description
本発明は、映像素材を加工し、画像を生成する技術に関する。 The present invention relates to a technique for processing a video material and generating an image.
近年、デジタル映像や画像に様々な変形・移動処理を施す画像処理が存在している。そのほとんどが対象の剛体性に仮定をおいて、対象の重心の移動、あるいは、面積が一定になるような制限のある変形に関する方法である。しかし、水面や雲が変化する場合は、明らかに剛体性を仮定できず、発達と衰退などにより面積一定の基準も崩れてしまう。また、拡大・縮小などの変形を行う場合には、個々の対象を識別しながら拡大・縮小変形を行うことができず、光学レンズによるような自然な変形を与えることができない。 In recent years, there has been image processing for performing various deformation / movement processes on digital video and images. Most of them are methods relating to the movement of the center of gravity of the object or the limited deformation that makes the area constant, assuming the rigid body of the object. However, when the water surface and clouds change, the rigid body cannot be assumed clearly, and the standard of constant area is broken due to development and decline. Further, when performing deformation such as enlargement / reduction, it is not possible to perform enlargement / reduction deformation while identifying individual objects, and natural deformation such as that caused by an optical lens cannot be applied.
そこで、煙や雲などの流体状パターンを表現する方法として、流体モデルに基づいた方法が提案されている(非特許文献1参照)。 Therefore, a method based on a fluid model has been proposed as a method of expressing a fluid pattern such as smoke or clouds (see Non-Patent Document 1).
また、画像の流体状パターンへの変形・移動については、流体力学の分野でよく用いられている移流方程式に基づく方法が提案されている(特許文献1参照)。特許文献1に記載の技術は、渦や発散について速度場を設定し、設定された速度場に基づいて、画像の画素ごとに移流項を含む移流方程式を適用して任意の時刻における画像を順次作成するものである。
しかしながら、非特許文献1に示す方法は、煙や雲などの流体状パターン表現には向いているが、計算時間を進めていくと画像劣化が顕著となる問題がある。 However, although the method shown in Non-Patent Document 1 is suitable for expressing fluid-like patterns such as smoke and clouds, there is a problem that image deterioration becomes remarkable as the calculation time is advanced.
また、移流方程式は、画像の濃淡値を時間変数にもち、速度場を既知として、画像の変形と移動を速度場に沿って行う偏微分方程式であって、速度、計算格子幅、時間幅の間にクーラン数により定義される計算の安定条件が必ず付随するため、計算時間の短縮には一定の限度がある。画像が数十万もの画素で構成されている場合、速度場も画素の数だけ設定・定義されるので、計算コストが掛かるという問題があった。さらに、移流項は高次の近似精度で差分化しないと、安定条件下であっても画像がぼやけていく問題がある。 The advection equation is a partial differential equation in which the gray level of an image is a time variable, the velocity field is known, and the image is deformed and moved along the velocity field. There is always a calculation stability condition defined by the number of Courants in between, so there is a certain limit to shortening the calculation time. When an image is composed of hundreds of thousands of pixels, the speed field is set and defined by the number of pixels. Furthermore, unless the advection term is differentiated with high-order approximation accuracy, there is a problem that the image is blurred even under stable conditions.
そこで、本願発明者は、CIP法に基づいて移流方程式を解くことにより、画像劣化を大幅に抑制する技術として特願2006−119516を提案したが、格子点間で3次補間関数と1次微分係数を計算する必要があること、および、プログラムのコード数がやや大きくなるという問題があった。 Therefore, the inventor of the present application has proposed Japanese Patent Application No. 2006-119516 as a technique for greatly suppressing image degradation by solving an advection equation based on the CIP method. However, a third-order interpolation function and a first-order differential function between lattice points are proposed. There was a problem that the coefficient had to be calculated and the number of codes of the program was slightly increased.
本発明は、上記に鑑みてなされたものであり、その課題とするところは、移流方程式に基づいて画像を変形する際に、処理の高速化と画像劣化の改善を図ることにある。 The present invention has been made in view of the above, and an object of the present invention is to increase the processing speed and improve image degradation when deforming an image based on an advection equation.
第1の本発明に係る画像生成方法は、画像入力手段により、格子点毎に濃淡値が設定された第1の画像を入力し、画像蓄積手段に格納するステップと、速度場設定手段により、速度成分の空間的な分布を表す速度場情報を設定し、速度場蓄積手段に格納するステップと、移流手段により、第1の画像から所定時間経過した時刻における第2の画像の格子点毎に、当該格子点における濃淡値が当該格子点における速度成分で所定時間過去に遡った位置における第1の画像の濃淡値が平行移動したものであるとするモデルに基づいて、速度場蓄積手段から速度場情報を読み出し、当該格子点における速度成分に基づいて当該格子点の所定時間過去に遡った位置を計算するステップと、補間手段により、画像蓄積手段から第1の画像を読み出し、第2の画像の格子点毎に、位置を計算するステップにおいて求めた当該格子点の所定時間過去に遡った位置における第1の画像の濃淡値を当該位置の近傍の第1の画像の格子点の濃淡値を補間することにより算出して、第2の画像の格子点における濃淡値と設定することで第2の画像を生成するステップと、を有し、補間することにより算出した第2の画像の格子点における濃淡値が、第1の画像を入力する際に設定した濃淡値の階調の範囲外の値になった場合には、補間に用いる第1の画像の一定領域内の格子点の濃淡値に重み付けをして当該濃淡値を非線形に補正する処理と、補正された濃淡値を用いて再び補間を行って濃淡値を求める処理とを、補間により算出した濃淡値が階調の範囲内に収まるまで繰り返すステップを有することを特徴とする。 The image generation method according to the first aspect of the present invention includes a step of inputting a first image in which a gray value is set for each grid point by an image input unit, storing the first image in the image storage unit, and a speed field setting unit Setting the velocity field information representing the spatial distribution of velocity components, storing the velocity field information in the velocity field accumulating means, and the advection means for each grid point of the second image at a time when a predetermined time has elapsed from the first image Based on a model in which the gray value at the grid point is a velocity component at the grid point and the gray value of the first image at a position retroactive to the past for a predetermined time is converted from the speed field accumulating means. Reading the field information, calculating the position of the grid point retroactive for a predetermined time based on the velocity component at the grid point, and reading the first image from the image storage means by the interpolation means; For each grid point of the image, the gray value of the first image at the position retroactive for a predetermined time of the grid point obtained in the step of calculating the position is used as the density of the grid point of the first image near the position. is calculated by interpolating the values, and generating a second image by setting a gray value at the lattice point of the second image, have a, the second image is calculated by interpolating When the gray value at the grid point becomes a value outside the range of the gray scale value set when the first image is input, the grid point in the fixed area of the first image used for interpolation is displayed. The process of weighting the gray value to correct the gray value in a non-linear manner and the process of obtaining the gray value by performing interpolation again using the corrected gray value, the gray value calculated by interpolation is within the range of the gradation. Japanese to have a repeating until it fits within To.
本発明にあっては、生成する第2の画像の格子点における濃淡値が基準となる第1の画像のどの位置における濃淡値が移流したものであるのかを、速度場情報に基づいて計算するとともに、その濃淡値を第1の画像の格子点に設定されている濃淡値を補間して算出することで、移流方程式と同等の変形と移動表現を作り出すことができ、移流方程式に基づいた数値計算から画像変形、画像予測まで広範囲にリアルタイム処理ができるようになる。また、濃淡値の補間に用いる格子点の濃淡値に重み付けをすることにより、補間される濃淡値が所定の階調値の範囲外の値を取ることがなくなるので、違和感のない補間を可能とする。 In the present invention, it is calculated based on the velocity field information at which position in the first image the gray value at the grid point of the second image to be generated is a reference. At the same time, by calculating the gray value by interpolating the gray value set at the grid point of the first image, it is possible to create a deformation and movement expression equivalent to the advection equation, and a numerical value based on the advection equation. Real-time processing can be performed over a wide range from calculation to image deformation and image prediction. In addition, by weighting the gray value of the grid points used for gray value interpolation, the gray value to be interpolated does not take a value outside the range of the predetermined gradation value, so that interpolation without a sense of incongruity is possible. To do.
上記画像生成方法において、第2の画像を生成するステップにおいて生成した第2の画像を第1の画像として画像蓄積手段に格納するステップを有し、速度場情報を設定するステップと位置を計算するステップと画像を生成するステップとを繰り返し実行することにより、さらに所定時間経過した時刻における画像を生成することを特徴とする。 The image generation method includes the step of storing the second image generated in the step of generating the second image in the image storage means as the first image, and calculating the speed field information and the position. By repeatedly executing the step and the step of generating an image, an image at a time when a predetermined time has passed is further generated.
本発明にあっては、生成された第2の画像を基準となる第1の画像として格納し、さらに所定時間経過した時刻における画像を生成することにより、時系列順に連続する複数の画像からなる動画を生成することができる。 In the present invention, the generated second image is stored as a reference first image, and further, an image at a time when a predetermined time has elapsed is generated, thereby forming a plurality of images that are continuous in time series. A video can be generated.
上記画像生成方法において、第2の画像を生成するステップにおいて用いられる補間方法は、3次補間法であることを特徴とする。 In the image generation method, the interpolation method used in the step of generating the second image is a cubic interpolation method.
本発明にあっては、3次補間法を用いることにより、誤差の累積が抑制されるので、画像の劣化を抑制することができる。 In the present invention, since the accumulation of errors is suppressed by using the cubic interpolation method, it is possible to suppress image deterioration.
上記画像生成方法において、第2の画像を生成するステップにおいて用いられる補間方法は、3次スプライン補間法であることを特徴とする。 In the image generation method, the interpolation method used in the step of generating the second image is a cubic spline interpolation method.
本発明にあっては、3次スプライン補間法を用いることにより、誤差の累積が抑制されるので、誤差の累積が抑制されるので、画像の劣化を抑制することができる。 In the present invention, since the accumulation of errors is suppressed by using the cubic spline interpolation method, the accumulation of errors is suppressed, so that the deterioration of the image can be suppressed.
第2の本発明に係る画像生成装置は、格子点毎に濃淡値が設定された第1の画像を入力し、画像蓄積手段に格納する画像入力手段と、速度成分の空間的な分布を表す速度場情報を設定し、速度場蓄積手段に格納する速度場設定手段と、第1の画像から所定時間経過した時刻における第2の画像の格子点毎に、当該格子点における濃淡値が当該格子点における速度成分で所定時間過去に遡った位置における第1の画像の濃淡値が平行移動したものであるとするモデルに基づいて、速度場蓄積手段から速度場情報を読み出し、当該格子点における速度成分に基づいて当該格子点の所定時間過去に遡った位置を計算する移流手段と、画像蓄積手段から第1の画像を読み出し、第2の画像の格子点毎に、移流手段が計算した当該格子点の所定時間過去に遡った位置における第1の画像の濃淡値を当該位置の近傍の第1の画像の格子点の濃淡値を補間することにより算出して、第2の画像の格子点における濃淡値と設定することで第2の画像を生成する補間手段と、を有し、補間手段が、濃淡値を補間した結果、当該濃淡値が第1の画像を入力する際に設定した濃淡値の階調の範囲外の値になった場合には、補間に用いる第1の画像の一定領域内の格子点の濃淡値に重み付けをして当該濃淡値を非線形に補正する処理と、補正された濃淡値を用いて再び補間を行って濃淡値を求める処理とを、補間により算出した濃淡値が階調の範囲内に収まるまで繰り返す機能を備えることを特徴とする。 The image generating apparatus according to the second aspect of the present invention inputs the first image in which the gray value is set for each grid point, stores the image in the image storage means, and expresses the spatial distribution of velocity components. For each grid point of the second image at a time when a predetermined time has elapsed from the first image, the gray value at the grid point is set to the grid. Based on a model in which the gray value of the first image at a position traced back in the past for a predetermined time in the velocity component at the point is translated, velocity field information is read from the velocity field accumulating means, and the velocity at the lattice point is read. Advection means for calculating the position of the grid point retroactively for a predetermined time based on the components, and the grid calculated by the advection means for each grid point of the second image by reading the first image from the image storage means Points for a predetermined time in the past The gray value of the first image at the retroactive position is calculated by interpolating the gray value of the grid point of the first image in the vicinity of the position, and set as the gray value at the grid point of the second image. in an interpolation unit for generating a second image, was closed, interpolation means, a result of interpolating the gray value, the gradation range of the gray value gray value set when entering the first image When the value becomes the value of, the gray value of the grid points in the fixed region of the first image used for interpolation is weighted and the gray value is corrected nonlinearly, and the corrected gray value is used. It has a function of repeating the process of performing the interpolation again to obtain the gray value until the gray value calculated by the interpolation falls within the gradation range .
上記画像生成装置において、補間手段により生成された第2の画像を第1の画像として画像蓄積手段に格納し、さらに所定時間経過した時刻における画像を生成させる繰返し手段を有することを特徴とする。 The image generating apparatus is characterized in that the second image generated by the interpolating means is stored in the image accumulating means as the first image, and further has a repeating means for generating an image at a time when a predetermined time has passed.
上記画像生成装置において、補間手段において用いられる補間方法は、3次スプライン補間法であることを特徴とする。 In the image generation apparatus, the interpolation method used in the interpolation means is a cubic spline interpolation method.
第3の本発明に係る画像生成プログラムは、上記画像生成方法における各ステップをコンピュータに実行させることを特徴とする。 An image generation program according to a third aspect of the present invention causes a computer to execute each step in the image generation method.
本発明によれば、移流方程式に基づいて画像を変形する際に、処理の高速化と画像劣化の改善を図ることができる。 According to the present invention, when an image is deformed based on an advection equation, it is possible to increase the processing speed and improve image degradation.
以下、本発明の実施の形態について図面を用いて説明する。図1は、一実施の形態における画像生成装置の構成を示すブロック図である。同図に示す画像生成装置1は、入力部11、速度場設定部12、移流部13、補間部14、繰返し部15、表示部16および記憶装置17を有する構成である。画像生成装置1は、演算処理装置、記憶装置、メモリ等を備えたコンピュータにより構成できるものであり、各部の処理はプログラムによって実行される。このプログラムは記憶装置17に記憶されており、記録媒体に記録することも、ネットワークを通して提供することも可能である。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating a configuration of an image generation apparatus according to an embodiment. The image generating apparatus 1 shown in the figure has a configuration including an input unit 11, a velocity field setting unit 12, an advection unit 13, an interpolation unit 14, a repetition unit 15, a display unit 16, and a storage device 17. The image generation device 1 can be configured by a computer including an arithmetic processing device, a storage device, a memory, and the like, and the processing of each unit is executed by a program. This program is stored in the storage device 17, and can be recorded on a recording medium or provided through a network.
本画像生成装置1は、その特徴として、入力部11により入力された1枚の基準画像に対して、速度場設定部12により特定の速度場を設定し、流体モデルとして移流方程式をリアルタイムに解くために、所定時間経過した時刻における画像の格子点の濃淡値は、基準画像のある位置の濃淡値が平行移動したものであるという線形移動モデルを想定し、移流部13により生成する画像の各格子点に対応する基準画像における位置を計算し、補間部14によりその位置における濃淡値を算出して画像を生成するものである。以下、各部での処理について詳細に説明する。 As a feature of the image generation apparatus 1, a specific velocity field is set by the velocity field setting unit 12 for one reference image input by the input unit 11, and the advection equation is solved in real time as a fluid model. Therefore, the gray value of the grid point of the image at the time when a predetermined time has elapsed assumes a linear movement model in which the gray value at a certain position of the reference image is translated, and each image generated by the advection unit 13 The position in the reference image corresponding to the grid point is calculated, and the interpolation unit 14 calculates the gray value at that position to generate an image. Hereinafter, processing in each unit will be described in detail.
入力部11は、格子点(画素)毎に濃淡値が設定された基準画像を入力し、記憶装置17に記憶させる。 The input unit 11 inputs a reference image in which a gray value is set for each grid point (pixel) and stores the reference image in the storage device 17.
速度場設定部12は、1枚の基準画像に対して発散、回転、収束、振動、波状などの速度場を設定し、記憶装置17に記憶させる。速度場は、速度成分の空間的な分布を表すものであって、本実施の形態においては、画像の格子点のそれぞれに流速(速度ベクトル)を設定したものを速度場情報として記憶装置17に記憶している。なお、速度場は、画像生成装置1に接続されたマウスなどのポインティングデバイス(図示せず)により入力したり、流体系の偏微分方程式に基づいて生成することができる。また、2枚の連続した時系列画像が入力された場合には、オプティカルフロー計算により速度場を生成することができる。 The speed field setting unit 12 sets a speed field such as divergence, rotation, convergence, vibration, and wave for one reference image, and stores the speed field in the storage device 17. The velocity field represents a spatial distribution of velocity components. In the present embodiment, a velocity field (velocity vector) set at each grid point of the image is stored in the storage device 17 as velocity field information. I remember it. The velocity field can be input by a pointing device (not shown) such as a mouse connected to the image generating apparatus 1 or can be generated based on a partial differential equation of a fluid system. When two continuous time-series images are input, a velocity field can be generated by optical flow calculation.
移流部13は、基準画像から所定時間経過した時刻における画像の各格子点の濃淡値が基準画像のどの位置における濃淡値が平行移動したものであるのかを計算する。基準画像における位置の算出は、記憶装置17から生成する画像に対応する速度場を読み出して、格子点に設定された速度ベクトルを参照することにより行われる。計算方法の詳細については後述する。 The advection unit 13 calculates the gray value at each grid point of the image at a time when a predetermined time has elapsed from the reference image, at which position of the reference image the gray value is translated. The position in the reference image is calculated by reading the velocity field corresponding to the image generated from the storage device 17 and referring to the velocity vector set at the lattice point. Details of the calculation method will be described later.
補間部14は、記憶装置17から基準画像を読み出し、移流部13が算出した基準画像における位置の濃淡値を算出する。移流部13で算出された基準画像における位置は必ずしも基準画像の格子点の位置と一致しないので、算出した位置の近傍の格子点の濃淡値を補間することにより濃淡値を算出する。算出された濃淡値を格子点における濃淡値として設定することにより画像を生成する。補間方法の詳細については後述する。 The interpolation unit 14 reads the reference image from the storage device 17 and calculates the gray value of the position in the reference image calculated by the advection unit 13. Since the position in the reference image calculated by the advection unit 13 does not necessarily coincide with the position of the grid point of the reference image, the gray value is calculated by interpolating the gray value of the grid point in the vicinity of the calculated position. An image is generated by setting the calculated gray value as the gray value at the lattice point. Details of the interpolation method will be described later.
繰返し部15は、さらに時間が経過した画像を生成するか否かを判断し、さらに画像を生成する場合には、補間部14において生成された画像を基準画像として記憶装置17に記憶させ、速度場設定部12、移流部13および補間部14における処理を再び繰り返す。なお、画像生成処理を繰り返す際には、速度場設定部12により速度場を時間変化させて新たな速度場を生成してもよい。 The repeating unit 15 determines whether or not to generate an image that has further passed, and when further generating an image, causes the storage device 17 to store the image generated by the interpolation unit 14 as a reference image, and The processes in the field setting unit 12, the advection unit 13, and the interpolation unit 14 are repeated again. When the image generation process is repeated, the speed field setting unit 12 may change the speed field with time to generate a new speed field.
表示部16は、生成された画像を表示するものである。なお、時系列順に生成された画像を順次表示することで動画として表示することも可能である。 The display unit 16 displays the generated image. In addition, it is also possible to display as a moving image by sequentially displaying the images generated in time series.
次に、移流部13における生成する画像の格子点に対応する基準画像の位置の算出について説明する。濃淡値 c(x(t), y(t)) が流速 u(t) により移動する移流方程式は次式(1)で表される。
また、図2(a)の説明図で示すように、基準画像の位置22(x0’(t),y0’(t))における濃淡値は、時刻t+1において格子点21(x0(t+1),y0(t+1))へ移流する。したがって、図2(b)の説明図で示すように、格子点21における濃淡値は、符号23で示す格子点21における流速u(t+1)でΔt時間移動したものと考えることができるので、位置22は次式で求めることができる。
また、次式(4)で示すように、式(2)、式(3)により求めた位置22(x0’(t),y0’(t))における濃淡値c(x0’(t),y0’(t))を時刻t+1における格子点21(x0(t+1),y0(t+1))の濃淡値c(x0(t+1),y0(t+1))とすることで、時刻t+1における画像を生成することができる。なお、濃淡値は、その過去から変化せずに到着したものと仮定する。これは、移流方程式における誤差拡散のない理想解を求めることに相当するものである。
以上のように、差分近似が不要であって、CIP法などのように煩雑な数式が不要となっており、極めてコンパクトな方式であるため、処理の高速化を図ることができる。また、差分近似に伴った安定条件が存在しないので、時間幅をCIP法に比べて数十倍大きくとることも可能である。 As described above, difference approximation is not necessary, complicated mathematical formulas such as the CIP method are unnecessary, and the method is extremely compact, so that the processing speed can be increased. In addition, since there is no stability condition associated with the difference approximation, the time width can be several tens of times larger than that of the CIP method.
なお、算出した位置22は濃淡値が設定された格子点上にないので、補間部14により、近傍の格子点の濃淡値を補間することで濃淡値c(x0’(t),y0’(t))を求める。 Since the calculated position 22 is not on the grid point where the gray value is set, the gray value c (x0 ′ (t), y0 ′ () is obtained by interpolating the gray value of the neighboring grid point by the interpolation unit 14. t)).
次に、補間部14における補間処理について詳細に説明する。ここでは、格子点上にない点Pにおける濃淡値fPを補間する方法として、線形補間法、3次補間法(3次方程式)および3次スプライン補間について説明する。 Next, the interpolation processing in the interpolation unit 14 will be described in detail. Here, a linear interpolation method, a cubic interpolation method (cubic equation), and a cubic spline interpolation will be described as methods for interpolating the gray value f P at the point P not on the grid point.
図3は、線形補間法を説明するための模式図である。点Pの座標を(dx,dy)とすると、点Pにおける濃淡値fPは次式(5)で求めることができる。
ここで、f00は格子点(0,0)の濃淡値、f01は格子点(0,1)の濃淡値、f10は格子点(1,0)の濃淡値、f11は格子点(1,1)の濃淡値であり、記憶装置17に格納された基準画像を読み出すことにより求めることができる。 Here, f 00 is the gray value of the grid point (0, 0), f 01 is the gray value of the grid point (0, 1), f 10 is the gray value of the grid point (1, 0), and f 11 is the grid point. The gray value of (1, 1) can be obtained by reading the reference image stored in the storage device 17.
次に、3次補間法について説明をする。図4は、3次補間法を説明するための模式図である。同図に示す点Pの近傍の格子点のうち、黒丸で示した点Pに隣接する格子点を第1次近傍、その周囲の白丸で示した格子点を第2次近傍と分類する。 Next, the cubic interpolation method will be described. FIG. 4 is a schematic diagram for explaining the cubic interpolation method. Of the lattice points in the vicinity of the point P shown in the figure, the lattice points adjacent to the point P indicated by the black circle are classified as the primary neighborhood, and the lattice points indicated by the surrounding white circles are classified as the secondary neighborhood.
まず、それぞれの格子点についてx方向、y方向それぞれ独立に距離Δx,Δyに対する重みWx,Wyを求め、最終的な重みWは、W=Wx*Wyにより求める。i方向の重みWiは次式(6)により計算する。なお、第1次近傍の格子点は式(6)の上段の計算式を用い、第2次近傍の格子点は式(6)の下段の計算式を用いる。
ここで、Δiは距離ΔxあるいはΔyである。例えば、第2次近傍である格子点(−1,−1)は、Δx=1+dx,Δy=1+dyであるから、Wx=dx(dx−1)2,Wy=dy(dy−1)2,W=dx(dx−1)2dy(dy−1)2となる。 Here, Δi is the distance Δx or Δy. For example, the lattice point (−1, −1) in the second order neighborhood is Δx = 1 + dx, Δy = 1 + dy, so that W x = dx (dx−1) 2 and W y = dy (dy−1). 2 and W = dx (dx−1) 2 dy (dy−1) 2 .
続いて、各格子点における重みと基準画像から得られる濃淡値を用いて濃淡値を求める。点Pにおける濃淡値fPは次式(7)で求めることができる。
ここで、W(i,j)は格子点(i,j)の重みを表し、f(i,j)は格子点(i,j)の濃淡値である。 Here, W (i, j) represents the weight of the grid point (i, j), and f (i, j) is the gray value of the grid point (i, j).
次に、3次スプライン補間について説明する。ここでは、簡単のために、1次元の場合について説明するが、2次元への展開は容易である。図5は、格子点{−1,0,1,2}の4点において、濃淡値データ{f[−1],f[0],f[1],f[2]}が設定されているときに、点xにおける濃淡値f[x]を求める説明をするための模式図である。 Next, cubic spline interpolation will be described. Here, for the sake of simplicity, a one-dimensional case will be described, but two-dimensional expansion is easy. FIG. 5 shows that gray value data {f [−1], f [0], f [1], f [2]} are set at four points {−1, 0, 1, 2}. FIG. 6 is a schematic diagram for explaining a calculation of a light and shade value f [x] at a point x.
区間[0,1]の間の点x(0≦x≦1)における濃淡値f[x]を次式(8)で示される3次関数f(x)で補間する。
式(8)、式(9)により、格子点0、格子点1における濃淡値および濃淡値の微分について成り立つ式をまとめると以下のようになる。なお、濃淡値の微分は中心差分で近似している。
以上4つの計算式より、式(8)に示される3次関数f(x)の係数A,B,C,Dを計算すると次式が得られる。
以上により、点xにおける濃淡値f[x]を計算することができる。 As described above, the gray value f [x] at the point x can be calculated.
次に、濃淡値を補間する方法として線形補間法を用いた場合と3次補間法を用いた場合の効果について比較により説明する。図6(a)は、流体状パターンの基準画像であり、図6(b)は、図6(a)に示す画像に対して3次補間法を数百ステップ適用した場合に生成された画像であり、図6(c)は、図6(a)に示す画像に対して線形補間法を数百ステップ適用した場合に生成された画像である。濃淡値の補間方法として3次補間法を適用した場合には、図6(b)に示すように、基準画像のテクスチャはほとんど保存されているのに対し、線形補間法を数百ステップ適用した場合には、図6(c)に示すように、画像パターンが平坦なものとなっている。これは、線形補間法よりも3次補間法の方が近似精度が高く、誤差の累積が抑制されるためである。 Next, the effects of using the linear interpolation method and the cubic interpolation method as a method for interpolating gray values will be described by comparison. FIG. 6A is a reference image of a fluid pattern, and FIG. 6B is an image generated when a cubic interpolation method is applied to the image shown in FIG. 6A by several hundred steps. FIG. 6C shows an image generated when the linear interpolation method is applied to the image shown in FIG. When the cubic interpolation method is applied as the gray value interpolation method, as shown in FIG. 6B, the texture of the reference image is almost preserved, whereas the linear interpolation method is applied by several hundred steps. In this case, as shown in FIG. 6C, the image pattern is flat. This is because the cubic interpolation method has higher approximation accuracy than the linear interpolation method, and the accumulation of errors is suppressed.
次に、3次補間法および3次スプライン補間法を用いるときに濃淡値に重み付けを行う場合について説明する。図7(a)は、3次補間法を適用した結果、符号61で示す部分のように画素が抜けた表示となった画像である。これは、3次関数の特性上、補間される濃淡値が負の値となったり、濃淡値の階調の上限、例えば8ビット階調のときには255を超えたりすることが原因である。濃淡値の階調の範囲を逸脱するのは、一定領域内の格子点の濃淡値が不連続な場合、数点の格子点の濃淡値が平均から大きく乖離した値を取る場合である。 Next, a case where weight values are weighted when using a cubic interpolation method and a cubic spline interpolation method will be described. FIG. 7A shows an image obtained by applying a cubic interpolation method and displaying a pixel as shown by a portion denoted by reference numeral 61. This is because, due to the characteristics of the cubic function, the shaded value to be interpolated becomes a negative value or exceeds the upper limit of the shade of the shaded value, for example, 255 when it is an 8-bit tone. The case where the grayscale value deviates from the range of grayscale values is when the grayscale values of the grid points in a certain region are discontinuous and the grayscale values of several grid points take a value greatly deviating from the average.
本実施の形態では、補正した値が濃淡値の階調の範囲(例えば、8ビット階調の場合は、0以上255以下)にないときには、補間に用いる一定領域内の格子点の濃淡値の平均と分散を求め、濃淡値に重み付けを行って、濃淡値を非線形に補正し、補正された濃淡値を用いて再び補間を行って濃淡値を求める。そして、補間された濃淡値が階調の範囲内に収まるまでこれを繰り返す。なお、重み付けは、0.001から0.1の小さい値を用いて少しずつ補正する。このように、濃淡値に重み付けを行い補間処理を行うことにより、図7(b)に示すように、抜けの部分を違和感なく補正することができる。 In the present embodiment, when the corrected value is not in the gradation range of the gradation value (for example, in the case of 8-bit gradation, 0 or more and 255 or less), the gradation value of the lattice point in the fixed area used for the interpolation is set. The average and variance are obtained, the gray value is weighted, the gray value is corrected nonlinearly, and interpolation is performed again using the corrected gray value to obtain the gray value. This is repeated until the interpolated gray value falls within the gradation range. The weighting is corrected little by little using a small value from 0.001 to 0.1. In this way, by performing weighting on the gray value and performing the interpolation process, as shown in FIG. 7B, the missing portion can be corrected without a sense of incongruity.
したがって、本実施の形態によれば、移流部13により、生成する画像の各格子点の濃淡値が基準画像のどの位置における濃淡値が平行移動したものであるのかを、速度場設定部12により設定された速度場に基づいて計算し、補間部14により、計算した基準画像の位置における濃淡値をその位置の近傍の格子点における濃淡値を補間することにより算出することで、簡素なアルゴリズムにより移流方程式と同等の変形と移動表現を行うことができるので、処理の高速化を図ることが可能となる。 Therefore, according to the present embodiment, the velocity field setting unit 12 uses the advection unit 13 to determine at which position in the reference image the gray value of each grid point of the generated image is translated. By calculating based on the set speed field and calculating the gray value at the calculated position of the reference image by interpolating the gray value at the lattice point in the vicinity of the position by the interpolation unit 14, a simple algorithm is used. Since deformation and movement expression equivalent to the advection equation can be performed, the processing speed can be increased.
本実施の形態によれば、繰返し部15により、生成された画像を基準画像として記憶装置17に記憶させ、さらに時間が経過した時刻における画像を生成することで、時系列順に連続する複数の画像からなる動画を生成することができる。 According to the present embodiment, the repeating unit 15 stores the generated image in the storage device 17 as a reference image, and further generates an image at the time when the time has elapsed, whereby a plurality of images that are consecutive in time series are generated. It is possible to generate a video consisting of
本実施の形態によれば、補間部14により、3次補間法または3次スプライン補間法を適用して濃淡値を算出することで、濃淡値に対する近似精度が高くなり、誤差の累積が抑制されるので、生成した画像を基準画像として繰返し処理を行っても画像の劣化を抑制することができる。 According to the present embodiment, the interpolation unit 14 calculates the gray value by applying the cubic interpolation method or the cubic spline interpolation method, so that the approximation accuracy with respect to the gray value increases and the accumulation of errors is suppressed. Therefore, even if the generated image is used as a reference image and repeated processing is performed, image degradation can be suppressed.
本実施の形態によれば、補間部14により、3次補間法または3次スプライン補間法を適用して濃淡値を補間する際に、補間された濃淡値が所定の階調値の範囲外の値になった場合には、補間に用いた格子点の濃淡値に重み付けをして濃淡値を補間することで、補間された濃淡値が階調値の範囲を逸脱することがなくなるので、違和感のない補間をすることができる。 According to the present embodiment, when the interpolation unit 14 applies the cubic interpolation method or the cubic spline interpolation method to interpolate the gray value, the interpolated gray value is outside the range of the predetermined gradation value. If the value becomes a value, weighting is applied to the gray value of the grid point used for the interpolation, and the gray value is interpolated so that the interpolated gray value does not deviate from the range of the gradation value. Interpolation without any
1…画像生成装置
11…入力部
12…速度場設定部
13…移流部
14…補間部
15…繰返し部
16…表示部
17…記憶装置
DESCRIPTION OF SYMBOLS 1 ... Image generation apparatus 11 ... Input part 12 ... Speed field setting part 13 ... Advection part 14 ... Interpolation part 15 ... Repeat part 16 ... Display part 17 ... Memory | storage device
Claims (8)
速度場設定手段により、速度成分の空間的な分布を表す速度場情報を設定し、速度場蓄積手段に格納するステップと、
移流手段により、前記第1の画像から所定時間経過した時刻における第2の画像の格子点毎に、当該格子点における濃淡値が当該格子点における速度成分で前記所定時間過去に遡った位置における前記第1の画像の濃淡値が平行移動したものであるとするモデルに基づいて、前記速度場蓄積手段から前記速度場情報を読み出し、当該格子点における速度成分に基づいて当該格子点の前記所定時間過去に遡った位置を計算するステップと、
補間手段により、前記画像蓄積手段から前記第1の画像を読み出し、前記第2の画像の格子点毎に、前記位置を計算するステップにおいて求めた当該格子点の前記所定時間過去に遡った位置における前記第1の画像の濃淡値を当該位置の近傍の前記第1の画像の格子点の濃淡値を補間することにより算出して、前記第2の画像の格子点における濃淡値と設定することで前記第2の画像を生成するステップと、
を有し、
補間することにより算出した前記第2の画像の格子点における濃淡値が、前記第1の画像を入力する際に設定した濃淡値の階調の範囲外の値になった場合には、補間に用いる前記第1の画像の一定領域内の格子点の濃淡値に重み付けをして当該濃淡値を非線形に補正する処理と、補正された濃淡値を用いて再び補間を行って濃淡値を求める処理とを、補間により算出した濃淡値が前記階調の範囲内に収まるまで繰り返すステップを有することを特徴とする画像生成方法。 A step of inputting a first image in which a gray value is set for each grid point by the image input means and storing the first image in the image storage means;
Setting speed field information representing a spatial distribution of speed components by the speed field setting means, and storing the speed field information in the speed field storage means;
For each grid point of the second image at a time when a predetermined time has elapsed from the first image, the gray value at the grid point is a velocity component at the grid point and the position at a position retroactive to the past by the advection means. Based on the model that the gray value of the first image is translated, the velocity field information is read from the velocity field accumulating means, and the predetermined time of the lattice point is determined based on the velocity component at the lattice point. Calculating a retroactive position; and
The interpolating means reads the first image from the image accumulating means, and for each grid point of the second image, the position of the grid point obtained in the step of calculating the position is a position retroactive to the past for the predetermined time. By calculating the gray value of the first image by interpolating the gray value of the grid point of the first image in the vicinity of the position, and setting it as the gray value at the grid point of the second image. Generating the second image;
I have a,
When the gray value at the grid point of the second image calculated by interpolation becomes a value outside the range of the gray value gradation set when the first image is input, interpolation is performed. A process of weighting the gray values of the grid points in the fixed region of the first image to be used to nonlinearly correct the gray values, and a process of obtaining a gray value by performing interpolation again using the corrected gray values preparative, image generation method grayscale value calculated by interpolation, characterized in that have a repeating up falls within the range of the gradation.
前記速度場情報を設定するステップと前記位置を計算するステップと前記画像を生成するステップとを繰り返し実行することにより、さらに所定時間経過した時刻における画像を生成することを特徴とする請求項1記載の画像生成方法。 Storing the second image generated in the step of generating the second image as the first image in the image storage means;
The image at the time when a predetermined time has passed is further generated by repeatedly executing the step of setting the velocity field information, the step of calculating the position, and the step of generating the image. Image generation method.
速度成分の空間的な分布を表す速度場情報を設定し、速度場蓄積手段に格納する速度場設定手段と、
前記第1の画像から所定時間経過した時刻における第2の画像の格子点毎に、当該格子点における濃淡値が当該格子点における速度成分で前記所定時間過去に遡った位置における前記第1の画像の濃淡値が平行移動したものであるとするモデルに基づいて、前記速度場蓄積手段から前記速度場情報を読み出し、当該格子点における速度成分に基づいて当該格子点の前記所定時間過去に遡った位置を計算する移流手段と、
前記画像蓄積手段から前記第1の画像を読み出し、前記第2の画像の格子点毎に、前記移流手段が計算した当該格子点の前記所定時間過去に遡った位置における前記第1の画像の濃淡値を当該位置の近傍の前記第1の画像の格子点の濃淡値を補間することにより算出して、前記第2の画像の格子点における濃淡値と設定することで前記第2の画像を生成する補間手段と、
を有し、
前記補間手段が、濃淡値を補間した結果、当該濃淡値が前記第1の画像を入力する際に設定した濃淡値の階調の範囲外の値になった場合には、補間に用いる前記第1の画像の一定領域内の格子点の濃淡値に重み付けをして当該濃淡値を非線形に補正する処理と、補正された濃淡値を用いて再び補間を行って濃淡値を求める処理とを、補間により算出した濃淡値が前記階調の範囲内に収まるまで繰り返す機能を備えることを特徴とする画像生成装置。 An image input unit that inputs a first image in which a gray value is set for each grid point and stores the first image in the image storage unit;
A velocity field setting means for setting velocity field information representing a spatial distribution of velocity components and storing the velocity field information in the velocity field storage means;
For each grid point of the second image at a time when a predetermined time has elapsed from the first image, the first image at a position where the gray value at the grid point goes back to the past for the predetermined time with the velocity component at the grid point. The speed field information is read from the speed field accumulating means based on the model that the gray value of the grid point is translated, and the grid point is traced back to the predetermined time based on the speed component at the grid point. Advection means for calculating the position;
The first image is read from the image storage means, and for each grid point of the second image, the gray level of the first image at a position retroactive to the grid time calculated by the advection means for the predetermined time in the past. The second image is generated by calculating the value by interpolating the gray value of the grid point of the first image in the vicinity of the position and setting the gray value at the grid point of the second image. Interpolation means to perform,
I have a,
As a result of the interpolation means interpolating the gray value, when the gray value becomes a value outside the range of the gray value set when the first image is input, the first value used for interpolation is used. A process of weighting gray values of grid points in a certain area of one image to nonlinearly correct the gray values, and a process of performing interpolation again using the corrected gray values to obtain a gray value. An image generating apparatus comprising a function of repeating until a gray value calculated by interpolation falls within the gradation range .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006320138A JP4369951B2 (en) | 2006-11-28 | 2006-11-28 | Image generation method, image generation apparatus, and image generation program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006320138A JP4369951B2 (en) | 2006-11-28 | 2006-11-28 | Image generation method, image generation apparatus, and image generation program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008134799A JP2008134799A (en) | 2008-06-12 |
JP4369951B2 true JP4369951B2 (en) | 2009-11-25 |
Family
ID=39559621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006320138A Active JP4369951B2 (en) | 2006-11-28 | 2006-11-28 | Image generation method, image generation apparatus, and image generation program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4369951B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4850271B2 (en) * | 2009-04-21 | 2012-01-11 | 日本電信電話株式会社 | Image generation apparatus, image generation method, and image generation program |
CN103679775B (en) * | 2014-01-03 | 2017-01-25 | 中南大学 | Farmland operation zone boundary modeling method with combination of lines and curves |
-
2006
- 2006-11-28 JP JP2006320138A patent/JP4369951B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2008134799A (en) | 2008-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Boukhtache et al. | When deep learning meets digital image correlation | |
WO2008038748A1 (en) | Prediction coefficient operation device and method, image data operation device and method, program, and recording medium | |
JP2007000205A (en) | Image processing apparatus, image processing method, and image processing program | |
EA012579B1 (en) | System and method for approximating an editable surface | |
JP2009134509A (en) | Device for and method of generating mosaic image | |
JP2007249354A (en) | Index estimation device, index estimation method and index estimation program | |
WO2011018878A1 (en) | Image processing system, image processing method and program for image processing | |
JP4369951B2 (en) | Image generation method, image generation apparatus, and image generation program | |
JP4199214B2 (en) | Movie generation device, movie generation method, movie generation program | |
CN109658508B (en) | Multi-scale detail fusion terrain synthesis method | |
JP2019023798A (en) | Super-resolution device and program | |
JP2006099467A (en) | Apparatus, method and program for image matching | |
JP4353957B2 (en) | Image generation method, image generation apparatus, and image generation program | |
JP5316385B2 (en) | Image processing apparatus and image processing program | |
JP2016157174A (en) | Three-dimensional space data interpolation program and shape generation program achieved by combining the same | |
EP4174482A1 (en) | Temperature distribution learning device | |
JP2022189901A (en) | Learning method, learning device, program, and recording medium | |
CN115018726A (en) | U-Net-based image non-uniform blur kernel estimation method | |
CN113096020B (en) | Calligraphy font creation method for generating confrontation network based on average mode | |
KR102298175B1 (en) | Image out-painting appratus and method on deep-learning | |
JP4339639B2 (en) | Computer hologram creation method | |
JP2019082847A (en) | Data estimation device, date estimation method, and program | |
CN113536971A (en) | Target detection method based on incremental learning | |
CN106355626A (en) | Self-adaption sampling method of planar region controlled by density | |
JP4272226B2 (en) | Image fluid system interaction expression apparatus, method, and program thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090224 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090415 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090519 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090708 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090804 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090828 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4369951 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120904 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130904 Year of fee payment: 4 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |