Nothing Special   »   [go: up one dir, main page]

JP5971017B2 - 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
JP5971017B2
JP5971017B2 JP2012173209A JP2012173209A JP5971017B2 JP 5971017 B2 JP5971017 B2 JP 5971017B2 JP 2012173209 A JP2012173209 A JP 2012173209A JP 2012173209 A JP2012173209 A JP 2012173209A JP 5971017 B2 JP5971017 B2 JP 5971017B2
Authority
JP
Japan
Prior art keywords
image
mask
low
pass filter
depth map
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
JP2012173209A
Other languages
Japanese (ja)
Other versions
JP2014033366A (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 JP2012173209A priority Critical patent/JP5971017B2/en
Priority to US13/760,825 priority patent/US8971611B2/en
Publication of JP2014033366A publication Critical patent/JP2014033366A/en
Application granted granted Critical
Publication of JP5971017B2 publication Critical patent/JP5971017B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (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 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.

特開2009−44722号公報JP 2009-44722 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)は、外部設定されるマスクパターンを補正するマスク補正部(80)と、入力画像のデプスマップを、前記マスク補正部(80)により補正された複数のマスクパターンにより指定される複数の領域ごとに加工するデプスマップ加工部(20)と、前記入力画像、及び前記デプスマップ加工部(20)により加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成する画像生成部(30)と、を備える。前記マスク補正部(80)は、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定するフィルタ形状設定部(85)を含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施す。前記フィルタ形状設定部(85)は、前記オブジェクトが左右の一側に画素シフトされる場合に、前記オブジェクトの他側のエッジが、一側のエッジよりも緩やかなフィルタ形状に設定する。 In order to solve the above-described problem, an image processing apparatus (100) according to an aspect of the present invention includes a mask correction unit (80) that corrects an externally set mask pattern, and a depth map of an input image. A depth map processing unit (20) that processes each of a plurality of areas specified by the plurality of mask patterns corrected by (80), the input image, and a depth map processed by the depth map processing unit (20). An image generation unit (30) that shifts pixels of the input image to generate an image of another viewpoint having a parallax with respect to the input image . The mask correction unit (80) compares whether the image of the different viewpoint is a right-eye image or a left-eye image, and compares an inner depth value and an outer depth value of an object boundary portion of the mask pattern. depending on the context the object and the surroundings resulting from the result, the filter shape setting unit for setting the filter shape of the low-pass filter comprises a (85), Kio object boundary before using at least the right and left unsymmetrical said low pass filter A blurring process is performed. The filter shape setting unit (85) sets the edge of the other side of the object to be a gentler filter shape than the edge of the one side when the object is pixel-shifted to the left and right sides.

本発明の別の態様は、画像処理方法である。この方法は、外部設定されるマスクパターンを補正するステップと、入力画像のデプスマップを、補正された複数のマスクパターンにより指定される複数の領域ごとに加工するステップと、前記入力画像、及び加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成するステップと、を有する。前記マスクパターンを補正するステップは、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定するステップを含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施す。前記フィルタ形状を設定するステップは、前記オブジェクトが左右の一側に画素シフトされる場合に、前記オブジェクトの他側のエッジが、一側のエッジよりも緩やかなフィルタ形状に設定する。 Another aspect of the present invention is an image processing method. The method includes a step of correcting an externally set mask pattern, a step of processing a depth map of an input image for each of a plurality of regions designated by the corrected plurality of mask patterns, the input image, and the processing based on the depth map, which is, by shifting the pixels of the input image, and a step of generating an image of another viewpoint with parallax with respect to the input image. The step of correcting the mask pattern comprises comparing whether the image of the different viewpoint is a right-eye image or a left-eye image, and comparing an inner depth value and an outer depth value of the boundary in the object boundary portion of the mask pattern. depending on the context the object and the surroundings resulting from the results, including the step of setting the filter shape of the low-pass filter, the Kio object boundary before at least the left and right by using the asymmetric said low pass filter is subjected to blurring processing . In the step of setting the filter shape, when the object is pixel-shifted to the left and right sides, the other edge of the object is set to a gentler filter shape than the one side edge.

なお、以上の構成要素の任意の組み合わせ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   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, etc. 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. 本発明の実施例2に係る画像編集システムの全体処理プロセスを説明するための図である。It is a figure for demonstrating the whole processing process of the image editing system which concerns on Example 2 of this invention. 本発明の実施例3に係るマスク補正部の構成例を示す図である。It is a figure which shows the structural example of the mask correction part which concerns on Example 3 of this invention. 図22(a)−(c)は左右対称な第2ローパスフィルタを用いたマスクエッジの加工処理を説明するための図である。FIGS. 22A to 22C are diagrams for explaining mask edge processing using a second symmetrical low-pass filter. 図23(a)−(c)は左右非対称な第2ローパスフィルタを用いたマスクエッジの加工処理を説明するための図である。FIGS. 23A to 23C are diagrams for explaining mask edge processing using a second low-pass asymmetric filter. 本発明の実施例3に係るフィルタ形状設定部によるフィルタ形状の決定処理を説明するためのフローチャートである。It is a flowchart for demonstrating the determination process of the filter shape by the filter shape setting part which concerns on Example 3 of this invention. 図25(a)−(c)は左右対称な第1ローパスフィルタを用いたマスクエッジの加工処理を説明するための図である。FIGS. 25A to 25C are diagrams for explaining mask edge processing using a first symmetrical low-pass filter. 図26(a)−(c)は左右非対称な第1ローパスフィルタを用いたマスクエッジの加工処理を説明するための図である。FIGS. 26A to 26C are diagrams for explaining mask edge processing using a first low-pass asymmetric filter.

図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 a deeper depth at the 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〜S15c)。具体的にはマスク補正部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 S15c). 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は、本発明の実施例2に係る画像編集システム500の全体処理プロセスを説明するための図である。図20の処理プロセスは図4の処理プロセスに、ローパスフィルタ処理が追加された構成である。以下、相違点について説明する。なお図14の処理プロセスと異なりマスクぼかし処理が追加されない。   FIG. 20 is a diagram for explaining the overall processing process of the image editing system 500 according to the second 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. .

次に実施例3について説明する。実施例1、2では、デプスマップを加工する際の基準となるマスクに対して以下の処理を施した。マスクの有効エリアの面積を可変する。マスクのエッジ部分に傾斜をつける(具体的には、0または1ではなく 0.5などの中間値を作る)。マスクにつけた傾斜(中間値)の値に応じて、デプスマップをαブレンド合成する。合成されたデプスマップにローパスフィルタをかけて、急峻な変化を抑圧する。   Next, Example 3 will be described. In Examples 1 and 2, the following processing was performed on a mask serving as a reference when processing a depth map. The area of the effective area of the mask is varied. Slope the edge of the mask (specifically, create an intermediate value such as 0.5 instead of 0 or 1). The depth map is subjected to α blend synthesis according to the value of the inclination (intermediate value) attached to the mask. A low-pass filter is applied to the synthesized depth map to suppress steep changes.

実施例1、2では、これらの処理により、合成デプスマップのオブジェクトの境界部分に連続性を持たせ、この合成デプスマップを基に生成された画像(3D画像)のオブジェクトの境界部分の不自然を目立たなくすることを示した。   In the first and second embodiments, by these processes, the boundary portion of the object of the synthesized depth map has continuity, and the boundary portion of the object of the image (3D image) generated based on this synthesized depth map is unnatural. To make it less noticeable.

この実施例1、2に係る方法では、本来補正の必要が無い部分にまで補正処理が行われる場合が発生する。その補正の副作用により画像が不自然に変化してしまう場合がある。また、その補正の副作用を回避または軽減するために補正の効果を弱めた場合、オブジェクトの境界部分の不自然さを完全に解消できないことがある。   In the methods according to the first and second embodiments, there is a case where correction processing is performed up to a portion where correction is not originally required. The image may change unnaturally due to the side effect of the correction. Further, when the effect of the correction is weakened to avoid or reduce the side effect of the correction, the unnaturalness of the boundary portion of the object may not be completely eliminated.

実施例3では、マスクぼかし処理の特殊性を考慮したうえで、マスクの補正処理を局所的に非対称に効果せしめる手段を講じる。これにより、狙いとする部分のみに排他的に補正処理を施すことができ、上記の副作用を回避または軽減できる。即ち、マスクのエッジ部分の処理を非対称に行い、その非対称なエッジを備えるマスクの加工を行う。これにより補正処理の副作用を抑えつつ、生成される3D画像におけるオブジェクトの境界部分の不自然さを目立ちにくくできる。   In the third embodiment, in consideration of the peculiarity of the mask blurring process, means for making the mask correction process locally asymmetrical is provided. As a result, the correction process can be performed exclusively on the target portion, and the above side effects can be avoided or reduced. That is, the processing of the edge portion of the mask is performed asymmetrically, and the mask having the asymmetrical edge is processed. As a result, the unnaturalness of the boundary portion of the object in the generated 3D image can be made inconspicuous while suppressing the side effects of the correction process.

マスクぼかし処理の特殊性に鑑み、まずマスクの加工を非対称に行うことで狙いとする効果が得られる理由を説明し、次にマスクの加工を非対称に行うための具体的手段について説明する。   In view of the peculiarities of the mask blurring process, first, the reason why the target effect can be obtained by performing the mask processing asymmetrically will be described, and then specific means for performing the mask processing asymmetrically will be described.

まずマスクの加工を非対称に行うことで狙いとする効果が得られる理由を説明する。上述したように本明細書では、デプスマップで表現されているデプス値に基づいて入力画像の一部の画素を水平にシフトすることにより、入力画像に対してオブジェクト毎に視差を持つ3D画像を生成する。一般に、入力画像を左眼画像とし、右眼画像を画素シフトで生成する場合において、飛び出し方向の視差を与えるには画素を左側にシフトする。この場合、シフトしたオブジェクトの右側には画素シフトにより画素抜けのエリアが生じる。一方、シフトしたオブジェクトの左側は、シフト画素が背景画素上に被さることになる。オブジェクトの左側には抜け画素が発生しない。   First, the reason why the targeted effect can be obtained by performing the mask processing asymmetrically will be described. As described above, in the present specification, a 3D image having a parallax for each object with respect to the input image is obtained by horizontally shifting some pixels of the input image based on the depth value represented by the depth map. Generate. In general, when an input image is a left-eye image and a right-eye image is generated by pixel shift, the pixel is shifted to the left side in order to give parallax in the pop-out direction. In this case, a pixel missing area is generated on the right side of the shifted object due to pixel shift. On the other hand, the shifted pixel covers the background pixel on the left side of the shifted object. There are no missing pixels on the left side of the object.

即ち画素シフトによる画素抜けは、オブジェクトの片側にだけ発生する。画素抜けが発生する方向は、生成すべき画像を右眼画像とするか左眼画像にするか、及びオブジェクトに飛び出し方向の視差を与えるか奥行き方向の視差を与えるかの二つに依存する。   That is, pixel omission due to pixel shift occurs only on one side of the object. The direction in which pixel dropout occurs depends on whether the image to be generated is a right-eye image or a left-eye image, and whether the object is given parallax in the pop-out direction or parallax in the depth direction.

上述の例において、オブジェクトの左右両側に均等なマスクエッジの加工処理を施した場合、オブジェクトの右側はその境界部分の不自然さを目立たなくできる。一方、オブジェクトの左側にあたる背景部分に何らかのテクスチャが存在する場合、上記のマスクエッジの加工処理の影響を受けた画素シフトが背景部分にも及ぶことになる。この場合、背景テクスチャが歪む可能性がある。例えば、その背景テクスチャに道路の白線が含まれる場合、白線が歪む可能性がある。   In the above-described example, when uniform mask edge processing is performed on both the left and right sides of the object, the right side of the object can make the unnaturalness of the boundary portion inconspicuous. On the other hand, when some texture exists in the background portion corresponding to the left side of the object, the pixel shift affected by the mask edge processing described above also reaches the background portion. In this case, the background texture may be distorted. For example, when the background texture includes a white line of a road, the white line may be distorted.

そこで、上述のマスクエッジの加工をオブジェクトの右側だけに作用させ、左側には作用させないようにする。これにより、オブジェクトの左側の背景テクスチャを歪まないようにできる。   Therefore, the mask edge processing described above is applied only to the right side of the object and not to the left side. This prevents the background texture on the left side of the object from being distorted.

次にマスクの加工を非対称に行うための具体的手段について説明する。実施例1で説明したようにマスクエッジの加工には、以下の2つのフィルタを用いる。1つは、マスクのエッジポジションを移動させ、マスクの有効エリアの面積を可変するために用いるフィルタである。もう1つは、マスクに応じたデプスマップのブレンド比率を制御するために、マスクエッジに傾斜を付けるためのフィルタである。前者は図16の第1ローパスフィルタ81に相当し、後者は第2ローパスフィルタ83に相当する。   Next, specific means for performing mask processing asymmetrically will be described. As described in the first embodiment, the following two filters are used for processing the mask edge. One is a filter used for moving the edge position of the mask and changing the area of the effective area of the mask. The other is a filter for inclining the mask edge in order to control the blend ratio of the depth map according to the mask. The former corresponds to the first low-pass filter 81 in FIG. 16, and the latter corresponds to the second low-pass filter 83.

これらのフィルタは、一般に左右または上下対称な係数で構成される。実施例3では中心に対して非対称な係数を設定したフィルタを意図的に用いる。これにより上記のマスクエッジの加工を左右非対称に行うことができ、上述の補正処理による副作用を回避または軽減できる。   These filters are generally composed of left-right or up-down symmetrical coefficients. In the third embodiment, a filter in which a coefficient asymmetric with respect to the center is set is used intentionally. As a result, the mask edge can be processed asymmetrically, and side effects due to the correction processing described above can be avoided or reduced.

図21は、実施例3に係るマスク補正部80の構成例を示す図である。実施例3に係るマスク補正部80は図16のマスク補正部80にフィルタ形状設定部85が追加された構成である。以下、図16のマスク補正部80との相違点について説明する。   FIG. 21 is a diagram illustrating a configuration example of the mask correction unit 80 according to the third embodiment. The mask correction unit 80 according to the third embodiment has a configuration in which a filter shape setting unit 85 is added to the mask correction unit 80 of FIG. Hereinafter, differences from the mask correction unit 80 of FIG. 16 will be described.

実施例3に係るマスク補正部80は、少なくとも左右が非対称な第2ローパスフィルタ83を用いて、マスクのオブジェクト境界部分に、ぼかし処理を施す。フィルタ形状設定部85は、第2ローパスフィルタ83のフィルタ形状を決定する。ユーザは操作部60から、第2ローパスフィルタ83のフィルタ形状を特定するための情報をフィルタ形状設定部85に設定できる。ユーザは、第2ローパスフィルタ83のタップ数および/または係数の値を左右非対称に設定することにより、左右非対称なフィルタ形状の第2ローパスフィルタ83を設定できる。   The mask correction unit 80 according to the third embodiment performs a blurring process on the object boundary portion of the mask using the second low-pass filter 83 that is asymmetric at least on the left and right. The filter shape setting unit 85 determines the filter shape of the second low-pass filter 83. The user can set information for specifying the filter shape of the second low-pass filter 83 in the filter shape setting unit 85 from the operation unit 60. The user can set the second low-pass filter 83 having a left-right asymmetric filter shape by setting the number of taps and / or the coefficient value of the second low-pass filter 83 to be left-right asymmetric.

また上述したように、ぼかし処理を水平方向だけでなく垂直方向にもかけるため、二次元ローパスフィルタを用いることもできる。この場合、ユーザは左右だけでなく上下にも非対称なフィルタ形状の第2ローパスフィルタ83を設定できる。また上述したように楕円状の二次元ローパスフィルタを用いれば、斜め方向にも自然なぼかし処理をかけることができる。   Further, as described above, since the blurring process is applied not only in the horizontal direction but also in the vertical direction, a two-dimensional low-pass filter can be used. In this case, the user can set the second low-pass filter 83 having an asymmetric filter shape not only on the left and right but also on the top and bottom. If an elliptical two-dimensional low-pass filter is used as described above, natural blurring processing can be performed in an oblique direction.

このようにユーザは、水平方向、垂直方向、斜め方向に個別の係数を持ち、かつ中心に対して非対称な係数を持つ第2ローパスフィルタ83を設定できる。即ち、上下左右斜め全方位に渡って非対称な形状の第2ローパスフィルタ83を設定できる。このようにユーザは、ぼかし処理の効果を、対象とするオブジェクトの縦横斜めのいかなる部分に対しても、任意に作用せしめることができる。   In this way, the user can set the second low-pass filter 83 having individual coefficients in the horizontal direction, the vertical direction, and the oblique direction and having coefficients that are asymmetric with respect to the center. That is, it is possible to set the second low-pass filter 83 having an asymmetric shape in all the upper, lower, left, and right oblique directions. In this way, the user can arbitrarily apply the effect of the blurring process to any portion of the target object that is vertically or horizontally oblique.

以下、第2ローパスフィルタ83を左右非対称にした場合の効果について考察する。この考察では説明を分かりやすくするため、水平方向にぼかし処理を施す一次元のローパスフィルタを想定する。   Hereinafter, the effect when the second low-pass filter 83 is asymmetrical will be considered. In this consideration, a one-dimensional low-pass filter that performs a blurring process in the horizontal direction is assumed for easy understanding.

図22(a)−(c)は左右対称な第2ローパスフィルタ83sを用いたマスクエッジの加工処理を説明するための図である。図23(a)−(c)は左右非対称な第2ローパスフィルタ83aを用いたマスクエッジの加工処理を説明するための図である。図22(a)は、左右対称な第2ローパスフィルタ83sの一例を示す。図23(a)は、左右非対称な第2ローパスフィルタ83aの一例を示す。   FIGS. 22A to 22C are diagrams for explaining mask edge processing using the second symmetrical low-pass filter 83s. FIGS. 23A to 23C are diagrams for explaining mask edge processing using the second asymmetric low-pass filter 83a. FIG. 22A shows an example of a second low-pass filter 83s that is symmetric. FIG. 23A shows an example of a second asymmetric low-pass filter 83a.

図22(b)は、図22(a)の左右対称な第2ローパスフィルタ83sを用いて、マスクM1(点線)をフィルタリングする処理を示す。フィルタリング後のマスクM2(実線)は左右のエッジが等しく緩やかになる。図23(b)は、図23(a)の左右非対称な第2ローパスフィルタ83aを用いて、マスクM4(点線)をフィルタリングする処理を示す。フィルタリング後のマスクM5(実線)はエッジ形状が左右で異なる。左のエッジの高レベル領域は緩やかになまる。右側のエッジの低レベル領域は緩やかに外側に広がる。   FIG. 22B shows a process of filtering the mask M1 (dotted line) using the symmetrical second low-pass filter 83s shown in FIG. In the mask M2 (solid line) after filtering, the left and right edges are equally gentle. FIG. 23B shows a process of filtering the mask M4 (dotted line) using the second asymmetric second low-pass filter 83a shown in FIG. The filtered mask M5 (solid line) has different edge shapes on the left and right. The high level area of the left edge is gently rounded. The low level region on the right edge gently spreads outward.

図17に示したように、第2ローパスフィルタ83によるフィルタリング後のマスクは、第2閾値を用いてクリッピング処理される。当該クリッピング処理では第2閾値より下のレベルのマスク値をゼロにする。第2閾値は、マスクレベルの中間付近のレベルに設定される。   As shown in FIG. 17, the mask after filtering by the second low-pass filter 83 is subjected to clipping processing using the second threshold. In the clipping process, the mask value at a level below the second threshold is set to zero. The second threshold is set to a level near the middle of the mask level.

図22(c)は、図22(b)のフィルタリング後のマスク(細い実線)を第2閾値でクリッピングする処理を示す。クリッピング後のマスクM3(太い実線)は、左右のエッジの低レベル領域が垂直になる。図23(c)は、図23(b)のフィルタリング後のマスク(細い実線)を第2閾値でクリッピングする処理を示す。クリッピング後のマスクM6も、左右のエッジの低レベル領域が垂直になる。   FIG. 22C shows a process of clipping the filtered mask (thin solid line) in FIG. 22B with the second threshold value. In the mask M3 (thick solid line) after clipping, the low level regions of the left and right edges are vertical. FIG. 23C illustrates a process of clipping the filtered mask (thin solid line) in FIG. 23B with the second threshold value. Also in the mask M6 after clipping, the low level regions of the left and right edges are vertical.

マスクM3とマスクM6を比較すると、前者は左右のエッジに均等な傾斜がついている。後者は左右のエッジの傾斜が異なる。図23(a)に示すように中心に対して左側だけに係数を持つ第2ローパスフィルタ83aを用いた場合、左側のエッジには傾斜がつくが、右側のエッジには殆ど傾斜がつかない。右側のエッジは、加工前の状態とほぼ同様な、急峻な状態のエッジが維持される。   When the mask M3 and the mask M6 are compared, the former has equal inclinations on the left and right edges. The latter has different left and right edge slopes. As shown in FIG. 23A, when the second low-pass filter 83a having a coefficient only on the left side with respect to the center is used, the left edge is inclined, but the right edge is hardly inclined. The right edge maintains a sharp edge substantially similar to the state before processing.

図23(b)に示すように非対称な第2ローパスフィルタ83aでフィルタリングされたマスクM5の右側のエッジには、その低レベル領域に緩やかな傾斜が付いている。その後、図23(c)に示すようにマスクM5と第2閾値を比較して、第2閾値より下のレベルのマスク値をゼロにクリッピングする。これにより、クリッピング後のマスクM6の右側のエッジにおける低レベル領域の傾斜は除去される。   As shown in FIG. 23B, the low-level region of the right edge of the mask M5 filtered by the asymmetric second low-pass filter 83a has a gentle slope. Thereafter, as shown in FIG. 23C, the mask M5 is compared with the second threshold value, and the mask value at a level lower than the second threshold value is clipped to zero. As a result, the slope of the low level region at the right edge of the mask M6 after clipping is removed.

仮に上記のクリッピング処理をしない場合、マスクのエッジ形状を左右非対称にすることはできても、マスクレベルの低レベル領域の傾斜が残ってしまう。実施例3に係るマスクエッジ加工処理の目的を果たせなくなる。即ち、レイヤデプスの左右非対称ブレンド、更には3D画像生成の際の画素シフトが及ぼす範囲を制限して、テクスチャのある背景部分にマスクエッジ加工処理の影響が及ばないようにする効果が果たせなくなる。   If the above-described clipping process is not performed, the mask edge shape may be left-right asymmetric, but the slope of the low-level region at the mask level remains. The purpose of the mask edge processing according to the third embodiment cannot be achieved. That is, the effect of preventing the mask edge processing process from affecting the background portion with the texture by limiting the range of the pixel depth when generating the 3D image, and the asymmetric blending of the layer depth.

これに対して上記のクリッピング処理を追加することにより、マスクの片側のエッジにだけ傾斜をつけ、もう片側のエッジには傾斜をつけないという加工が可能になる。よって、実施例3に係るクリッピング処理は、マスクエッジの形状を非対称にする単純な加工処理から容易に類推できない有利な効果を奏している。   On the other hand, by adding the above-described clipping processing, it is possible to perform processing in which only the edge on one side of the mask is inclined and the other edge is not inclined. Therefore, the clipping processing according to the third embodiment has an advantageous effect that cannot be easily inferred from simple processing that makes the shape of the mask edge asymmetric.

上述したようにユーザは、第2ローパスフィルタ83のフィルタ形状を任意に設定することができる。したがってオブジェクトの全方位ではなく任意の方向に偏りを持つぼかし処理が可能である。例えば、オブジェクトの周囲のテクスチャの状況に応じて、その偏りを調整できる。以下の説明では第2ローパスフィルタ83のフィルタ形状を手動ではなく自動で設定する処理を説明する。これにより、ユーザの負担を軽減できる。   As described above, the user can arbitrarily set the filter shape of the second low-pass filter 83. Therefore, it is possible to perform a blurring process with a bias in an arbitrary direction rather than in all directions. For example, the bias can be adjusted in accordance with the state of the texture around the object. In the following description, processing for setting the filter shape of the second low-pass filter 83 automatically instead of manually will be described. Thereby, a user's burden can be reduced.

図21に戻る。フィルタ形状設定部85は、生成すべき画像が右眼画像であるか左眼画像であるか、及びマスクのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、第2ローパスフィルタ83のフィルタ形状を設定する。   Returning to FIG. The filter shape setting unit 85 determines whether the image to be generated is a right-eye image or a left-eye image, and an object obtained from a comparison result of the inner depth value and the outer depth value in the object boundary portion of the mask. The filter shape of the second low-pass filter 83 is set in accordance with the anteroposterior relationship with the surroundings.

生成すべき画像が左眼画像であり、かつオブジェクトが周囲より手前(即ち、飛び出し方向)に位置する場合、3D画像生成部30はオブジェクトを右側に画素シフトする。生成すべき画像が左眼画像であり、かつオブジェクトが周囲より奥(即ち、奥行き方向)に位置する場合、3D画像生成部30はオブジェクトを左側に画素シフトする。生成すべき画像が右眼画像であり、かつオブジェクトが周囲より手前(即ち、飛び出し方向)に位置する場合、3D画像生成部30はオブジェクトを左側に画素シフトする。生成すべき画像が右眼画像であり、かつオブジェクトが周囲より奥(即ち、奥行き方向)に位置する場合、3D画像生成部30はオブジェクトを右側に画素シフトする。   When the image to be generated is a left-eye image and the object is positioned in front of the surroundings (that is, in the protruding direction), the 3D image generation unit 30 shifts the object to the right by a pixel. When the image to be generated is a left-eye image and the object is located deeper than the surroundings (that is, in the depth direction), the 3D image generation unit 30 shifts the object to the left by a pixel. When the image to be generated is a right-eye image and the object is positioned in front of the surroundings (that is, the pop-out direction), the 3D image generation unit 30 shifts the object to the left by a pixel. When the image to be generated is a right-eye image and the object is located deeper than the surroundings (that is, in the depth direction), the 3D image generation unit 30 shifts the object to the right by a pixel.

オブジェクトが右側に画素シフトされる場合、フィルタ形状設定部85は、第2ローパスフィルタ83の左側のエッジが右側のエッジより緩やかなフィルタ形状に設定する。右側のエッジには傾斜をつかないか、またはごく小さな傾斜しかつかないフィルタ形状に設定する。オブジェクトが左側に画素シフトされる場合、フィルタ形状設定部85は、第2ローパスフィルタ83の右側のエッジが右側のエッジより緩やかなフィルタ形状に設定する。   When the object is pixel-shifted to the right side, the filter shape setting unit 85 sets the left edge of the second low-pass filter 83 to a more gentle filter shape than the right edge. Set the filter shape so that the right edge is not inclined or has a very small inclination. When the object is pixel-shifted to the left side, the filter shape setting unit 85 sets the right edge of the second low-pass filter 83 to a gentler filter shape than the right edge.

以下より具体的に説明する。本明細書における画像編集システム500において、3D画像を構成する右眼画像と左眼画像のうち、一方にオリジナルの入力画像を割り当て、他方に、画素シフトにより生成される画像を割り当てる。この割り当ては、ユーザの設定により決定される。フィルタ形状設定部85には、決定された割り当てが設定される。   More specific description will be given below. In the image editing system 500 in this specification, an original input image is assigned to one of a right eye image and a left eye image constituting a 3D image, and an image generated by pixel shift is assigned to the other. This assignment is determined by user settings. In the filter shape setting unit 85, the determined assignment is set.

次に、マスクが指し示すオブジェクトが、その周囲に対して飛び出す方向に存在するか、反対に奥行き方向に存在するか判断する。飛び出し方向に存在する場合、右眼画像内のオブジェクトと左眼画像内のオブジェクトの間の距離を長くする必要がある。反対に奥行き方向に存在する場合、当該距離を短くする必要がある。オブジェクトが周囲に対して飛び出す方向に存在するか奥行き方向に存在するかの判断には、デプスマップを使用する。   Next, it is determined whether the object pointed to by the mask exists in a direction that protrudes from the periphery of the object, or exists in the depth direction. When it exists in the pop-out direction, it is necessary to increase the distance between the object in the right eye image and the object in the left eye image. On the other hand, when it exists in the depth direction, it is necessary to shorten the distance. A depth map is used to determine whether an object exists in a direction that protrudes from the surroundings or in a depth direction.

フィルタ形状設定部85は、デプスマップを解析することにより、マスクが指し示すオブジェクトのエリアのデプス値と、その周辺のデプス値の相対差を求める。例えば、当該オブジェクトのエリア内のデプス値の平均値と、その周辺における設定された範囲内のデプス値の平均値との差分を求める。   The filter shape setting unit 85 analyzes the depth map to obtain a relative difference between the depth value of the area of the object indicated by the mask and the surrounding depth values. For example, the difference between the average value of the depth values in the area of the object and the average value of the depth values in the set range around the object is obtained.

本明細書では白に近いほどデプス値が高く、黒に近いほどデプス値が低くなる。したがって、オブジェクトのエリアのデプス値のほうが、その周辺のデプス値より大きい場合、オブジェクトが周辺より観察者に近いと判定できる。反対にオブジェクトのエリアのデプス値のほうが、その周辺のデプス値より小さい場合、オブジェクトがその周辺より観察者から遠いと判定できる。   In this specification, the closer to white, the higher the depth value, and the closer to black, the lower the depth value. Therefore, when the depth value of the area of the object is larger than the depth value of the surrounding area, it can be determined that the object is closer to the observer than the surrounding area. On the contrary, when the depth value of the area of the object is smaller than the depth value of the surrounding area, it can be determined that the object is farther from the observer than the surrounding area.

マスクが指し示すオブジェクトのエリアのデプス値が、その周辺のデプス値より大きい場合、即ちオブジェクトが飛び出し方向に位置すると判定される場合について考える。この前提において右眼画像に画素シフトにより生成される画像を割り当てる場合、画素シフトの方向は左と判定できる。この場合、画素シフトによってオブジェクトの右側に画素抜け領域が発生する。したがってオブジェクトの右側に、より広く、より傾斜が付くように加工され、オブジェクトの左側が加工されない補正処理が望まれる。フィルタ形状設定部85はこのよう補正処理を実現するため、右側のエッジがより緩やかなフィルタ形状の第2ローパスフィルタ83を設定する。   Consider the case where the depth value of the area of the object pointed to by the mask is larger than the surrounding depth values, that is, when it is determined that the object is located in the pop-out direction. Under this assumption, when an image generated by pixel shift is assigned to the right eye image, the pixel shift direction can be determined to be left. In this case, a pixel omission area occurs on the right side of the object due to the pixel shift. Therefore, a correction process is desired in which the right side of the object is processed to be wider and more inclined, and the left side of the object is not processed. In order to implement such correction processing, the filter shape setting unit 85 sets the second low-pass filter 83 having a filter shape with a gentler right edge.

このようにフィルタ形状設定部85は、画素シフトにより生成される画像が右眼画像である左眼画像であるか、及びオブジェクトのエリアとその周辺のデプスの相対差の2つのパラメータにより、第2ローパスフィルタ83のフィルタ形状を偏らせるべき方向を決定する。   As described above, the filter shape setting unit 85 determines whether the image generated by the pixel shift is the left eye image that is the right eye image, and the second parameter based on the two parameters of the relative difference between the object area and the surrounding depth. The direction in which the filter shape of the low-pass filter 83 should be biased is determined.

図24は、実施例3に係るフィルタ形状設定部85によるフィルタ形状の決定処理を説明するためのフローチャートである。まずフィルタ形状設定部85は、生成される画像が左眼画像であるか右眼画像であるか判定する(S10)。次にオブジェクトが周辺より飛び出しているか奥まっているか判定する(S20、S22)。   FIG. 24 is a flowchart for explaining filter shape determination processing by the filter shape setting unit 85 according to the third embodiment. First, the filter shape setting unit 85 determines whether the generated image is a left eye image or a right eye image (S10). Next, it is determined whether the object protrudes from the periphery or is recessed (S20, S22).

左眼画像であり(S10の左眼)、かつオブジェクトが周辺より奥まっている場合(S20の奥まり)、フィルタ形状設定部85は画素シフトの方向が左と判定し、第2ローパスフィルタ83のフィルタ形状を、右側のエッジに傾斜が付加されたフィルタ形状に設定する(S31)。左眼画像であり(S10の左眼)、かつオブジェクトが周辺より飛び出している場合(S20の飛び出し)、フィルタ形状設定部85は画素シフトの方向が右と判定し、第2ローパスフィルタ83のフィルタ形状を、左側のエッジに傾斜が付加されたフィルタ形状に設定する(S32)。   When the image is a left-eye image (the left eye of S10) and the object is deeper than the periphery (the depth of S20), the filter shape setting unit 85 determines that the pixel shift direction is left, and the second low-pass filter 83 The filter shape is set to a filter shape in which an inclination is added to the right edge (S31). When the image is a left-eye image (the left eye of S10) and the object protrudes from the periphery (the protrusion of S20), the filter shape setting unit 85 determines that the pixel shift direction is right, and the filter of the second low-pass filter 83 The shape is set to a filter shape with a slope added to the left edge (S32).

右眼画像であり(S10の右眼)、かつオブジェクトが周辺より飛び出している場合(S22の飛び出し)、フィルタ形状設定部85は画素シフトの方向が左と判定し、第2ローパスフィルタ83のフィルタ形状を、右側のエッジに傾斜が付加されたフィルタ形状に設定する(S31)。右眼画像であり(S10の右眼)、かつオブジェクトが周辺より奥まっている場合(S22の奥まり)、フィルタ形状設定部85は画素シフトの方向が右と判定し、第2ローパスフィルタ83のフィルタ形状を、左側のエッジに傾斜が付加されたフィルタ形状に設定する(S32)。   When the image is a right eye image (the right eye of S10) and the object protrudes from the periphery (the protrusion of S22), the filter shape setting unit 85 determines that the pixel shift direction is left, and the filter of the second low-pass filter 83 The shape is set to a filter shape in which an inclination is added to the right edge (S31). When the image is a right eye image (the right eye of S10) and the object is deeper than the periphery (the depth of S22), the filter shape setting unit 85 determines that the pixel shift direction is right, and the second low-pass filter 83 The filter shape is set to a filter shape in which an inclination is added to the left edge (S32).

またフィルタ形状設定部85は、オブジェクト境界の内側のデプス値と外側のデプス値との差分に応じて、より緩やかにすべき側(即ち、傾斜を付加すべき側)のエッジにおける傾斜の程度を決定できる。当該差分が大きいほど、オブジェクト境界の段差が大きく、画素シフト量が大きくなることを示す。フィルタ形状設定部85は、当該差分が大きいほど傾斜の程度を大きくする。即ち、当該差分が大きいほど、エッジに付加すべき傾斜をより緩やかに設定する。   Further, the filter shape setting unit 85 determines the degree of inclination at the edge on the side that should be made gentler (that is, the side on which the inclination should be added) according to the difference between the depth value inside the object boundary and the depth value outside. Can be determined. The larger the difference, the larger the step of the object boundary, and the larger the pixel shift amount. The filter shape setting unit 85 increases the degree of inclination as the difference increases. That is, as the difference is larger, the slope to be added to the edge is set more gently.

これまで第2ローパスフィルタ83を左右非対称にする例を説明した。実施例3では第2ローパスフィルタ83だけでなく第1ローパスフィルタ81も左右非対称にすることができる。   The example in which the second low-pass filter 83 is left-right asymmetric has been described so far. In the third embodiment, not only the second low-pass filter 83 but also the first low-pass filter 81 can be asymmetrical.

図25(a)−(c)は左右対称な第1ローパスフィルタ81sを用いたマスクエッジの加工処理を説明するための図である。図26(a)−(c)は左右非対称な第1ローパスフィルタ81aを用いたマスクエッジの加工処理を説明するための図である。図25(a)は、左右対称な第1ローパスフィルタ81sの一例を示す。図26(a)は、左右非対称な第1ローパスフィルタ81aの一例を示す。   FIGS. 25A to 25C are diagrams for explaining the mask edge processing using the first low-pass symmetric first low-pass filter 81s. FIGS. 26A to 26C are views for explaining mask edge processing using the first asymmetric low-pass filter 81a. FIG. 25A shows an example of a first symmetrical low-pass filter 81s. FIG. 26A shows an example of a first low-pass filter 81a that is asymmetrical.

図25(b)は、図25(a)の左右対称な第1ローパスフィルタ81sを用いて、マスクM7(点線)をフィルタリングする処理を示す。フィルタリング後のマスクM8(実線)は左右のエッジが等しく緩やかになる。図26(b)は、図26(a)の左右非対称な第1ローパスフィルタ81aを用いて、マスクM10(点線)をフィルタリングする処理を示す。フィルタリング後のマスクM11(実線)はエッジ形状が左右で異なる。左側のエッジの高レベル領域が緩やかになまる。右側のエッジの低レベル領域は緩やかに外側に広がる。   FIG. 25B shows a process of filtering the mask M7 (dotted line) using the symmetrical first low-pass filter 81s shown in FIG. In the mask M8 after filtering (solid line), the left and right edges are equally gentle. FIG. 26B shows a process of filtering the mask M10 (dotted line) using the left-right asymmetric first low-pass filter 81a shown in FIG. The filtered mask M11 (solid line) has different edge shapes on the left and right. The high level area on the left edge is gently rounded. The low level region on the right edge gently spreads outward.

図25(c)は、図25(b)のフィルタリング後のマスク(細い実線)を第1閾値(図17参照)で二値化することにより、マスクのエッジ幅を広げる加工処理を示す。エッジ幅を広げる場合、第1閾値をゼロ付近に設定する。図26(c)は、図26(b)のフィルタリング後のマスク(細い実線)を第1閾値で二値化することにより、マスクのエッジ幅を広げる加工処理を示す。   FIG. 25C shows a processing for widening the edge width of the mask by binarizing the filtered mask (thin solid line) in FIG. 25B with the first threshold (see FIG. 17). When widening the edge width, the first threshold is set near zero. FIG. 26C shows a processing for widening the edge width of the mask by binarizing the filtered mask (thin solid line) in FIG. 26B with the first threshold value.

図25(c)に示すように加工後のマスクM9は、左右が均等に広がっている。一方、図26(c)に示すように加工後のマスクM12は、左右のエッジの移動量が異なる。中心に対して左側だけに係数を持つ第1ローパスフィルタ81aを用い場合、図26(c)に示すように右側のエッジポジションは右に移動するが、左側のエッジポジションは元の位置のままである。このようにマスクの左右を不均等に広げることができる。   As shown in FIG. 25C, the processed mask M9 is spread evenly on the left and right. On the other hand, as shown in FIG. 26 (c), the processed mask M12 differs in the amount of movement of the left and right edges. When the first low-pass filter 81a having a coefficient only on the left side with respect to the center is used, the right edge position moves to the right as shown in FIG. 26C, but the left edge position remains at the original position. is there. In this way, the left and right sides of the mask can be spread unevenly.

マスクのエッジに傾斜をつける場合、オブジェクトの境界部分が広くなる。この場合においてマスクのエッジポジションをそのままにしておくと、オブジェクト境界部分がオブジェクトの内側に侵食してくる。したがってエッジに傾斜をつける場合、通常、そのエッジポジションを外側に移動させる。傾斜の程度が大きいほど、よりエッジポジションを外側に移動させる。このように傾斜の程度とエッジポジションの移動量は比例関係にある。   When the edge of the mask is inclined, the boundary portion of the object becomes wider. In this case, if the edge position of the mask is left as it is, the object boundary portion erodes inside the object. Therefore, when the edge is inclined, the edge position is usually moved outward. The greater the inclination, the more the edge position is moved outward. Thus, the degree of inclination and the amount of movement of the edge position are in a proportional relationship.

図23(a)−(c)及び図26(a)−(c)に示すように、左側に係数を持つフィルタ形状のローパスフィルタでは、左側のエッジに傾斜がつき、右側のエッジポジションが外側に移動する。したがって第1ローパスフィルタ81と第2ローパスフィルタ83では左右反対のフィルタ形状に設定する必要がある。オブジェクトの左側をぼかしたい場合、左側に係数を持つ第2ローパスフィルタ83を設定し、右側に係数を持つ第1ローパスフィルタ81を設定する。反対にオブジェクトの右側をぼかしたい場合、右側に係数を持つ第2ローパスフィルタ83を設定し、左側に係数を持つ第1ローパスフィルタ81を設定する。   As shown in FIGS. 23 (a)-(c) and FIGS. 26 (a)-(c), in a filter-shaped low-pass filter having a coefficient on the left side, the left edge is inclined and the right edge position is outside. Move to. Therefore, the first low-pass filter 81 and the second low-pass filter 83 need to be set to opposite left and right filter shapes. In order to blur the left side of the object, the second low-pass filter 83 having a coefficient on the left side is set, and the first low-pass filter 81 having a coefficient on the right side is set. On the contrary, when it is desired to blur the right side of the object, the second low-pass filter 83 having a coefficient on the right side is set, and the first low-pass filter 81 having a coefficient on the left side is set.

図26(a)−(c)に示した例は、第1ローパスフィルタ81を用いてマスクのエッジポジションを外側に移動させる(即ち、マスクの幅を広げる)場合の例である。マスクの幅を広げる場合、外側に移動させるエッジの側と逆側に係数を持つフィルタ形状の第1ローパスフィルタ81を用いる。反対にマスクのエッジポジションを内側に移動させる(即ち、マスクの幅を狭める)場合、内側に移動させるエッジの側と同じ側に係数を持つフィルタ形状の第1ローパスフィルタ81を用いる。   The example shown in FIGS. 26A to 26C is an example in which the edge position of the mask is moved outward (that is, the width of the mask is widened) using the first low-pass filter 81. When increasing the width of the mask, a filter-shaped first low-pass filter 81 having a coefficient on the side opposite to the edge to be moved outward is used. On the other hand, when the edge position of the mask is moved inward (that is, the width of the mask is narrowed), a filter-shaped first low-pass filter 81 having a coefficient on the same side as the edge to be moved inward is used.

図26(a)では左側にのみ係数を持つフィルタ形状の第1ローパスフィルタ81aが示されている。図26(b)では、この第1ローパスフィルタ81aによりフィルタリングされた後のマスクM11が示されている。このマスクM11の左側では内側に傾斜が付き、右側では外側に傾斜が付いている。   FIG. 26A shows a filter-shaped first low-pass filter 81a having a coefficient only on the left side. FIG. 26B shows the mask M11 after being filtered by the first low-pass filter 81a. On the left side of the mask M11, the inner side is inclined, and on the right side, the outer side is inclined.

オリジナルマスクM10の幅を広げる場合、第1閾値のレベルを低く設定する。フィルタリング後のマスクM11を第1閾値で二値化すると、オリジナルマスクM10の外側に傾斜が付いている右側のエッジが外側に移動され、オリジナルマスクM10の幅が右側に伸びる(図26(c)参照)。左側は変化しない。反対にオリジナルマスクM10の幅を狭める場合、第1閾値のレベルを高く設定する。フィルタリング後のマスクM11を第1閾値で二値化すると、オリジナルマスクM10の内側に傾斜が付いている左側のエッジが内側に移動され、オリジナルマスクM10の左側が縮む。右側は変化しない。このようにマスクの幅を広げる場合、第1ローパスフィルタ81の係数を持つ側と反対側が広がり、マスクの幅を狭める場合、第1ローパスフィルタ81の係数を持つ側と同じ側が狭まる。   When the width of the original mask M10 is increased, the first threshold level is set low. When the mask M11 after filtering is binarized with the first threshold value, the right edge having an inclination on the outside of the original mask M10 is moved to the outside, and the width of the original mask M10 extends to the right (FIG. 26C). reference). The left side does not change. Conversely, when the width of the original mask M10 is narrowed, the first threshold level is set high. When the filtered mask M11 is binarized with the first threshold value, the left edge having an inclination inside the original mask M10 is moved inward, and the left side of the original mask M10 is contracted. The right side does not change. When the width of the mask is increased in this way, the side opposite to the side having the coefficient of the first low-pass filter 81 is expanded, and when the width of the mask is decreased, the same side as the side having the coefficient of the first low-pass filter 81 is decreased.

これまでの説明では、エッジの加工を行う際に、一意の係数で定義された1つのフィルタを用いて、マスク全体を一律に処理する手法を示した。この点、これまでに述べてきたマスクエッジの加工を非対称に行う効果を得るためには、必ずしも1つのフィルタを用いる処理に限定されない。それぞれフィルタ形状が異なる複数のフィルタを用いて、マスクエッジのエリア毎に個別にフィルタ処理してもよい。即ち、マスクの加工を幅広く行いたいエリアには、幅の広い形状を持つフィルタを用いる。反対に、マスクの加工度合いを少なくしたいエリアには、幅の狭い形状を持つフィルタを用いるか、または全くフィルタ処理しない。このように複数種類のローパスフィルタをマスクエッジのエリア毎に切り替えて使用してもよい。   In the description so far, the method of uniformly processing the entire mask using one filter defined by a unique coefficient when performing edge processing has been shown. In this respect, in order to obtain the effect of performing the asymmetrical processing of the mask edge described so far, the processing is not necessarily limited to processing using one filter. A plurality of filters each having a different filter shape may be used to individually perform filtering for each mask edge area. That is, a filter having a wide shape is used in an area where it is desired to process the mask widely. On the other hand, a filter having a narrow shape is used for an area where it is desired to reduce the degree of mask processing, or no filtering is performed. In this way, a plurality of types of low-pass filters may be switched for each mask edge area.

以上説明したように実施例3によれば、マスクエッジの加工を、オブジェクトの上下左右斜め全方向に渡って非対称に行うことができる。このようなマスクを用いてオブジェクトの境界部分を補正することにより、正常な背景テクスチャに影響を及ぼすことなく、歪みが生じている部分のみを排他的に補正できる。したがって高品位な3D画像を生成できる。   As described above, according to the third embodiment, the mask edge can be processed asymmetrically in all the diagonal directions of the object. By correcting the boundary portion of the object using such a mask, it is possible to exclusively correct only the portion where distortion has occurred without affecting the normal background texture. Therefore, a high-quality 3D image can be generated.

以上、本発明を実施の形態をもとに説明した。実施の形態は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   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. .

実施例3では、マスクのエッジポジションを左右非対称に移動させるために、第1ローパスフィルタ81のフィルタ形状を左右非対称に設定する例を説明した。この点、左右対称な第1ローパスフィルタ81を使用しつつ、第1閾値を右側のエッジ部分と左側のエッジ部分で異なる値に設定することによっても、マスクのエッジポジションを左右非対称に移動させることができる。マスクのエッジポジションを外側に移動させる場合は第1閾値を低く設定し、内側に移動させる場合は高く設定する。   In the third embodiment, the example in which the filter shape of the first low-pass filter 81 is set to be left-right asymmetric in order to move the edge position of the mask left-right asymmetrically has been described. In this respect, the mask edge position can be moved asymmetrically by setting the first threshold value to be different between the right edge portion and the left edge portion while using the first symmetrical low-pass filter 81. Can do. When moving the edge position of the mask to the outside, the first threshold value is set low, and when moving to the inside, it is set high.

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 クリッピング部、 85 フィルタ形状設定部。   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 section, 85 Filter configuration Fixed part.

Claims (8)

外部設定されるマスクパターンを補正するマスク補正部と、
入力画像のデプスマップを、前記マスク補正部により補正された複数のマスクパターンにより指定される複数の領域ごとに加工するデプスマップ加工部と、
前記入力画像、及び前記デプスマップ加工部により加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成する画像生成部と、を備え、
前記マスク補正部は、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定するフィルタ形状設定部を含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施し、
前記フィルタ形状設定部は、前記オブジェクトが左右の一側に画素シフトされる場合に、前記オブジェクトの他側のエッジが、一側のエッジよりも緩やかなフィルタ形状に設定する
ことを特徴とする画像処理装置。
A mask correction unit for correcting an externally set mask pattern;
A depth map processing unit that processes a depth map of an input image for each of a plurality of regions specified by a plurality of mask patterns corrected by the mask correction unit;
An image generator that shifts pixels of the input image based on the input image and the depth map processed by the depth map processor, and generates an image of another viewpoint having a parallax with respect to the input image. And comprising
The mask correction unit obtains whether the image of the different viewpoint is a right-eye image or a left-eye image, and a comparison result between an inner depth value and an outer depth value in an object boundary portion of the mask pattern. depending on the context the object and the surroundings to be, comprise filter shape setting unit for setting the filter shape of the low-pass filter, the Kio object boundary before using at least the right and left unsymmetrical said low pass filter, facilities blurring processing And
The filter shape setting unit sets an edge of the other side of the object to a gentler filter shape than an edge of the one side when the object is pixel-shifted to the left and right sides. Processing equipment.
外部設定されるマスクパターンを補正するマスク補正部と、
入力画像のデプスマップを、前記マスク補正部により補正された複数のマスクパターンにより指定される複数の領域ごとに加工するデプスマップ加工部と、
前記入力画像、及び前記デプスマップ加工部により加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成する画像生成部と、を備え、
前記マスク補正部は、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定するフィルタ形状設定部を含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施し、
前記フィルタ形状設定部は、
前記別視点の画像が左眼画像であり、かつ前記オブジェクトが周囲より手前に位置する場合、前記ローパスフィルタの左側のエッジが右側のエッジより緩やかなフィルタ形状に設定し、
前記別視点の画像が左眼画像であり、かつ前記オブジェクトが周囲より奥に位置する場合、前記ローパスフィルタの右側のエッジが左側のエッジより緩やかなフィルタ形状に設定し、
前記別視点の画像が右眼画像であり、かつ前記オブジェクトが周囲より手前に位置する場合、前記ローパスフィルタの右側のエッジが左側のエッジより緩やかなフィルタ形状に設定し、
前記別視点の画像が右眼画像であり、かつ前記オブジェクトが周囲より奥に位置する場合、前記ローパスフィルタの左側のエッジが右側のエッジより緩やかなフィルタ形状に設定する、
ことを特徴とする画像処理装置。
A mask correction unit for correcting an externally set mask pattern;
A depth map processing unit that processes a depth map of an input image for each of a plurality of regions specified by a plurality of mask patterns corrected by the mask correction unit;
An image generator that shifts pixels of the input image based on the input image and the depth map processed by the depth map processor, and generates an image of another viewpoint having a parallax with respect to the input image. And comprising
The mask correction unit obtains whether the image of the different viewpoint is a right-eye image or a left-eye image, and a comparison result between an inner depth value and an outer depth value in an object boundary portion of the mask pattern. Including a filter shape setting unit that sets a filter shape of a low-pass filter according to the front-rear relationship between the object and the surroundings, and performing blurring processing on the object boundary using the low-pass filter that is asymmetrical at least to the left and right,
The filter shape setting unit
When the image of the different viewpoint is a left eye image and the object is positioned in front of the surroundings, the left edge of the low-pass filter is set to a gentler filter shape than the right edge,
When the image of the other viewpoint is a left eye image and the object is located behind the surroundings, the right edge of the low-pass filter is set to a gentler filter shape than the left edge,
When the image of the different viewpoint is a right eye image and the object is positioned in front of the surroundings, the right edge of the low-pass filter is set to a gentler filter shape than the left edge,
When the image of the different viewpoint is a right eye image and the object is located behind the surroundings, the left edge of the low-pass filter is set to a gentler filter shape than the right edge,
Images processor you wherein a.
前記フィルタ形状設定部は、前記境界の内側のデプス値と外側のデプス値との差分に応じて、より緩やかにすべき側のエッジにおける傾斜の程度を決定する、
ことを特徴とする請求項またはに記載の画像処理装置。
The filter shape setting unit determines the degree of inclination at the edge on the side that should be more gentle, according to the difference between the depth value inside the boundary and the depth value outside.
The image processing apparatus according to claim 1 or 2, characterized in that.
前記マスク補正部は、
マスク信号にフィルタをかける第1ローパスフィルタと、
前記第1ローパスフィルタから出力されるマスク信号を前記マスク信号のエッジの位置を移動させるための第1閾値を用いて二値化する二値化部と、
前記二値化部による二値化によりエッジの位置が移動された前記マスク信号のエッジに傾斜をつけるためのローパスフィルタであり、前記少なくとも左右が非対称なローパスフィルタである第2ローパスフィルタと、
前記第2ローパスフィルタにより出力されるマスク信号を第2閾値を用いて、前記第2閾値以下の信号をゼロにクリッピングするクリッピング部を、を含む、
ことを特徴とする請求項1からのいずれかに記載の画像処理装置。
The mask correction unit
A first low-pass filter for filtering the mask signal;
A binarization unit that binarizes the mask signal output from the first low-pass filter using a first threshold for moving the position of the edge of the mask signal;
A low-pass filter for inclining an edge of the mask signal whose edge position has been moved by binarization by the binarization unit, and a second low-pass filter that is an at least left-right asymmetric low-pass filter;
A clipping unit for clipping a mask signal output by the second low-pass filter to zero using a second threshold value and a signal equal to or lower than the second threshold value;
The image processing apparatus according to any one of claims 1 to 3, characterized in that.
前記第1ローパスフィルタおよび前記二値化部は、前記マスク信号における傾斜をつけるべき側のエッジの位置を外側に移動させ、
前記第1ローパスフィルタは、少なくとも左右が非対称なローパスフィルタであり、前記第2ローパスフィルタのフィルタ形状と左右反対なフィルタ形状に設定される、
ことを特徴とする請求項に記載の画像処理装置。
The first low-pass filter and the binarization unit move the position of the edge on the side to be inclined in the mask signal to the outside,
The first low-pass filter is a low-pass filter that is asymmetric at least on the left and right, and is set to a filter shape opposite to the left and right of the filter shape of the second low-pass filter.
The image processing apparatus according to claim 4 .
前記デプスマップ加工部は、前記マスク補正部により補正されたマスクパターンをもとに生成される、前記複数の領域の各デプスマップをアルファブレンドする、
ことを特徴とする請求項1からのいずれかに記載の画像処理装置。
The depth map processing unit alpha blends each depth map of the plurality of regions generated based on the mask pattern corrected by the mask correction unit.
The image processing apparatus according to any one of claims 1 to 5, characterized in that.
外部設定されるマスクパターンを補正するステップと、
入力画像のデプスマップを、補正された複数のマスクパターンにより指定される複数の領域ごとに加工するステップと、
前記入力画像、及び加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成するステップと、を有し
前記マスクパターンを補正するステップは、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定するステップを含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施し、
前記フィルタ形状を設定するステップは、前記オブジェクトが左右の一側に画素シフトされる場合に、前記オブジェクトの他側のエッジが、一側のエッジよりも緩やかなフィルタ形状に設定する
ことを特徴とする画像処理方法。
A step of correcting an externally set mask pattern;
Processing the depth map of the input image for each of a plurality of areas specified by the corrected plurality of mask patterns;
The input image, and based on processed depth map, by shifting the pixels of the input image, comprising the steps of: generating an image of another viewpoint with parallax with respect to the input image,
The step of correcting the mask pattern comprises comparing whether the image of the different viewpoint is a right-eye image or a left-eye image, and comparing an inner depth value and an outer depth value of the boundary in the object boundary portion of the mask pattern. depending on the context the object and the surroundings resulting from the results, including the step of setting the filter shape of the low-pass filter, the Kio object boundary before using at least the right and left unsymmetrical said low pass filter, facilities blurring processing And
The step of setting the filter shape is characterized in that, when the object is pixel-shifted to the left and right sides, the other side edge of the object is set to a gentler filter shape than the one side edge. Image processing method.
外部設定されるマスクパターンを補正する処理と、
入力画像のデプスマップを、補正された複数のマスクパターンにより指定される複数の領域ごとに加工する処理と、
前記入力画像、及び加工されたデプスマップをもとに、前記入力画像の画素をシフトして、前記入力画像に対して視差を持つ別視点の画像を生成する処理と、をコンピュータに実行させ、
前記マスクパターンを補正する処理は、前記別視点の画像が右眼画像であるか左眼画像であるか、及び前記マスクパターンのオブジェクト境界部分における境界の内側のデプス値と外側のデプス値の比較結果から得られるオブジェクトと周囲との前後関係に応じて、ローパスフィルタのフィルタ形状を設定する処理を含み、少なくとも左右が非対称な前記ローパスフィルタを用いて前記オブジェクト境界部分に、ぼかし処理を施し、
前記フィルタ形状を設定する処理は、前記オブジェクトが左右の一側に画素シフトされる場合に、前記オブジェクトの他側のエッジが、一側のエッジよりも緩やかなフィルタ形状に設定する
ことを特徴とする画像処理プログラム。
Processing to correct the externally set mask pattern;
Processing the depth map of the input image for each of a plurality of areas specified by a plurality of corrected mask patterns;
Based on the input image and the processed depth map, shift the pixels of the input image to generate an image of another viewpoint having a parallax with respect to the input image ,
The process of correcting the mask pattern is performed by comparing whether the image of the different viewpoint is a right-eye image or a left-eye image, and comparing an inner depth value and an outer depth value of the boundary in the object boundary portion of the mask pattern. depending on the context the object and the surroundings resulting from the results, including the process of setting the filter shape of the low-pass filter, the Kio object boundary before using at least the right and left unsymmetrical said low pass filter, facilities blurring processing And
The process of setting the filter shape is characterized in that, when the object is pixel-shifted to the left and right sides, the other edge of the object is set to a gentler filter shape than the one edge. Image processing program.
JP2012173209A 2012-02-08 2012-08-03 Image processing apparatus, image processing method, and image processing program Active JP5971017B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2012173209A JP5971017B2 (en) 2012-08-03 2012-08-03 Image processing apparatus, image processing method, and image processing program
US13/760,825 US8971611B2 (en) 2012-02-08 2013-02-06 Image process device, image process method, and image process program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012173209A JP5971017B2 (en) 2012-08-03 2012-08-03 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2014033366A JP2014033366A (en) 2014-02-20
JP5971017B2 true JP5971017B2 (en) 2016-08-17

Family

ID=50282867

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP5971017B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10552973B2 (en) 2016-11-14 2020-02-04 Samsung Electronics Co., Ltd. Image vision processing method, device and equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5956494B2 (en) * 2014-03-27 2016-07-27 株式会社大一商会 Game machine
CN114974445A (en) * 2022-06-24 2022-08-30 中国科学院兰州化学物理研究所 Molecular dynamics modeling method based on real microstructure of material

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4952657B2 (en) * 2007-07-19 2012-06-13 株式会社Jvcケンウッド Pseudo stereoscopic image generation apparatus, image encoding apparatus, image encoding method, image transmission method, image decoding apparatus, and image decoding method
FR2932911A1 (en) * 2008-06-24 2009-12-25 France Telecom METHOD AND DEVICE FOR FILLING THE OCCULTATION ZONES OF A DEPTH CARD OR DISPARITIES ESTIMATED FROM AT LEAST TWO IMAGES.
JP5820985B2 (en) * 2011-01-19 2015-11-24 パナソニックIpマネジメント株式会社 Stereoscopic image processing apparatus and stereoscopic image processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10552973B2 (en) 2016-11-14 2020-02-04 Samsung Electronics Co., Ltd. Image vision processing method, device and equipment

Also Published As

Publication number Publication date
JP2014033366A (en) 2014-02-20

Similar Documents

Publication Publication Date Title
JP5962393B2 (en) Image processing apparatus, image processing method, and image processing program
JP2015022458A (en) Image processing device, image processing method, and image processing program
US8971611B2 (en) Image process device, image process method, and image process program
US9401039B2 (en) Image processing device, image processing method, program, and integrated circuit
US8488868B2 (en) Generation of a depth map from a monoscopic color image for rendering stereoscopic still and video images
KR101696918B1 (en) Comfort noise and film grain processing for 3 dimensional video
TWI712990B (en) Method and apparatus for determining a depth map for an image, and non-transitory computer readable storage medium
JP5820985B2 (en) Stereoscopic image processing apparatus and stereoscopic image processing method
JP5303692B1 (en) Stereoscopic image processing apparatus and stereoscopic image processing method
JP2018524896A (en) Method and apparatus for determining a depth map of an image
JP2001320731A (en) Device for converting two-dimensional image into there dimensional image and its method
JP2011120233A (en) 3d video special effect apparatus, 3d video special effect method, and, 3d video special effect program
JP2010152521A (en) Apparatus and method for performing stereographic processing to image
JP5971017B2 (en) Image processing apparatus, image processing method, and image processing program
US10893258B1 (en) Displacement-oriented view synthesis system and method
JP2015012429A (en) Image processing apparatus, image processing method, and image processing program
JP5900321B2 (en) Image processing apparatus, image processing method, and image processing program
JP5807569B2 (en) Image processing apparatus, image processing method, and image processing program
JP2004320189A (en) Method for converting two-dimensional image into three-dimensional image
JP5867128B2 (en) Image processing apparatus, image processing method, and image processing program
JP5488482B2 (en) Depth estimation data generation device, depth estimation data generation program, and pseudo-stereoscopic image display device
Munezawa et al. Noise removal method for moving images using 3-D and time-domain total variation regularization decomposition
JP5807570B2 (en) Image processing apparatus, image processing method, and image processing program
JP5887966B2 (en) Image processing apparatus, image processing method, and image processing program
JP5807571B2 (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: 20150331

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151006

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151202

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160627

R150 Certificate of patent or registration of utility model

Ref document number: 5971017

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150