JP5867128B2 - Image processing apparatus, image processing method, and image processing program - Google Patents

Image processing apparatus, image processing method, and image processing program Download PDF

Info

Publication number
JP5867128B2
JP5867128B2 JP2012025128A JP2012025128A JP5867128B2 JP 5867128 B2 JP5867128 B2 JP 5867128B2 JP 2012025128 A JP2012025128 A JP 2012025128A JP 2012025128 A JP2012025128 A JP 2012025128A JP 5867128 B2 JP5867128 B2 JP 5867128B2
Authority
JP
Japan
Prior art keywords
pixel
depth
image
depth map
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012025128A
Other languages
Japanese (ja)
Other versions
JP2013162465A (en
Inventor
浩 竹下
浩 竹下
俊文 森
俊文 森
賢治 久保田
賢治 久保田
石川 雅規
雅規 石川
悟 石坂
悟 石坂
笠 浩之
浩之 笠
裕司 西
裕司 西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JVCKenwood Corp
Original Assignee
JVCKenwood Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JVCKenwood Corp filed Critical JVCKenwood Corp
Priority to JP2012025128A priority Critical patent/JP5867128B2/en
Publication of JP2013162465A publication Critical patent/JP2013162465A/en
Application granted granted Critical
Publication of JP5867128B2 publication Critical patent/JP5867128B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Description

本発明は、2D画像を立体視のための3D画像に変換する処理を実行する画像処理装置、画像処理方法及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program for executing processing for converting a 2D image into a 3D image for stereoscopic viewing.

近年、3D映画、3D放送などの3D映像コンテンツが普及してきている。観察者に立体視させるためには、視差を持つ右眼画像と左眼画像が必要である。3D映像を表示する際、右眼画像と左眼画像を時分割に表示し、シャッタメガネや偏光メガネなどの映像分離用メガネにより右眼画像と左眼画像を分離する。これにより観察者は右眼画像を右眼のみで、左眼画像を左眼のみで観察でき立体視できる。なお右眼画像と左眼画像を時分割ではなく空間分割すればメガネは必要なくなるが解像度が低下する。メガネ方式にしてもメガネレス方式にしても右眼画像と左眼画像が必要な点では共通する。   In recent years, 3D video contents such as 3D movies and 3D broadcasts have become widespread. In order to make an observer stereoscopically view, a right eye image and a left eye image having parallax are required. When displaying a 3D image, the right eye image and the left eye image are displayed in a time-sharing manner, and the right eye image and the left eye image are separated by image separation glasses such as shutter glasses and polarized glasses. Thus, the observer can observe the right eye image only with the right eye and the left eye image only with the left eye and can perform stereoscopic viewing. Note that if the right eye image and the left eye image are divided not by time division but by space division, glasses are not necessary, but the resolution is lowered. Both the glasses method and the glassesless method are common in that a right eye image and a left eye image are required.

3D映像を製作するには大きく2つの方法があり、2台のカメラを用いて右眼画像と左眼画像を同時に撮影する方法と、1台のカメラで撮影された2D画像を後に編集して視差画像を生成する方法がある。本発明は後者の方法に関するものであり、2D3D変換技術に関するものである。   There are two main methods for producing 3D video. A method for simultaneously capturing a right eye image and a left eye image using two cameras, and a later editing of a 2D image captured by one camera. There is a method for generating a parallax image. The present invention relates to the latter method, and to 2D3D conversion technology.

図1は、2D3D変換の基本処理プロセスを説明するための図である。まず2D入力画像からデプスマップ(奥行き情報ともいう)を生成する(ステップS10)。そして2D入力画像とデプスマップを用いて3D画像を生成する(ステップS30)。図1では2D入力画像を3D出力画像の右眼画像とし、2D入力画像をデプスマップを用いて画素シフトした画像を3D出力画像の左眼画像としている。以下、所定の視差を持つ右眼画像と左眼画像の組みを3D画像または視差画像という。   FIG. 1 is a diagram for explaining a basic processing process of 2D3D conversion. First, a depth map (also referred to as depth information) is generated from the 2D input image (step S10). Then, a 3D image is generated using the 2D input image and the depth map (step S30). In FIG. 1, a 2D input image is a right eye image of a 3D output image, and an image obtained by pixel shifting the 2D input image using a depth map is a left eye image of the 3D output image. Hereinafter, a combination of a right eye image and a left eye image having a predetermined parallax is referred to as a 3D image or a parallax image.

3D画像を生成する際にはデプスマップを用いて2D画像を画素シフトして、当該2D画像に対して視差を持つ別視点の2D画像を生成する。この画素シフトにより、生成される別視点の2D画像内に欠落画素が発生する。一般的に、この欠落画素は周辺画素から補間される。   When generating a 3D image, the 2D image is pixel-shifted using a depth map, and a 2D image of another viewpoint having a parallax with respect to the 2D image is generated. Due to this pixel shift, missing pixels are generated in the 2D image of the different viewpoint to be generated. Generally, this missing pixel is interpolated from surrounding pixels.

特開2011−48586号公報JP 2011-48586 A

画面内においてオブジェクト境界でのデプスの段差が大きい場合、その境界部分の画素シフト量も大きくなる。したがって欠落画素の数、即ち欠落領域の面積も大きくなる。上述したようにその欠落画素には周辺画素が補間されるが、その欠落領域の面積が大きくなると、補間される画素が補間位置にマッチしない箇所が発生しやすくなる。   When the depth difference at the object boundary is large in the screen, the pixel shift amount at the boundary part is also large. Therefore, the number of missing pixels, that is, the area of the missing region also increases. As described above, peripheral pixels are interpolated in the missing pixel, but when the area of the missing region is increased, a portion where the interpolated pixel does not match the interpolation position is likely to occur.

本発明はこうした状況に鑑みてなされたものであり、その目的は、2D画像から3D画像を生成する際に、オブジェクト境界部分の画像品質を向上させる技術を提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide a technique for improving the image quality of an object boundary portion when generating a 3D image from a 2D image.

上記課題を解決するために、本発明のある態様の画像処理装置(100)は、入力画像とデプスマップをもとに別視点の画像を生成する画像処理装置(100)であって、前記入力画像を前記デプスマップをもとに画素シフトする画素シフト部(31)と、前記画素シフト部(31)による画素シフトにより発生する欠落画素を補間する際、隣接画素とのデプス値の変化量が設定値より大きい画素の補間をスキップし、対象画素およびその周辺画素のうち、隣接画素とのデプス値の変化量が設定値より大きい画素が少なくとも一つ存在する場合、前記対象画素を欠落させる画素補間部(33)と、外部設定されるパラメータにしたがい、前記対象画素およびその周辺画素で規定される監視領域を設定する監視領域設定部(32)と、を備える。前記画素補間部(33)は、前記監視領域設定部により設定された監視領域において規定される周辺画素と、前記対象画素とのデプス値の変化量に基づき、欠落画素を補間するIn order to solve the above problems, an image processing apparatus (100) according to an aspect of the present invention is an image processing apparatus (100) that generates an image of a different viewpoint based on an input image and a depth map. When interpolating the pixel shift unit (31) that shifts the image based on the depth map and the missing pixel generated by the pixel shift by the pixel shift unit (31) , the amount of change in the depth value between adjacent pixels is Pixel that skips interpolation of pixels larger than the set value and causes the target pixel to be omitted when there is at least one pixel whose depth value change amount with the adjacent pixel is larger than the set value among the target pixel and its surrounding pixels includes an interpolation unit (33), in accordance with parameters that are externally set, wherein the target pixel and the monitoring area setting section for setting a surveillance region defined by the peripheral pixels (32), the The pixel interpolation unit (33) interpolates missing pixels based on the amount of change in depth value between the peripheral pixels defined in the monitoring area set by the monitoring area setting unit and the target pixel .

本発明の別の態様は、画像処理方法である。この方法は、入力画像とデプスマップをもとに別視点の画像を生成する画像処理方法であって、前記入力画像を前記デプスマップをもとに画素シフトするステップと、画素シフトにより発生する欠落画素を補間する際、隣接画素とのデプス値の変化量が設定値より大きい画素の補間をスキップし、対象画素およびその周辺画素のうち、隣接画素とのデプス値の変化量が設定値より大きい画素が少なくとも一つ存在する場合、前記対象画素を欠落させるステップと、外部設定されるパラメータにしたがい、前記対象画素およびその周辺画素で規定される監視領域を設定するステップと、を備える。欠落画素を補間するステップは、設定された監視領域において規定される周辺画素と、前記対象画素とのデプス値の変化量に基づき、欠落画素を補間するAnother aspect of the present invention is an image processing method. This method is an image processing method for generating an image of a different viewpoint based on an input image and a depth map, wherein the input image is pixel-shifted based on the depth map, and missing caused by pixel shift. When interpolating a pixel, the interpolation of the pixel whose depth value change amount with the adjacent pixel is larger than the set value is skipped, and among the target pixel and its surrounding pixels, the change amount of the depth value with the adjacent pixel is larger than the set value. When at least one pixel is present, the method includes a step of deleting the target pixel and a step of setting a monitoring region defined by the target pixel and its surrounding pixels according to an externally set parameter . In the step of interpolating the missing pixel, the missing pixel is interpolated based on the change amount of the depth value between the peripheral pixel defined in the set monitoring region and the target pixel .

なお、以上の構成要素の任意の組み合わせ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   It should be noted that any combination of the above-described constituent elements and a conversion of the expression of the present invention between a method, an apparatus, a system, a recording medium, a computer program, and the like are also effective as an aspect of the present invention.

本発明によれば、2D画像から3D画像を生成する際に、製作者の手間を軽減しつつ高品質な3D画像を生成できる。   According to the present invention, when generating a 3D image from a 2D image, it is possible to generate a high-quality 3D image while reducing the labor of the producer.

2D3D変換の基本処理プロセスを説明するための図である。It is a figure for demonstrating the basic processing process of 2D3D conversion. 本発明の基本となる実施例に係る画像編集システムの構成を示す図である。It is a figure which shows the structure of the image editing system which concerns on the Example used as the foundation of this invention. 本発明の実施例に係るデプスマップ生成部の構成例を示す図である。It is a figure which shows the structural example of the depth map production | generation part which concerns on the Example of this invention. 本発明の基本となる実施例に係る画像編集システムの全体処理プロセスを説明するための図である。It is a figure for demonstrating the whole processing process of the image editing system which concerns on the Example used as the foundation of this invention. 入力デプスマップのゲイン調整プロセスを説明するための図である。It is a figure for demonstrating the gain adjustment process of an input depth map. 入力デプスマップのオフセット調整プロセスを説明するための図である。It is a figure for demonstrating the offset adjustment process of an input depth map. レイヤデプスマップの合成処理プロセスを説明するための図である。It is a figure for demonstrating the synthetic | combination process of a layer depth map. マスクを使用しない入力デプスマップのゲイン調整プロセスを説明するための図である。It is a figure for demonstrating the gain adjustment process of the input depth map which does not use a mask. マスクを使用しない入力デプスマップのオフセット調整プロセスを説明するための図である。It is a figure for demonstrating the offset adjustment process of the input depth map which does not use a mask. 画素シフトと画素補間を説明するための図である。It is a figure for demonstrating pixel shift and pixel interpolation. オブジェクト境界のデプスの段差が大きい場合における、画素シフトと画素補間を説明するための図である。It is a figure for demonstrating pixel shift and pixel interpolation in case the depth level | step difference of an object boundary is large. オブジェクト境界のデプスの段差が大きい場合でも不自然さが発生しない、画素シフトと画素補間を説明するための図である。It is a figure for demonstrating pixel shift and pixel interpolation which does not generate | occur | produce unnatural even when the level | step difference of the depth of an object boundary is large. 本発明の実施例1に係る画像編集システムの構成を示す図である。1 is a diagram illustrating a configuration of an image editing system according to Embodiment 1 of the present invention. 本発明の実施例1に係る画像編集システムの全体処理プロセスを説明するための図である。It is a figure for demonstrating the whole processing process of the image editing system which concerns on Example 1 of this invention. レイヤデプスマップのアルファブレンドを説明するための図である。It is a figure for demonstrating the alpha blend of a layer depth map. マスク補正部の構成例を示す図である。It is a figure which shows the structural example of a mask correction | amendment part. 図16のマスク補正部によるマスクぼかし処理を説明するための図である。It is a figure for demonstrating the mask blurring process by the mask correction part of FIG. 第1ローパスフィルタによりマスク信号に形成される傾斜と、二値化部に設定される第1閾値の関係を説明するための図である。It is a figure for demonstrating the relationship between the inclination formed in a mask signal by a 1st low-pass filter, and the 1st threshold value set to a binarization part. 第1ローパスフィルタにより付加される傾斜と、第2ローパスフィルタにより付加される傾斜を比較するための図である。It is a figure for comparing the inclination added by a 1st low-pass filter, and the inclination added by a 2nd low-pass filter. 本発明の実施例1の変形例に係る画像編集システムの全体処理プロセスを説明するための図である。It is a figure for demonstrating the whole processing process of the image editing system which concerns on the modification of Example 1 of this invention. 本発明の実施例2に係る画像編集システムによるフィルオフ機能を説明するための図である。It is a figure for demonstrating the fill-off function by the image editing system which concerns on Example 2 of this invention. 本発明の実施例2に係る3D画像生成部の構成を示す図である。It is a figure which shows the structure of the 3D image generation part which concerns on Example 2 of this invention. 図23(a)−(e)は、監視領域の複数の例を示す図である。FIGS. 23A to 23E are diagrams illustrating a plurality of examples of monitoring areas. 5つの設定パラメータにより生成される監視領域の具体例を説明するための図である(その1)。It is a figure for demonstrating the specific example of the monitoring area | region produced | generated by five setting parameters (the 1). 5つの設定パラメータにより生成される監視領域の具体例を説明するための図である(その2)。It is a figure for demonstrating the specific example of the monitoring area | region produced | generated by five setting parameters (the 2). デプス信号の微分値の監視およびフィルオフを説明するための図である(右眼画像)。It is a figure for demonstrating monitoring of the differential value of a depth signal, and fill-off (right eye image). デプス信号の微分値の監視およびフィルオフを説明するための図である(左眼画像)It is a figure for demonstrating the monitoring of the differential value of a depth signal, and fill-off (left eye image)

図2は、本発明の基本となる実施例に係る画像編集システム500の構成を示す図である。本実施例に係る画像編集システム500は、画像処理装置100及びコンソール端末装置200を備える。   FIG. 2 is a diagram showing a configuration of an image editing system 500 according to an embodiment as a basis of the present invention. An image editing system 500 according to the present embodiment includes an image processing device 100 and a console terminal device 200.

コンソール端末装置200は画像製作者(以下、ユーザという)が画像を製作、編集するために使用する端末装置である。コンソール端末装置200は操作部60および表示部70を備える。操作部60はキーボード、マウス等の入力デバイスであり、表示部70はディスプレイ等の出力デバイスである。なお入出力が一体となったデバイスであるタッチパネルディスプレイが用いられてもよい。またコンソール端末装置200はプリンタ、スキャナ等の印刷物を媒体として用いるユーザインタフェースを含んでもよい。操作部60はユーザ操作を受け付け、そのユーザ操作に起因した信号を生成し、画像処理装置100に出力する。表示部70は画像処理装置100により生成された画像を表示する。   The console terminal device 200 is a terminal device used by an image producer (hereinafter referred to as a user) to produce and edit an image. The console terminal device 200 includes an operation unit 60 and a display unit 70. The operation unit 60 is an input device such as a keyboard and a mouse, and the display unit 70 is an output device such as a display. Note that a touch panel display which is a device in which input and output are integrated may be used. The console terminal device 200 may include a user interface that uses a printed material such as a printer or a scanner as a medium. The operation unit 60 receives a user operation, generates a signal resulting from the user operation, and outputs the signal to the image processing apparatus 100. The display unit 70 displays an image generated by the image processing apparatus 100.

画像処理装置100はデプスマップ生成部10、デプスマップ加工部20、3D画像生成部30、操作受付部40、表示制御部50を含む。これらの構成はハードウエア的には、任意のプロセッサ、メモリ、その他のLSIで実現でき、ソフトウエア的にはメモリにロードされたプログラムなどによって実現されるが、ここではそれらの連携によって実現される機能ブロックを描いている。したがって、これらの機能ブロックがハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できることは、当業者には理解されるところである。例えばデプスマップ生成部10、デプスマップ加工部20、3D画像生成部30について、その機能を全てソフトウェアで実現してもよいし、デプスマップ生成部10および3D画像生成部30の機能を専用のロジック回路で構成し、デプスマップ加工部20の機能をソフトウェアで実現してもよい。   The image processing apparatus 100 includes a depth map generation unit 10, a depth map processing unit 20, a 3D image generation unit 30, an operation reception unit 40, and a display control unit 50. These configurations can be realized by an arbitrary processor, memory, or other LSI in terms of hardware, and can be realized by a program loaded into the memory in terms of software, but here by their cooperation. Draw functional blocks. Accordingly, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof. For example, all the functions of the depth map generation unit 10, the depth map processing unit 20, and the 3D image generation unit 30 may be realized by software, and the functions of the depth map generation unit 10 and the 3D image generation unit 30 are dedicated logic. It may be configured by a circuit, and the function of the depth map processing unit 20 may be realized by software.

デプスマップ生成部10は、入力される2D画像とデプスモデルをもとに当該2D画像のデプスマップを生成する。デプスマップは、デプス値(奥行き値ともいう)を輝度値で表したグレースケール画像である。デプスマップ生成部10はシーン構造を推定して、そのシーン構造に適合的なデプスモデルを使用してデプスマップを生成する。本実施例ではデプスマップ生成部10は複数の基本デプスモデルを合成してデプスマップ生成に使用する。その際、当該2D画像のシーン構造に応じて複数の基本デプスモデルの合成比率を変化させる。   The depth map generation unit 10 generates a depth map of the 2D image based on the input 2D image and the depth model. The depth map is a grayscale image in which depth values (also referred to as depth values) are represented by luminance values. The depth map generation unit 10 estimates a scene structure and generates a depth map using a depth model suitable for the scene structure. In this embodiment, the depth map generation unit 10 combines a plurality of basic depth models and uses them for depth map generation. At that time, the composition ratio of a plurality of basic depth models is changed according to the scene structure of the 2D image.

図3は、本発明の実施例に係るデプスマップ生成部10の構成例を示す図である。デプスマップ生成部10は、画面上部高域成分評価部11、画面下部高域成分評価部12、合成比率決定部13、第1基本デプスモデル用フレームメモリ14、第2基本デプスモデル用フレームメモリ15、第3基本デプスモデル用フレームメモリ16、合成部17、加算部18を含む。   FIG. 3 is a diagram illustrating a configuration example of the depth map generation unit 10 according to the embodiment of the present invention. The depth map generation unit 10 includes an upper screen high-frequency component evaluation unit 11, a lower screen high-frequency component evaluation unit 12, a composition ratio determination unit 13, a first basic depth model frame memory 14, and a second basic depth model frame memory 15. , A third basic depth model frame memory 16, a synthesis unit 17, and an addition unit 18.

画面上部高域成分評価部11は、処理すべき2D画像の画面上部において高域成分を有する画素の割合を算出する。その割合を画面上部の高域成分評価値とする。なお画面全体に対する画面上部の割合は略20%に設定するとよい。画面下部高域成分評価部12は当該2D画像の画面下部において高域成分を有する画素の割合を算出する。その割合を画面下部の高域成分評価値とする。なお画面全体に対する画面下部の割合は略20%に設定するとよい。   The screen upper high frequency component evaluation unit 11 calculates the ratio of pixels having a high frequency component in the upper screen of the 2D image to be processed. The ratio is used as the high frequency component evaluation value at the top of the screen. The ratio of the upper part of the screen to the entire screen is preferably set to approximately 20%. The lower screen high frequency component evaluation unit 12 calculates the ratio of pixels having a high frequency component in the lower screen of the 2D image. The ratio is used as the high frequency component evaluation value at the bottom of the screen. The ratio of the lower part of the screen to the entire screen is preferably set to approximately 20%.

第1基本デプスモデル用フレームメモリ14は第1基本デプスモデルを保持し、第2基本デプスモデル用フレームメモリ15は第2基本デプスモデルを保持し、第3基本デプスモデル用フレームメモリ16は第3デプスモデルを保持する。第1基本デプスモデルは画面上部及び画面下部をそれぞれ凹状の球面とするモデルである。第2基本デプスモデルは画面上部を縦方向に軸線を有する円筒面、画面下部を凹状の球面とするモデルである。第3基本デプスモデルは画面上部を平面、画面下部を横方向に軸線を有する円筒面とするモデルである。   The first basic depth model frame memory 14 holds the first basic depth model, the second basic depth model frame memory 15 holds the second basic depth model, and the third basic depth model frame memory 16 stores the third basic depth model. Holds the depth model. The first basic depth model is a model in which the upper part of the screen and the lower part of the screen are concave spherical surfaces. The second basic depth model is a model in which the upper part of the screen is a cylindrical surface having an axis in the vertical direction and the lower part of the screen is a concave spherical surface. The third basic depth model is a model in which the upper part of the screen is a plane and the lower part of the screen is a cylindrical surface having an axis in the horizontal direction.

合成比率決定部13は、画面上部高域成分評価部11および画面下部高域成分評価部12によりそれぞれ算出された、画面上部および画面下部の高域成分評価値をもとに第1基本デプスモデル、第2基本デプスモデル、第3基本デプスモデルの合成比率k1,k2,k3(ただし、k1+k2+k3=1)を決定する。合成部17はこれらの合成比率k1,k2,k3と、第1基本デプスモデル、第2基本デプスモデル、第3基本デプスモデルをそれぞれ乗算し、それぞれの乗算結果を加算する。この演算結果が合成基本デプスモデルとなる。   The composition ratio determination unit 13 is a first basic depth model based on the high-frequency component evaluation values of the upper screen portion and the lower screen portion calculated by the upper screen region high-frequency component evaluation unit 11 and the lower screen region high-frequency component evaluation unit 12, respectively. The combination ratios k1, k2, and k3 (where k1 + k2 + k3 = 1) of the second basic depth model and the third basic depth model are determined. The synthesizing unit 17 multiplies the synthesis ratios k1, k2, and k3 by the first basic depth model, the second basic depth model, and the third basic depth model, and adds the multiplication results. This calculation result becomes a synthetic basic depth model.

例えば合成比率決定部13は、画面上部の高域成分評価値が小さい場合は画面上部に空もしくは平坦な壁が存在するシーンと認識して、画面上部の奥行きを深くした第2基本デプスモデルの比率を増加させる。また画面下部の高域成分評価値が小さい場合は画面下部に平坦な地面もしくは水面が手前に連続的に広がるシーンと認識して、第3基本デプスモデルの比率を増加させる。第3基本デプスモデルでは、画面上部は遠景として平面近似し、画面下部は下に行くほど奥行きを小さくしている。   For example, when the high frequency component evaluation value at the upper part of the screen is small, the composition ratio determining unit 13 recognizes that the scene has an empty or flat wall at the upper part of the screen, and the second basic depth model with the deeper upper part of the screen. Increase the ratio. If the high-frequency component evaluation value at the bottom of the screen is small, it is recognized as a scene in which the flat ground or water surface continuously spreads at the bottom of the screen, and the ratio of the third basic depth model is increased. In the third basic depth model, the upper part of the screen is approximated as a distant view, and the depth is reduced toward the bottom of the lower part of the screen.

加算部18は、合成部17により生成された合成基本デプスモデルに上記2D画像の赤成分(R)信号を重畳してデプスマップを生成する。R信号を使用する理由は、R信号の大きさが順光に近い環境で、かつテクスチャの明度が大きく異ならないような条件において、被写体の凹凸と一致する確率が高いという経験則によるものである。また赤色および暖色は色彩学における前進色であり、寒色系よりも奥行きが手前に認識され、立体感が強調されるためである。   The adding unit 18 generates a depth map by superimposing the red component (R) signal of the 2D image on the combined basic depth model generated by the combining unit 17. The reason for using the R signal is based on an empirical rule that there is a high probability of matching with the unevenness of the subject in an environment in which the magnitude of the R signal is close to direct light and the brightness of the texture is not significantly different. . Further, red and warm colors are forward colors in chromatics, and the depth is recognized in front of the cold color system, and the stereoscopic effect is emphasized.

図2に戻る。デプスマップ加工部20は、デプスマップ生成部10により生成されたデプスマップを加工する。本実施例ではデプスマップ加工部20は、外部設定される複数のマスクパターン(以下、単にマスクという)により指定される画面内の複数の領域ごとに、デプスマップ生成部10により生成されたデプスマップを個別または独立に加工する。例えばゲイン調整、オフセット調整、グラデーション処理などの加工を行う。デプスマップ加工部20による処理の詳細は後述する。   Returning to FIG. The depth map processing unit 20 processes the depth map generated by the depth map generation unit 10. In the present embodiment, the depth map processing unit 20 generates a depth map generated by the depth map generation unit 10 for each of a plurality of areas in the screen specified by a plurality of mask patterns (hereinafter simply referred to as masks) set externally. Are processed individually or independently. For example, processing such as gain adjustment, offset adjustment and gradation processing is performed. Details of the processing by the depth map processing unit 20 will be described later.

3D画像生成部30は、上述の2D画像およびデプスマップ加工部20により加工されたデプスマップをもとに別視点の2D画像を生成する。3D画像生成部30は、オリジナル視点の2D画像と別視点の2D画像を右眼画像と左眼画像として出力する。   The 3D image generation unit 30 generates a 2D image of another viewpoint based on the above-described 2D image and the depth map processed by the depth map processing unit 20. The 3D image generation unit 30 outputs the 2D image of the original viewpoint and the 2D image of the different viewpoint as the right eye image and the left eye image.

以下、オリジナル視点の2D画像とデプスマップを用いて当該2D画像と視差を持つ別視点の2D画像を生成する具体例を説明する。この具体例ではオリジナル視点の2D画像を画面表示させた場合の視点を基準にして、左に視点移動した別視点の2D画像を生成する。その場合、観察者に対してテクスチャを近景として表示させるときは画面に向かって左側へオリジナル視点の2D画像のテクスチャを所定量移動させ、テクスチャを観察者に遠景として表示させるときは画面に向かって右側へテクスチャを所定量移動させる。   Hereinafter, a specific example of generating a 2D image of another viewpoint having a parallax with the 2D image using the 2D image of the original viewpoint and the depth map will be described. In this specific example, a 2D image of another viewpoint that is moved to the left is generated based on the viewpoint when the 2D image of the original viewpoint is displayed on the screen. In that case, when displaying the texture as a foreground for the observer, move the texture of the 2D image of the original viewpoint to the left side toward the screen by a predetermined amount, and toward the screen when displaying the texture as a distant view for the observer. Move the texture to the right by a predetermined amount.

デプスマップの各画素の輝度値をYd、飛び出し感を表す輻輳値をm、立体感を表す奥行き値をnとする。3D画像生成部30は輝度値Ydの小さい値から順に、その輝度値Ydに対応するオリジナル視点の2D画像のテクスチャを画素ごとに(Yd−m)/n画素分左にシフトする。(Yd−m)/nの値が負の場合、(m−Yd)/n画素分右にシフトする。なお観察者には、デプスマップの輝度値Ydの小さいテクスチャは画面奥側に見え、輝度値Ydの大きいテクスチャは画面手前に見える。輝度値Yd、輻輳値m、奥行き値nは0〜255の範囲の値であり、例えば、輻輳値m=200、奥行き値n=20に設定される。   Let Yd be the luminance value of each pixel in the depth map, m be the convergence value representing the pop-out feeling, and n be the depth value representing the stereoscopic effect. The 3D image generation unit 30 sequentially shifts the texture of the 2D image at the original viewpoint corresponding to the luminance value Yd to the left by (Yd−m) / n pixels in order from the smallest luminance value Yd. If the value of (Yd−m) / n is negative, shift to the right by (m−Yd) / n pixels. For the observer, a texture with a small luminance value Yd of the depth map appears on the back side of the screen, and a texture with a large luminance value Yd appears on the front side of the screen. The luminance value Yd, the convergence value m, and the depth value n are values in the range of 0 to 255. For example, the convergence value m = 200 and the depth value n = 20 are set.

なお、デプスマップ生成部10によるデプスマップ生成、および3D画像生成部30による3D画像生成のより詳細な説明は、本出願人が先に出願した特開2005−151534号公報、特開2009−44722号公報に開示されている。   A more detailed description of the depth map generation by the depth map generation unit 10 and the 3D image generation by the 3D image generation unit 30 will be described in Japanese Patent Application Laid-Open Nos. 2005-151534 and 2009-44722 previously filed by the present applicant. It is disclosed in the gazette.

操作受付部40は、コンソール端末装置200の操作部60から入力される信号を受け付ける。操作受付部40は、入力される信号をその内容に応じてデプスマップ加工部20または3D画像生成部30に出力する。表示制御部50はコンソール端末装置200の表示部70を制御する。具体的には表示制御部50は、2D入力画像、デプスマップ生成部10により生成されたデプスマップ、デプスマップ加工部20により加工されたデプスマップ、3D画像生成部30により生成された3D画像を表示できる。   The operation reception unit 40 receives a signal input from the operation unit 60 of the console terminal device 200. The operation reception unit 40 outputs the input signal to the depth map processing unit 20 or the 3D image generation unit 30 according to the content. The display control unit 50 controls the display unit 70 of the console terminal device 200. Specifically, the display control unit 50 displays the 2D input image, the depth map generated by the depth map generation unit 10, the depth map processed by the depth map processing unit 20, and the 3D image generated by the 3D image generation unit 30. Can be displayed.

図4は、本発明の基本となる実施例に係る画像編集システム500の全体処理プロセスを説明するための図である。一般的に2D画像には複数のオブジェクトが含まれる。図4の2D入力画像は3つのオブジェクトを含む。具体的には人物、木、背景のオブジェクトを含む。まずデプスマップ生成部10は、2D入力画像からデプスマップを生成する(ステップS10)。デプスマップは白に近いほど輝度が高く観察者との距離が近いことを示し、黒に近いほど輝度が低く観察者との距離が遠いことを示す。3D画像を生成する場合、デプスマップの白に近い領域ほど飛び出し量が大きくなり、黒に近い領域ほど引っ込み量が大きくなる。   FIG. 4 is a diagram for explaining the entire processing process of the image editing system 500 according to the embodiment as the basis of the present invention. In general, a 2D image includes a plurality of objects. The 2D input image of FIG. 4 includes three objects. Specifically, it includes people, trees, and background objects. First, the depth map generation unit 10 generates a depth map from the 2D input image (step S10). In the depth map, the closer to white, the higher the luminance and the closer to the observer, and the closer to black, the lower the luminance and the farther the observer. When a 3D image is generated, the pop-out amount increases as the area is closer to white in the depth map, and the retraction amount increases as the area is closer to black.

本実施例では画像内の複数のオブジェクトに対して個別に奥行き感を調整するために、デプスマップ内の個々のオブジェクト領域に対して独立にエフェクト調整する。具体的には、画像中の個々のオブジェクト領域を表す複数のマスクを用いて、デプスマップ内に、個々のオブジェクト領域を特定する。そして特定されたオブジェクト領域ごとに個別にエフェクト調整し、エフェクト調整された複数のデプスマップを得る。そして、この複数のデプスマップを合成して一つのデプスマップを生成する。このデプスマップは、オリジナル視点の2D画像から別視点の2D画像を生成する際に使用される。   In this embodiment, in order to individually adjust the sense of depth for a plurality of objects in the image, the effect adjustment is performed independently for each object area in the depth map. Specifically, each object area is specified in the depth map using a plurality of masks representing each object area in the image. Then, effect adjustment is performed individually for each identified object region, and a plurality of depth maps adjusted for effect are obtained. Then, one depth map is generated by combining the plurality of depth maps. This depth map is used when generating a 2D image of another viewpoint from a 2D image of the original viewpoint.

デプスマップ生成部10は2D入力画像のデプスマップを自動的に生成する(S10)。生成されたデプスマップは、デプスマップ加工部20に入力される。デプスマップ加工部20には、2D入力画像内の複数のオブジェクト領域をそれぞれ表す複数のマスクも入力される。これらのマスクはユーザによりトレースされたオブジェクト領域の輪郭をもとに生成される。例えば、表示制御部50は表示部70に2D入力画像を表示させ、ユーザはその2D入力画像内においてオブジェクト領域とすべき領域の輪郭を、操作部60を使用してトレースする。操作受付部40は操作部60からの信号により、個々のオブジェクト領域の輪郭情報を生成し、マスクとしてデプスマップ加工部20に出力する。なおユーザが印刷物上に描いた輪郭をスキャナにより読み取ることによりマスクを画像処理装置100に読み込ませてもよい。   The depth map generator 10 automatically generates a depth map of the 2D input image (S10). The generated depth map is input to the depth map processing unit 20. The depth map processing unit 20 also receives a plurality of masks respectively representing a plurality of object regions in the 2D input image. These masks are generated based on the outline of the object area traced by the user. For example, the display control unit 50 displays a 2D input image on the display unit 70, and the user traces the outline of the region to be an object region in the 2D input image using the operation unit 60. The operation receiving unit 40 generates contour information of each object region based on a signal from the operation unit 60 and outputs the contour information to the depth map processing unit 20 as a mask. Note that the mask may be read by the image processing apparatus 100 by reading the outline drawn on the printed matter by the scanner.

図4では各マスクの有効領域を白で無効領域を黒で描いている。人物のマスクは人物の領域のみを有効とし、他の領域を無効とするパターンである。木のマスクは木の領域のみを有効とし、他の領域を無効とするパターンである。背景のマスクは背景のみを有効とし、他の領域を無効とするパターンである。   In FIG. 4, the effective area of each mask is drawn in white and the ineffective area is drawn in black. The mask of the person is a pattern in which only the person area is valid and the other areas are invalid. The tree mask is a pattern in which only the tree area is valid and the other areas are invalid. The background mask is a pattern in which only the background is valid and other areas are invalid.

1画面あたりのマスクの数に制約はなく、ユーザが任意に設定できる。またオブジェクト領域はユーザが1つのオブジェクト領域にすべきと決定した領域に設定できる。例えば、図4に示すように1人の人物に1つのオブジェクト領域を設定してもよいし、人物の部位ごと、さらに各部位の部分ごとにオブジェクト領域を設定してもよい。特に高品質な3D画像を生成する際には、1人の人物に対しても多数のオブジェクト領域を設定し、部位ごと、さらに各部位の部分ごとに厚みや奥行き方向の位置を調整することもある。   There is no restriction on the number of masks per screen, and the user can arbitrarily set it. The object area can be set to an area determined by the user to be one object area. For example, as shown in FIG. 4, one object area may be set for one person, or an object area may be set for each part of the person and for each part. In particular, when generating a high-quality 3D image, a large number of object regions can be set for one person, and the position in the thickness and depth direction can be adjusted for each part and for each part. is there.

デプスマップ加工部20は、デプスマップ生成部10から入力されるデプスマップ(以下、入力デプスマップという)を、ユーザインタフェースを介して入力される複数のマスクを用いて加工する(S20)。デプスマップ加工部20は各マスクで特定される領域ごとに、個別にデプスマップを加工する。以下、この領域別のデプスマップの加工をデプスマップのレイヤ処理と呼ぶ。またレイヤ処理されたデプスマップをレイヤデプスマップと呼ぶ。本明細書ではレイヤを、マスクの有効領域に対する処理の単位を示す概念として使用している。   The depth map processing unit 20 processes the depth map (hereinafter referred to as input depth map) input from the depth map generation unit 10 using a plurality of masks input via the user interface (S20). The depth map processing unit 20 processes the depth map individually for each area specified by each mask. Hereinafter, this depth map processing for each region is referred to as depth map layer processing. A depth map that has been subjected to layer processing is called a layer depth map. In this specification, a layer is used as a concept indicating a unit of processing for an effective area of a mask.

図4では、一例としてデプスマップ加工部20は入力デプスマップから、人物のマスク(レイヤ1のマスク)を用いて人物の領域を特定してレイヤ処理している(S21a)。同様に入力デプスマップから、木のマスク(レイヤ2のマスク)を用いて木の領域を特定してレイヤ処理している(S21b)。同様に入力デプスマップから、背景のマスク(レイヤ3のマスク)を用いて背景の領域を特定してレイヤ処理している(S21c)。   In FIG. 4, as an example, the depth map processing unit 20 performs layer processing by specifying a person region from the input depth map using a person mask (layer 1 mask) (S <b> 21 a). Similarly, from the input depth map, a tree region is identified using a tree mask (layer 2 mask) and layer processing is performed (S21b). Similarly, a background region is identified from the input depth map using a background mask (layer 3 mask) and layer processing is performed (S21c).

デプスマップ加工部20は、レイヤ1〜3のレイヤデプスマップの各オブジェクト領域のデプスマップを合成する(S22)。この合成されたデプスマップを合成デプスマップと呼ぶ。3D画像生成部30は、この合成デプスマップを用いて2D入力画像の画素をシフトし、2D入力画像に対して視差を持つ画像を生成する(S30)。3D画像生成部30は2D入力画像を3D出力画像の右眼画像(R)とし、生成した画像を左眼画像(L)として出力する。   The depth map processing unit 20 synthesizes the depth maps of the object areas of the layer depth maps of layers 1 to 3 (S22). This combined depth map is referred to as a combined depth map. The 3D image generation unit 30 shifts the pixels of the 2D input image using the composite depth map, and generates an image having a parallax with respect to the 2D input image (S30). The 3D image generation unit 30 outputs the 2D input image as the right eye image (R) of the 3D output image and the generated image as the left eye image (L).

まず、デプスマップ加工部20によるレイヤ処理としてゲイン調整する例を説明する。ゲイン調整はオブジェクトの奥行き方向の厚みを調整する処理である。ゲインを上げるとオブジェクトが厚くなり、ゲインを下げるとオブジェクトが薄くなる。   First, an example of gain adjustment as layer processing by the depth map processing unit 20 will be described. Gain adjustment is a process of adjusting the thickness of the object in the depth direction. Increasing the gain makes the object thicker and lowering the gain makes the object thinner.

図5は、入力デプスマップのゲイン調整プロセスを説明するための図である。デプスマップ加工部20は、加工前のデプスマップである入力デプスマップに対して、人物のマスクの有効領域だけにゲインを乗算して、入力デプスマップ内の人物の部分のみデプス値の振幅を大きくする(S21a)。図5において加工後のデプスマップであるレイヤデプスマップは人物の部分の振幅が大きくなっている(符号a参照)。   FIG. 5 is a diagram for explaining the gain adjustment process of the input depth map. The depth map processing unit 20 multiplies the input depth map, which is a depth map before processing, by a gain only in the effective area of the person's mask, and increases the amplitude of the depth value only in the portion of the person in the input depth map. (S21a). In FIG. 5, the amplitude of the person portion of the layer depth map, which is a depth map after processing, is large (see symbol a).

次に、デプスマップ加工部20によるレイヤ処理としてオフセット調整する例を説明する。オフセット調整はオブジェクトの奥行き方向の位置を調整する処理である。正のオフセット値を加算するとオブジェクトが飛び出し方向に移動し、負のオフセット値を加算すると引っ込み方向に移動する。   Next, an example in which offset adjustment is performed as layer processing by the depth map processing unit 20 will be described. Offset adjustment is a process of adjusting the position of the object in the depth direction. When a positive offset value is added, the object moves in the pop-out direction, and when a negative offset value is added, the object moves in the retracting direction.

図6は、入力デプスマップのオフセット調整プロセスを説明するための図である。デプスマップ加工部20は、加工前のデプスマップである入力デプスマップに対して、木のマスクの有効領域だけにオフセットを加算して、入力デプスマップ内の木の部分のみデプス値のレベルを高くする(S21b)。図6において加工後のデプスマップであるレイヤデプスマップは木の部分のレベルが高くなっている(符号b参照)。   FIG. 6 is a diagram for explaining the offset adjustment process of the input depth map. The depth map processing unit 20 adds an offset only to the effective area of the tree mask to the input depth map, which is the depth map before processing, and increases the level of the depth value only for the portion of the tree in the input depth map. (S21b). In FIG. 6, the layer depth map, which is the depth map after processing, has a higher level of the tree portion (see symbol b).

図7は、レイヤデプスマップの合成処理プロセスを説明するための図である。デプスマップ加工部20は、レイヤ1のレイヤデプスマップ(人物のデプスマップ)のうち、レイヤ1のマスク(人物のマスク)の有効領域のみを切り出す。同様にレイヤ2のレイヤデプスマップ(木のデプスマップ)のうち、レイヤ2のマスク(木のマスク)の有効領域のみを切り出す。同様にレイヤ3のレイヤデプスマップ(背景のデプスマップ)のうち、レイヤ3のマスク(背景のマスク)の有効領域のみを切り出す。デプスマップ加工部20は、切り出した3つのデプスマップを組み合わせて合成デプスマップを生成する。   FIG. 7 is a diagram for explaining a process for synthesizing a layer depth map. The depth map processing unit 20 cuts out only the effective area of the layer 1 mask (person's mask) from the layer 1 layer depth map (person's depth map). Similarly, only the effective area of the layer 2 mask (tree mask) is cut out from the layer 2 layer depth map (tree depth map). Similarly, only the effective area of the layer 3 mask (background mask) is cut out from the layer 3 layer depth map (background depth map). The depth map processing unit 20 generates a combined depth map by combining the three extracted depth maps.

図8は、マスクを使用しない入力デプスマップのゲイン調整プロセスを説明するための図である。レイヤデプスマップの合成の際、各レイヤデプスマップのマスクの有効領域のみを用いて合成するのであれば、各レイヤデプスマップのマスクの無効領域は合成デプスマップに反映されないことになる。よって、デプスマップ加工部20は入力デプスマップ全体にゲインを乗算して、入力デプスマップ全体のデプス値の振幅を大きくする(S21a)。図8においてレイヤデプスマップは全体の振幅が大きくなっている(符号c参照)。   FIG. 8 is a diagram for explaining an input depth map gain adjustment process without using a mask. If the layer depth map is synthesized by using only the effective area of the mask of each layer depth map, the invalid area of the mask of each layer depth map is not reflected in the synthesized depth map. Therefore, the depth map processing unit 20 multiplies the entire input depth map by the gain to increase the amplitude of the depth value of the entire input depth map (S21a). In FIG. 8, the entire amplitude of the layer depth map is large (see symbol c).

図9は、マスクを使用しない入力デプスマップのオフセット調整プロセスを説明するための図である。レイヤデプスマップの合成の際、各レイヤデプスマップのマスクの有効領域のみを用いて合成するのであれば、各レイヤデプスマップのマスクの無効領域は合成デプスマップに反映されないことになる。よって、デプスマップ加工部20は入力デプスマップ全体にオフセットを加算して、入力デプスマップ全体のデプス値のレベルを高くする(S21b)。図9においてレイヤデプスマップは全体のレベルが高くなっている(符号d参照)。   FIG. 9 is a diagram for explaining an offset adjustment process of an input depth map without using a mask. If the layer depth map is synthesized by using only the effective area of the mask of each layer depth map, the invalid area of the mask of each layer depth map is not reflected in the synthesized depth map. Therefore, the depth map processing unit 20 adds an offset to the entire input depth map to increase the level of the depth value of the entire input depth map (S21b). In FIG. 9, the overall level of the layer depth map is high (see symbol d).

図10は、画素シフトと画素補間を説明するための図である。3D画像生成部30は合成デプスマップをもとに2D入力画像の画素をシフトし、2D入力画像に対して視差を持つ画像を生成する(S30)。図10では2D入力画像内の人物領域の画素を左にシフトする例を示している。図10のデプスマップは人物領域のデプス値にオフセット値が加算されて人物領域のデプス値が大きくなっている。人物領域のデプス値が大きくなると、3D画像の人物領域の飛び出し量が大きくなる。   FIG. 10 is a diagram for explaining pixel shift and pixel interpolation. The 3D image generation unit 30 shifts the pixels of the 2D input image based on the combined depth map, and generates an image having a parallax with respect to the 2D input image (S30). FIG. 10 shows an example in which the pixel of the person area in the 2D input image is shifted to the left. In the depth map of FIG. 10, the offset value is added to the depth value of the person area, and the depth value of the person area is increased. When the depth value of the person area increases, the pop-out amount of the person area of the 3D image increases.

人物領域の周囲の背景領域を画素シフトせずに人物領域のみを画素シフトすると、画素が存在しない欠落画素領域が発生する(補正前の画素シフト画像の符号e参照)。3D画像生成部30は、この欠落画素領域をその周辺画素から生成した画素で補間して欠落画素領域を補正する。画素補間には様々な方法があるが、例えば人物領域の境界の画素で補間する(補正後の画素シフト画像の符号f参照)。   If only the person area is pixel-shifted without shifting the background area around the person area, a missing pixel area in which no pixel exists is generated (see reference symbol e of the pixel-shifted image before correction). The 3D image generation unit 30 corrects the missing pixel region by interpolating the missing pixel region with pixels generated from the surrounding pixels. There are various methods for pixel interpolation. For example, interpolation is performed using pixels at the boundary of the person area (see reference numeral f of the pixel shifted image after correction).

図11は、オブジェクト境界のデプスの段差が大きい場合における、画素シフトと画素補間を説明するための図である。オブジェクト境界でのデプスの段差が大きい場合、画素シフト量も大きくなるため、欠落画素領域の面積も大きくなる。この欠落画素領域を周辺画素から生成した画素で補間する場合、その補間する領域の面積も大きくなるため、オブジェクト境界での画像の不自然、不整合、不適合が目立つようになる。   FIG. 11 is a diagram for explaining pixel shift and pixel interpolation when the depth difference of the object boundary is large. When the depth difference at the object boundary is large, the pixel shift amount is also large, so that the area of the missing pixel region is also large. When this missing pixel area is interpolated with pixels generated from surrounding pixels, the area of the area to be interpolated also increases, so that unnaturalness, inconsistency, and incompatibility of the image at the object boundary become conspicuous.

図11では図10と比較して人物領域の画素シフト量が大きくなっている。図11の補正前の画素シフト画像の欠落画素領域の面積は、図10のその面積より大きくなっている(符号g参照)。図11の補正後の画素シフト画像でも図10の補正後の画素シフト画像と同様に、欠落画素領域に人物領域の境界の画素を補間している。その欠落画素領域は本来は背景とすべき領域であり、その領域が大きくなると人物の形状が崩れてしまう(符号h参照)。   In FIG. 11, the pixel shift amount of the person area is larger than that in FIG. The area of the missing pixel region of the pixel shifted image before correction in FIG. 11 is larger than that in FIG. 10 (see symbol g). In the pixel shift image after correction in FIG. 11 as well, the pixels at the boundary of the person area are interpolated in the missing pixel area, as in the pixel shift image after correction in FIG. The missing pixel area is an area that should originally be a background, and when the area becomes larger, the shape of the person collapses (see symbol h).

また画像内のオブジェクトには、その境界が鮮明なものばかりではなく不鮮明なものも存在する。オブジェクト境界の不鮮明は、例えば撮影時のピンぼけ、手ぶれ、モーションブラーなどにより発生する。オブジェクト境界が不鮮明であいまいな場合、オブジェクト境界に合わせた適切なマスクを作成するのが困難である。不正確な輪郭で作成されたマスクを用いて、デプスマップの加工、画素シフト、画素補間を行った場合、生成される3D画像のオブジェクトの輪郭が不自然になりやすくなる。   Some objects in the image have not only clear boundaries but also unclear edges. The blurring of the object boundary occurs due to, for example, blurring at the time of shooting, camera shake, or motion blur. When the object boundary is unclear, it is difficult to create an appropriate mask that matches the object boundary. When depth map processing, pixel shift, and pixel interpolation are performed using a mask created with an inaccurate contour, the contour of the object of the generated 3D image tends to be unnatural.

図12は、オブジェクト境界のデプスの段差が大きい場合でも不自然さが発生しない、画素シフトと画素補間を説明するための図である。オブジェクト境界における欠落画素領域の面積が大きい場合でも、人物と背景がなだらかに切り替わるように補間することで、オブジェクト境界の不自然を目立ちにくくできる。   FIG. 12 is a diagram for explaining pixel shift and pixel interpolation in which unnaturalness does not occur even when the depth difference of the object boundary is large. Even when the area of the missing pixel region at the object boundary is large, the unnaturalness of the object boundary can be made inconspicuous by performing interpolation so that the person and the background are switched smoothly.

図12の補正前の画素シフト画像の欠落画素領域の面積も、図11と同様に図10のその面積より大きくなっている(符号i参照)。図12の補正後の画素シフト画像では図11の補正後の画素シフト画像と異なり、人物と背景の境界における不自然が目立ちにくくなっている(符号j参照)。   The area of the missing pixel region of the pixel shifted image before correction in FIG. 12 is also larger than that in FIG. 10 as in FIG. 11 (see symbol i). In the pixel-shifted image after correction shown in FIG. 12, unlike the pixel-shifted image after correction shown in FIG. 11, unnaturalness at the boundary between the person and the background is less noticeable (see symbol j).

図13は、本発明の実施例1に係る画像編集システム500の構成を示す図である。実施例1に係る画像編集システム500では、図2の基本となる実施例に係る画像編集システム500の画像処理装置100にマスク補正部80が追加される。以下、図13の実施例1に係る画像編集システム500と、図2の基本となる実施例に係る画像編集システム500との相違点を説明する。   FIG. 13 is a diagram showing the configuration of the image editing system 500 according to the first embodiment of the present invention. In the image editing system 500 according to the first embodiment, a mask correction unit 80 is added to the image processing apparatus 100 of the image editing system 500 according to the basic embodiment of FIG. Hereinafter, differences between the image editing system 500 according to the first embodiment shown in FIG. 13 and the image editing system 500 according to the basic embodiment shown in FIG. 2 will be described.

マスク補正部80は、操作受付部40を介してコンソール端末装置200から設定されるマスクを補正してデプスマップ加工部20に出力する。具体的にはマスク補正部80はマスクのオブジェクト境界に、ぼかし処理を施す。デプスマップ加工部20は、マスク補正部80により補正されたマスクをもとに生成される、複数のオブジェクト領域の各デプスマップをアルファブレンドする。即ちデプスマップ加工部20は、複数のレイヤデプスマップを、各マスクで規定された係数(α値)にしたがい合成する。   The mask correction unit 80 corrects the mask set from the console terminal device 200 via the operation reception unit 40 and outputs the corrected mask to the depth map processing unit 20. Specifically, the mask correction unit 80 performs a blurring process on the object boundary of the mask. The depth map processing unit 20 alpha-blends each depth map of a plurality of object regions generated based on the mask corrected by the mask correction unit 80. That is, the depth map processing unit 20 combines a plurality of layer depth maps according to the coefficient (α value) defined by each mask.

図14は、本発明の実施例1に係る画像編集システム500の全体処理プロセスを説明するための図である。図14の処理プロセスは図4の処理プロセスに、マスクぼかし処理が追加された構成である。以下、相違点について説明する。なお以下の説明では、マスクの有効領域(図では白で描いている)内の画素値を1、無効領域(図面では黒で描いている)内の画素値を0とする。   FIG. 14 is a diagram for explaining the overall processing process of the image editing system 500 according to the first embodiment of the present invention. The processing process of FIG. 14 has a configuration in which a mask blurring process is added to the processing process of FIG. Hereinafter, differences will be described. In the following description, the pixel value in the effective area of the mask (drawn in white in the figure) is 1, and the pixel value in the invalid area (drawn in black in the drawing) is 0.

実施例1では操作受付部40から出力されるレイヤ1のマスク(人物のマスク)、レイヤ2のマスク(木のマスク)及びレイヤ3のマスク(背景のマスク)は、デプスマップ加工部20に入力される前にマスク補正部80に入力される。マスク補正部80は各マスクのオブジェクト境界部分にぼかし処理を施す(S15a〜S15b)。具体的にはマスク補正部80は、マスク信号のエッジ(即ち、0と1の境界)及びその近傍領域(以下、両者を総称してエッジ領域という)の値を、0と1の間の値(0と1を除く)に補正する(符号k参照)。   In the first embodiment, the layer 1 mask (person mask), the layer 2 mask (tree mask), and the layer 3 mask (background mask) output from the operation reception unit 40 are input to the depth map processing unit 20. It is input to the mask correction unit 80 before being processed. The mask correction unit 80 performs blurring processing on the object boundary portion of each mask (S15a to S15b). Specifically, the mask correction unit 80 sets the values of the edge of the mask signal (that is, the boundary between 0 and 1) and its neighboring area (hereinafter collectively referred to as edge area) to a value between 0 and 1. (Excluding 0 and 1) (see symbol k).

デプスマップ加工部20は、補正されたマスクのレベルに応じて、レイヤデプスマップを合成する(S22)。これによりマスクのエッジ領域では、なだらかにデプス値が変化する合成デプスマップを生成できる。3D画像生成部30は、この合成デプスマップを用いて画素シフト、画素補間を行う。これによりオブジェクト境界がなだらかに変化し、オブジェクト境界の不自然が目立たなくなる。   The depth map processing unit 20 synthesizes a layer depth map according to the corrected mask level (S22). As a result, a combined depth map in which the depth value changes gently can be generated in the edge region of the mask. The 3D image generation unit 30 performs pixel shift and pixel interpolation using the composite depth map. As a result, the object boundary changes gently, and the unnaturalness of the object boundary becomes inconspicuous.

図15は、レイヤデプスマップのアルファブレンドを説明するための図である。デプスマップ加工部20は、マスク補正部80により補正された各マスク信号の値をもとに、各レイヤデプスマップ内のデプス値のブレンド比率を決定する。各レイヤデプスマップは指定された順番に重ね合わされる。重ね合わせの順番はユーザが操作部60から入力し、操作受付部40を介してデプスマップ加工部20に設定される。本明細書の例では背景のレイヤデプスマップ、木のレイヤデプスマップ、人物のデプスマップの順番で重ね合わされる。   FIG. 15 is a diagram for explaining alpha blending of the layer depth map. The depth map processing unit 20 determines a blend ratio of depth values in each layer depth map based on the value of each mask signal corrected by the mask correction unit 80. Each layer depth map is overlaid in the specified order. The order of superimposition is input from the operation unit 60 by the user and is set in the depth map processing unit 20 via the operation reception unit 40. In the example of this specification, the background layer depth map, the tree layer depth map, and the person depth map are overlaid in this order.

図15においてレイヤn(nは自然数)のマスク信号のエッジ領域は、0%から50%への垂直な立ち上がりと、50%から100%へのなだらかな傾斜から構成される。各パーセンテージの数値は合成比率を示している。このレイヤnのマスク信号を用いて、レイヤnのデプス信号(以下、レイヤnデプスという)と、レイヤΣ(n−1)の合成デプス信号(以下、レイヤΣ(n−1)デプスという)をブレンドする。レイヤΣ(n−1)デプスは、レイヤ1からレイヤ(n−1)までの各デプス信号をブレンドした合成デプス信号である。即ち、レイヤnデプスがブレンドされる時点までに生成された合成デプス信号である。   In FIG. 15, the edge region of the mask signal of layer n (n is a natural number) is composed of a vertical rise from 0% to 50% and a gentle slope from 50% to 100%. Each percentage value indicates the composition ratio. Using this layer n mask signal, a layer n depth signal (hereinafter referred to as layer n depth) and a layer Σ (n−1) combined depth signal (hereinafter referred to as layer Σ (n−1) depth) are used. Blend. The layer Σ (n−1) depth is a combined depth signal obtained by blending the depth signals from the layer 1 to the layer (n−1). That is, it is a combined depth signal generated up to the time point when the layer n depth is blended.

レイヤnのマスク信号の合成比率が0%の期間(符号l参照)では、レイヤnデプスが0%、レイヤΣ(n−1)デプスが100%でブレンドされる。即ち、レイヤΣ(n−1)デプスはレイヤnデプスにより全く上書きされず、レイヤΣ(n−1)デプスがそのまま出力される(符号o参照)。レイヤnのマスク信号の合成比率が50%の時点(符号p参照)では、レイヤnデプスが50%、レイヤΣ(n−1)デプスが50%の比率でブレンドされる。   In a period in which the composition ratio of the mask signal of layer n is 0% (see reference numeral 1), layer n depth is blended at 0% and layer Σ (n-1) depth is blended at 100%. That is, the layer Σ (n−1) depth is not overwritten at all by the layer n depth, and the layer Σ (n−1) depth is output as it is (see symbol o). At the time when the composition ratio of the mask signal of layer n is 50% (see symbol p), the layer n depth is blended at a ratio of 50% and the layer Σ (n−1) depth is blended at a ratio of 50%.

レイヤnのマスク信号の合成比率が50%〜100%の期間(符号m参照)では、合成比率が変化しながらレイヤnデプスとレイヤΣ(n−1)デプスがブレンドされる。例えばレイヤnのマスク信号の合成比率が75%の時点(符号q参照)では、レイヤnデプスが75%、レイヤΣ(n−1)デプスが25%の比率でブレンドされる。レイヤnのマスク信号の合成比率が100%に到達した時点(符号r参照)から、レイヤnデプスが100%、レイヤΣ(n−1)デプスが0%の比率でブレンドされる。レイヤnのマスク信号の合成比率が100%の期間(符号n参照)では、レイヤΣ(n−1)デプスはレイヤnデプスにより完全上書きされ、結果としてレイヤnデプスがそのまま出力される(符号s参照)。これによりレイヤΣnデプスが生成される。レイヤΣnデプスは、レイヤ1からレイヤnまでの各デプス信号をブレンドした合成デプス信号である。   In a period in which the composition ratio of the mask signal of layer n is 50% to 100% (see symbol m), the layer n depth and the layer Σ (n−1) depth are blended while the composition ratio changes. For example, when the composition ratio of the mask signal of layer n is 75% (see symbol q), the layer n depth is blended at a ratio of 75% and the layer Σ (n−1) depth is blended at a ratio of 25%. From the point in time when the composition ratio of the mask signal of layer n reaches 100% (see symbol r), the layer n depth is blended at a ratio of 100% and the layer Σ (n−1) depth is blended at a ratio of 0%. During the period when the composition ratio of the mask signal of layer n is 100% (see symbol n), the layer Σ (n−1) depth is completely overwritten by the layer n depth, and as a result, the layer n depth is output as it is (symbol s). reference). Thereby, the layer Σn depth is generated. The layer Σn depth is a combined depth signal obtained by blending the depth signals from layer 1 to layer n.

なおレイヤデプスのブレンドの際に、レイヤΣ(n−1)デプスのマスク信号は使用されない。レイヤΣnデプスのマスク信号のみにより、レイヤΣnデプスとレイヤΣ(n−1)デプスとの合成比率が決定される。したがってレイヤデプスの重なりが多い領域では、下のレイヤデプスのデプス値はレイヤデプスが重ねられるにつれ薄まっていく。   Note that the layer Σ (n−1) depth mask signal is not used during layer depth blending. The combination ratio of the layer Σn depth and the layer Σ (n−1) depth is determined only by the layer Σn depth mask signal. Therefore, in a region where the layer depth overlaps frequently, the depth value of the lower layer depth becomes thinner as the layer depth is overlapped.

以下、マスク信号のエッジをぼかす処理について具体的に説明する。このぼかし処理は以下の3つの基本ステップからなる。まずオリジナルのマスク信号のエッジを、対象となるオブジェクトの輪郭に対して適切な位置になるように移動させる。これによりマスクのオブジェクト領域の面積が拡大または縮小する。次に当該マスクのエッジに傾斜をつける。最後に傾斜をつけたマスクのエッジ領域を制限する。   Hereinafter, the process of blurring the edge of the mask signal will be described in detail. This blurring process consists of the following three basic steps. First, the edge of the original mask signal is moved to an appropriate position with respect to the contour of the target object. Thereby, the area of the object region of the mask is enlarged or reduced. Next, the edge of the mask is inclined. Limit the edge area of the mask with the last slope.

以下、上述のぼかし処理をローパスフィルタを用いて行う方法を説明する。まず黒い部分のレベルが0、白い部分のレベルが1であるマスクにローパスフィルタをかける。これにより、平坦部分のレベルは変化させずに、エッジ領域に0と1の中間のレベルの傾斜が付加されたマスクを生成できる。   Hereinafter, a method of performing the above blurring process using a low-pass filter will be described. First, a low-pass filter is applied to a mask in which the level of the black part is 0 and the level of the white part is 1. As a result, it is possible to generate a mask in which a slope having an intermediate level between 0 and 1 is added to the edge region without changing the level of the flat portion.

さらにマスクのエッジ領域のうち、マスクの有効領域に対して外側にのみ傾斜を付け、内側は加工前のレベルを保持したい場合がある。またその逆に、マスクのエッジ領域のうち、マスクの有効領域に対して内側にのみ傾斜を付け、外側は加工前のレベルを保持したい場合もある。これらの場合を考慮して、マスクの有効領域を拡大または縮小して、マスク信号のエッジの位置を任意に移動させる処理を、ぼかしマスク生成用のローパスフィルタの前段に挿入する。   Further, in some cases, it is desired to incline only the outer side of the effective area of the mask in the edge area of the mask and to maintain the level before processing on the inner side. On the contrary, in some cases, it is desired to incline only the inside of the mask edge area with respect to the effective area of the mask and to maintain the level before processing on the outside. In consideration of these cases, processing for arbitrarily moving the position of the edge of the mask signal by enlarging or reducing the effective area of the mask is inserted before the low-pass filter for generating the blur mask.

さらに、ぼかし処理によりマスクのエッジが意図した量より大きく拡大することを防ぐために、ぼかされたエッジ領域を制限する処理を、ぼかしマスク生成用のローパスフィルタの後段に挿入する。以下、このローパスフィルタを用いたぼかし処理について、より具体的に説明する。   Furthermore, in order to prevent the edge of the mask from expanding more than the intended amount due to the blurring process, a process for limiting the blurred edge region is inserted after the low-pass filter for blur mask generation. Hereinafter, the blurring process using the low-pass filter will be described more specifically.

図16は、マスク補正部80の構成例を示す図である。マスク補正部80は第1ローパスフィルタ81、二値化部82、第2ローパスフィルタ83、クリッピング部84を含む。これらの構成もハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できる。   FIG. 16 is a diagram illustrating a configuration example of the mask correction unit 80. The mask correction unit 80 includes a first low-pass filter 81, a binarization unit 82, a second low-pass filter 83, and a clipping unit 84. These configurations can also be realized in various forms by hardware only, software only, or a combination thereof.

1段目の第1ローパスフィルタ81は、オリジナルのマスク信号にローパスフィルタをかける。二値化部82は第1ローパスフィルタ81から出力される、エッジに傾斜がついたマスク信号を第1閾値を用いて二値化する。第1ローパスフィルタ81および二値化部82の作用により、オリジナルのマスク信号のエッジの位置が移動される。   The first low-pass filter 81 in the first stage applies a low-pass filter to the original mask signal. The binarization unit 82 binarizes the mask signal output from the first low-pass filter 81 and having an inclined edge using the first threshold value. By the action of the first low-pass filter 81 and the binarization unit 82, the position of the edge of the original mask signal is moved.

2段目の第2ローパスフィルタ83は、二値化部82から出力されるエッジの位置が移動されたマスク信号にローパスフィルタをかける。これによりマスク信号のエッジに傾斜がつけられる。クリッピング部84は第2ローパスフィルタ83から出力される、エッジに傾斜がついたマスク信号を第2閾値を用いて、第2閾値以下の信号を0にクリッピングする。   The second low-pass filter 83 at the second stage applies a low-pass filter to the mask signal output from the binarization unit 82 whose edge position has been moved. As a result, the edge of the mask signal is inclined. The clipping unit 84 uses the second threshold value for the mask signal output from the second low-pass filter 83 and having an inclined edge to clip a signal equal to or lower than the second threshold value to zero.

図17は、図16のマスク補正部80によるマスクぼかし処理を説明するための図である。図17の左に処理フローを、中央にマスクの信号波形を、右にマスクの画像を示す。図17の説明ではマスクの各画素値が8ビットで規定され、マスクの画像において黒が0(0b00000000)、白が255(0b11111111)であるとする。通常、オリジナルのマスク信号は0または255のみを持つ二値信号である。   FIG. 17 is a diagram for explaining mask blurring processing by the mask correction unit 80 of FIG. FIG. 17 shows a processing flow on the left, a mask signal waveform in the center, and a mask image on the right. In the description of FIG. 17, it is assumed that each pixel value of the mask is defined by 8 bits, and black is 0 (0b00000000) and white is 255 (0b11111111) in the mask image. Usually, the original mask signal is a binary signal having only 0 or 255.

オリジナルのマスク信号は、第1ローパスフィルタ81に入力される。第1ローパスフィルタ81はマスク信号のエッジの位置をかえる前処理として、オリジナルのマスク信号にローパスフィルタをかける(S81)。具体的には第1ローパスフィルタ81はオリジナルのマスク信号を、エッジ領域が傾斜を持つマスク信号に加工する。傾斜部分の値は0と255の間の値(0と255を除く)に加工される。  The original mask signal is input to the first low-pass filter 81. The first low-pass filter 81 applies a low-pass filter to the original mask signal as pre-processing for changing the position of the edge of the mask signal (S81). Specifically, the first low-pass filter 81 processes the original mask signal into a mask signal having an inclined edge region. The value of the inclined portion is processed to a value between 0 and 255 (excluding 0 and 255).

次に二値化部82はマスク信号のエッジの位置をかえる前処理として、加工されたマスク信号の値と第1閾値を比較してマスク信号を二値化する(S82)。具体的にはマスク信号の値が第1閾値よりも大きい場合はマスク信号の値を255に設定し、小さい場合は0に設定する。これにより再び、マスク信号は0または255のみを持つ二値信号となる。   Next, as a preprocessing for changing the position of the edge of the mask signal, the binarization unit 82 compares the value of the processed mask signal with the first threshold value and binarizes the mask signal (S82). Specifically, when the value of the mask signal is larger than the first threshold, the value of the mask signal is set to 255, and when it is smaller, it is set to 0. As a result, the mask signal again becomes a binary signal having only 0 or 255.

第1閾値が0と255の中間値である127より小さく設定される場合、二値化されたマスク信号のエッジは、オリジナルのマスク信号のエッジよりも外側に移動される。この場合、マスクの画像内において白の面積が拡大する。一方、第1閾値が中間値である127より大きく設定される場合、二値化されたマスク信号のエッジは、オリジナルのマスク信号のエッジよりも内側に移動される。この場合、マスクの画像内において白の面積が縮小する。なお第1閾値が中間値である127に設定される場合、二値化されたマスク信号のエッジは、オリジナルのマスク信号におけるエッジの位置と同じになる。   When the first threshold value is set to be smaller than 127, which is an intermediate value between 0 and 255, the edge of the binarized mask signal is moved outside the edge of the original mask signal. In this case, the white area is enlarged in the mask image. On the other hand, when the first threshold value is set to be larger than the intermediate value 127, the edge of the binarized mask signal is moved inward from the edge of the original mask signal. In this case, the white area is reduced in the mask image. When the first threshold is set to 127, which is an intermediate value, the edge of the binarized mask signal is the same as the position of the edge in the original mask signal.

図17ではマスク信号のエッジの位置を外側に移動させる例を示している。第1ローパスフィルタ81のタップ数や係数などのフィルタ特性および二値化部82の第1閾値を可変することにより、マスク信号のエッジの位置を任意に調整できる。   FIG. 17 shows an example in which the edge position of the mask signal is moved outward. By varying the filter characteristics such as the number of taps and coefficients of the first low-pass filter 81 and the first threshold value of the binarization unit 82, the position of the edge of the mask signal can be arbitrarily adjusted.

図18は、第1ローパスフィルタ81によりマスク信号に形成される傾斜と、二値化部82に設定される第1閾値の関係を説明するための図である。同じエッジの位置のマスク信号を生成する場合において、傾斜が緩くて長い場合は第1閾値が高くなり、傾斜が短く急な場合は第1閾値が低くなる関係にある。ユーザが操作部60から第1ローパスフィルタ81のフィルタ特性および二値化部82の第1閾値を入力することにより、操作受付部40を介して第1ローパスフィルタ81および二値化部82に設定される。ユーザは操作部60から、第1ローパスフィルタ81のフィルタ特性および二値化部82の第1閾値の少なくとも一方を調整することにより、マスク信号のエッジの位置を任意に調整できる。なお第1閾値を低く設定したほうが傾斜を短くできるため、第1ローパスフィルタ81のタップ数を減らすことができ、第1ローパスフィルタ81を簡素化できる。   FIG. 18 is a diagram for explaining the relationship between the slope formed in the mask signal by the first low-pass filter 81 and the first threshold value set in the binarization unit 82. When generating mask signals at the same edge position, the first threshold value is high when the slope is slow and long, and the first threshold value is low when the slope is short and steep. When the user inputs the filter characteristics of the first low-pass filter 81 and the first threshold value of the binarization unit 82 from the operation unit 60, the first low-pass filter 81 and the binarization unit 82 are set via the operation reception unit 40. Is done. The user can arbitrarily adjust the position of the edge of the mask signal by adjusting at least one of the filter characteristic of the first low-pass filter 81 and the first threshold value of the binarization unit 82 from the operation unit 60. Since the slope can be shortened by setting the first threshold value low, the number of taps of the first low-pass filter 81 can be reduced, and the first low-pass filter 81 can be simplified.

図17に戻る。エッジの位置が移動されたマスク信号は第2ローパスフィルタ83に入力される。第2ローパスフィルタ83は、エッジの位置が移動されたマスク信号にローパスフィルタをかける(S83)。これにより、再びエッジ領域に傾斜が付加されたぼかしマスクが生成される。   Returning to FIG. The mask signal whose edge position has been moved is input to the second low-pass filter 83. The second low-pass filter 83 applies a low-pass filter to the mask signal whose edge position has been moved (S83). As a result, a blur mask in which an inclination is added to the edge region again is generated.

次にクリッピング部84は、第2ローパスフィルタ83により生成されたエッジ領域に傾斜を持つマスク信号の値と第2閾値を比較して、当該マスク信号の値が第2閾値以下のときマスク信号の値を0に設定する(S84)。即ちエッジ領域において白側の傾斜は残し、黒側の傾斜は急峻に落とす。これにより第2閾値より大きい領域では白からグレーに変化する傾斜がつき、第2閾値以下の領域では黒のマスクを生成できる。このクリッピング処理により、マスク内のぼかしをかけた領域を制限し、マスクのエッジ領域が意図した大きさより、大きくなることを抑制できる。   Next, the clipping unit 84 compares the value of the mask signal having an inclination in the edge region generated by the second low-pass filter 83 with the second threshold, and when the value of the mask signal is equal to or smaller than the second threshold, The value is set to 0 (S84). That is, in the edge region, the white side slope is left and the black side slope is sharply dropped. As a result, a slope that changes from white to gray is provided in an area greater than the second threshold, and a black mask can be generated in an area that is less than or equal to the second threshold. By this clipping process, it is possible to limit the blurred area in the mask and prevent the edge area of the mask from becoming larger than intended.

図17では、ぼかし処理を水平方向にかける例を示しているが、二次元ローパスフィルタを用いることにより、ぼかし処理を水平方向と垂直方向の両方にかけることもできる。その際、水平方向と垂直方向で係数が異なるフィルタを用いてもよい。その場合、水平方向と垂直方向とで個別にマスク信号のエッジの位置、傾斜の度合い、ぼかし幅を調整できる。   Although FIG. 17 shows an example in which the blurring process is performed in the horizontal direction, the blurring process can be performed in both the horizontal direction and the vertical direction by using a two-dimensional low-pass filter. At that time, filters having different coefficients in the horizontal direction and the vertical direction may be used. In that case, the position of the edge of the mask signal, the degree of inclination, and the blur width can be individually adjusted in the horizontal direction and the vertical direction.

また水平方向と垂直方向で係数が異なり、かつ斜め方向は縦横の係数の中間値を持つ楕円状の二次元ローパスフィルタを用いてもよい。楕円状の二次元ローパスフィルタを用いれば、水平方向と垂直方向とで個別にマスク信号のエッジの位置および傾斜の度合い、ぼかし幅を調整でき、その調整を斜め方向に作用させることもできる。例えば、正方形のオリジナルマスクを、縦横が任意の長さで、かつ角が丸くなった長方形に加工することができる。また正方形のオリジナルマスクを、縦横の傾斜の度合いが個別かつ任意で、角においては縦横の傾斜の度合いと連続性を持ちつつなだらかに変化する傾斜を持つ全方位に任意のなだらかな傾斜がついた長方形に加工することもできる。   Alternatively, an elliptical two-dimensional low-pass filter having different coefficients in the horizontal direction and the vertical direction and having an intermediate value between the vertical and horizontal coefficients in the oblique direction may be used. If an elliptical two-dimensional low-pass filter is used, the edge position of the mask signal, the degree of inclination, and the blur width can be individually adjusted in the horizontal direction and the vertical direction, and the adjustment can be applied in an oblique direction. For example, a square original mask can be processed into a rectangular shape with arbitrary length and width and rounded corners. In addition, the square original mask has an arbitrary gentle slope in all directions, with the degree of vertical and horizontal inclination being individual and arbitrary, and with the angle gradually changing with the degree of horizontal and vertical inclination and continuity. It can also be processed into a rectangle.

図19は、第1ローパスフィルタ81により付加される傾斜と、第2ローパスフィルタ83により付加される傾斜を比較するための図である。第1ローパスフィルタ81により付加される傾斜(符号t参照)は、二値化境界位置を調整するために使用される仮の傾斜であり、二値化後には消える。したがって傾斜は一定の角度で線形に変化する傾斜でよい。第2ローパスフィルタ83により付加される傾斜(符号t参照)は、残る傾斜であるため、ユーザがその傾斜の形状も調整するとよい。例えば傾斜の上部では上が凸の、下部では下が凸の形状に調整してもよい。この形状に調整すると、クリッピングされる幅を大きくできる。   FIG. 19 is a diagram for comparing the slope added by the first low-pass filter 81 with the slope added by the second low-pass filter 83. The slope added by the first low-pass filter 81 (see symbol t) is a temporary slope used to adjust the binarization boundary position and disappears after binarization. Therefore, the inclination may be an inclination that changes linearly at a constant angle. Since the inclination (see symbol t) added by the second low-pass filter 83 is the remaining inclination, the user may adjust the shape of the inclination. For example, the upper part of the slope may be adjusted to be convex, and the lower part may be adjusted to be convex. By adjusting to this shape, the clipped width can be increased.

このように、第1ローパスフィルタ81、第2ローパスフィルタ83のタップ数や係数などのフィルタ特性、二値化部82の第1閾値、クリッピング部84の第2閾値を調整することにより、マスク信号のエッジの位置、マスクの有効領域の面積、ぼかし幅をそれぞれ自由に調整できる。また全てのレイヤのマスク信号に同一のぼかし処理をかける必要はなく、各レイヤのマスク信号ごとに個別にぼかし処理をかけてもよい。   In this way, the mask signal is adjusted by adjusting the filter characteristics such as the number of taps and coefficients of the first low-pass filter 81 and the second low-pass filter 83, the first threshold value of the binarization unit 82, and the second threshold value of the clipping unit 84. The edge position, the effective area of the mask, and the blur width can be freely adjusted. Further, it is not necessary to apply the same blurring process to the mask signals of all layers, and the blurring process may be performed individually for each mask signal of each layer.

以上のぼかし処理により、マスク信号のエッジを任意の位置に移動させ、マスクの有効領域の面積を変化させることができる。またエッジ領域に任意の傾きの傾斜をつけることができる。さらにマスクのぼかし領域を任意に制限することができる。   By the blurring process described above, the edge of the mask signal can be moved to an arbitrary position, and the area of the effective area of the mask can be changed. In addition, the edge region can be given an arbitrary inclination. Further, the blur area of the mask can be arbitrarily limited.

ぼかしマスクは、後段のデプスマップの合成で使用される。デプスマップ加工部20は、ぼかしマスクのレベルに応じて、複数のレイヤデプスマップをアルファブレンドする。その際、ぼかしマスクのレベルに応じて、各レイヤデプスマップの合成比率が決定される。   The blur mask is used in the synthesis of the depth map in the subsequent stage. The depth map processing unit 20 alpha blends a plurality of layer depth maps according to the level of the blur mask. At that time, the composition ratio of each layer depth map is determined according to the level of the blur mask.

以上説明したように実施例1によれば、レイヤデプスマップを合成する際、ぼかしマスクを使用することにより、合成デプスマップのオブジェクト境界部分に連続性を持たせることができる。即ちオブジェクト境界部分に大きな段差がある場合、その段差をなだらかにすることができる。したがって、この合成デプスマップをもとに生成される別視点の画像のオブジェクト境界部分を自然な境界に仕上げることができる。   As described above, according to the first embodiment, when layer depth maps are combined, by using a blur mask, it is possible to provide continuity to the object boundary portion of the combined depth map. That is, when there is a large step at the object boundary, the step can be made gentle. Therefore, the object boundary portion of the image of another viewpoint generated based on this composite depth map can be finished to a natural boundary.

また境界があいまいなオブジェクトに対して、不正確な輪郭で作成されたマスクを用いた場合でも、その輪郭の位置を調整することにより、生成される3D画像のオブジェクトの輪郭が不自然な輪郭となることを回避できる。   In addition, even when a mask created with an inaccurate contour is used for an object with an ambiguous boundary, by adjusting the position of the contour, the contour of the object of the generated 3D image becomes an unnatural contour. Can be avoided.

以下、ぼかしマスクを用いずにオブジェクト境界の不自然を目立ちにくくする方法について説明する。   Hereinafter, a method for making the unnaturalness of the object boundary inconspicuous without using a blur mask will be described.

図20は、本発明の実施例1の変形例に係る画像編集システム500の全体処理プロセスを説明するための図である。図20の処理プロセスは図4の処理プロセスに、ローパスフィルタ処理が追加された構成である。以下、相違点について説明する。なお図14の処理プロセスと異なりマスクぼかし処理が追加されない。   FIG. 20 is a diagram for explaining the overall processing process of the image editing system 500 according to the modification of the first embodiment of the present invention. The processing process of FIG. 20 has a configuration in which low-pass filter processing is added to the processing process of FIG. Hereinafter, differences will be described. Unlike the processing process of FIG. 14, the mask blurring process is not added.

デプスマップ加工部20は、合成デプスマップにローパスフィルタをかける(S85)。これにより、デプスマップ内のオブジェクト境界におけるデプス値の変化がなだらかになる。ただし、ぼかしマスクを使用する方法と比較し、そのデプス値の変化をオブジェクト毎に任意に調整することはできない。また、ぼかしマスクを使用する方法では、オブジェクト境界におけるデプス値の変化だけをなだらかに加工できる。これに対して、合成デプスマップにローパスフィルタをかける方法では、オブジェクト境界だけでなくオブジェクト内部の平坦部分についても、細かなディテール(凹凸)が失われる。   The depth map processing unit 20 applies a low-pass filter to the combined depth map (S85). Thereby, the change of the depth value at the object boundary in the depth map becomes gentle. However, the change in the depth value cannot be arbitrarily adjusted for each object as compared with the method using the blur mask. Further, in the method using the blur mask, only the change of the depth value at the object boundary can be smoothly processed. On the other hand, in the method of applying a low-pass filter to the composite depth map, fine details (unevenness) are lost not only on the object boundary but also on the flat part inside the object.

ぼかしマスクを使用する方法と、合成デプスマップにローパスフィルタをかける処理は、各々独立で使用することもできるし、両方の処理を同時に使用することもできる。また、各々の処理の順番を入れ替えることもできる。レイヤ合成する前のデプスマップにローパスフィルタをかけて、ぼかし処理されたレイヤデプスマップを生成し、それらレイヤデプスマップをぼかしマスクを用いて合成し、さらに合成デプスマップにローパスフィルタをかけてもよい。   The method of using the blur mask and the process of applying the low pass filter to the composite depth map can be used independently of each other, or both processes can be used simultaneously. Moreover, the order of each process can also be replaced. It is also possible to apply a low pass filter to the depth map before layer synthesis to generate a blurred layer depth map, synthesize the layer depth map using a blur mask, and then apply a low pass filter to the composite depth map. .

次に実施例2について説明する。実施例1ではオブジェクト境界をぼかすことにより、オブジェクト境界の不自然を目立ちにくくする方法を説明した。実施例2ではオブジェクト境界における不自然な箇所の画素をユーザの手作業によるペイント処理で修正する方法を説明する。このペイント処理は、以下の3つのプロセスからなる。まず不自然な箇所の画素を特定する。次に不自然な箇所の画素を消去する。最後に消去した箇所の画素をペイントにより再構成する。   Next, Example 2 will be described. In the first embodiment, the method of making the object boundary unnatural is not noticeable by blurring the object boundary. In the second embodiment, a method of correcting a pixel at an unnatural place on an object boundary by a user's manual painting process will be described. This painting process consists of the following three processes. First, an unnatural pixel is specified. Next, the unnatural pixel is erased. The pixel at the last erased portion is reconstructed by painting.

上記プロセスにおいて、画素シフトと同時に画素補間する場合、不自然な箇所の特定が困難である。また画素補間しない場合でも、シフトされた画素が欠落画素の周辺にまばらに存在する状態が発生し得る。その場合、まばらに存在するシフトされた画素を消去してから、あらためてペイントによる画素の再描画を行う必要がある。これらは、ペイント作業の工数を増やす要因となっている。   In the above process, when pixel interpolation is performed simultaneously with pixel shift, it is difficult to identify an unnatural part. Even when pixel interpolation is not performed, a state in which shifted pixels exist sparsely around missing pixels may occur. In that case, it is necessary to erase the sparsely shifted pixels and then redraw the pixels by painting again. These are factors that increase the man-hours for painting work.

図21は、本発明の実施例2に係る画像編集システム500によるフィルオフ機能を説明するための図である。フィルオフ機能は、以下の3つの機能を含む。広い欠落画素領域が生じるのは画素シフト量が大きいときである。第1機能は、画素シフト量が大きいときには画素補間を停止することにより意図的に欠落画素を残す機能である。第2機能は欠落画素がまばらでなくカタマリで生じる状態を作り出す機能である。具体的には、注目画素だけでなくその周辺画素についても画素シフト量を監視し、周辺画素を含めたいずれかの画素で、画素シフト量が大きいときに画素補間を停止する。第3機能は、発生した欠落画素を補間する代わりに特定色の画素を埋めることにより、欠落画素領域をユーザに認識しやすくする。   FIG. 21 is a diagram for explaining the fill-off function by the image editing system 500 according to the second embodiment of the present invention. The fill-off function includes the following three functions. A wide missing pixel region occurs when the pixel shift amount is large. The first function is a function that intentionally leaves missing pixels by stopping pixel interpolation when the pixel shift amount is large. The second function is a function for creating a state in which missing pixels are not sparse but occur in a catalyzed manner. Specifically, the pixel shift amount is monitored not only for the pixel of interest but also for its peripheral pixels, and pixel interpolation is stopped when the pixel shift amount is large for any pixel including the peripheral pixels. The third function makes it easier for the user to recognize the missing pixel region by filling in pixels of a specific color instead of interpolating the generated missing pixels.

図21において図11及び図12と同様に、画素シフトにより発生する欠落画素領域の面積は、図10のその面積より大きくなっている(符号v参照)。図21では欠落画素をカタマリで発生させ、欠落画素領域を特定色の画素で埋めている(符号w参照)。ユーザはペイント作業により、その特定色の欠落画素領域を描画して修正する(符号x参照)。   In FIG. 21, as in FIGS. 11 and 12, the area of the missing pixel region generated by the pixel shift is larger than that of FIG. 10 (see symbol v). In FIG. 21, missing pixels are generated in a catalyzed manner, and the missing pixel region is filled with pixels of a specific color (see reference symbol w). The user draws and corrects the missing pixel area of the specific color by the painting work (see symbol x).

図22は、本発明の実施例2に係る3D画像生成部30の構成を示す図である。実施例2に係る3D画像生成部30は、画素シフト部31、監視領域設定部32、画素補間部33を含む。これらの構成もハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できる。   FIG. 22 is a diagram illustrating a configuration of the 3D image generation unit 30 according to the second embodiment of the present invention. The 3D image generation unit 30 according to the second embodiment includes a pixel shift unit 31, a monitoring region setting unit 32, and a pixel interpolation unit 33. These configurations can also be realized in various forms by hardware only, software only, or a combination thereof.

画素シフト部31は、デプスマップ加工部20により加工されたデプスマップをもとに2D入力画像を画素シフトする。画素補間部33は、画素シフト部31による画素シフトにより発生する欠落画素を補間する。基本的に欠落画素をその周辺画素で補間する。画素補間部33は、欠落画素を補間する際、隣接画素とのデプス値の変化量(以下、デプスの微分値という)が設定値より大きい画素の補間をスキップする。当該設定値はユーザが操作部60から調整可能であり、当該設定値を調整することにより補間スキップ処理の感度を調整できる。   The pixel shift unit 31 pixel-shifts the 2D input image based on the depth map processed by the depth map processing unit 20. The pixel interpolation unit 33 interpolates missing pixels that are generated by the pixel shift by the pixel shift unit 31. Basically, the missing pixel is interpolated with the surrounding pixels. When interpolating missing pixels, the pixel interpolation unit 33 skips interpolation of pixels whose depth value change amount with an adjacent pixel (hereinafter referred to as a depth differential value) is larger than a set value. The set value can be adjusted by the user from the operation unit 60, and the sensitivity of the interpolation skip process can be adjusted by adjusting the set value.

画素補間部33は、対象画素およびその周辺画素のうち、デプスの微分値が当該設定値より大きい画素が少なくとも一つ存在する場合、対象画素を欠落させる。この欠落された画素も補間をスキップさせる。監視領域設定部32は対象画素およびその周辺画素で規定される監視領域を設定する。当該監視領域の面積および/または形状は、固定であってもよいし可変であってもよい。   The pixel interpolation unit 33 deletes the target pixel when at least one pixel having a depth differential value larger than the set value is present among the target pixel and its peripheral pixels. This missing pixel is also skipped for interpolation. The monitoring area setting unit 32 sets a monitoring area defined by the target pixel and its surrounding pixels. The area and / or shape of the monitoring area may be fixed or variable.

監視領域設定部32は、外部設定されるパラメータにしたがい当該監視領域を設定できる。当該パラメータはユーザが操作部60から調整可能である。例えば、対象画素を基準として上方向画素数、下方向画素数、左方向画素数、右方向画素数、膨張率の5つのパラメータにより規定される監視領域を設定できる。したがって対象画素を中心として左右非対称な監視領域を設定することもできる。例えば、監視領域設定部32は、画素シフト部31により2D入力画像が左にシフトされる場合は対象画素の左側より右側の面積が広い監視領域を設定し、2D入力画像が右にシフトされる場合は対象画素の右側より左側の面積が広い監視領域を設定することもできる。   The monitoring area setting unit 32 can set the monitoring area according to a parameter set externally. The parameter can be adjusted by the user from the operation unit 60. For example, it is possible to set a monitoring region defined by five parameters of the number of upward pixels, the number of downward pixels, the number of leftward pixels, the number of rightward pixels, and the expansion rate with reference to the target pixel. Therefore, it is possible to set a monitoring region that is asymmetrical about the target pixel. For example, when the 2D input image is shifted to the left by the pixel shift unit 31, the monitoring area setting unit 32 sets a monitoring area having a larger area on the right side than the left side of the target pixel, and the 2D input image is shifted to the right. In this case, it is possible to set a monitoring area having a larger area on the left side than the right side of the target pixel.

画素補間部33は、欠落画素に周辺画素を補間する代わりに、特定色の画素を埋め込んでもよい。例えば赤などの目立ちやすい色の画素を埋め込んでもよい。   The pixel interpolating unit 33 may embed a pixel of a specific color instead of interpolating the peripheral pixel to the missing pixel. For example, a pixel with a conspicuous color such as red may be embedded.

以下、具体例を挙げながら上述の3つの機能についてより詳細に説明する。まず第1機能について説明する。上述したように画素シフト量が大きいときは、画素シフト量の基準となるデプス値の変化量も大きくなる。デプスの微分値が設定値より大きい場合には、画素補間によるオブジェクト境界の不自然が顕著になると判断して画素補間を停止する。デプスの微分値は、対象画素のデプス値から、水平方向に1画素ずれた画素のデプス値を減算することにより求められる。   Hereinafter, the above three functions will be described in more detail with specific examples. First, the first function will be described. As described above, when the pixel shift amount is large, the amount of change in the depth value that serves as a reference for the pixel shift amount also increases. When the depth differential value is larger than the set value, it is determined that the unnaturalness of the object boundary due to pixel interpolation becomes significant, and the pixel interpolation is stopped. The differential value of the depth is obtained by subtracting the depth value of the pixel shifted by one pixel in the horizontal direction from the depth value of the target pixel.

入力画像を左に画素シフトして別の画像を生成する場合、オブジェクト境界の不自然はシフトされた画素の右側で発生する。よってこの場合、対象画素のデプスの変化を右側だけで監視して対象画素の左側に影響を与えないようにするとよい。同様に入力画像を右に画素シフトして別の画像を生成する場合、対象画素のデプスの変化を左側だけで監視して対象画素の右側に影響を与えないようにするとよい。   When the input image is shifted leftward to generate another image, object boundary unnaturalness occurs on the right side of the shifted pixel. Therefore, in this case, it is preferable to monitor the change in the depth of the target pixel only on the right side so as not to affect the left side of the target pixel. Similarly, when generating another image by shifting the input image to the right, it is preferable to monitor the change in the depth of the target pixel only on the left side so as not to affect the right side of the target pixel.

次に第2機能について説明する。欠落画素をカタマリで発生させるために、注目画素だけでなくその周辺画素についても、画素シフト量に対応するデプスの微分値を監視する。周辺の監視領域が広いほど、発生する欠落画素のカタマリの面積が大きくなるが、あまり広すぎると、正常にシフトされ修正の必要のない画素まで欠落させてしまうことになる。よって適切な監視領域の設定が必要となる。   Next, the second function will be described. In order to generate missing pixels in a catamaly, the differential value of the depth corresponding to the pixel shift amount is monitored not only for the pixel of interest but also for the surrounding pixels. The larger the peripheral monitoring area, the larger the area of the missing pixel catalyzer generated. However, if it is too wide, pixels that are normally shifted and need not be corrected will be lost. Therefore, it is necessary to set an appropriate monitoring area.

図23(a)−(e)は、監視領域の複数の例を示す。図23(a)は十字型、図23(b)は手裏剣型、図23(c)はダイヤ型、図23(d)は八角形型、図23(e)は長方形型の監視領域である。これらの形状は膨張率により設定可能である。十字型は膨張率を0%、手裏剣型は膨張率を25%、ダイヤ型は膨張率を50%、八角形型は膨張率を75%、長方形型は膨張率を100%に設定することにより生成される。   FIGS. 23A to 23E show a plurality of examples of monitoring areas. 23A is a cross-shaped area, FIG. 23B is a shuriken type, FIG. 23C is a diamond type, FIG. 23D is an octagonal type, and FIG. 23E is a rectangular type monitoring area. . These shapes can be set by the expansion coefficient. By setting the expansion rate to 0% for the cross type, 25% for the shuriken type, 50% for the diamond type, 75% for the octagonal type, and 100% for the rectangular type Generated.

この例では膨張率は、十字線とその十字線を内接する長方形との関係により定義される。具体的には当該長方形の中心と頂点とを結ぶ線分の長さを100%とした場合における、その線分の伸縮率で膨張率は定義される。即ち監視領域は、十字線の4つの端点と、それぞれ伸縮された線分の4つの端点とを結んで形成される。膨張率が0%のときは当該線分は存在しなくなるため十字線の4つの端点を結んで形成される。これら十字型から長方形型まで形状の異なる監視領域を自由に設定できることにより、ユーザの意図に沿った形状の、欠落画素のカタマリを生成できる。   In this example, the expansion rate is defined by the relationship between the crosshair and the rectangle inscribed in the crosshair. Specifically, the expansion rate is defined by the expansion / contraction rate of the line segment when the length of the line segment connecting the center and the vertex of the rectangle is 100%. That is, the monitoring area is formed by connecting the four end points of the crosshairs and the four end points of the stretched line segments. When the expansion rate is 0%, the line segment does not exist, and is formed by connecting the four end points of the crosshair. Since these monitoring regions having different shapes from a cross shape to a rectangular shape can be freely set, it is possible to generate a catalog of missing pixels having a shape in accordance with the user's intention.

以下、5つの設定パラメータを用いて監視領域を設定する方法を具体例を挙げながら説明する。使用する5つの設定パラメータは、上方向の画素数、下方向の画素数、左方向の画素数、右方向の画素数、膨張率である。膨張率は図23(a)−(e)で説明した膨張率である。   Hereinafter, a method for setting a monitoring area using five setting parameters will be described with a specific example. The five setting parameters to be used are the number of pixels in the upward direction, the number of pixels in the downward direction, the number of pixels in the left direction, the number of pixels in the right direction, and the expansion rate. The expansion coefficient is the expansion coefficient described with reference to FIGS.

図24は、5つの設定パラメータにより生成される監視領域の具体例を説明するための図である(その1)。この具体例では上方向の画素数Tが2、下方向の画素数Bが6、左方向の画素数Lが4、右方向の画素数Rが6に設定される。   FIG. 24 is a diagram for explaining a specific example of the monitoring area generated by the five setting parameters (part 1). In this specific example, the upper pixel number T is set to 2, the lower pixel number B is set to 6, the left pixel number L is set to 4, and the right pixel number R is set to 6.

図25は、5つの設定パラメータにより生成される監視領域の具体例を説明するための図である(その2)。図25のグラフには図24の設定値を前提に、膨張率Pが25%、膨張率Pが50%、膨張率Pが75%、膨張率Pが100%の場合の監視領域が描かれている。このように上記5つの設定パラメータをそれぞれ独立に自由に設定することにより、上下左右非対称な形状の監視領域を任意に設定できる。   FIG. 25 is a diagram for explaining a specific example of the monitoring area generated by the five setting parameters (part 2). In the graph of FIG. 25, on the assumption of the setting values of FIG. 24, a monitoring region is drawn when the expansion rate P is 25%, the expansion rate P is 50%, the expansion rate P is 75%, and the expansion rate P is 100%. ing. As described above, by freely setting the above five setting parameters independently, it is possible to arbitrarily set a monitoring region having an asymmetrical shape in the vertical and horizontal directions.

図26は、デプス信号の微分値の監視およびフィルオフを説明するための図である(右眼画像)。右眼画像は、入力画像を左に画素シフトして生成される。画素シフト部31は、デプス信号をもとに入力画像を画素シフトする。図26では画素f−kが左に3画素分、シフトされる。そのシフトの結果、画素f−kの右側に3画素の欠落画素領域が発生する。   FIG. 26 is a diagram for explaining monitoring of the differential value of the depth signal and fill-off (right eye image). The right eye image is generated by pixel shifting the input image to the left. The pixel shift unit 31 pixel-shifts the input image based on the depth signal. In FIG. 26, the pixel f-k is shifted three pixels to the left. As a result of the shift, a missing pixel region of 3 pixels is generated on the right side of the pixel f-k.

画素補間部33は、フィルオフするか否かを判定するためにデプス信号の微分値を生成する。左に画素シフトする場合、注目画素のデプス値と左隣画素のデプス値の差分を、デプス信号の微分値(X(n)-X(n-1))とする。欠落画素はシフトされた画素の右側に発生するため、デプス信号の微分値の負側を抽出することにより、欠落画素の位置を特定できる。負側が抽出されたデプス信号の微分値が設定値を超える場合、画素補間部33はその画素をフィルオフする。フィルオフされる画素は欠落画素領域の右端の画素だけであるため、その左側の2画素は原則として、フィルオフされない。   The pixel interpolation unit 33 generates a differential value of the depth signal in order to determine whether or not to fill off. When shifting the pixel to the left, the difference between the depth value of the pixel of interest and the depth value of the left adjacent pixel is taken as the differential value of the depth signal (X (n) -X (n-1)). Since the missing pixel occurs on the right side of the shifted pixel, the position of the missing pixel can be specified by extracting the negative side of the differential value of the depth signal. When the differential value of the depth signal from which the negative side is extracted exceeds the set value, the pixel interpolation unit 33 fills off the pixel. Since only the pixel at the right end of the missing pixel region is filled off, the two pixels on the left side are not filled off in principle.

図26では、デプス信号の微分値の監視領域を左に3画素、右に0画素、拡張している。したがって画素補間部33は対象画素とその左隣の2画素の合計3画素の、デプス信号の微分値を監視することになる。その3画素のいずれかのデプス信号の微分値が設定値を超えた場合、画素補間部33は対象画素をフィルオフする。これにより図26の一番下に示すような適切なフィルオフ領域を得ることができる。よって欠落画素領域について適切にフィルオフすることができる。また、監視領域の右側の拡張は0画素であるため、フィルオフする必要がない領域はフィルオフされない設定となっている。   In FIG. 26, the monitoring region of the differential value of the depth signal is expanded by 3 pixels on the left and 0 pixel on the right. Therefore, the pixel interpolating unit 33 monitors the differential value of the depth signal of a total of three pixels including the target pixel and the two pixels adjacent to the left side. When the differential value of the depth signal of any of the three pixels exceeds the set value, the pixel interpolation unit 33 fills off the target pixel. As a result, an appropriate fill-off region as shown at the bottom of FIG. 26 can be obtained. Therefore, it is possible to appropriately fill off the missing pixel region. Further, since the extension on the right side of the monitoring area is 0 pixels, the area which does not need to be filled off is set to be not filled off.

図27は、デプス信号の微分値の監視およびフィルオフを説明するための図である(左眼画像)。左眼画像は、入力画像を右に画素シフトして生成される。画素シフト部31は、デプス信号をもとに入力画像を画素シフトする。図27では画素f−hが右に3画素分、シフトされる。そのシフトの結果、画素f−hの左側に3画素の欠落画素領域が発生する。   FIG. 27 is a diagram for explaining monitoring of the differential value of the depth signal and fill-off (left eye image). The left eye image is generated by pixel shifting the input image to the right. The pixel shift unit 31 pixel-shifts the input image based on the depth signal. In FIG. 27, the pixel fh is shifted to the right by 3 pixels. As a result of the shift, a missing pixel region of 3 pixels is generated on the left side of the pixel f-h.

画素補間部33は、フィルオフするか否かを判定するためにデプス信号の微分値を生成する。右に画素シフトする場合、注目画素のデプス値と右隣画素のデプス値の差分を、デプス信号の微分値(X(n+1)-X(n))とする。欠落画素はシフトされた画素の左側に発生するため、デプス信号の微分値の正側を抽出することにより、欠落画素の位置を特定できる。正側が抽出されたデプス信号の微分値が設定値を超える場合、画素補間部33はその画素をフィルオフする。フィルオフされる画素は欠落画素領域の左端の画素だけであるため、その右側の2画素分は原則として、フィルオフされない。   The pixel interpolation unit 33 generates a differential value of the depth signal in order to determine whether or not to fill off. When the pixel is shifted to the right, the difference between the depth value of the pixel of interest and the depth value of the right adjacent pixel is set to the differential value (X (n + 1) −X (n)) of the depth signal. Since the missing pixel occurs on the left side of the shifted pixel, the position of the missing pixel can be specified by extracting the positive side of the differential value of the depth signal. When the differential value of the depth signal from which the positive side is extracted exceeds the set value, the pixel interpolation unit 33 fills off the pixel. Since only the pixel at the left end of the missing pixel region is filled off, the two pixels on the right side are not filled off in principle.

図27では、デプス信号の微分値の監視領域を右に3画素、左に0画素、拡張している。したがって画素補間部33は対象画素とその右隣の2画素の合計3画素の、デプス信号の微分値を監視することになる。その3画素のいずれかのデプス信号の微分値が設定値を超えた場合、画素補間部33は対象画素をフィルオフする。これにより、図27の一番下に示すような適切なフィルオフ領域を得ることができる。よって欠落画素領域について適切にフィルオフすることができる。また、監視領域の左側の拡張は0画素であるため、フィルオフする必要がない領域はフィルオフされない設定となっている。   In FIG. 27, the monitoring area of the differential value of the depth signal is expanded by 3 pixels on the right and 0 pixel on the left. Therefore, the pixel interpolating unit 33 monitors the differential value of the depth signal of a total of three pixels, that is, the target pixel and the two pixels adjacent to the right. When the differential value of the depth signal of any of the three pixels exceeds the set value, the pixel interpolation unit 33 fills off the target pixel. Thereby, an appropriate fill-off region as shown at the bottom of FIG. 27 can be obtained. Therefore, it is possible to appropriately fill off the missing pixel region. Further, since the left extension of the monitoring area is 0 pixels, the area that does not need to be filled off is set not to be filled off.

このように、監視領域を左右で非対称に設定する機能を有することにより、画素シフトによって生じる欠落画素領域を、画素シフトの特性と方向に従って適切に特定することができる。そして特定した欠落画素領域のフィルオフを適切に行うことができる。   Thus, by having the function of setting the monitoring area asymmetrically on the left and right, the missing pixel area caused by the pixel shift can be appropriately specified according to the characteristics and direction of the pixel shift. Then, the specified missing pixel region can be appropriately filled off.

次に第3機能について説明する。画素補間部33は、フィルオフにより補間されない欠落画素に対して周辺画素と異なる、赤色等の画素を書き込む。これにより、欠落画素の位置を特定しやすくなる。書き込む画素は赤色に限らず他の色でもよい。例えば原画に存在する色と異なる任意の色の画素を書き込むことにより、欠落画素の位置を認識しやすくさせることができる。また、書き込む画素の色を黒や白にすれば、ペイント作業時に画素を消す作業を省略させることができる。書き込む画素の画素値を任意に変更可能に設計することにより、目的に応じて書き込む画素の色を任意に選択できる。   Next, the third function will be described. The pixel interpolation unit 33 writes a pixel such as red, which is different from the surrounding pixels, to the missing pixel that is not interpolated due to fill-off. This makes it easy to specify the position of the missing pixel. The pixel to be written is not limited to red, but may be another color. For example, by writing a pixel of an arbitrary color different from the color existing in the original image, the position of the missing pixel can be easily recognized. Also, if the color of the pixel to be written is black or white, the operation of erasing the pixel at the time of painting can be omitted. By designing the pixel value of the pixel to be written to be arbitrarily changeable, the color of the pixel to be written can be arbitrarily selected according to the purpose.

以上説明したように実施例2によれば、画素シフトにより発生する欠落画素に対する画素補間をスキップする機能を備えたことにより、画素補間によりオブジェクト境界が不自然になることを回避できる。また対象画素のデプスの微分値だけでなく、対象画素の周辺画素のデプスの微分値も監視することにより、欠落画素がまばらに発生することを回避できる。ユーザがペイント作業する際、欠落画素周辺の欠落していない画素を消去する作業が必要となるが、欠落画素をブロックで発生させることにより、ペイント作業を簡略化させることができる。また画素補間しない欠落画素に特定色の画素を埋め込むことにより、ペイント作業により編集されるべき欠落画素領域をユーザに認識しやすくできる。   As described above, according to the second embodiment, by providing a function of skipping pixel interpolation for missing pixels caused by pixel shift, it is possible to avoid unnatural object boundaries due to pixel interpolation. Further, by monitoring not only the depth differential value of the target pixel but also the depth differential value of the peripheral pixels of the target pixel, it is possible to avoid occurrence of missing pixels sparsely. When the user performs a painting operation, it is necessary to delete pixels that are not missing around the missing pixels. However, the painting operation can be simplified by generating missing pixels in blocks. In addition, by embedding a pixel of a specific color in a missing pixel that is not subjected to pixel interpolation, it is possible for the user to easily recognize a missing pixel region to be edited by a painting operation.

以上説明した実施例1もしくは実施例2に係る画像編集システム500を単独で使用することにより、または実施例1と実施例2の組み合わせに係る画像編集システム500を使用することにより、2D画像から3D画像を生成する際に、オブジェクト境界部分の画像品質を向上させることができる。   By using the image editing system 500 according to the first embodiment or the second embodiment described above alone, or by using the image editing system 500 according to the combination of the first embodiment and the second embodiment, a 3D image can be converted into a 3D image. When generating an image, the image quality of the object boundary portion can be improved.

以上、本発明を実施の形態をもとに説明した。実施の形態は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   The present invention has been described based on the embodiments. The embodiments are exemplifications, and it will be understood by those skilled in the art that various modifications can be made to combinations of the respective constituent elements and processing processes, and such modifications are within the scope of the present invention. .

実施例2に係る画像編集システム500では、デプスマップ加工部20による加工をスキップして、デプスマップ生成部10により生成されたデプスマップをそのまま使用してもよい。またオブジェクト領域ごとに分割せずに、一括で加工されたデプスマップを使用してもよい。またユーザの作業により一から生成されたデプスマップが使用されてもよい。   In the image editing system 500 according to the second embodiment, processing by the depth map processing unit 20 may be skipped, and the depth map generated by the depth map generation unit 10 may be used as it is. Further, a depth map processed in a batch may be used without being divided for each object area. Also, a depth map generated from scratch by the user's work may be used.

500 画像編集システム、 100 画像処理装置、 10 デプスマップ生成部、 11 画面上部高域成分評価部、 12 画面下部高域成分評価部、 13 合成比率決定部、 14 第1基本デプスモデル用フレームメモリ、 15 第2基本デプスモデル用フレームメモリ、 16 第3基本デプスモデル用フレームメモリ、 17 合成部、 18 加算部、 20 デプスマップ加工部、 30 3D画像生成部、 31 画素シフト部、 32 監視領域設定部、 33 画素補間部、 40 操作受付部、 50 表示制御部、 200 コンソール端末装置、 60 操作部、 70 表示部、 80 マスク補正部、 81 第1ローパスフィルタ、 82 二値化部、 83 第2ローパスフィルタ、 84 クリッピング部。   500 image editing system, 100 image processing apparatus, 10 depth map generation unit, 11 upper screen high frequency component evaluation unit, 12 lower screen high frequency component evaluation unit, 13 synthesis ratio determination unit, 14 frame memory for first basic depth model, 15 Frame memory for the second basic depth model, 16 Frame memory for the third basic depth model, 17 Compositing unit, 18 Adder unit, 20 Depth map processing unit, 30 3D image generation unit, 31 Pixel shift unit, 32 Monitoring region setting unit 33 pixel interpolation unit, 40 operation reception unit, 50 display control unit, 200 console terminal device, 60 operation unit, 70 display unit, 80 mask correction unit, 81 first low pass filter, 82 binarization unit, 83 second low pass Filter, 84 clipping unit.

Claims (6)

入力画像とデプスマップをもとに別視点の画像を生成する画像処理装置であって、
前記入力画像を前記デプスマップをもとに画素シフトする画素シフト部と、
前記画素シフト部による画素シフトにより発生する欠落画素を補間する際、隣接画素とのデプス値の変化量が設定値より大きい画素の補間をスキップし、対象画素およびその周辺画素のうち、隣接画素とのデプス値の変化量が設定値より大きい画素が少なくとも一つ存在する場合、前記対象画素を欠落させる画素補間部と、
外部設定されるパラメータにしたがい、前記対象画素およびその周辺画素で規定される監視領域を設定する監視領域設定部と、を備え、
前記画素補間部は、前記監視領域設定部により設定された監視領域において規定される周辺画素と、前記対象画素とのデプス値の変化量に基づき、欠落画素を補間することを特徴とする画像処理装置。
An image processing device that generates an image of a different viewpoint based on an input image and a depth map,
A pixel shift unit that pixel-shifts the input image based on the depth map;
When interpolating a missing pixel generated by pixel shift by the pixel shift unit, the interpolation of a pixel whose depth value change amount with an adjacent pixel is larger than a set value is skipped, and among the target pixel and its surrounding pixels, If there is at least one pixel whose depth value change amount is greater than the set value, a pixel interpolation unit that drops the target pixel
A monitoring area setting unit for setting a monitoring area defined by the target pixel and its surrounding pixels according to an externally set parameter ,
The pixel interpolation unit interpolates missing pixels based on a change amount of a depth value between a peripheral pixel defined in the monitoring region set by the monitoring region setting unit and the target pixel. apparatus.
前記監視領域設定部は、前記画素シフト部により前記入力画像が左にシフトされる場合、前記対象画素の左側より右側の面積が広い前記監視領域を設定し、前記画素シフト部により前記入力画像が右にシフトされる場合、前記対象画素の右側より左側の面積が広い前記監視領域を設定することを特徴とする請求項に記載の画像処理装置。 When the input image is shifted to the left by the pixel shift unit, the monitoring region setting unit sets the monitoring region having a larger area on the right side than the left side of the target pixel, and the input image is input by the pixel shift unit. when shifted to the right, the image processing apparatus according to claim 1, characterized in that the left side of the area from the right side of the target pixel is set wider the monitored area. 前記監視領域設定部は、前記対象画素を基準として上方向画素数、下方向画素数、左方向画素数、右方向画素数、膨張率が前記パラメータとして外部設定され、それらのパラメータをもとに前記監視領域を設定することを特徴とする請求項またはに記載の画像処理装置。 In the monitoring area setting unit, the number of upward pixels, the number of downward pixels, the number of leftward pixels, the number of rightward pixels, and the expansion rate are externally set as the parameters based on the target pixel, and based on these parameters the image processing apparatus according to claim 1 or 2, characterized in that for setting the monitored area. 前記画素補間部は、前記欠落画素に特定色の画素を埋め込むことを特徴とする請求項1からのいずれかに記載の画像処理装置。 The pixel interpolation unit, an image processing apparatus according to any one of claims 1 to 3, characterized in that embedding pixel of a specific color to the missing pixel. 入力画像とデプスマップをもとに別視点の画像を生成する画像処理方法であって、
前記入力画像を前記デプスマップをもとに画素シフトするステップと、
画素シフトにより発生する欠落画素を補間する際、隣接画素とのデプス値の変化量が設定値より大きい画素の補間をスキップし、対象画素およびその周辺画素のうち、隣接画素とのデプス値の変化量が設定値より大きい画素が少なくとも一つ存在する場合、前記対象画素を欠落させるステップと、
外部設定されるパラメータにしたがい、前記対象画素およびその周辺画素で規定される監視領域を設定するステップと、を備え、
欠落画素を補間するステップは、設定された監視領域において規定される周辺画素と、前記対象画素とのデプス値の変化量に基づき、欠落画素を補間することを特徴とする画像処理方法。
An image processing method for generating an image of a different viewpoint based on an input image and a depth map,
Pixel shifting the input image based on the depth map;
When interpolating missing pixels due to pixel shift, the interpolation of pixels whose depth value change amount with the adjacent pixel is larger than the set value is skipped, and the depth value change with the adjacent pixel among the target pixel and its surrounding pixels If there is at least one pixel whose amount is greater than a set value , the step of deleting the target pixel ;
Setting a monitoring area defined by the target pixel and its surrounding pixels according to an externally set parameter , and
The image processing method characterized in that the step of interpolating the missing pixel interpolates the missing pixel based on the amount of change in the depth value between the peripheral pixel defined in the set monitoring region and the target pixel .
入力画像とデプスマップをもとに別視点の画像を生成する画像処理プログラムであって、
前記入力画像を前記デプスマップをもとに画素シフトする処理と、
画素シフトにより発生する欠落画素を補間する際、隣接画素とのデプス値の変化量が設定値より大きい画素の補間をスキップし、対象画素およびその周辺画素のうち、隣接画素とのデプス値の変化量が設定値より大きい画素が少なくとも一つ存在する場合、前記対象画素を欠落させる処理と、
外部設定されるパラメータにしたがい、前記対象画素およびその周辺画素で規定される監視領域を設定する処理と、をコンピュータに実行させ、
欠落画素を補間する処理は、設定された監視領域において規定される周辺画素と、前記対象画素とのデプス値の変化量に基づき、欠落画素を補間することを特徴とする画像処理プログラム。
An image processing program for generating an image of a different viewpoint based on an input image and a depth map,
A process of pixel shifting the input image based on the depth map;
When interpolating missing pixels due to pixel shift, the interpolation of pixels whose depth value change amount with the adjacent pixel is larger than the set value is skipped, and the depth value change with the adjacent pixel among the target pixel and its surrounding pixels When there is at least one pixel whose amount is larger than a set value, a process of deleting the target pixel ;
In accordance with parameters set externally, the processing for setting a monitoring area defined by the target pixel and its surrounding pixels is executed by a computer,
An image processing program characterized in that the process of interpolating a missing pixel interpolates the missing pixel based on a change amount of a depth value between a peripheral pixel defined in a set monitoring region and the target pixel .
JP2012025128A 2012-02-08 2012-02-08 Image processing apparatus, image processing method, and image processing program Active JP5867128B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012025128A JP5867128B2 (en) 2012-02-08 2012-02-08 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012025128A JP5867128B2 (en) 2012-02-08 2012-02-08 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2013162465A JP2013162465A (en) 2013-08-19
JP5867128B2 true JP5867128B2 (en) 2016-02-24

Family

ID=49174353

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012025128A Active JP5867128B2 (en) 2012-02-08 2012-02-08 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP5867128B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840881B (en) * 2018-12-12 2023-05-05 奥比中光科技集团股份有限公司 3D special effect image generation method, device and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3551467B2 (en) * 1994-04-13 2004-08-04 松下電器産業株式会社 Parallax calculating device, parallax calculating method, and image combining device
JP4179938B2 (en) * 2003-02-05 2008-11-12 シャープ株式会社 Stereoscopic image generating apparatus, stereoscopic image generating method, stereoscopic image generating program, and computer-readable recording medium recording the stereoscopic image generating program
JP2004248212A (en) * 2003-02-17 2004-09-02 Kazunari Era Stereoscopic image display apparatus
JP2011081605A (en) * 2009-10-07 2011-04-21 Fujifilm Corp Image processing apparatus, method and program

Also Published As

Publication number Publication date
JP2013162465A (en) 2013-08-19

Similar Documents

Publication Publication Date Title
JP5962393B2 (en) Image processing apparatus, image processing method, and image processing program
US8971611B2 (en) Image process device, image process method, and image process program
JP2015022458A (en) Image processing device, image processing method, and image processing program
KR101969864B1 (en) Method of synthesizing images based on mutual interlocking of object and background images
JP5615552B2 (en) Generating an image depth map
KR100914845B1 (en) Method and apparatus for 3d reconstructing of object by using multi-view image information
KR20060121972A (en) Electronic watermarking method, electronic watermark detecting method, apparatus and program
US20150379720A1 (en) Methods for converting two-dimensional images into three-dimensional images
TWI712990B (en) Method and apparatus for determining a depth map for an image, and non-transitory computer readable storage medium
JP2018524896A (en) Method and apparatus for determining a depth map of an image
JP2008276410A (en) Image processor and method
US20240046430A1 (en) Corrective Lighting for Video Inpainting
JP6904842B2 (en) Image processing device, image processing method
JP5971017B2 (en) Image processing apparatus, image processing method, and image processing program
JP5900321B2 (en) Image processing apparatus, image processing method, and image processing program
JP5867128B2 (en) Image processing apparatus, image processing method, and image processing program
JP5807569B2 (en) Image processing apparatus, image processing method, and image processing program
JP7387029B2 (en) Single-image 3D photography technology using soft layering and depth-aware inpainting
JPH1153534A (en) Method and device for reparing image
Munezawa et al. Noise removal method for moving images using 3-D and time-domain total variation regularization decomposition
WO2010018610A1 (en) Background video generating method and background video generating system
JP5887966B2 (en) Image processing apparatus, image processing method, and image processing program
JP2015103960A (en) Method, program and apparatus for specifying image depth
JP5807571B2 (en) Image processing apparatus, image processing method, and image processing program
JP5807570B2 (en) Image processing apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140731

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150423

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150512

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150608

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151221

R150 Certificate of patent or registration of utility model

Ref document number: 5867128

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150