JP2013044806A - Imaging apparatus - Google Patents

Imaging apparatus Download PDF

Info

Publication number
JP2013044806A
JP2013044806A JP2011180890A JP2011180890A JP2013044806A JP 2013044806 A JP2013044806 A JP 2013044806A JP 2011180890 A JP2011180890 A JP 2011180890A JP 2011180890 A JP2011180890 A JP 2011180890A JP 2013044806 A JP2013044806 A JP 2013044806A
Authority
JP
Japan
Prior art keywords
image
phase difference
color
band
blur
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.)
Withdrawn
Application number
JP2011180890A
Other languages
Japanese (ja)
Inventor
Kazuya Yamanaka
一哉 山中
Akihiro Kubota
明広 窪田
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.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2011180890A priority Critical patent/JP2013044806A/en
Priority to PCT/JP2012/067486 priority patent/WO2013027504A1/en
Publication of JP2013044806A publication Critical patent/JP2013044806A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/34Systems for automatic generation of focusing signals using different areas in a pupil plane
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • H04N13/207Image signal generators using stereoscopic image cameras using a single 2D image sensor
    • H04N13/218Image signal generators using stereoscopic image cameras using a single 2D image sensor using spatial multiplexing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/257Colour aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/672Focus control based on electronic image sensor signals based on the phase difference signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/843Demosaicing, e.g. interpolating colour pixel values
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/10Circuitry of solid-state image sensors [SSIS]; Control thereof for transforming different wavelengths into image signals
    • H04N25/11Arrangement of colour filter arrays [CFA]; Filter mosaics
    • H04N25/13Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements
    • H04N25/134Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements based on three different wavelength filter elements

Abstract

PROBLEM TO BE SOLVED: To provide an imaging apparatus with manufacturing cost rise suppressed, enabling easy confirmation of a focal part and a non-focal part by visual observation.SOLUTION: An imaging apparatus includes: a color image pick-up element 22 for generating an RGB image; an imaging optical system 9 for imaging a subject image in the image pick-up element 22; a band-limiting filter 12 which is arranged on an optical path of photographing luminous flux and which performs first band limitation for passing light of R and G therethrough by cutting off light of B trying to pass through a first partial pupil and second band limitation for passing the light of B and G therethrough by cutting off the light of R trying to pass through a second partial pupil; and a display part 27 which displays a phase difference image indicating phase difference between an R image and a B image.

Description

本発明は、撮像素子から得られた画像に基づき被写体の合焦状態を確認し得る撮像装置に関する。   The present invention relates to an imaging apparatus capable of confirming a focused state of a subject based on an image obtained from an imaging element.

従来より、撮像装置から被写体までの距離を測定する技術は種々のものが提案されており、例えば、照明光を照射し被写体からの反射光を受光して測距を行うアクティブ測距方式や、基線長を設けて配置した複数の撮像装置(例えばステレオカメラ)の取得画像から三角測距の原理により測距を行う方式、あるいは撮像装置自体により取得した画像のコントラストが高くなるようにフォーカスレンズを駆動するコントラストAF方式など、様々な方式が提案されている。   Conventionally, various techniques for measuring the distance from the imaging device to the subject have been proposed.For example, an active distance measurement method for performing distance measurement by irradiating illumination light and receiving reflected light from the subject, A focus lens is used so that the contrast of the image acquired by the imaging device itself is increased by a method of performing distance measurement based on the principle of triangulation from images acquired by a plurality of imaging devices (for example, stereo cameras) arranged with a base line length. Various methods such as a contrast AF method for driving have been proposed.

しかし、アクティブ測距方式は測距用投光装置などの測距専用の部材が必要であり、また、三角測距方式では複数の撮像装置が必要であるために、撮像装置が大型化したりコストが上昇したりする要因となる。一方、コントラストAF方式は、撮像装置自体により取得した画像を利用するために、測距専用部材等は不要であるが、フォーカスレンズの位置を変化させながら複数回の撮像を行ってコントラスト値のピークを探す方式であるために、合焦位置に対応するピークを探すのに時間を要し、高速のAFを行うことが困難である。   However, the active distance measurement method requires a dedicated member for distance measurement such as a light projection device for distance measurement, and the triangular distance measurement method requires a plurality of image pickup devices. Will increase. On the other hand, since the contrast AF method uses an image acquired by the imaging apparatus itself, a dedicated distance measuring member or the like is not required. However, the contrast value peak is obtained by performing multiple imaging while changing the position of the focus lens. Therefore, it takes time to search for a peak corresponding to the in-focus position, and it is difficult to perform high-speed AF.

このような背景の下、大型化やコストの上昇を抑えながら距離情報を取得する技術として、レンズの瞳を通過する光束を複数に分割して受光し、レンズ内の一瞳領域を通過した光束から得られた画素信号と、レンズ内の他の瞳領域を通過した光束から得られた画素信号と、の間で相関演算を行うことにより、被写体までの距離情報を取得する技術が提案されている。   Under such a background, as a technology to acquire distance information while suppressing an increase in size and cost, a light beam that passes through the pupil of the lens is divided into a plurality of light beams, and a light beam that passes through one pupil region in the lens Has been proposed to obtain distance information to the subject by performing a correlation operation between the pixel signal obtained from the pixel signal and the pixel signal obtained from the light beam that has passed through another pupil region in the lens. Yes.

このような瞳分割画像を同時に取得する技術としては、例えば、距離検出用の画素上に遮光板(マスク)を配置する技術がある。例えば特開2009−147665号公報には、撮像素子の一部の画素上に瞳分割を行い得るような遮光膜を形成して焦点検出用画素とし、焦点検出用画素から得られた画像から位相差を取得し、スプリット画像を生成すると共に、平面画像も生成する技術が記載されている。   As a technique for simultaneously acquiring such pupil division images, for example, there is a technique for disposing a light shielding plate (mask) on a pixel for distance detection. For example, Japanese Patent Application Laid-Open No. 2009-147665 discloses a focus detection pixel by forming a light-shielding film that can perform pupil division on a part of pixels of an image sensor, and is based on an image obtained from the focus detection pixel. A technique for acquiring a phase difference, generating a split image, and also generating a planar image is described.

また、瞳分割を遮光板(マスク)によることなく行う技術として、例えば特開2001−174696号公報には、部分瞳毎に異なる分光特性を持たせた瞳色分割用フィルタを撮影光学系に介在させ、撮影光学系からの被写体像をカラー撮像素子により受光することで、色による瞳分割を行う技術が記載されている。すなわち、カラー撮像素子から出力される画像信号を色分離して、各色画像上の同一被写体間の相対的なズレ量を検知することにより、合焦位置から近距離側にずれているのか遠距離側にずれているのかのフォーカシングズレ方向と、その方向への合焦位置からのズレ量であるフォーカシングズレ量と、の2つのフォーカシング情報が取得される。   As a technique for performing pupil division without using a light-shielding plate (mask), for example, Japanese Patent Laid-Open No. 2001-174696 includes a pupil color division filter having different spectral characteristics for each partial pupil in an imaging optical system. In addition, a technique is described in which a subject image from a photographic optical system is received by a color image sensor to perform pupil division by color. In other words, the image signal output from the color image sensor is color-separated, and the relative shift amount between the same subject on each color image is detected, so that it is shifted from the in-focus position to the short distance side or the long distance Two pieces of focusing information, that is, a focusing shift direction that is shifted to the side and a focusing shift amount that is a shift amount from the in-focus position in that direction, are acquired.

特開2009−147665号公報JP 2009-147665 A 特開2001−174696号公報JP 2001-174696 A

上記特開2009−147665号公報に記載の技術は、微細加工技術を用いて画素との位置合わせをしながら撮像素子上に遮光膜を形成する必要があり、汎用の撮像素子をそのまま利用することができず、製造コストが高くなってしまう。   The technique described in the above Japanese Patent Application Laid-Open No. 2009-147665 needs to form a light-shielding film on the image sensor while aligning with the pixel using a fine processing technique, and uses a general-purpose image sensor as it is. Cannot be produced, resulting in an increase in manufacturing costs.

また、上記特開2001−174696号公報に記載の技術は、単に位相差量の検出についてしか記載されておらず、被写体のどの部分が合焦しどの部分が非合焦であるかをユーザが目視で確認するための技術については何等開示されていない。   Further, the technique described in Japanese Patent Application Laid-Open No. 2001-174696 describes only detection of the phase difference amount, and the user can determine which part of the subject is in focus and which part is out of focus. There is no disclosure of technology for visual confirmation.

本発明は上記事情に鑑みてなされたものであり、合焦部、非合焦部を目視で容易に確認することができる、製造コストが抑制された撮像装置を提供することを目的としている。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an imaging apparatus with reduced manufacturing costs, in which a focused part and a non-focused part can be easily confirmed visually.

上記の目的を達成するために、本発明の一態様による撮像装置は、複数の波長帯域の光をそれぞれ受光して光電変換し、第1の帯域の第1の画像と第2の帯域の第2の画像と第3の帯域の第3の画像とを生成するカラーの撮像素子と、被写体像を前記撮像素子に結像する撮像光学系と、前記撮像光学系を経て前記撮像素子に至る撮影光束の光路上に配設されていて、前記撮像光学系の瞳領域の一部である第1の領域を通過しようとする撮影光束中の前記第1の帯域の光を遮断し前記第2の帯域および前記第3の帯域の光を通過させる第1の帯域制限と、前記撮像光学系の瞳領域の他の一部である第2の領域を通過しようとする撮影光束中の第2の帯域の光を遮断し前記第1の帯域および前記第3の帯域の光を通過させる第2の帯域制限と、を行う帯域制限フィルタと、前記第1の画像と前記第2の画像との位相差を示す位相差画像を表示する表示部と、を具備している。   In order to achieve the above object, an imaging device according to one embodiment of the present invention receives and photoelectrically converts light in a plurality of wavelength bands, and performs first conversion on the first image in the first band and the second in the second band. A color imaging device that generates a second image and a third image in the third band, an imaging optical system that forms a subject image on the imaging device, and imaging that reaches the imaging device via the imaging optical system The second band is disposed on the optical path of the light beam and blocks the light in the first band in the photographing light beam that attempts to pass through the first region that is a part of the pupil region of the imaging optical system. A first band limitation that allows light in the band and the third band to pass through, and a second band in the imaging light flux that attempts to pass through a second region that is another part of the pupil region of the imaging optical system And a second band limitation that blocks the light of the first band and allows the light of the first band and the third band to pass. Cormorant a band limiting filter, which includes a display unit for displaying a phase difference image illustrating the phase difference between the first image and the second image.

本発明の撮像装置によれば、製造コストが抑制されるとともに、合焦部、非合焦部を目視で容易に確認することが可能となる。   According to the imaging apparatus of the present invention, the manufacturing cost is suppressed, and the in-focus portion and the out-of-focus portion can be easily confirmed visually.

本発明の実施形態に係る3D実施例1における撮像装置の構成を示すブロック図。The block diagram which shows the structure of the imaging device in 3D Example 1 which concerns on embodiment of this invention. 上記実施形態に係る3D実施例1における撮像素子の画素配列を説明するための図。The figure for demonstrating the pixel arrangement | sequence of the image pick-up element in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1における帯域制限フィルタの一構成例を説明するための図。The figure for demonstrating one structural example of the band-limiting filter in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1において、合焦位置にある被写体を撮像するときの被写体光束集光の様子を示す平面図。The top view which shows the mode of a subject light beam condensing when imaging the to-be-photographed object in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1において、合焦位置よりも近距離側にある被写体を撮像するときの被写体光束集光の様子を示す平面図。The top view which shows the mode of a subject light beam condensing at the time of imaging the to-be-photographed object in 3D Example 1 which concerns on the said embodiment in the short distance side from an in-focus position. 上記実施形態に係る3D実施例1において、合焦位置よりも近距離側にある被写体上の1点からの光により形成されるボケの形状を示す図。The figure which shows the shape of the blur formed with the light from one point on the to-be-photographed object in the 3D Example 1 which concerns on the said embodiment in the short distance side from a focus position. 上記実施形態に係る3D実施例1において、合焦位置よりも近距離側にある被写体上の1点からの光により形成されるボケの形状を色成分毎に示す図。The figure which shows the shape of the blur formed with the light from one point on the to-be-photographed object for every color component in 3D Example 1 which concerns on the said embodiment for a short distance side. 上記実施形態に係る3D実施例1において、合焦位置よりも遠距離側にある被写体を撮像するときの被写体光束集光の様子を示す平面図。The top view which shows the mode of a subject light beam condensing when imaging the to-be-photographed object in the 3D Example 1 which concerns on the said embodiment in the far distance side from a focus position. 上記実施形態に係る3D実施例1において、合焦位置よりも遠距離側にある被写体上の1点からの光により形成されるボケの形状を示す図。The figure which shows the shape of the blur formed with the light from one point on the to-be-photographed object in the 3D Example 1 which concerns on the said embodiment in the far distance side from a focusing position. 上記実施形態に係る3D実施例1において、合焦位置よりも遠距離側にある被写体上の1点からの光により形成されるボケの形状を色成分毎に示す図。The figure which shows the shape of the blur formed with the light from one point on the to-be-photographed object for every color component in 3D Example 1 which concerns on the said embodiment for a far distance side. 上記実施形態に係る3D実施例1において、合焦位置とそれよりも近距離および遠距離にある被写体を撮像したときの画像の様子を示す図。In 3D Example 1 which concerns on the said embodiment, the figure which shows the mode of an image when the to-be-photographed object and the to-be-photographed object in the short distance and far distance are imaged. 上記実施形態に係る3D実施例1における帯域制限フィルタの第1の変形例を示す図。The figure which shows the 1st modification of the band-limiting filter in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1における帯域制限フィルタの第2の変形例を示す図。The figure which shows the 2nd modification of the band-limiting filter in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1における帯域制限フィルタの第3の変形例を示す図。The figure which shows the 3rd modification of the band-limiting filter in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1における帯域制限フィルタの第4の変形例を示す図。The figure which shows the 4th modification of the band-limiting filter in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1において、カラー化処理後のボケ形状の概要を示す図。In 3D Example 1 which concerns on the said embodiment, the figure which shows the outline | summary of the blur shape after colorization process. 上記実施形態に係る3D実施例1の2D実施例1のカラー化処理において、合焦位置よりも遠距離側にある被写体のR画像に対して適用されるR用フィルタの形状を示す図。The figure which shows the shape of the filter for R applied to the R image of the to-be-photographed object at the far side in the colorization process of 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例1のカラー化処理において、合焦位置よりも遠距離側にある被写体のB画像に対して適用されるB用フィルタの形状を示す図。The figure which shows the shape of the filter for B applied in the colorization process of 2D Example 1 of 3D Example 1 which concerns on the said embodiment with respect to the to-be-photographed object's B image far from a focusing position. 上記実施形態に係る3D実施例1において、2D実施例1の変形例のカラー化処理における合焦位置よりも遠距離側にある被写体のR画像およびB画像のシフトの様子を示す図。In 3D Example 1 which concerns on the said embodiment, the figure which shows the mode of the shift of the R image of the to-be-photographed object and B image in the far side from the focus position in the colorization process of the modification of 2D Example 1. FIG. 上記実施形態に係る3D実施例1の2D実施例1の変形例のカラー化処理においてR画像およびB画像に対して適用されるフィルタの形状を示す図。The figure which shows the shape of the filter applied with respect to R image and B image in the colorization process of the modification of 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例1において、横方向の標準偏差を大きくした楕円型ガウシアンフィルタの形状を示す図。The figure which shows the shape of the elliptical Gaussian filter which enlarged the standard deviation of the horizontal direction in 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例1において、縦方向の標準偏差を小さくした楕円型ガウシアンフィルタの形状を示す図。The figure which shows the shape of the elliptical Gaussian filter which made small the standard deviation of the vertical direction in 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例1において、色画像生成部により行われるカラー化処理を示すフローチャート。The flowchart which shows the colorization process performed by the color image generation part in 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例1における画像処理装置の構成を示すブロック図。The block diagram which shows the structure of the image processing apparatus in 2D Example 1 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例2において、色画像生成部により行われるカラー化処理の概要を示す図。The figure which shows the outline | summary of the colorization process performed by the color image generation part in 2D Example 2 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例2において、位相差検出を行う際にR画像およびB画像に設定する部分領域を示す図。The figure which shows the partial area | region set to R image and B image in 2D Example 2 of 3D Example 1 which concerns on the said embodiment, when performing a phase difference detection. 上記実施形態に係る3D実施例1の2D実施例2において、オリジナルR画像のボケ拡散部分領域をRコピー画像にコピー加算する様子を示す図。The figure which shows a mode that copy addition of the blur diffusion partial area | region of an original R image is carried out to R copy image in 2D Example 2 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例2において、オリジナルB画像のボケ拡散部分領域をBコピー画像にコピー加算する様子を示す図。The figure which shows a mode that copy addition of the blur spreading | diffusion partial area | region of an original B image is carried out to B copy image in 2D Example 2 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例2において、位相差量に応じてボケ拡散部分領域のサイズを変更する例を示す線図。The diagram which shows the example which changes the size of a blur spreading | diffusion partial area | region according to 2D Example 2 of 3D Example 1 which concerns on the said embodiment according to phase difference amount. 上記実施形態に係る3D実施例1の2D実施例2において、色画像生成部により行われるカラー化処理を示すフローチャート。The flowchart which shows the colorization process performed by the color image generation part in 2D Example 2 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例3において、位相差量に応じた各色のPSFのテーブルの概要を示す図。The figure which shows the outline | summary of the table of PSF of each color according to phase difference amount in 2D Example 3 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例3において、色画像生成部により行われるカラー化処理の概要を示す図。The figure which shows the outline | summary of the colorization process performed by the color image generation part in 2D Example 3 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例3において、色画像生成部により行われるボケ量コントロールを伴うカラー化処理の概要を示す図。The figure which shows the outline | summary of the colorization process with the blur amount control performed by the color image generation part in 2D Example 3 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1の2D実施例3において、色画像生成部により行われるカラー化処理を示すフローチャート。The flowchart which shows the colorization process performed by the color image generation part in 2D Example 3 of 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例1において、カラー化処理後の2次元画像から左目画像および右目画像を生成する様子を示す図。The figure which shows a mode that the 3D Example 1 which concerns on the said embodiment produces | generates a left eye image and a right eye image from the two-dimensional image after a colorization process. 上記実施形態に係る3D実施例1において、ステレオ画像生成部による立体視画像の生成処理を示すフローチャート。The flowchart which shows the production | generation process of the stereoscopic image by the stereo image production | generation part in 3D Example 1 which concerns on the said embodiment. 上記実施形態に係る3D実施例2の立体視画像の生成処理において合焦位置よりも遠距離側にある被写体の像から左目画像を生成する際のシフトの様子を示す図。The figure which shows the mode of the shift at the time of producing | generating a left eye image from the image | photographing of the to-be-photographed object of the far side rather than a focusing position in the production | generation process of the stereoscopic vision image of 3D Example 2 which concerns on the said embodiment. 上記実施形態に係る3D実施例2の立体視画像の生成処理において合焦位置よりも遠距離側にある被写体の像から右目画像を生成する際のシフトの様子を示す図。The figure which shows the mode of the shift at the time of producing | generating a right-eye image from the image | photographing of the to-be-photographed object of the far side from the focus position in the production | generation process of the stereoscopic vision image of 3D Example 2 which concerns on the said embodiment. 上記実施形態に係る3D実施例2において、シフト後の左目画像における各色のボケ形状を近似させるフィルタ処理を行った後の様子を示す図。The figure which shows the mode after performing the filter process which approximates the blurring shape of each color in the left-eye image after a shift in 3D Example 2 which concerns on the said embodiment. 上記実施形態に係る3D実施例2において、シフト後の右目画像における各色のボケ形状を近似させるフィルタ処理を行った後の様子を示す図。The figure which shows a mode after performing the filter process which approximates the blurring shape of each color in the right-eye image after a shift in 3D Example 2 which concerns on the said embodiment. 本発明の実施形態1の撮像装置の表示部に表示される位相差画像の例を示す図。FIG. 3 is a diagram illustrating an example of a phase difference image displayed on a display unit of the imaging apparatus according to the first embodiment of the present invention. 上記実施形態1の撮像装置における表示処理を示すフローチャート。3 is a flowchart showing display processing in the imaging apparatus according to the first embodiment. 本発明の実施形態2の撮像装置の表示部に表示される位相差画像の例を示す図。The figure which shows the example of the phase difference image displayed on the display part of the imaging device of Embodiment 2 of this invention. 上記実施形態2の撮像装置における表示処理を示すフローチャート。7 is a flowchart showing display processing in the imaging apparatus according to the second embodiment. 本発明の実施形態3の撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図。The block diagram which shows the detailed structure of the image process part and system controller in the imaging device of Embodiment 3 of this invention. 上記実施形態3の撮像装置の表示部に表示される位相差画像の例を示す図。FIG. 10 is a diagram illustrating an example of a phase difference image displayed on a display unit of the imaging apparatus according to the third embodiment. 上記実施形態3の撮像装置における表示処理を示すフローチャート。10 is a flowchart illustrating display processing in the imaging apparatus according to the third embodiment. 本発明の実施形態4の撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図。The block diagram which shows the detailed structure of the image process part and system controller in the imaging device of Embodiment 4 of this invention. 上記実施形態4の撮像装置の表示部に表示される位相差画像の例を示す図。FIG. 6 is a diagram illustrating an example of a phase difference image displayed on a display unit of the imaging apparatus according to the fourth embodiment. 上記実施形態4の撮像装置における表示処理を示すフローチャート。10 is a flowchart illustrating display processing in the imaging apparatus according to the fourth embodiment. 本発明の実施形態5の撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図。The block diagram which shows the detailed structure of the image process part and system controller in the imaging device of Embodiment 5 of this invention. 上記実施形態5の撮像装置の表示部に表示される位相差画像の例を示す図。FIG. 10 is a diagram illustrating an example of a phase difference image displayed on a display unit of the imaging apparatus according to the fifth embodiment. 上記実施形態5の撮像装置における表示処理を示すフローチャート。10 is a flowchart illustrating display processing in the imaging apparatus according to the fifth embodiment. 上記実施形態5において、位相差量の大きさに応じて予め定められた色の一例を示す線図。In the said Embodiment 5, the diagram which shows an example of the color predetermined according to the magnitude | size of phase difference amount.

以下、図面を参照して本発明の実施の形態を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

まず、図1から図40を参照して、本発明の各実施形態に係る技術について説明する。ここに、図1から図36を参照して3次元立体視画像に係る3D実施例1を、図37から図40を参照して3次元立体視画像に係る3D実施例2を、それぞれ説明する。また、平面画像に関しては、3D実施例1中において、2D実施例1〜2D実施例3として説明する。
[3D実施例1]
First, a technique according to each embodiment of the present invention will be described with reference to FIGS. Here, 3D Example 1 related to a three-dimensional stereoscopic image will be described with reference to FIGS. 1 to 36, and 3D Example 2 related to a three-dimensional stereoscopic image will be described with reference to FIGS. . The planar image will be described as 2D Example 1 to 2D Example 3 in 3D Example 1.
[3D Example 1]

図1から図36は本発明の実施形態に係る3D実施例1を示したものであり、図1は撮像装置の構成を示すブロック図である。   FIG. 1 to FIG. 36 show a 3D example 1 according to the embodiment of the present invention, and FIG. 1 is a block diagram showing the configuration of the imaging apparatus.

本3D実施例1の撮像装置は、例えばデジタルスチルカメラとして構成されている。ただし、ここではデジタルスチルカメラを例に挙げているが、撮像装置は、カラー撮像素子を備え、撮像機能を有する装置であればどのようなものでも良く、幾つかの例を挙げれば、上述したデジタルスチルカメラ、ビデオカメラ、カメラ付携帯電話、カメラ付携帯情報端末(カメラ付PDA)、カメラ付パーソナルコンピュータ、監視カメラ、内視鏡、デジタル顕微鏡(デジタルマイクロスコープ)などである。   The imaging apparatus according to the 3D embodiment 1 is configured as a digital still camera, for example. However, here, a digital still camera is taken as an example, but the imaging device may be any device that has a color imaging device and has an imaging function. Digital still cameras, video cameras, mobile phones with cameras, personal digital assistants with cameras (PDAs with cameras), personal computers with cameras, surveillance cameras, endoscopes, digital microscopes (digital microscopes), and the like.

撮像装置は、レンズユニット1と、このレンズユニット1がレンズマウントを介して着脱自在に取り付けられる本体部であるボディユニット2と、を備えている。なお、ここではレンズユニット1が着脱式である場合を例に挙げて説明するが、勿論、着脱式でなくても構わない。   The imaging apparatus includes a lens unit 1 and a body unit 2 that is a main body portion to which the lens unit 1 is detachably attached via a lens mount. Here, a case where the lens unit 1 is detachable will be described as an example, but of course, it may not be detachable.

レンズユニット1は、レンズ10と絞り11とを含む撮像光学系9と、帯域制限フィルタ12と、レンズ制御部14と、レンズ側通信コネクタ15と、を備えている。   The lens unit 1 includes an imaging optical system 9 including a lens 10 and a diaphragm 11, a band limiting filter 12, a lens control unit 14, and a lens side communication connector 15.

ボディユニット2は、シャッタ21と、撮像素子22と、撮像回路23と、撮像駆動部24と、画像処理部25と、画像メモリ26と、表示部27と、インターフェース(IF)28と、システムコントローラ30と、センサ部31と、操作部32と、ストロボ制御回路33と、ストロボ34と、ボディ側通信コネクタ35と、を備えている。なお、図1のボディユニット2内には記録媒体29も記載されているが、この記録媒体29は撮像装置に対して着脱自在な例えばメモリカード(スマートメディア、SDカード、xDピクチャーカード等)で構成されているために、撮像装置に固有の構成でなくても構わない。   The body unit 2 includes a shutter 21, an imaging element 22, an imaging circuit 23, an imaging drive unit 24, an image processing unit 25, an image memory 26, a display unit 27, an interface (IF) 28, and a system controller. 30, a sensor unit 31, an operation unit 32, a strobe control circuit 33, a strobe 34, and a body side communication connector 35. In addition, although the recording medium 29 is also described in the body unit 2 of FIG. 1, this recording medium 29 is a memory card (smart media, SD card, xD picture card, etc.) which is detachable with respect to the imaging device. Since it is configured, the configuration may not be unique to the imaging apparatus.

まず、レンズユニット1における撮像光学系9は、被写体像を撮像素子22に結像するためのものである。この撮像光学系9のレンズ10は、焦点調節を行うためのフォーカスレンズを備えて構成されている。レンズ10は、一般的には複数枚のレンズで構成されることが多いが、図1においては簡単のために1枚のレンズのみを図示している。   First, the imaging optical system 9 in the lens unit 1 is for forming a subject image on the imaging element 22. The lens 10 of the imaging optical system 9 includes a focus lens for performing focus adjustment. Although the lens 10 is generally composed of a plurality of lenses in general, only one lens is shown in FIG. 1 for simplicity.

撮像光学系9の絞り11は、レンズ10を通過する被写体光束の通過範囲を規制することにより、撮像素子22上に結像される被写体像の明るさを調節するためのものである。   The diaphragm 11 of the imaging optical system 9 is for adjusting the brightness of the subject image formed on the imaging element 22 by regulating the passage range of the subject light flux passing through the lens 10.

帯域制限フィルタ12は、撮像光学系9を経て撮像素子22に至る撮影光束の光路上(望ましくは、撮像光学系9の絞り11の位置またはその近傍)に配設されており、撮像光学系9の瞳領域の一部である第1の領域を通過しようとする撮影光束中の第1の帯域の光を遮断し第2の帯域および第3の帯域の光を通過させる第1の帯域制限と、撮像光学系9の瞳領域の他の一部である第2の領域を通過しようとする撮影光束中の第2の帯域の光を遮断し第1の帯域および第3の帯域の光を通過させる第2の帯域制限と、を行うフィルタである。   The band limiting filter 12 is disposed on the optical path of the imaging light beam that passes through the imaging optical system 9 and reaches the imaging device 22 (preferably at the position of the diaphragm 11 of the imaging optical system 9 or in the vicinity thereof). A first band limitation that blocks light in the first band in the photographic light flux that attempts to pass through the first area that is a part of the pupil area, and allows light in the second band and the third band to pass through. The light of the second band in the imaging light flux that attempts to pass through the second area that is another part of the pupil area of the imaging optical system 9 is blocked and the light of the first band and the third band is allowed to pass. And a second band limitation to be performed.

ここに、図3は帯域制限フィルタ12の一構成例を説明するための図である。この図3に示す構成例の帯域制限フィルタ12は、撮像光学系9の瞳領域が、第1の領域と第2の領域とに2分されたものとなっている。すなわち、帯域制限フィルタ12は、撮像装置を標準姿勢(いわゆる、カメラを通常の横位置に構えた姿勢)として撮像素子22から見たときに、左半分がG(緑)成分およびR(赤)成分を通過させB(青)成分を遮断する(すなわち、B(青)成分は第1の帯域と第2の帯域との内の一方の帯域である)RGフィルタ12r、右半分がG成分およびB成分を通過させR成分を遮断する(すなわち、R成分は第1の帯域と第2の帯域との内の他方の帯域である)GBフィルタ12bとなっている。従って、帯域制限フィルタ12は、撮像光学系9の絞り11の開口を通過する光に含まれるG成分を全て通過させ(すなわち、G成分は第3の帯域である)、R成分を開口の半分の領域だけ通過させ、B成分を開口の残り半分の領域だけ通過させる。なお、帯域制限フィルタ12のRGB各分光透過特性が、撮像素子22にオンチップで構成されている素子フィルタ(図2参照)のRGB各分光透過特性と異なると、RGフィルタ12rとGBフィルタ12bの空間位置の相違に基づいて得られる画像から後述するように取得する位置情報の精度が低下したり、分光特性のミスマッチによる光量ロスが発生したりすることになる。従って、帯域制限フィルタ12の分光透過特性は、撮像素子22の素子フィルタの分光透過特性と、同一または可能な限り近似していることが望ましい。また、帯域制限フィルタ12の他の構成例については、後で図12〜図15等を参照して説明する。   FIG. 3 is a diagram for explaining a configuration example of the band limiting filter 12. In the band limiting filter 12 of the configuration example shown in FIG. 3, the pupil region of the imaging optical system 9 is divided into a first region and a second region. In other words, the band limiting filter 12 has a left half of the G (green) component and R (red) when the image pickup device is viewed from the image pickup device 22 in a standard posture (so-called posture in which the camera is held in a normal horizontal position). RG filter 12r that passes the component and blocks the B (blue) component (that is, the B (blue) component is one of the first band and the second band), the right half is the G component and The GB filter 12b is configured to pass the B component and block the R component (that is, the R component is the other of the first band and the second band). Therefore, the band limiting filter 12 passes all the G components contained in the light passing through the aperture 11 of the imaging optical system 9 (that is, the G component is the third band), and the R component is half of the aperture. And pass the B component only through the remaining half of the aperture. If the RGB spectral transmission characteristics of the band limiting filter 12 are different from the RGB spectral transmission characteristics of an element filter (see FIG. 2) configured on-chip in the image sensor 22, the RG filter 12r and the GB filter 12b As will be described later, the accuracy of the position information acquired from the images obtained based on the difference in the spatial position is reduced, or a light amount loss due to a mismatch in spectral characteristics occurs. Therefore, it is desirable that the spectral transmission characteristic of the band limiting filter 12 is the same as or as close as possible to the spectral transmission characteristic of the element filter of the image sensor 22. Other configuration examples of the band limiting filter 12 will be described later with reference to FIGS.

レンズ制御部14は、レンズユニット1の制御を行うものである。すなわち、レンズ制御部14は、レンズ側通信コネクタ15およびボディ側通信コネクタ35を介してシステムコントローラ30から受信した指令に基づき、レンズ10内のフォーカスレンズを駆動して合焦させたり、絞り11を駆動して絞り開口径を変更させたりするものである。   The lens control unit 14 controls the lens unit 1. That is, the lens control unit 14 drives and focuses the focus lens in the lens 10 based on a command received from the system controller 30 via the lens-side communication connector 15 and the body-side communication connector 35, or the aperture 11 is moved. It is driven to change the aperture diameter.

レンズ側通信コネクタ15は、レンズユニット1とボディユニット2とがレンズマウントにより結合されてボディ側通信コネクタ35と接続されることにより、レンズ制御部14とシステムコントローラ30との間の通信を可能にするコネクタである。   The lens-side communication connector 15 enables communication between the lens control unit 14 and the system controller 30 by connecting the lens unit 1 and the body unit 2 with a lens mount and connecting to the body-side communication connector 35. Connector.

次に、ボディユニット2におけるシャッタ21は、レンズ10から撮像素子22に到達する被写体光束の通過時間を規制することにより、撮像素子22の露光時間を調節するための光学シャッタである。なお、ここでは光学シャッタを用いているが、光学シャッタに代えて、または光学シャッタに加えて、撮像素子22による素子シャッタ(電子シャッタ)を用いるようにしても構わない。   Next, the shutter 21 in the body unit 2 is an optical shutter for adjusting the exposure time of the image sensor 22 by regulating the passage time of the subject light beam reaching the image sensor 22 from the lens 10. Although an optical shutter is used here, an element shutter (electronic shutter) by the image sensor 22 may be used instead of or in addition to the optical shutter.

撮像素子22は、撮像光学系9により結像される被写体像を、複数の波長帯(例えば、RGBが挙げられるが、これに限るものではない)光毎にそれぞれ受光して光電変換し、電気信号として出力するカラー撮像素子であり、例えば、CCDやCMOS等として構成されている。ここに、カラー撮像素子の構成としては、オンチップの素子カラーフィルタを備えた単板の撮像素子でも良いし、RGB各色光への色分解を行うダイクロイックプリズムを用いた3板式であっても良いし、同一の画素位置で半導体の深さ方向位置に応じてRGBの撮像情報を取得可能な方式の撮像素子であっても良いし、複数の波長帯光の撮像情報を取得可能であればどのようなものでも構わない。   The imaging device 22 receives and photoelectrically converts the subject image formed by the imaging optical system 9 for each of a plurality of wavelength bands (for example, but not limited to RGB), and performs photoelectric conversion. A color image sensor that outputs a signal, for example, a CCD or CMOS. Here, the configuration of the color image sensor may be a single-plate image sensor provided with an on-chip element color filter, or a three-plate system using a dichroic prism that performs color separation into RGB color lights. However, it may be an image sensor of a method capable of acquiring RGB imaging information according to the position in the depth direction of the semiconductor at the same pixel position, or any imaging element that can acquire imaging information of a plurality of wavelength bands. It does n’t matter.

例えば、図2を参照して、一般的なデジタルスチルカメラに用いられることが多い単板のカラー撮像素子の構成例を説明する。ここに、図2は撮像素子22の画素配列を説明するための図である。本3D実施例1においては、オンチップで搭載される素子カラーフィルタが透過する複数の波長帯光はR、G、およびBとなっており、この図2に示すように、原色ベイヤー配列の単板カラー撮像素子が構成されている。従って、撮像素子22がこの図2に示したような構成である場合には、1画素に付き1色の色成分のみが得られることになるために、画像処理部25においてデモザイキング処理を行い1画素につきRGBの3色が揃ったカラー画像を生成するようになっている。   For example, with reference to FIG. 2, a configuration example of a single-plate color image sensor often used for a general digital still camera will be described. FIG. 2 is a diagram for explaining the pixel arrangement of the image sensor 22. In the present 3D embodiment 1, the plurality of wavelength band lights transmitted by the element color filter mounted on-chip are R, G, and B. As shown in FIG. A plate color imaging device is configured. Therefore, when the image pickup device 22 has the configuration shown in FIG. 2, only one color component is obtained per pixel, and therefore the image processor 25 performs a demosaicing process. A color image in which three colors of RGB are aligned per pixel is generated.

撮像回路23は、撮像素子22から出力される画像信号を増幅(ゲイン調整)したり、撮像素子22がアナログ撮像素子であってアナログの画像信号を出力する場合には、A/D変換してデジタル画像信号(以下では「画像情報」ともいう)を生成したりするものである(撮像素子22がデジタル撮像素子である場合には、撮像回路23に入力される時点で既にデジタルとなっているためにA/D変換は行わない)。撮像回路23は、後述するように撮像駆動部24で切り換えられた撮像モードに対応するフォーマットで、画像信号を画像処理部25へ出力する。   The image pickup circuit 23 performs A / D conversion when the image signal output from the image pickup device 22 is amplified (gain adjustment), or when the image pickup device 22 is an analog image pickup device and outputs an analog image signal. Or a digital image signal (hereinafter also referred to as “image information”) (when the image pickup device 22 is a digital image pickup device, it is already digital when it is input to the image pickup circuit 23). Therefore, A / D conversion is not performed). The imaging circuit 23 outputs an image signal to the image processing unit 25 in a format corresponding to the imaging mode switched by the imaging driving unit 24 as will be described later.

撮像駆動部24は、システムコントローラ30の指令に基づいて、撮像素子22および撮像回路23にタイミング信号および電力を供給して、撮像素子に露光、読出、素子シャッタ等を行わせるとともに、撮像素子22の動作に同期させて撮像回路23によるゲイン調整およびA/D変換を実行させるように制御するものである。また、この撮像駆動部24は、撮像素子22の撮像モードを切り換える制御も行う。   The imaging drive unit 24 supplies a timing signal and power to the imaging element 22 and the imaging circuit 23 based on a command from the system controller 30 to cause the imaging element to perform exposure, reading, element shuttering, and the like, and also to the imaging element 22. Control is performed to execute gain adjustment and A / D conversion by the imaging circuit 23 in synchronism with the above operations. The imaging drive unit 24 also performs control to switch the imaging mode of the imaging element 22.

画像処理部25は、WB(ホワイトバランス)調整、黒レベルの補正、γ補正、欠陥画素の補正、デモザイキング、画像情報の色情報の変換処理、画像情報の画素数変換処理、等のデジタル画像処理を行うものである。この画像処理部25は、さらに、色間補正部36と、色画像生成部37と、ステレオ画像生成部40と、を備えている。   The image processing unit 25 is a digital image such as WB (white balance) adjustment, black level correction, γ correction, defective pixel correction, demosaicing, image information color information conversion processing, image information pixel number conversion processing, and the like. The processing is performed. The image processing unit 25 further includes a color correction unit 36, a color image generation unit 37, and a stereo image generation unit 40.

上述したように、帯域制限フィルタ12は通過させる光の帯域(色)によって、撮像光学系9の瞳領域における通過領域を制限しているために、通過する光は、帯域によって明るさが異なることになる。色間補正部36は、このような帯域間(色間)の明るさの違いを補正するためのものである。この帯域間(色間)の明るさの違いの補正は、簡易的には、帯域毎の通過領域の面積に応じて補正することが考えられるが、画像の中心よりも周辺の方が光量が低下する傾向があることを考慮して、撮像光学系9の光学特性に応じたより詳細な補正を行うようにしても勿論構わない。このときには、撮像装置内で補正値を算出するに限るものではなく、テーブルデータ等として補正値を保持するようにしても構わない。具体例として、帯域制限フィルタ12が図3に示したように構成されている場合には、RとBはGの半分の通過光量となるために、Rの色信号とBの色信号を2倍にする処理を簡易的な色間補正として行うことが考えられる(同様に、後述する図12〜図15の構成の場合には、それぞれの帯域毎の通過領域の面積に応じて補正することになる)。このような処理を行うことにより、光量バランスの点においては図3の帯域制限フィルタ12が挿入されていない撮像装置と同様な画像として扱うことが可能となり、各種機能(例えば画像生成処理など)を利用することが可能となる。   As described above, since the band limiting filter 12 limits the pass region in the pupil region of the imaging optical system 9 by the band (color) of the light that passes through, the brightness of the light that passes through the band varies. become. The inter-color correction unit 36 is for correcting such a difference in brightness between bands (between colors). The brightness difference between bands (between colors) can be easily corrected according to the area of the pass region for each band, but the amount of light in the periphery is larger than the center of the image. Of course, more detailed correction according to the optical characteristics of the imaging optical system 9 may be performed in consideration of the tendency to decrease. At this time, the correction value is not limited to be calculated in the imaging apparatus, and the correction value may be held as table data or the like. As a specific example, when the band limiting filter 12 is configured as shown in FIG. 3, R and B have half the amount of light passing through G, so that the R color signal and the B color signal are 2 It is conceivable to perform the doubling process as a simple inter-color correction (similarly, in the case of the configuration shown in FIGS. 12 to 15 described later, correction is performed according to the area of the pass region for each band. become). By performing such processing, it becomes possible to handle the image as an image similar to that of the image pickup apparatus in which the band limiting filter 12 of FIG. 3 is not inserted in terms of light quantity balance, and various functions (for example, image generation processing) are performed. It can be used.

色画像生成部37は、カラー画像情報を形成するためのデジタル処理であるカラー化の処理を行うものである。図3に示したような帯域制限フィルタ12を用いた場合には、R画像とB画像とに空間的な位置ズレが発生することがあるために、この空間的な位置ズレを補正するのが色画像生成部37が行うカラー化処理の一例である。   The color image generation unit 37 performs colorization processing that is digital processing for forming color image information. When the band limiting filter 12 as shown in FIG. 3 is used, a spatial positional deviation may occur between the R image and the B image. Therefore, the spatial positional deviation is corrected. It is an example of the colorization process which the color image generation part 37 performs.

まず、各色画像の空間的な位置ズレについて、図4〜図11を参照して説明する。ここに、図4は合焦位置にある被写体を撮像するときの被写体光束集光の様子を示す平面図、図5は合焦位置よりも近距離側にある被写体を撮像するときの被写体光束集光の様子を示す平面図、図6は合焦位置よりも近距離側にある被写体上の1点からの光により形成されるボケの形状を示す図、図7は合焦位置よりも近距離側にある被写体上の1点からの光により形成されるボケの形状を色成分毎に示す図、図8は合焦位置よりも遠距離側にある被写体を撮像するときの被写体光束集光の様子を示す平面図、図9は合焦位置よりも遠距離側にある被写体上の1点からの光により形成されるボケの形状を示す図、図10は合焦位置よりも遠距離側にある被写体上の1点からの光により形成されるボケの形状を色成分毎に示す図、図11は合焦位置とそれよりも近距離および遠距離にある被写体を撮像したときの画像の様子を示す図である。なお、ボケ形状の説明に際しては、絞り11の開口が円形状である場合を例に挙げて説明する。   First, the spatial positional shift of each color image will be described with reference to FIGS. FIG. 4 is a plan view showing a state of subject light flux condensing when imaging a subject at the in-focus position, and FIG. 5 is a subject light flux concentrating when imaging a subject closer to the in-focus position. FIG. 6 is a plan view showing the state of light, FIG. 6 is a diagram showing the shape of a blur formed by light from one point on the subject that is closer to the focus position, and FIG. 7 is a closer distance than the focus position. FIG. 8 is a diagram showing the shape of blur formed by light from one point on a subject on the side for each color component, and FIG. 8 is a diagram of subject light flux collection when imaging a subject farther than the in-focus position. FIG. 9 is a plan view showing the state, FIG. 9 is a diagram showing the shape of a blur formed by light from one point on the subject that is on the far side from the in-focus position, and FIG. 10 is on the far side from the in-focus position. FIG. 11 is a diagram showing the shape of a blur formed by light from one point on a subject for each color component. Location and than a diagram showing a state of image obtained by imaging the object at a short distance and long distance. In the description of the blur shape, the case where the aperture of the diaphragm 11 has a circular shape will be described as an example.

被写体OBJcが合焦位置にあるときには、被写体OBJc上の1点から放射された光は、図4に示すように、帯域制限フィルタ12全体を通過するG成分も、帯域制限フィルタ12の半分のRGフィルタ12rのみを通過するR成分も、帯域制限フィルタ12の他の半分のGBフィルタ12bのみを通過するB成分も、撮像素子22上の1点に集光され、点像IMGrgbを形成するために、上述したような通過領域の面積に応じた光量の相違はあるものの、色間に位置ズレは発生しない。従って、合焦位置にある被写体OBJcを撮像したときには、図11に示すように、色にじみのない被写体像IMGrgbが結像される。   When the subject OBJc is at the in-focus position, the light emitted from one point on the subject OBJc has a G component that passes through the entire band limiting filter 12 as shown in FIG. Both the R component that passes only through the filter 12r and the B component that passes only through the other half of the GB filter 12b of the band limiting filter 12 are collected at one point on the image sensor 22 to form a point image IMGrgb. Although there is a difference in the amount of light according to the area of the passing region as described above, no positional deviation occurs between the colors. Therefore, when the subject OBJc at the in-focus position is imaged, a subject image IMGrgb having no color blur is formed as shown in FIG.

これに対して、被写体OBJnが例えば合焦位置よりも近距離側にある場合には、被写体OBJn上の1点から放射された光により、図5〜図7に示すように、G成分については円形ボケをなす被写体像IMGgが形成され、R成分については左半分の半円形ボケをなす被写体像IMGrが形成され、B成分については右半分の半円形ボケをなす被写体像IMGbが形成される。従って、合焦位置よりも近距離側にある被写体OBJnを撮像したときには、図11に示すように、R成分の被写体像IMGrが左側にずれ、B成分の被写体像IMGbが右側にずれたボケ画像が形成され、このボケ画像におけるR成分とB成分の左右位置は、撮像素子22から見たときの帯域制限フィルタ12におけるR成分透過領域(RGフィルタ12r)とB成分透過領域(GBフィルタ12b)の左右位置と同じである(なお、図11においてはズレを強調して示しており、実際に生じているボケ形状の図示は省略している(下記遠距離側の場合も同様))。そして、被写体OBJnが合焦位置から近距離側へ離れるほど、ボケが大きくなって、R成分の被写体像IMGrの重心位置とB成分の被写体像IMGbの重心位置との離間距離が大きくなることになる。なお、G成分の被写体像IMGgについては、図6、図7に示すように、R成分の被写体像IMGrとB成分の被写体像IMGbとにまたがったボケ画像となる。このG成分の被写体像IMGgは、帯域制限フィルタ12を使用しない場合のボケ画像と同じ情報になるために、上述した色画像生成部37が行うカラー化処理における標準画像として使用することが可能である。   On the other hand, when the subject OBJn is closer to the in-focus position, for example, the light emitted from one point on the subject OBJn is used for the G component as shown in FIGS. A subject image IMGg that forms a circular blur is formed, a subject image IMGr that forms a semicircular blur of the left half is formed for the R component, and a subject image IMGb that forms a semicircular blur of the right half is formed for the B component. Therefore, when the subject OBJn that is closer to the in-focus position is imaged, as shown in FIG. 11, the blur component image in which the R component subject image IMGr is shifted to the left and the B component subject image IMGb is shifted to the right. The left and right positions of the R component and B component in this blurred image are the R component transmission region (RG filter 12r) and B component transmission region (GB filter 12b) of the band limiting filter 12 when viewed from the image sensor 22. (In FIG. 11, the deviation is emphasized and illustration of the blurred shape actually generated is omitted (the same applies to the case of the far side below)). As the subject OBJn moves away from the in-focus position, the blur increases, and the distance between the center of gravity of the R component subject image IMGr and the center of gravity of the B component subject image IMGb increases. Become. Note that the G component subject image IMGg is a blurred image extending over the R component subject image IMGr and the B component subject image IMGb, as shown in FIGS. Since the G component subject image IMGg has the same information as the blurred image when the band limiting filter 12 is not used, it can be used as a standard image in the colorization processing performed by the color image generation unit 37 described above. is there.

一方、被写体OBJfが例えば合焦位置よりも遠距離側にある場合には、被写体OBJf上の1点から放射された光により、図8〜図10に示すように、G成分については円形ボケをなす被写体像IMGgが形成され、R成分については右半分の半円形ボケをなす被写体像IMGrが形成され、B成分については左半分の半円形ボケをなす被写体像IMGbが形成される。従って、合焦位置よりも遠距離側にある被写体OBJfを撮像したときには、図11に示すように、R成分の被写体像IMGrが右側にずれ、B成分の被写体像IMGbが左側にずれたボケ画像が形成され、このボケ画像におけるR成分とB成分の左右位置は、撮像素子22から見たときの帯域制限フィルタ12におけるR成分透過領域(RGフィルタ12r)とB成分透過領域(GBフィルタ12b)の左右位置と逆である。そして、被写体OBJfが合焦位置から遠距離側へ離れるほど、ボケが大きくなって、R成分の被写体像IMGrの重心位置とB成分の被写体像IMGbの重心位置との離間距離が大きくなることになる。なお、G成分の被写体像が、R成分の被写体像IMGrとB成分の被写体像IMGbとにまたがったボケ画像となる(図9、図10参照)のは、この遠距離側においても同様である。そして、遠距離側においても、G成分の被写体像IMGgは、帯域制限フィルタ12を使用しない場合のボケ画像と同じ情報になるために、上述した色画像生成部37が行うカラー化処理における標準画像として使用することが可能である。   On the other hand, when the subject OBJf is on the far side of the in-focus position, for example, the light emitted from one point on the subject OBJf causes a circular blur for the G component as shown in FIGS. A subject image IMGg is formed, a subject image IMGr that forms a semicircular blur of the right half is formed for the R component, and a subject image IMGb that forms a semicircular blur of the left half is formed for the B component. Therefore, when the subject OBJf that is farther than the in-focus position is imaged, as shown in FIG. 11, the blur component image in which the R component subject image IMGr is shifted to the right side and the B component subject image IMGb is shifted to the left side. The left and right positions of the R component and B component in this blurred image are the R component transmission region (RG filter 12r) and B component transmission region (GB filter 12b) of the band limiting filter 12 when viewed from the image sensor 22. It is the opposite of the left and right position As the subject OBJf moves away from the in-focus position, the blur increases, and the distance between the center of gravity of the R component subject image IMGr and the center of gravity of the B component subject image IMGb increases. Become. It is to be noted that the G component subject image becomes a blurred image straddling the R component subject image IMGr and the B component subject image IMGb (see FIGS. 9 and 10) as well on the far side. . On the far side, the G component subject image IMGg has the same information as the blurred image when the band limiting filter 12 is not used. Therefore, the standard image in the colorization process performed by the color image generation unit 37 described above. It can be used as

図1の説明に戻って、そこで色画像生成部37は、カラー化処理として、図2に示すようなベイヤー配列における画素数が最も多くかつ輝度信号に対する寄与が最も大きいG成分の画像を標準画像として、R成分の画像およびB成分の画像の各色ズレを補正する処理を、後で詳しく説明するように行うようになっている。このように、絞り11の開口全域の情報を取得可能なG色を基準として画像を生成することにより、観賞に耐え得る高品質な画像を得ることが可能となる。   Returning to the description of FIG. 1, the color image generation unit 37 performs, as a colorization process, a G component image having the largest number of pixels and the largest contribution to the luminance signal in the Bayer array as illustrated in FIG. 2 as a standard image. As described above, the process of correcting each color shift between the R component image and the B component image is performed as will be described in detail later. In this way, by generating an image based on the G color that can acquire information on the entire aperture of the diaphragm 11, it is possible to obtain a high-quality image that can withstand viewing.

ステレオ画像生成部40は、撮像素子22から取得された1枚の画像データに基づいて、後述する距離演算部39により演算された位相差量に基づき、第2の画像および第3の画像のボケの重心位置を第1の画像のボケの重心位置の方向へ移動させた一の片目用カラー画像(左目画像と右目画像との何れか一方)を生成するとともに、第1の画像および第3の画像のボケの重心位置を第2の画像のボケの重心位置の方向へ移動させた他の片目用カラー画像(左目画像と右目画像との何れか他方)を生成することにより、カラーの立体視画像を生成するものである。このステレオ画像生成部40の処理については、後で詳しく説明する。   The stereo image generation unit 40 is based on a single image data acquired from the image sensor 22, and based on a phase difference amount calculated by a distance calculation unit 39 described later, the second image and the third image are blurred. The one-eye color image (one of the left-eye image and the right-eye image) is generated by moving the center-of-gravity position in the direction of the center-of-gravity position of the blur of the first image, and the first image and the third image By generating another one-eye color image (one of the left-eye image and the right-eye image) in which the position of the center of gravity of the image is moved in the direction of the position of the center of gravity of the second image. An image is generated. The processing of the stereo image generation unit 40 will be described in detail later.

画像メモリ26は、高速な書き込みや読み出しが可能なメモリであり、例えばSDRAM(Synchronous Dynamic Random Access Memory)により構成されていて、画像処理用のワークエリアとして使用されるとともに、システムコントローラ30のワークエリアとしても使用される。例えば、画像メモリ26は、画像処理部25により処理された最終的な画像を記憶するだけでなく、画像処理部25による複数の処理過程における各中間画像も適宜記憶する。   The image memory 26 is a memory capable of high-speed writing and reading, and is constituted by, for example, an SDRAM (Synchronous Dynamic Random Access Memory). The image memory 26 is used as a work area for image processing and is also a work area of the system controller 30. Also used as For example, the image memory 26 not only stores the final image processed by the image processing unit 25 but also appropriately stores each intermediate image in a plurality of processing steps by the image processing unit 25.

表示部27は、LCD等を有して構成されていて、画像処理部25により表示用に処理された画像(記録媒体29から読み出されて画像処理部25により表示用に処理された画像も含む)を表示するものである。具体的には、この表示部27は、ライブビュー画像の表示、静止画像記録時の確認表示、記録媒体29から読み出した静止画像または動画像の再生表示、等を行う。また、本3D実施例1においては、表示部27は、立体視画像を表示可能に構成されているものとする。   The display unit 27 includes an LCD or the like, and an image processed for display by the image processing unit 25 (an image read from the recording medium 29 and processed for display by the image processing unit 25 is also included). Display). Specifically, the display unit 27 performs live view image display, confirmation display when recording a still image, reproduction display of a still image or a moving image read from the recording medium 29, and the like. In the 3D embodiment 1, the display unit 27 is configured to be able to display a stereoscopic image.

インターフェース(IF)28は、記録媒体29を着脱可能に接続するものであり、記録媒体29へ記録する情報の伝達、および記録媒体29から読み出した情報の伝達を行う。   The interface (IF) 28 is detachably connected to the recording medium 29, and transmits information to be recorded on the recording medium 29 and information read from the recording medium 29.

記録媒体29は、画像処理部25により記録用に処理された画像や、該画像に関連する各種データを記録するものであり、上述したように例えばメモリカード等として構成されている。   The recording medium 29 records an image processed for recording by the image processing unit 25 and various data related to the image, and is configured as a memory card or the like as described above.

センサ部31は、例えば、撮像装置のブレを検出するための加速度センサ等で構成される手振れセンサ、撮像素子22の温度を測定するための温度センサ、撮像装置周辺の明るさを測定するための明るさセンサ、等を含んでいる。このセンサ部31による検出結果はシステムコントローラ30に入力される。ここに、手振れセンサによる検出結果は撮像素子22やレンズ10を駆動して手振れ補正を行ったり、画像処理による手振れ補正を行ったりするために用いられる。また、温度センサによる検出結果は撮像駆動部24による駆動クロックの制御や撮像素子22から得られる画像中のノイズ量を推定するのに用いられる。さらに、明るさセンサによる検出結果は、例えば、周囲の明るさに応じて表示部27の輝度を適正に制御するために用いられる。   The sensor unit 31 is, for example, a camera shake sensor configured by an acceleration sensor or the like for detecting blur of the imaging device, a temperature sensor for measuring the temperature of the imaging device 22, and a brightness for measuring the brightness around the imaging device. Includes brightness sensor, etc. The detection result by the sensor unit 31 is input to the system controller 30. Here, the detection result by the camera shake sensor is used to drive the image pickup device 22 and the lens 10 to perform camera shake correction or to perform camera shake correction by image processing. The detection result by the temperature sensor is used to control the drive clock by the imaging drive unit 24 and to estimate the amount of noise in the image obtained from the image sensor 22. Furthermore, the detection result by the brightness sensor is used, for example, to appropriately control the luminance of the display unit 27 according to the ambient brightness.

操作部32は、撮像装置の電源をオン/オフするための電源スイッチ、静止画像や動画像等の撮像動作を指示入力するための2段式の押圧ボタンでなるレリーズボタン、撮像モード等を変更するためのモードボタン、選択項目や数値などを変更するのに用いられる十字キー、等を含んでいる。この操作部32の操作により発生した信号は、システムコントローラ30に入力される。   The operation unit 32 changes a power switch for turning on / off the power of the image pickup device, a release button including a two-stage press button for inputting an image pickup operation such as a still image or a moving image, an image pickup mode, and the like. Mode buttons, cross keys used to change selection items, numerical values, and the like. A signal generated by the operation of the operation unit 32 is input to the system controller 30.

ストロボ制御回路33は、システムコントローラ30の指令に基づいて、ストロボ34の発光量や発光タイミングを制御するものである。   The strobe control circuit 33 controls the light emission amount and the light emission timing of the strobe 34 based on a command from the system controller 30.

ストロボ34は、ストロボ制御回路33の制御により、被写体へ照明光を照射する発光源である。   The strobe 34 is a light source that emits illumination light to the subject under the control of the strobe control circuit 33.

ボディ側通信コネクタ35は、上述したように、レンズユニット1とボディユニット2とがレンズマウントにより結合されてレンズ側通信コネクタ15と接続されることにより、レンズ制御部14とシステムコントローラ30との間の通信を可能にするコネクタである。   As described above, the body side communication connector 35 is connected between the lens control unit 14 and the system controller 30 when the lens unit 1 and the body unit 2 are coupled by the lens mount and connected to the lens side communication connector 15. It is a connector that enables communication.

システムコントローラ30は、このボディユニット2の制御を行うとともに、レンズ制御部14を介してレンズユニット1の制御も行うものであり、この撮像装置を統合的に制御する制御部である。このシステムコントローラ30は、図示しないフラッシュメモリ等の不揮発性メモリから撮像装置の基本制御プログラムを読み出して、操作部32からの入力に応じて、撮像装置全体を制御するようになっている。   The system controller 30 controls the body unit 2 and also controls the lens unit 1 via the lens control unit 14, and is a control unit that integrally controls the imaging apparatus. The system controller 30 reads a basic control program of the image pickup apparatus from a non-illustrated non-volatile memory such as a flash memory, and controls the entire image pickup apparatus in accordance with an input from the operation unit 32.

例えば、システムコントローラ30は、レンズ制御部14を介して絞り11の絞り調整を制御したり、シャッタ21を制御して駆動したり、センサ部31の加速度センサによる検出結果に基づいて図示しない手振れ補正機構を制御駆動して手振れ補正を行ったり、等を行う。さらに、システムコントローラ30は、操作部32のモードボタンからの入力に応じて、撮像装置のモード設定(静止画像を撮像するための静止画モード、動画像を撮像するための動画モード、立体視画像を撮像するための3Dモード等の設定)を行うものとなっている。   For example, the system controller 30 controls the diaphragm adjustment of the diaphragm 11 via the lens control unit 14, controls and drives the shutter 21, and shake correction (not shown) based on the detection result by the acceleration sensor of the sensor unit 31. The mechanism is controlled to perform camera shake correction or the like. Further, the system controller 30 sets the mode setting of the imaging device (a still image mode for capturing a still image, a moving image mode for capturing a moving image, a stereoscopic image in response to an input from the mode button of the operation unit 32. 3D mode or the like for imaging).

さらに、システムコントローラ30は、コントラストAF制御部38と、距離演算部39とを備え、コントラストAF制御部38によりAF制御を行わせ、あるいは、距離演算部39により算出された距離情報に基づきレンズユニット1を制御してAFを行うものである。   Further, the system controller 30 includes a contrast AF control unit 38 and a distance calculation unit 39, and causes the contrast AF control unit 38 to perform AF control or based on the distance information calculated by the distance calculation unit 39. 1 is performed to perform AF.

コントラストAF制御部38は、画像処理部25から出力される画像信号(この画像信号は、輝度成分を含む割合が高いG画像であっても良いし、後述するカラー化処理により色ずれが補正された画像に係る輝度信号画像であっても構わない)からコントラスト値(AF評価値ともいう)を生成し、レンズ制御部14を介してレンズ10内のフォーカスレンズを制御するものである。すなわち、コントラストAF制御部38は、画像信号にフィルタ、例えばハイパスフィルタを作用させて高周波成分を抽出し、コントラスト値とする。そして、コントラストAF制御部38は、フォーカスレンズ位置を異ならせてコントラスト値を取得し、コントラスト値が大きくなる方向へフォーカスレンズを移動させて、さらにコントラスト値を取得する。このような処理を繰り返して行うことにより、最大のコントラスト値が得られるフォーカスレンズ位置(合焦位置)へフォーカスレンズを駆動するように制御するものである。   The contrast AF control unit 38 may output an image signal output from the image processing unit 25 (this image signal may be a G image having a high ratio including a luminance component, and color misregistration is corrected by a colorization process described later. A contrast value (also referred to as an AF evaluation value) is generated from the luminance signal image related to the image, and the focus lens in the lens 10 is controlled via the lens control unit 14. That is, the contrast AF control unit 38 extracts a high-frequency component by applying a filter, for example, a high-pass filter, to the image signal to obtain a contrast value. Then, the contrast AF control unit 38 acquires the contrast value by changing the focus lens position, moves the focus lens in the direction in which the contrast value increases, and further acquires the contrast value. By repeatedly performing such processing, control is performed so that the focus lens is driven to the focus lens position (focus position) at which the maximum contrast value is obtained.

次に、距離演算部39は、撮像素子22から得られた、第1の帯域の第1の画像と第2の帯域の第2の画像との位相差量を演算し、演算した位相差量に基づき、被写体までの距離を演算するものである。具体的には、距離演算部39は、図7、図10、図11等に示したようなR成分とB成分とのズレ量から、レンズの公式により距離情報を演算する。   Next, the distance calculation unit 39 calculates the phase difference amount between the first image in the first band and the second image in the second band obtained from the image sensor 22 and calculates the calculated phase difference amount. Based on the above, the distance to the subject is calculated. Specifically, the distance calculation unit 39 calculates distance information according to the lens formula from the amount of deviation between the R component and the B component as shown in FIG. 7, FIG. 10, FIG.

すなわち、距離演算部39は、撮像画像として得られたRGB各色の成分の内の、R成分とB成分とを抽出する。そして、R成分とB成分とに相関演算を行うことにより、R成分の画像とB成分の画像とに生じているズレの方向とズレの大きさとを算出する(ただしこれに限定されるものではなく、R画像とG画像との間、またはB画像とG画像との間に生じているズレの方向とズレの大きさとを算出することも不可能ではない)。   That is, the distance calculation unit 39 extracts the R component and the B component from the components of each of the RGB colors obtained as the captured image. Then, by calculating the correlation between the R component and the B component, the direction of the deviation and the magnitude of the deviation occurring in the R component image and the B component image are calculated (however, the present invention is not limited to this). In addition, it is not impossible to calculate the direction of displacement and the size of the displacement occurring between the R image and the G image or between the B image and the G image).

ここに、例えば図3に示したような帯域制限フィルタ12を用いる場合には、図5〜図11を参照して説明したように、被写体が合焦位置よりも近いか遠いかによって、画像におけるR成分とB成分のズレの方向が逆になる。従って、ズレの方向は、着目する被写体が合焦位置よりも近いか遠いかを判別するための情報となる。   Here, for example, when the band limiting filter 12 as shown in FIG. 3 is used, as described with reference to FIGS. 5 to 11, in the image, depending on whether the subject is closer or farther than the in-focus position. The direction of deviation between the R component and the B component is reversed. Therefore, the direction of deviation is information for determining whether the subject of interest is closer or farther than the in-focus position.

また、合焦位置から近距離側または遠距離側へ離れれば離れるほど、R成分とB成分のズレの大きさが大きくなる。従って、ズレの大きさは、着目する被写体が合焦位置からどの程度の距離だけ離れているかを判定するための情報となる。   Further, the larger the distance from the in-focus position to the short distance side or the far distance side, the larger the difference between the R component and the B component. Therefore, the magnitude of the deviation is information for determining how far the subject of interest is away from the in-focus position.

こうして、距離演算部39は、算出したズレの方向とズレの大きさとに基づいて、着目する被写体が、合焦位置よりも近い側または遠い側へ、どの程度の距離だけ離れているかを算出するようになっている。   In this way, the distance calculation unit 39 calculates how far the subject of interest is away to the side closer to or farther from the in-focus position based on the calculated direction of deviation and magnitude of deviation. It is like that.

距離演算部39は、操作部32からの入力に基づき、または撮像装置の基本制御プログラムに基づき、システムコントローラ30により決定された距離演算領域(例えば、撮像画像の全領域、あるいは撮像画像における距離情報を取得したい一部の領域)について、上述したような距離演算を行う。このような、ズレ量を取得して距離情報を演算する技術は、例えば上記特開2001−16611号公報に記載された技術を用いることができる。   The distance calculation unit 39 is based on an input from the operation unit 32 or based on a basic control program of the imaging apparatus, and a distance calculation area determined by the system controller 30 (for example, the entire area of the captured image or distance information in the captured image). The distance calculation as described above is performed for a part of the region where it is desired to acquire the image. For example, a technique described in Japanese Patent Application Laid-Open No. 2001-16611 can be used as the technique for calculating the distance information by acquiring the deviation amount.

距離演算部39により取得された距離情報は、例えばオートフォーカス(AF)に利用することができる。   The distance information acquired by the distance calculation unit 39 can be used, for example, for autofocus (AF).

すなわち、距離演算部39によりR成分とB成分のズレに基づく距離情報を取得し、取得した距離情報に基づきシステムコントローラ30がレンズ制御部14を介してレンズ10のフォーカスレンズを駆動するAF、すなわち位相差AFを行うことができる。これにより、1枚の撮像画像に基づいて、高速なAFが可能となる。   That is, the distance calculation unit 39 acquires distance information based on the difference between the R component and the B component, and the system controller 30 drives the focus lens of the lens 10 via the lens control unit 14 based on the acquired distance information, that is, AF. Phase difference AF can be performed. Thereby, high-speed AF is possible based on one captured image.

ただし、システムコントローラ30内には上述したように距離演算部39とコントラストAF制御部38とが設けられているために、AF制御を距離演算部39による算出結果に基づいて行っても良いが、コントラストAF制御部38により行っても構わない。   However, since the distance calculation unit 39 and the contrast AF control unit 38 are provided in the system controller 30 as described above, AF control may be performed based on the calculation result by the distance calculation unit 39. It may be performed by the contrast AF control unit 38.

ここに、コントラストAF制御部38によるコントラストAFは合焦精度が高い反面、複数枚の撮像画像が必要になるために、合焦速度が早いとはいえない課題がある。一方、距離演算部39による被写体距離の算出は、1枚の撮像画像に基づいて行うことができるために、合焦速度が早い反面、合焦精度はコントラストAFよりも劣ることがある。   Here, contrast AF by the contrast AF control unit 38 has high focusing accuracy, but requires a plurality of captured images, and thus there is a problem that the focusing speed cannot be said to be high. On the other hand, since the calculation of the subject distance by the distance calculation unit 39 can be performed based on one captured image, the focusing speed is fast, but the focusing accuracy may be inferior to the contrast AF.

そこで、コントラストAF制御部38内に設けられているAFアシスト制御部38aが、コントラストAF制御部38と距離演算部39とを組み合わせてAFを行わせるようにしても良い。すなわち、帯域制限フィルタ12を介して取得した画像のR成分とB成分のズレに基づく距離演算を、距離演算部39に行わせて、被写体が現在のフォーカス位置よりも遠距離側にあるのか、あるいは近距離側にあるのかを取得する。あるいはさらに、被写体が現在のフォーカス位置から離れている距離を取得する。次に、AFアシスト制御部38aは、取得した遠距離側または近距離側へ(取得した距離の分だけ)フォーカスレンズを駆動し、コントラストAFを行わせるようにコントラストAF制御部38を制御する。このような処理を行うことにより、早い合焦速度で高い合焦精度を得ることが可能となる。   Therefore, the AF assist control unit 38a provided in the contrast AF control unit 38 may perform AF by combining the contrast AF control unit 38 and the distance calculation unit 39. That is, the distance calculation unit 39 performs a distance calculation based on the deviation between the R component and the B component of the image acquired through the band limiting filter 12 to determine whether the subject is on the far side from the current focus position. Or it is acquired whether it exists in the short distance side. Alternatively, the distance that the subject is away from the current focus position is acquired. Next, the AF assist control unit 38a drives the focus lens toward the acquired long distance side or the short distance side (by the acquired distance), and controls the contrast AF control unit 38 to perform contrast AF. By performing such processing, it is possible to obtain high focusing accuracy at a fast focusing speed.

また、撮像素子22から得られたR画像とB画像とは、例えばステレオ立体視画像(3D画像)として用いることができる。   In addition, the R image and the B image obtained from the image sensor 22 can be used as, for example, a stereo stereoscopic image (3D image).

3D画像は、左側の瞳からの画像を左目で観察し、右側の瞳からの画像を右目で観察できれば良い。このような3D画像の観察方式として、従来よりアナグリフ方式が知られている(上述した特開平4−251239号公報も参照)。このアナグリフ方式は、一般に、赤色の左目画像と青色の右目画像とを生成して両方を表示し、左目側に赤色透過フィルタ、右目側に青色透過フィルタを配置したアナグリフ用の赤青メガネを用いてこの画像を観察することにより、モノクロの立体視画像を観察可能とする方式である。   The 3D image may be obtained by observing an image from the left pupil with the left eye and observing an image from the right pupil with the right eye. An anaglyph method is conventionally known as such a 3D image observation method (see also the above-mentioned Japanese Patent Laid-Open No. 4-251239). This anaglyph method generally uses red and blue glasses for anaglyphs that generate a red left-eye image and a blue right-eye image, display both, and arrange a red transmission filter on the left eye side and a blue transmission filter on the right eye side. By observing the lever image, a monochrome stereoscopic image can be observed.

そこで本3D実施例1においては、標準姿勢の撮像素子22から得られたR画像とB画像(色画像生成部37における、R成分とB成分の位置ズレを補正するカラー化処理を行わない画像)を、このアナグリフ方式の赤青メガネで観察すればそのまま立体視が可能となるように構成している。すなわち、図3を参照して説明したように、撮像装置を標準姿勢とすると、帯域制限フィルタ12のRGフィルタ12rが撮像素子22から被写体を見たときの左側に配置され、GBフィルタ12bが右側に配置されるように構成している。これにより赤青メガネをかければ、左側のRGフィルタ12rを透過したR成分光が左目のみにより観察され、右側のGBフィルタ12bを透過したB成分光が右目のみにより観察されて、立体視が可能となる。   Thus, in the present 3D embodiment 1, an R image and a B image obtained from the image sensor 22 in the standard posture (an image in which color processing for correcting the positional deviation between the R component and the B component in the color image generation unit 37 is not performed). ) Can be viewed as it is by observing with the anaglyph type red-blue glasses. That is, as described with reference to FIG. 3, when the imaging apparatus is in the standard posture, the RG filter 12r of the band limiting filter 12 is arranged on the left side when the subject is viewed from the imaging element 22, and the GB filter 12b is on the right side. It is comprised so that it may be arrange | positioned. Thus, when wearing red and blue glasses, the R component light transmitted through the left RG filter 12r is observed only by the left eye, and the B component light transmitted through the right GB filter 12b is observed only by the right eye, allowing stereoscopic viewing. It becomes.

また、本3D実施例1においては、上述したように、ステレオ画像生成部40により、アナグリフ方式ではない、カラーの立体視画像を生成することもできるようになっている。   In the 3D embodiment 1, as described above, the stereo image generation unit 40 can generate a color stereoscopic image that is not an anaglyph method.

次に、図12〜図15を参照して、帯域制限フィルタ12の変形例について説明する。   Next, modified examples of the band limiting filter 12 will be described with reference to FIGS.

まず、図12は帯域制限フィルタ12の第1の変形例を示す図である。   First, FIG. 12 is a diagram showing a first modification of the band limiting filter 12.

図12に示す帯域制限フィルタ12は、撮像光学系9の瞳領域が、第1の領域と第2の領域との間に第1の帯域制限および第2の帯域制限の両方を受ける撮影光束が通過する領域が挟まれる構成となっている。すなわち、図3に示した帯域制限フィルタ12は、撮像装置を標準姿勢にして撮像素子22から見たときに、左半分がRGフィルタ12r、右半分がGBフィルタ12bであった。これに対して、この図12に示す帯域制限フィルタ12は、左側のRGフィルタ12rと右側のGBフィルタ12bとの間に、G成分のみを通過させるGフィルタ12gを配置したものとなっている。   In the band limiting filter 12 shown in FIG. 12, the imaging light beam in which the pupil region of the imaging optical system 9 receives both the first band limitation and the second band limitation between the first region and the second region. It is configured such that a passing area is sandwiched. That is, the band limiting filter 12 shown in FIG. 3 is the RG filter 12r on the left half and the GB filter 12b on the right half when viewed from the image pickup device 22 with the image pickup apparatus in the standard posture. On the other hand, in the band limiting filter 12 shown in FIG. 12, a G filter 12g that allows only the G component to pass is disposed between the left RG filter 12r and the right GB filter 12b.

このような構成においても、撮像光学系9の絞り11の開口を通過する光に含まれるG成分が全て通過するのは図3の帯域制限フィルタ12と同様である。ただし、RGフィルタ12rとGBフィルタ12bとが離間して配置されているために、非合焦位置にある被写体の撮像素子22上における像の、R成分とB成分の位置ズレがより明瞭化されるために、距離演算部39による距離演算精度が向上する利点がある。従って、高い精度の距離情報を得たい場合には、この図12に示すような構成の帯域制限フィルタ12を用いると良い。   Even in such a configuration, all of the G component included in the light passing through the aperture of the diaphragm 11 of the imaging optical system 9 passes in the same way as the band limiting filter 12 in FIG. However, since the RG filter 12r and the GB filter 12b are arranged apart from each other, the positional deviation between the R component and the B component of the image of the subject at the out-of-focus position on the image sensor 22 is further clarified. Therefore, there is an advantage that the distance calculation accuracy by the distance calculation unit 39 is improved. Therefore, when it is desired to obtain distance information with high accuracy, it is preferable to use the band limiting filter 12 configured as shown in FIG.

また、図13は帯域制限フィルタ12の第2の変形例を示す図である。   FIG. 13 is a diagram showing a second modification of the band limiting filter 12.

この図13に示す帯域制限フィルタ12は、撮像光学系9の瞳領域が、第1の領域と第2の領域との間に帯域制限を受けない撮影光束が通過する領域が挟まれる構成となっている。すなわち、帯域制限フィルタ12は、左側のRGフィルタ12rと右側のGBフィルタ12bとの間に、RGB全色の成分(つまり、白色光W)を通過させるWフィルタ12wを配置したものとなっている。   The band limiting filter 12 shown in FIG. 13 has a configuration in which the pupil region of the imaging optical system 9 is sandwiched between the first region and the second region through which the imaging light flux that is not subjected to the band limitation passes. ing. In other words, the band limiting filter 12 is a filter in which a W filter 12w that passes components of all RGB colors (that is, white light W) is disposed between the left RG filter 12r and the right GB filter 12b. .

このような構成においても、撮像光学系9の絞り11の開口を通過する光に含まれるG成分が全て通過するのは図3の帯域制限フィルタ12と同様である。これに対して、R成分はRGフィルタ12rおよびWフィルタ12wを通過する一方で、GBフィルタ12bに遮断される。同様に、B成分はGBフィルタ12bおよびWフィルタ12wを通過する一方で、RGフィルタ12rに遮断される。   Even in such a configuration, all of the G component included in the light passing through the aperture of the diaphragm 11 of the imaging optical system 9 passes in the same way as the band limiting filter 12 in FIG. In contrast, the R component passes through the RG filter 12r and the W filter 12w, but is blocked by the GB filter 12b. Similarly, the B component passes through the GB filter 12b and the W filter 12w, but is blocked by the RG filter 12r.

このような構成によれば、Wフィルタ12wの部分についてはG成分のみでなく、R成分およびB成分も透過されるために、帯域制限フィルタ12を透過するR成分およびB成分の光量が増加し、明るい撮像画像を取得することができる利点がある(ただし、距離演算部39により算出される距離情報は精度が低下する可能性がある)。従って、距離情報としてはそれ程高い精度は必要でない場合に用いると、必要な効果を得られるとともに、例えば明るい高品位の3D画像を取得することが可能となる。   According to such a configuration, not only the G component but also the R component and the B component are transmitted through the portion of the W filter 12w, so that the light amounts of the R component and the B component that pass through the band limiting filter 12 increase. There is an advantage that a bright captured image can be acquired (however, the accuracy of the distance information calculated by the distance calculation unit 39 may be reduced). Accordingly, when the distance information is used when high accuracy is not necessary, a necessary effect can be obtained and, for example, a bright high-quality 3D image can be acquired.

さらに、図14は帯域制限フィルタ12の第3の変形例を示す図である。   Further, FIG. 14 is a diagram showing a third modification of the band limiting filter 12.

この図14に示す帯域制限フィルタ12は、第1の領域と第2の領域とが、撮像装置が標準姿勢であるときの上下方向位置および左右方向位置を異ならせて配置されたものとなっている。すなわち、帯域制限フィルタ12は、例えば円形をなすフィルタを十字状に4分割して、左下(グラフにおける第3象限)にRGフィルタ12r、右上(グラフにおける第1象限)にGBフィルタ12bを配置するとともに、左上(グラフにおける第2象限)に第1のGフィルタ12g1を、右下(グラフにおける第4象限)に第2のGフィルタ12g2を、それぞれ配置したものとなっている。   In the band limiting filter 12 shown in FIG. 14, the first region and the second region are arranged with different vertical and horizontal positions when the imaging apparatus is in the standard posture. Yes. That is, the band limiting filter 12 divides a circular filter into four crosses, for example, and arranges the RG filter 12r in the lower left (third quadrant in the graph) and the GB filter 12b in the upper right (first quadrant in the graph). In addition, the first G filter 12g1 is arranged in the upper left (second quadrant in the graph), and the second G filter 12g2 is arranged in the lower right (fourth quadrant in the graph).

なお、図14に示した帯域制限フィルタにより、取得される位相差の方向は斜め45度の方向の位相差である。この位相差情報を用いて、後の色画像生成部によりカラー化処理を行った後、ステレオ画像生成部においてステレオ画像生成を行う。その際、色画像生成部においてカラー化処理を行う場合には、通常の帯域制限フィルタ(図14に示した帯域制限フィルタ以外のフィルタ例)では水平方向の位相差を利用していたところを、斜め45度の位相差方向でカラー化処理を行う。そして、ステレオ画像生成部において、ステレオ画像生成処理を行う場合には、通常の水平方向の位相差を利用してステレオ画像の生成処理を行う(水平方向の位相差は、斜め45度の位相差の水平成分だけを抽出すれば、容易に取得可能である)。このようにすることで、帯域制限フィルタで取得される位相差が斜め方向の場合でも、人が見た上で自然な水平方向に位相差を持つステレオ画像を生成することが出来ることになる。   Note that the direction of the phase difference acquired by the band limiting filter shown in FIG. 14 is a phase difference of 45 degrees obliquely. Using this phase difference information, the subsequent color image generation unit performs colorization processing, and then the stereo image generation unit performs stereo image generation. At that time, when color processing is performed in the color image generation unit, a normal band limiting filter (filter example other than the band limiting filter shown in FIG. 14) uses a horizontal phase difference. Colorization processing is performed in a phase difference direction of 45 degrees obliquely. When the stereo image generation process is performed in the stereo image generation unit, a stereo image generation process is performed using a normal horizontal phase difference (the horizontal phase difference is a 45 ° diagonal phase difference). If only the horizontal component is extracted, it can be easily obtained). By doing in this way, even when the phase difference acquired by the band limiting filter is in an oblique direction, it is possible to generate a stereo image having a phase difference in a natural horizontal direction when viewed by a person.

上述した図3、図12、図13に示したような帯域制限フィルタ12の構成の場合には、垂直方向のエッジを有する被写体の距離情報取得は容易であるが、水平方向のエッジを有する被写体の距離情報取得は困難となる。これに対して、この図14に示したような帯域制限フィルタ12の構成を採用すれば、垂直方向のエッジを有する被写体と、水平方向のエッジを有する被写体と、の何れに対しても、距離情報を容易に取得することができる利点がある。このようにRGフィルタ12rとGBフィルタ12bの水平方向位置および垂直方向位置を異ならせることにより、距離情報取得における被写体エッジの方向依存性(特に、水平/垂直方向依存性)を改善することが可能となる。   In the case of the configuration of the band limiting filter 12 as shown in FIGS. 3, 12, and 13 described above, it is easy to obtain distance information of a subject having a vertical edge, but a subject having a horizontal edge. It becomes difficult to acquire distance information. On the other hand, if the configuration of the band limiting filter 12 as shown in FIG. 14 is adopted, the distance to both the subject having the vertical edge and the subject having the horizontal edge is determined. There is an advantage that information can be easily acquired. Thus, by making the horizontal position and the vertical position of the RG filter 12r and the GB filter 12b different, it is possible to improve the subject edge direction dependency (particularly, the horizontal / vertical direction dependency) in distance information acquisition. It becomes.

なお、帯域制限フィルタ12が図12〜図14等に示すように構成されている場合でも、R画像とB画像のズレ量の大きさや、後述するようなボケのPSFの形状が変化するだけであるために、下記に説明するような色画像生成部37におけるR成分とB成分の位置ズレを補正するカラー化処理を同様に適用して、色ズレの補正された画像を生成することができる。   Even when the band limiting filter 12 is configured as shown in FIG. 12 to FIG. 14 and the like, the amount of deviation between the R image and the B image and the shape of the blurred PSF as described later only change. Therefore, it is possible to generate an image with corrected color misalignment by similarly applying a colorization process for correcting the positional misalignment between the R component and the B component in the color image generating unit 37 as described below. .

続いて、図15は帯域制限フィルタ12の第4の変形例を示す図である。   Next, FIG. 15 is a diagram illustrating a fourth modification of the band limiting filter 12.

図3や図12〜図14に示した帯域制限フィルタ12は通常のカラーフィルタであったが、この図15に示す帯域制限フィルタ12は、色選択透過素子18により構成したものとなっている。   The band limiting filter 12 shown in FIGS. 3 and 12 to 14 is a normal color filter, but the band limiting filter 12 shown in FIG. 15 is configured by a color selective transmission element 18.

ここに、色選択透過素子18は、色(波長)に対応して偏光透過軸を回転可能な部材と、例えばLCDのような偏光透過軸の回転する/しないを選択制御可能な部材と、を複数組み合わせることにより実現された、色分布を変更可能な素子である。この色選択透過素子18は、具体例としては、西暦2000年4月にSID2000において「SID ’00 Digest, Vol. 31, p. 92」として開示されたようなカラーリンク社のカラースイッチが挙げられる。   Here, the color selective transmission element 18 includes a member capable of rotating the polarization transmission axis corresponding to the color (wavelength) and a member capable of selectively controlling whether the polarization transmission axis rotates or not, such as an LCD. This element is realized by combining a plurality of elements, and can change the color distribution. A specific example of the color selective transmission element 18 is a color switch manufactured by Colorlink as disclosed in SID2000 as “SID '00 Digest, Vol. 31, p. 92” in April 2000 AD. .

この色選択透過素子18は、撮像装置を標準姿勢(横位置)にして撮像素子22から見たときに、左半分が第1色選択透過素子18L、右半分が第2色選択透過素子18Rとして構成されている。ここに、第1色選択透過素子18Lは、G成分およびR成分を通過させB成分を遮断するRG状態と、RGB全成分(W)を通過させるW状態と、を選択的に取り得るようになっている。また、第2色選択透過素子18Rは、G成分およびB成分を通過させR成分を遮断するGB状態と、RGB全成分(W)を通過させるW状態と、を選択的に取り得るようになっている。これら第1色選択透過素子18Lと第2色選択透過素子18Rとは、図示しない色選択駆動部により各独立に駆動されるようになっていて、第1色選択透過素子18LにRG状態を取らせ、かつ第2色選択透過素子18RにGB状態を取らせることにより、図3に示した帯域制限フィルタ12と同様の機能を果たすことができる。   The color selective transmission element 18 has the left half as the first color selection transmission element 18L and the right half as the second color selection transmission element 18R when viewed from the imaging element 22 with the imaging apparatus in the standard posture (lateral position). It is configured. Here, the first color selective transmission element 18L can selectively take an RG state that passes the G component and the R component and blocks the B component, and a W state that passes all the RGB components (W). It has become. Further, the second color selective transmission element 18R can selectively take a GB state in which the G component and the B component are allowed to pass and an R component is blocked, and a W state in which all the RGB components (W) are allowed to pass. ing. The first color selection / transmission element 18L and the second color selection / transmission element 18R are independently driven by a color selection drive unit (not shown), and the first color selection / transmission element 18L is set in the RG state. In addition, by causing the second color selective transmission element 18R to assume the GB state, the same function as the band limiting filter 12 shown in FIG. 3 can be achieved.

さらに、構成を別のものに変更すれば、色選択透過素子18が図12〜図14に示した帯域制限フィルタ12と同様の機能を果たすようにすることも可能であるし、さらに他の構成の帯域制限フィルタ12を構成することもできる。   Furthermore, if the configuration is changed to another configuration, the color selective transmission element 18 can perform the same function as the band limiting filter 12 shown in FIGS. The band limiting filter 12 can also be configured.

次に、色画像生成部37において行われる、各色画像同士のずれ(色ズレ)を補正するためのカラー化処理について説明する。
[2D実施例1]
Next, a colorization process for correcting a shift (color shift) between the color images performed in the color image generation unit 37 will be described.
[2D Example 1]

まず、図16〜図24は、カラー化処理の2D実施例1を示す図である。   First, FIGS. 16-24 is a figure which shows 2D Example 1 of a colorization process.

図3に示した帯域制限フィルタ12を用いて、合焦位置よりも遠距離側にある被写体を撮影したときには図7に示すようなボケが形成され、合焦位置よりも近距離側にある被写体を撮影したときには図10に示すようなボケが形成される。   When the subject on the far side from the in-focus position is photographed using the band limiting filter 12 shown in FIG. 3, a blur as shown in FIG. 7 is formed, and the subject is in the near side from the in-focus position. As shown in FIG. 10, a blur is formed.

カラー化処理は、これら図7または図10に示したような形状のボケを、図16に示すような形状のボケに補正するための処理である。ここに、図16は、カラー化処理後のボケ形状の概要を示す図である。   The colorization process is a process for correcting the blur having the shape shown in FIG. 7 or 10 to the blur having the shape shown in FIG. FIG. 16 is a diagram showing an outline of the blurred shape after the colorization process.

以下では、説明を簡単にするために、被写体が合焦位置よりも遠距離側にある場合(図10に示す場合)を例に挙げて説明するが、被写体が合焦位置よりも近距離側にある場合には、図7を図10と比較すれば分かるように、R画像のボケとB画像のボケの形状や位置が左右反対になるだけであるために、以下の処理を適宜変更すれば同様に適用することが可能である。   In the following, in order to simplify the description, the case where the subject is on the far side from the in-focus position (in the case shown in FIG. 10) will be described as an example, but the subject is closer to the in-focus side than the in-focus position. In this case, as can be seen by comparing FIG. 7 with FIG. 10, the shape and position of the blur of the R image and the blur of the B image are just opposite to each other. It is possible to apply similarly.

図17は2D実施例1のカラー化処理において合焦位置よりも遠距離側にある被写体のR画像に対して適用されるR用フィルタの形状を示す図、図18は2D実施例1のカラー化処理において合焦位置よりも遠距離側にある被写体のB画像に対して適用されるB用フィルタの形状を示す図である。   FIG. 17 is a diagram showing the shape of the R filter applied to the R image of the subject that is farther than the in-focus position in the colorization processing of the 2D embodiment 1, and FIG. 18 is the color of the 2D embodiment 1. It is a figure which shows the shape of the filter for B applied with respect to the to-be-photographed object's B image in the far side rather than a focus position in a conversion process.

このカラー化処理は、色ズレの補正およびボケ形状の補正を、フィルタリング処理(フィルタカーネルを画像に畳み込み演算する処理)により行うものとなっている。すなわち、R画像に対してR用のフィルタリング処理を行うことにより、R画像のボケの形状および重心位置を、標準画像であるG画像のボケの形状および重心位置に近似させるとともに、B画像に対してB用のフィルタリング処理を行うことにより、B画像のボケの形状および重心位置を、標準画像であるG画像のボケの形状および重心位置に近似させる処理となっている。ここに、重心位置を近似させるのは色ズレを補正するためであり、ボケの形状を近似させるのは各色毎にボケの形状が異なるのを補正してカラー画像におけるボケを自然な形状のボケとするためである。   In this colorization process, the correction of color misregistration and the correction of the blurred shape are performed by a filtering process (a process of convolving a filter kernel with an image). That is, by performing R filtering processing on the R image, the blur shape and the gravity center position of the R image are approximated to the blur shape and the gravity center position of the G image that is the standard image, and the B image By performing the filtering process for B, the blur shape and the gravity center position of the B image are approximated to the blur shape and the gravity center position of the G image that is the standard image. Here, the center of gravity position is approximated to correct color misregistration, and the blur shape is approximated to correct the blur shape different for each color, and the blur in the color image is naturally blurred. This is because.

特に、ここでは、R画像およびB画像のボケの形状を、標準画像であるG画像のボケの形状に合わせているが、その理由としては、G画像のボケが円形状をしており自然なボケであること、G画像のボケの大きさがR画像およびB画像のボケの大きさよりも大きいために、R画像およびB画像のボケ形状をG画像のボケ形状に合わせる方が処理が容易であること、等が挙げられる。   In particular, here, the blur shape of the R image and the B image is matched with the blur shape of the G image, which is the standard image. The reason is that the blur of the G image has a circular shape. Since it is blur and the blur size of the G image is larger than the blur size of the R image and the B image, it is easier to process the blur shape of the R image and the B image with the blur shape of the G image. There are some things.

図17に示すR用フィルタカーネルは、R画像に畳み込み演算するためのものであり、ボケフィルタの一例としてガウシアンフィルタを配置したものとなっている。このR用フィルタカーネルは、ガウシアンフィルタのフィルタ係数のピーク(フィルタ係数の重心位置にほぼ対応する)が、カーネル中心の位置(カーネルの上下を2等分する横ラインChと、カーネルの左右を2等分する縦ラインでありG画像のボケ形状の重心を通る縦ラインCgとが交差する位置)から、Gの画像とRの画像の間の位相差分ずれた位置(横ラインChと、R画像のボケ形状の重心を通る縦ラインCrとが交差する位置)にあるフィルタ形状となっている。   The R filter kernel shown in FIG. 17 is used for performing a convolution operation on an R image, and a Gaussian filter is disposed as an example of a blur filter. In this R filter kernel, the peak of the filter coefficient of the Gaussian filter (corresponding approximately to the position of the center of gravity of the filter coefficient) is the position of the center of the kernel (the horizontal line Ch that divides the top and bottom of the kernel into two equal parts) and the left and right of the kernel. A position where the phase difference between the G image and the R image is shifted (a horizontal line Ch and the R image) from the vertical line that equally divides and the vertical line Cg passing through the center of gravity of the blurred shape of the G image. This is a filter shape at a position where the vertical line Cr passing through the center of gravity of the blurred shape intersects.

図18に示すB用フィルタカーネルは、B画像に畳み込み演算するためのものであり、R用フィルタカーネルと同様に、ボケフィルタの一例としてガウシアンフィルタを配置したものとなっている。このB用フィルタカーネルは、ガウシアンフィルタのフィルタ係数のピーク(フィルタ係数の重心位置にほぼ対応する)が、カーネル中心の位置(横ラインChと縦ラインCgとが交差する位置)から、Gの画像とBの画像の間の位相差分ずれた位置(横ラインChと、B画像のボケ形状の重心を通る縦ラインCbとが交差する位置)にあるフィルタ形状となっている。   The B filter kernel shown in FIG. 18 is for performing a convolution operation on the B image, and, like the R filter kernel, a Gaussian filter is arranged as an example of a blur filter. In the B filter kernel, the peak of the filter coefficient of the Gaussian filter (corresponding approximately to the position of the center of gravity of the filter coefficient) starts from the position of the center of the kernel (the position where the horizontal line Ch and the vertical line Cg intersect). The filter shape is at a position where the phase difference between the images B and B is shifted (a position where the horizontal line Ch intersects the vertical line Cb passing through the center of gravity of the blur shape of the B image).

このようなフィルタ形状のR用フィルタカーネルおよびB用フィルタカーネルをR画像およびB画像にそれぞれ作用させることにより、色ズレの補正と、ボケ形状の補正と、を同時に行うことが可能となっている。   By causing the R filter kernel and the B filter kernel having such a filter shape to act on the R image and the B image, respectively, it is possible to simultaneously perform color misalignment correction and blur shape correction. .

次に、図19および図20を参照して、カラー化処理の変形例を説明する。ここに、図19は2D実施例1の変形例のカラー化処理における合焦位置よりも遠距離側にある被写体のR画像およびB画像のシフトの様子を示す図、図20は2D実施例1の変形例のカラー化処理においてR画像およびB画像に対して適用されるフィルタの形状を示す図である。   Next, a modification of the colorization process will be described with reference to FIGS. 19 and 20. FIG. 19 is a diagram showing a shift state of the R image and the B image of the subject on the far side from the in-focus position in the colorization process of the modification of the 2D embodiment 1, and FIG. It is a figure which shows the shape of the filter applied with respect to R image and B image in the colorization process of the modified example.

この例のカラー化処理は、色ズレの補正を平行移動(シフト)により行い、ボケ形状の補正をフィルタリング処理により行うものとなっている。   In this example, the color processing is performed by correcting the color misregistration by parallel movement (shift) and correcting the blurred shape by the filtering processing.

すなわちまず、図10に示すR画像に対して位相差に応じたR用のシフト処理を行うことにより、図19に示すようにR画像の重心位置を標準画像であるG画像のボケの重心位置に近似させるとともに、図10に示すB画像に対して位相差に応じたB用のシフト処理を行うことにより、図19に示すようにB画像の重心位置を標準画像であるG画像の重心位置に近似させる。   That is, first, by performing an R shift process corresponding to the phase difference on the R image shown in FIG. 10, the center of gravity position of the R image becomes the center of gravity position of the blur of the G image that is the standard image as shown in FIG. 10 and performing the B shift processing corresponding to the phase difference on the B image shown in FIG. 10, the center of gravity of the B image is changed to the center of gravity of the G image as the standard image as shown in FIG. 19. To approximate.

その後に、R画像およびB画像に対して図20に示すような同一のフィルタリング処理を行うことにより、R画像およびB画像のボケの形状を、標準画像であるG画像のボケの形状に近似させるようになっている(図16参照)。   Thereafter, the same filtering process as shown in FIG. 20 is performed on the R image and the B image to approximate the blur shape of the R image and the B image to the blur shape of the G image that is the standard image. (See FIG. 16).

ここに、図20に示すフィルタカーネルは、R画像およびB画像に畳み込み演算するためのものであり、ボケフィルタの一例としてガウシアンフィルタを配置したものとなっている。このフィルタカーネルは、ガウシアンフィルタのフィルタ係数のピーク(フィルタ係数の重心位置に対応する)が、カーネル中心の位置(横ラインChと縦ラインCgとが交差する位置)にあるフィルタ形状となっている。   Here, the filter kernel shown in FIG. 20 is for performing a convolution operation on the R image and the B image, and a Gaussian filter is arranged as an example of the blur filter. This filter kernel has a filter shape in which the peak of the filter coefficient of the Gaussian filter (corresponding to the position of the center of gravity of the filter coefficient) is at the position of the kernel center (position where the horizontal line Ch and the vertical line Cg intersect). .

ただし、ここでは図3に示したような、第1の領域と第2の領域とが左右対称の帯域制限フィルタ12を想定しているために、R画像およびB画像に対して同一のフィルタリング処理を行っているが、第1の領域と第2の領域とが非対称である場合には、R画像とB画像とに対して異なるフィルタリング処理を行うようにしても良いことは勿論である。   However, since the band limiting filter 12 in which the first area and the second area are symmetric is assumed here as shown in FIG. 3, the same filtering process is applied to the R image and the B image. However, when the first region and the second region are asymmetric, it is needless to say that different filtering processes may be performed on the R image and the B image.

また、上述ではボケフィルタとしてガウシアンフィルタ(円型ガウシアンフィルタ)を例に挙げているが、勿論これに限定されるものではない。例えば図3に示したフィルタ形状の場合には、図7や図10に示したように、R画像およびB画像に発生するボケは縦方向の半月状(すなわち、円形よりも横方向に短い形状)となる。従って、横方向(より一般には、位相差が生じている方向)を長軸方向とする、図21や図22等に示すような楕円型ガウシアンフィルタを用いれば、より高精度にボケを円形状に近づける補正処理を行うことが可能となる。ここに、図21は2D実施例1において横方向の標準偏差を大きくした楕円型ガウシアンフィルタの形状を示す図、図22は2D実施例1において縦方向の標準偏差を小さくした楕円型ガウシアンフィルタの形状を示す図である。なお、図21および図22には図20に対応したフィルタカーネルの中心にフィルタ係数のピーク(フィルタ係数の重心位置に対応する)が位置する例を示したが、図17や図18に対応させる場合には、フィルタカーネルの中心からフィルタ係数のピーク(フィルタ係数の重心位置にほぼ対応する)をずらすことは勿論である。   In the above description, a Gaussian filter (circular Gaussian filter) is taken as an example of the blur filter, but the present invention is not limited to this. For example, in the case of the filter shape shown in FIG. 3, as shown in FIGS. 7 and 10, blurring generated in the R image and the B image has a half-moon shape in the vertical direction (that is, a shape shorter in the horizontal direction than in the circular shape). ) Therefore, if an elliptical Gaussian filter as shown in FIG. 21, FIG. 22 or the like having the horizontal direction (more generally, the direction in which the phase difference is generated) as the major axis direction is used, the blur is more accurately formed into a circular shape. It is possible to perform a correction process to approach FIG. 21 is a diagram showing the shape of an elliptical Gaussian filter having a large horizontal standard deviation in 2D Embodiment 1, and FIG. 22 is a diagram of the elliptical Gaussian filter having a small vertical standard deviation in 2D Embodiment 1. It is a figure which shows a shape. 21 and 22 show examples in which the peak of the filter coefficient (corresponding to the position of the center of gravity of the filter coefficient) is located at the center of the filter kernel corresponding to FIG. 20, but it corresponds to FIG. 17 and FIG. In this case, it goes without saying that the peak of the filter coefficient (which substantially corresponds to the position of the center of gravity of the filter coefficient) is shifted from the center of the filter kernel.

さらに、ボケフィルタは、円型ガウシアンフィルタや楕円型ガウシアンフィルタに限るものでないことも勿論であり、R画像やB画像のボケ形状を、G画像のボケ形状に近似することができるようなボケフィルタであれば、広く適用することが可能である。   Further, the blur filter is not limited to the circular Gaussian filter and the elliptical Gaussian filter, and the blur filter that can approximate the blur shape of the R image or the B image to the blur shape of the G image. If so, it can be widely applied.

次に、図23は、2D実施例1において色画像生成部37により行われるカラー化処理を示すフローチャートである。   Next, FIG. 23 is a flowchart illustrating the colorization processing performed by the color image generation unit 37 in the 2D embodiment 1.

(ステップS1)
この処理を開始すると、初期設定を行う。この初期設定においては、まず、処理対象のRGB画像(つまり、R画像、G画像、およびB画像)の読み込みを行う。次に、R画像のコピーであるRコピー画像と、B画像のコピーであるBコピー画像と、を作成する。
(Step S1)
When this process is started, initialization is performed. In this initial setting, first, an RGB image to be processed (that is, an R image, a G image, and a B image) is read. Next, an R copy image that is a copy of the R image and a B copy image that is a copy of the B image are created.

(ステップS2)
続いて、位相差検出を行うための注目画素を設定する。ここでは、注目画素を、R画像とB画像との内の何れか一方、ここでは例えばR画像に設定する。
(Step S2)
Subsequently, a target pixel for performing phase difference detection is set. Here, the target pixel is set to one of the R image and the B image, here, for example, the R image.

(ステップS3)
ステップS2で設定された注目画素に対する位相差を検出する。この位相差の検出は、注目画素を中心位置に含む部分領域をR画像に設定して基準画像とし、B画像に同一サイズの部分領域を設定して参照画像として(図26等参照)、参照画像の位置を位相差が発生している方向にずらしながら距離演算部39において基準画像と参照画像との間で相関演算を行い、最も相関値が高いと判定された参照画像と基準画像との間の位置ズレ量(なお、位置ズレ量の符号が位置ズレの方向の情報を与える)を位相差量とする。
(Step S3)
A phase difference with respect to the target pixel set in step S2 is detected. This phase difference is detected by setting a partial area including the target pixel at the center position as an R image as a reference image, and setting a partial area of the same size as a B image as a reference image (see FIG. 26, etc.) The distance calculation unit 39 performs a correlation calculation between the reference image and the reference image while shifting the position of the image in the direction in which the phase difference is generated, and the reference image determined to have the highest correlation value is compared with the reference image. The amount of misalignment between them (note that the sign of the misregistration amount gives information on the direction of misalignment) is the phase difference amount.

なお、部分領域は任意のサイズに設定することができるが、安定的に位相差を検出するためには縦横それぞれ30[ピクセル]以上の部分領域を利用することが好ましく、一例としては51×51[ピクセル]の領域が挙げられる。   The partial area can be set to an arbitrary size. However, in order to stably detect the phase difference, it is preferable to use partial areas of 30 [pixels] or more in the vertical and horizontal directions. As an example, 51 × 51 An area of [Pixel] is given.

そして、距離演算部39における相関演算は、具体的には、例えばZNCC演算、あるいは予めフィルタ処理が施された画像に対するSAD演算などの処理により行う。   The correlation calculation in the distance calculation unit 39 is specifically performed by a process such as a ZNCC calculation or an SAD calculation on an image that has been previously filtered.

まず、ZNCCによる相関演算は、以下の数式1に基づき行う。
[数1]

Figure 2013044806
ここに、IはR画像の部分領域、TはB画像の部分領域(Iと同一サイズの部分領域)、I(バー)はIの平均値、T(バー)はTの平均値、Mは部分領域の横幅[ピクセル]、Nは部分領域の縦幅[ピクセル]である。この数式1に基づきZNCC演算を行い、その結果の絶対値|RZNCC|を相関演算の結果として得られた相関値とする。 First, the correlation calculation by ZNCC is performed based on Equation 1 below.
[Equation 1]
Figure 2013044806
Here, I is a partial area of the R image, T is a partial area of the B image (partial area of the same size as I), I (bar) is an average value of I, T (bar) is an average value of T, and M is The horizontal width [pixel] of the partial area, and N is the vertical width [pixel] of the partial area. A ZNCC operation is performed based on Equation 1, and the absolute value | RZNCC | of the result is set as a correlation value obtained as a result of the correlation operation.

また、予めフィルタ処理が施された画像に対するSAD演算を行う場合は、はじめにR画像およびB画像に対してソーベルフィルタなどに代表される微分フィルタや、LOGフィルタなどのバンドパスフィルタなどのフィルタリング処理を施しておく。そしてその後に、以下の数式2に示すSAD演算により相関演算を行う。
[数2]

Figure 2013044806
ここに、I’はフィルタリング処理が施された後のR画像の部分領域、T’はフィルタリング処理が施された後のB画像の部分領域(I’と同一サイズの部分領域)、Mは部分領域の横幅[ピクセル]、Nは部分領域の縦幅[ピクセル]である。この場合には、RSADが相関演算の結果得られた相関値である。 In addition, when performing SAD calculation on an image that has been previously filtered, filtering processing such as a differential filter represented by a Sobel filter or a bandpass filter such as a LOG filter is first applied to the R image and the B image. Apply. After that, the correlation calculation is performed by the SAD calculation shown in the following formula 2.
[Equation 2]
Figure 2013044806
Here, I ′ is a partial region of the R image after the filtering process is performed, T ′ is a partial region of the B image after the filtering process is performed (partial region of the same size as I ′), and M is a partial region The horizontal width [pixel] of the area, and N is the vertical width [pixel] of the partial area. In this case, RSAD is a correlation value obtained as a result of the correlation calculation.

(ステップS4)
画像内における全ての注目画素に対する位相差検出処理が完了したか否かを判定する。そして、完了するまで、注目画素の位置をずらしながらステップS2およびステップS3の処理を繰り返して行う。ここに、画像内における全ての注目画素とは、画像内において位相差検出可能な全ての画素のことを指している。なお、位相差検出不可能な画素については、検出を行わないままとするか、あるいは周囲の注目画素の検出結果に基づいて補間等を行って位相差量を算出するかすれば良い。
(Step S4)
It is determined whether or not the phase difference detection processing for all the target pixels in the image is completed. Then, until the completion, the processing of step S2 and step S3 is repeated while shifting the position of the target pixel. Here, all the target pixels in the image indicate all pixels in the image that can detect the phase difference. It should be noted that pixels that cannot detect the phase difference may be left undetected, or the phase difference amount may be calculated by performing interpolation or the like based on the detection result of the surrounding pixel of interest.

(ステップS5)
次に、補正処理を行うための注目画素を、位相差量が求められた画素に対して設定する。ここに、注目画素の画素位置は、R画像とB画像とで同一の(つまり共通の)画素位置である。なお、以下では補正処理として、図17および図18を参照して説明したように、平行移動(シフト)を伴わないフィルタのみを用いたカラー化処理を行う場合について説明する。
(Step S5)
Next, the target pixel for performing the correction process is set for the pixel for which the phase difference amount is obtained. Here, the pixel position of the target pixel is the same (that is, common) pixel position in the R image and the B image. Hereinafter, as the correction process, as described with reference to FIGS. 17 and 18, a case will be described in which a colorization process using only a filter without translation (shift) is performed.

(ステップS6)
注目画素の位相差量に応じて、R画像にフィルタリング処理を行うためのR画像用フィルタの形状を取得する。ここに、位相差量とR画像用のフィルタ形状との関係は、例えば以下の表1に示すようなテーブルとして、撮像装置内に予め保持されている。この表1に示す例では、フィルタ形状を決定するのは、フィルタカーネルの大きさ、フィルタカーネル中心からのガウシアンフィルタのずれ、ガウシアンフィルタの標準偏差σ(この標準偏差σは、ボケフィルタのボケの広がり度合いを示している)である。従って、注目画素の位相差量に基づきテーブル参照を行うことにより、R画像用フィルタの形状を取得することができる。
[表1]

Figure 2013044806
(Step S6)
The shape of the R image filter for filtering the R image is acquired according to the phase difference amount of the target pixel. Here, the relationship between the phase difference amount and the filter shape for the R image is held in advance in the imaging apparatus as a table as shown in Table 1 below, for example. In the example shown in Table 1, the filter shape is determined by determining the size of the filter kernel, the deviation of the Gaussian filter from the center of the filter kernel, the standard deviation σ of the Gaussian filter (this standard deviation σ is the blur of the blur filter) It shows the degree of spread). Therefore, the shape of the R image filter can be acquired by referring to the table based on the phase difference amount of the target pixel.
[Table 1]
Figure 2013044806

(ステップS7)
次に、R画像における注目画素とその近傍の画素とでなる近傍領域に対してフィルタリング処理を行い、注目画素におけるフィルタ出力値を取得する。そして、取得したフィルタ出力値を、Rコピー画像の注目画素位置にコピーして、Rコピー画像を更新する。
(Step S7)
Next, a filtering process is performed on a neighboring region including the target pixel and its neighboring pixels in the R image, and a filter output value at the target pixel is acquired. Then, the acquired filter output value is copied to the target pixel position of the R copy image, and the R copy image is updated.

(ステップS8)
注目画素の位相差量に応じて、B画像にフィルタリング処理を行うためのB画像用フィルタの形状を取得する。ここに、位相差量とB画像用のフィルタ形状との関係は、例えば以下の表2に示すようなテーブルとして、撮像装置内に予め保持されている。この表2に示す例においても、フィルタ形状を決定するのは、フィルタカーネルの大きさ、フィルタカーネル中心からのガウシアンフィルタのずれ、ガウシアンフィルタの標準偏差σである。従って、注目画素の位相差量に基づきテーブル参照を行うことにより、B画像用フィルタの形状を取得することができる。
[表2]

Figure 2013044806
(Step S8)
The shape of the B image filter for performing filtering processing on the B image is acquired according to the phase difference amount of the target pixel. Here, the relationship between the phase difference amount and the filter shape for the B image is held in advance in the imaging apparatus as a table as shown in Table 2 below, for example. Also in the example shown in Table 2, the filter shape is determined by the size of the filter kernel, the deviation of the Gaussian filter from the center of the filter kernel, and the standard deviation σ of the Gaussian filter. Therefore, the shape of the B image filter can be acquired by referring to the table based on the phase difference amount of the target pixel.
[Table 2]
Figure 2013044806

(ステップS9)
次に、B画像における注目画素とその近傍の画素とでなる近傍領域に対してフィルタリング処理を行い、注目画素におけるフィルタ出力値を取得する。そして、取得したフィルタ出力値を、Bコピー画像の注目画素位置にコピーして、Bコピー画像を更新する。
(Step S9)
Next, a filtering process is performed on a neighboring region including the target pixel and its neighboring pixels in the B image, and a filter output value at the target pixel is acquired. Then, the acquired filter output value is copied to the target pixel position of the B copy image, and the B copy image is updated.

(ステップS10)
画像内における全ての注目画素に対するフィルタリング処理が完了したか否かを判定する。そして、処理が完了するまで、注目画素の位置をずらしながらステップS5〜S9の処理を繰り返して行う。
(Step S10)
It is determined whether or not the filtering process for all the target pixels in the image has been completed. Then, the processes in steps S5 to S9 are repeated while shifting the position of the target pixel until the process is completed.

こうして、全ての注目画素に対するフィルタリング処理が完了したと判定された場合には、Rコピー画像およびBコピー画像をR画像およびB画像に対する補正画像として出力し、このカラー化処理を終了する。   In this way, when it is determined that the filtering process for all the target pixels has been completed, the R copy image and the B copy image are output as corrected images for the R image and the B image, and the colorization process is ended.

なお、ステップS6やステップS8において、円型ガウシアンフィルタを用いるのに代えて、図21や図22等に示したような楕円型ガウシアンフィルタを用いる場合は、楕円形ガウシアンフィルタの標準偏差値をx方向とy方向とで別々に設定すると良いために、撮像装置内に保持するフィルタ形状に関するパラメータテーブルは、フィルタカーネル中心からのずれを除いて、例えば以下の表3に示すようになる。
[表3]

Figure 2013044806
In step S6 or step S8, instead of using the circular Gaussian filter, when using an elliptical Gaussian filter as shown in FIG. 21 or FIG. 22, the standard deviation value of the elliptical Gaussian filter is set to x. Since the direction and the y direction may be set separately, the parameter table relating to the filter shape held in the imaging apparatus is as shown in Table 3 below, for example, excluding the deviation from the filter kernel center.
[Table 3]
Figure 2013044806

ここに記載は省略したが、ステップS6において楕円型ガウシアンフィルタを用いる場合のフィルタカーネル中心からのずれは例えば表1と同様、ステップS8において楕円型ガウシアンフィルタを用いる場合のフィルタカーネル中心からのずれは例えば表2と同様とすれば良い。   Although not described here, the deviation from the filter kernel center when the elliptical Gaussian filter is used in step S6 is the deviation from the filter kernel center when the elliptical Gaussian filter is used in step S8, for example, as in Table 1. For example, it may be the same as in Table 2.

さらに、上述では表1や表2を参照して、テーブルを用いて位相差量に応じたフィルタの形状を取得する例を説明したが、これに限るものでもない。例えば、フィルタの形状を決定するための各パラメータと位相差量との対応関係を例えば数式等として保持しておいて、位相差量を数式に代入して、演算等によりフィルタの形状を決定するようにしても構わない。   Further, in the above description, an example in which the shape of the filter corresponding to the phase difference amount is acquired using the table with reference to Table 1 or Table 2 is not limited thereto. For example, the correspondence between each parameter for determining the filter shape and the phase difference amount is held as, for example, an equation, the phase difference amount is substituted into the equation, and the filter shape is determined by calculation or the like. It doesn't matter if you do.

なお、帯域制限フィルタ12を介して撮影した画像から位相差を検出する処理および色ズレを補正するカラー化処理は、必ずしも撮像装置という形態において行う必要はなく、撮像装置とは別途の画像処理装置41(例えば、画像処理プログラムを実行するコンピュータなど)において行うようにしても構わない。   Note that the processing for detecting the phase difference from the image captured through the band limiting filter 12 and the colorization processing for correcting the color misregistration do not necessarily have to be performed in the form of the imaging device, and the image processing device is separate from the imaging device. 41 (for example, a computer that executes an image processing program) may be performed.

図24は2D実施例1における画像処理装置41の構成を示すブロック図である。   FIG. 24 is a block diagram illustrating a configuration of the image processing apparatus 41 in the 2D embodiment 1.

この画像処理装置41は、図1に示した撮像装置のボディユニット2から、撮像機構に係る図示しないレンズマウント、シャッタ21、撮像素子22、撮像回路23、撮像駆動部24や、レンズユニット1のAF制御に係るコントラストAF制御部38(AFアシスト制御部38aを含む)、レンズユニット1との通信に係るボディ側通信コネクタ35、被写体の照明に係るストロボ制御回路33およびストロボ34、撮像装置の状態を取得するためのセンサ部31などを取り除き、インターフェース(IF)28から入力された情報を記録するための記録部42をさらに設けたものとなっている。この記録部42は、インターフェース28を介して入力し記録した情報を、画像処理部25へ出力するようになっている。なお、画像処理部25から記録部42へ情報を記録することも可能である。そして、記録部42は、インターフェース28とともに、システムコントローラ30A(コントラストAF制御部38を取り除いたことに伴い、システムコントローラの符号を30Aとしている)により制御されるようになっている。また、撮像に係るレリーズボタン等も不要であるために、操作部の符号を32Aとしている。   The image processing apparatus 41 includes, from the body unit 2 of the imaging apparatus illustrated in FIG. Contrast AF control unit 38 (including AF assist control unit 38a) related to AF control, body side communication connector 35 related to communication with the lens unit 1, strobe control circuit 33 and strobe 34 related to subject illumination, and state of the imaging device The sensor unit 31 for obtaining the information is removed, and a recording unit 42 for recording information input from the interface (IF) 28 is further provided. The recording unit 42 is configured to output information input and recorded via the interface 28 to the image processing unit 25. Information can be recorded from the image processing unit 25 to the recording unit 42. The recording unit 42 is controlled by the system controller 30A (the reference number of the system controller is 30A in accordance with the removal of the contrast AF control unit 38) together with the interface 28. In addition, since a release button and the like for imaging are not necessary, the reference numeral of the operation unit is 32A.

また、画像処理装置41における一連の処理は、例えば次のように行う。まず、帯域制限フィルタ12を備えた撮像装置を用いて、画像を撮影し、撮像回路23から出力されたままのRAW画像として記録媒体29に記録する。さらに、帯域制限フィルタ12の形状等に係る情報や、撮像光学系9のレンズデータ等も記録媒体29に併せて記録する。   In addition, a series of processing in the image processing apparatus 41 is performed as follows, for example. First, an image is captured using an imaging device including the band limiting filter 12 and is recorded on the recording medium 29 as a RAW image output from the imaging circuit 23. Further, information related to the shape of the band limiting filter 12, lens data of the imaging optical system 9, and the like are also recorded on the recording medium 29.

次に、この記録媒体29を画像処理装置41のインターフェース28に接続して、画像および各種情報を記録部42に記録する。記録が終了したら、記録媒体29はインターフェース28から取り外しても構わない。   Next, the recording medium 29 is connected to the interface 28 of the image processing apparatus 41, and an image and various types of information are recorded in the recording unit 42. When recording is completed, the recording medium 29 may be removed from the interface 28.

その後は、記録部42に記録されている画像および各種情報を読み出して、上述した撮像装置と同様にして、距離演算部39による位相差の演算を行ったり、色画像生成部37による色ズレを補正するカラー化処理を行ったり、後述するようなステレオ画像生成部40による立体視画像の生成処理を行ったりする。   Thereafter, the image and various types of information recorded in the recording unit 42 are read out, and the phase difference is calculated by the distance calculating unit 39 or the color shift by the color image generating unit 37 is performed in the same manner as the imaging device described above. Coloring processing to be corrected is performed, or stereoscopic image generation processing by the stereo image generation unit 40 as described later is performed.

こうして、画像処理装置41により処理されたカラー化後の画像や立体視画像は、再び記録部42に記録される。また、記録部42に記録されたカラー化後の画像や立体視画像は、表示部に表示されたり、インターフェース28を介して外部機器に送信されたりする。こうして、外部機器においては、カラー化後の画像や立体視画像を様々な用途に利用することができる。   Thus, the colorized image and the stereoscopic image processed by the image processing device 41 are recorded in the recording unit 42 again. Further, the colorized image and stereoscopic image recorded in the recording unit 42 are displayed on the display unit or transmitted to an external device via the interface 28. Thus, in the external device, the colorized image and the stereoscopic image can be used for various purposes.

このようなカラー化処理の2D実施例1によれば、ボケフィルタ自体を用いることにより、またはボケフィルタを用いる前に平行移動(シフト)することにより、R画像およびB画像の重心位置を、標準画像であるG画像の重心位置に近似させているために、色ずれが軽減された鑑賞用としてより好ましい画像を得ることができる。   According to the 2D embodiment 1 of such colorization processing, the barycentric positions of the R image and the B image can be determined by using the blur filter itself or by translating (shifting) it before using the blur filter. Since it is approximated to the position of the center of gravity of the G image, which is an image, it is possible to obtain a more preferable image for viewing with reduced color misregistration.

このときさらに、ボケフィルタにより、R画像およびB画像のボケ形状を、標準画像であるG画像のボケ形状に近似させているために、自然なボケ形状の、鑑賞用としてより好ましい画像を得ることができる。
[2D実施例2]
At this time, since the blur shape of the R image and the B image is approximated to the blur shape of the G image, which is the standard image, by the blur filter, a natural blur shape and a more preferable image for viewing are obtained. Can do.
[2D Example 2]

図25から図30はカラー化処理の2D実施例2を示したものであり、図25は2D実施例2において色画像生成部37により行われるカラー化処理の概要を示す図である。   25 to 30 show a 2D embodiment 2 of the colorization process, and FIG. 25 is a diagram showing an outline of the colorization process performed by the color image generation unit 37 in the 2D embodiment 2.

この2D実施例2において、上述の2D実施例1と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In this 2D embodiment 2, the same parts as those of the above-mentioned 2D embodiment 1 are denoted by the same reference numerals, description thereof will be omitted, and only different points will be mainly described.

本2D実施例は、色画像生成部37におけるカラー化処理を上述した2D実施例1とは異ならせたものとなっている。すなわち、上述した2D実施例1は、色ズレの補正を、ボケフィルタを用いて行っていたが、本2D実施例は画像のコピー加算処理により行うものとなっている。   In this 2D embodiment, the colorization processing in the color image generation unit 37 is different from the 2D embodiment 1 described above. That is, in the 2D embodiment 1 described above, correction of color misregistration is performed using a blur filter, but in the present 2D embodiment, image copy addition processing is performed.

図25を参照して、被写体が合焦位置よりも遠距離側にある場合の、本2D実施例におけるカラー化処理の概念を説明する。   With reference to FIG. 25, the concept of the colorization process in the present 2D embodiment when the subject is on the far side from the in-focus position will be described.

被写体が合焦位置よりも遠距離側にある場合には、図10に示したように、R画像のボケは、G画像のボケの左半分が欠けた形状であり、B画像のボケは、G画像のボケの右半分が欠けた形状である。   When the subject is on the far side from the in-focus position, as shown in FIG. 10, the blur of the R image has a shape in which the left half of the blur of the G image is missing, and the blur of the B image is The right half of the blur of the G image is missing.

そこで、図25に示すように、R画像のボケをG画像のボケに近似させるために、R画像のボケを、R画像のボケの欠損部分へコピー加算し、B画像のボケを、B画像のボケの欠損部分へコピー加算するようにしたものである。   Therefore, as shown in FIG. 25, in order to approximate the blur of the R image to the blur of the G image, the blur of the R image is copied and added to the missing portion of the blur of the R image, and the blur of the B image is changed to the B image. Copy addition is added to the missing part of the blur.

コピー加算する部分領域の形状は、R画像およびB画像におけるボケの欠損部分の各形状と合致することが望ましいが、ここでは処理を簡単にするために、矩形状(例えば正方形状)の領域としている。   It is desirable that the shape of the partial area to be copied and added matches the shape of the missing portion of the blur in the R image and the B image, but here, in order to simplify the processing, a rectangular (for example, square) area is used. Yes.

G画像における円形状をなすボケ拡散領域の中に、ボケ拡散部分領域G1と、ボケ拡散部分領域G2と、を示している。ここに、ボケ拡散部分領域G1とボケ拡散部分領域G2とは、G画像の円形状をなすボケ拡散領域の重心を通る縦ラインCgに対して左右対称の位置に、同一の大きさとして配置されている。また、部分領域G1,G2の大きさは、色ズレ補正の機能を果たすことを考慮すると、円形状をなすボケ拡散領域の半径程度の大きさであることが望ましい。   The blur diffusion partial region G1 and the blur diffusion partial region G2 are shown in the circular blur diffusion region in the G image. Here, the blur diffusion partial region G1 and the blur diffusion partial region G2 are arranged in the same size at positions symmetrical to the vertical line Cg passing through the center of gravity of the blur diffusion region forming the circular shape of the G image. ing. In addition, the sizes of the partial areas G1 and G2 are preferably about the size of the radius of the circular blur diffusion area in consideration of fulfilling the function of color misregistration correction.

一方、R画像に対して示したボケ拡散部分領域R1は、ボケ拡散部分領域G2と同じ大きさで同一位置の領域である。そして、R画像のボケ拡散領域には、ボケ拡散部分領域G1と同じ大きさで同一位置のボケ拡散部分領域R2が不足している。   On the other hand, the blur diffusion partial region R1 shown for the R image is a region having the same size and the same size as the blur diffusion partial region G2. In the blur diffusion region of the R image, the blur diffusion partial region R2 having the same size and the same position as the blur diffusion partial region G1 is insufficient.

同様に、B画像に対して示したボケ拡散部分領域B1は、ボケ拡散部分領域G1と同じ大きさで同一位置の領域である。そして、B画像のボケ拡散領域には、ボケ拡散部分領域G2と同じ大きさで同一位置のボケ拡散部分領域B2が不足している。   Similarly, the blur diffusion partial region B1 shown for the B image is a region having the same size and the same size as the blur diffusion partial region G1. The blur diffusion region B2 of the B image lacks the blur diffusion partial region B2 having the same size and the same position as the blur diffusion partial region G2.

そこで、R画像のボケ拡散部分領域R1を、ボケ拡散部分領域G2を移動させたときにボケ拡散部分領域G1に完全に重なる移動量(例えば、円形状をなすボケ拡散領域の半径程度の移動量になると考えられる)だけ移動させて、(後述するように、R画像のコピーであるRコピー画像に対して)コピー加算することにより、R画像のボケ拡散部分領域R2を生成する。このボケ拡散部分領域R2は、G画像のボケ拡散部分領域G1(あるいはB画像のボケ拡散部分領域B1)に相当する領域となる。   Therefore, a movement amount that completely overlaps the blur diffusion partial region G1 when the blur diffusion partial region G2 is moved in the blur diffusion partial region R1 of the R image (for example, a movement amount about the radius of the circular blur diffusion region G1). The blur diffused partial area R2 of the R image is generated by moving and moving the image (to an R copy image that is a copy of the R image, as will be described later). The blur diffusion partial region R2 is a region corresponding to the blur diffusion partial region G1 of the G image (or the blur diffusion partial region B1 of the B image).

同様に、B画像のボケ拡散部分領域B1を、ボケ拡散部分領域G1を移動させたときにボケ拡散部分領域G2に完全に重なる移動量(同上)だけ移動させて、(後述するように、B画像のコピーであるBコピー画像に対して)コピー加算することにより、B画像のボケ拡散部分領域B2を生成する。このボケ拡散部分領域B2は、G画像のボケ拡散部分領域G2(あるいはR画像のボケ拡散部分領域R1)に相当する領域となる。   Similarly, the blur diffusion partial region B1 of the B image is moved by a movement amount (same as above) that completely overlaps the blur diffusion partial region G2 when the blur diffusion partial region G1 is moved (as will be described later, B The blur diffusion partial area B2 of the B image is generated by performing the copy addition (to the B copy image which is a copy of the image). This blur diffusion partial area B2 is an area corresponding to the blur diffusion partial area G2 of the G image (or the blur diffusion partial area R1 of the R image).

このような処理により、R画像およびB画像においてそれぞれ不足しているボケ拡散部分領域を補うことができ、その結果としてG画像、R画像、B画像のボケ拡散領域を近似させることができる。そして、これにより、R画像のボケ拡散領域の重心はG画像のボケ拡散領域の重心に近接し、B画像のボケ拡散領域の重心はG画像のボケ拡散領域の重心に近接することになる。   By such processing, it is possible to compensate for the blur diffusion partial region that is lacking in each of the R image and the B image, and as a result, it is possible to approximate the blur diffusion regions of the G image, the R image, and the B image. Thus, the center of gravity of the blur diffusion region of the R image is close to the center of gravity of the blur diffusion region of the G image, and the center of gravity of the blur diffusion region of the B image is close to the center of gravity of the blur diffusion region of the G image.

このような処理を、R画像およびB画像の全体に対して行うことにより、色ずれが補正されたカラー画像を得ることができる。   By performing such processing on the entire R image and B image, a color image with corrected color misregistration can be obtained.

次に、図26は2D実施例2において位相差検出を行う際にR画像およびB画像に設定する部分領域を示す図、図27は2D実施例2においてオリジナルR画像のボケ拡散部分領域をRコピー画像にコピー加算する様子を示す図、図28は2D実施例2においてオリジナルB画像のボケ拡散部分領域をBコピー画像にコピー加算する様子を示す図、図29は2D実施例2において位相差量に応じてボケ拡散部分領域のサイズを変更する例を示す線図、図30は2D実施例2において色画像生成部37により行われるカラー化処理を示すフローチャートである。図26〜図29を適宜参照しながら、図30に沿って説明する。   Next, FIG. 26 is a diagram illustrating a partial region set in the R image and the B image when performing phase difference detection in the 2D embodiment 2, and FIG. FIG. 28 is a diagram showing a state of adding a copy to a copy image, FIG. 28 is a diagram showing a state of copying and adding a blur diffusion partial area of an original B image to a B copy image in 2D Example 2, and FIG. FIG. 30 is a flowchart illustrating a colorization process performed by the color image generation unit 37 in the 2D embodiment 2 in accordance with an example of changing the size of the blur diffusion partial area according to the amount. It demonstrates along FIG. 30, referring FIG. 26-FIG. 29 suitably.

(ステップS21)
この処理を開始すると、初期設定を行う。この初期設定においては、まず、処理対象のRGB画像(つまり、R画像、G画像、およびB画像)の読み込みを行う。ここで、入力画像がベイヤー画像である場合には、事前に画像処理部25においてデモザイキング処理を行っておくものとする。
(Step S21)
When this process is started, initialization is performed. In this initial setting, first, an RGB image to be processed (that is, an R image, a G image, and a B image) is read. Here, when the input image is a Bayer image, it is assumed that the demosaicing process is performed in advance in the image processing unit 25.

次に、R画像とB画像との位相差を補正するのに、R画像およびB画像自体を使用するのに代えて、色差Cr,Cbを用いることにする。これは、一般的な被写体においては、RGB画像よりも色差画像の方が画素値の変動が滑らかであるために、補正処理を安定して行うことができる利点があるためである(ただし、R画像およびB画像をそのまま用いても構わない。この場合には以下の処理において、Cr→R,Cb→Bの読み替えを行えば良い)。   Next, in order to correct the phase difference between the R image and the B image, color differences Cr and Cb are used instead of using the R image and the B image itself. This is because a general subject has an advantage that the correction process can be performed stably because the variation of the pixel value is smoother in the color difference image than in the RGB image (however, R The image and the B image may be used as they are.In this case, in the following processing, the reading of Cr → R and Cb → B may be performed).

すなわち、例えば下記の数式3に基づき、R画像とG画像との色差量を計算して色差画像であるCr画像を生成するとともに、B画像とG画像との色差量を計算して色差画像であるCb画像を生成する。
[数3]
Cr=R−G
Cb=B−G
That is, for example, based on the following Equation 3, the color difference amount between the R image and the G image is calculated to generate a Cr image that is a color difference image, and the color difference amount between the B image and the G image is calculated to calculate the color difference image. A certain Cb image is generated.
[Equation 3]
Cr = R-G
Cb = BG

なお、RGB信号から色差信号Cr,Cb(および輝度信号Y)を算出するその他の演算方法としては、
[数4]
Y = 0.29900R+0.58700G+0.11400B
Cr= 0.50000R−0.41869G−0.08131B
Cb=−0.16874R−0.33126G+0.50000B
が広く知られているために、数式3に代えて、数式4を用いても構わない。
As other calculation methods for calculating the color difference signals Cr and Cb (and the luminance signal Y) from the RGB signals,
[Equation 4]
Y = 0.29900R + 0.58700G + 0.11400B
Cr = 0.50000R-0.41869G-0.0811B
Cb = −0.16874R−0.33126G + 0.50000B
Is widely known, instead of Equation 3, Equation 4 may be used.

次に、オリジナルのCr画像Cr0のコピー画像であるCrコピー画像Cr1(図27参照)と、オリジナルのCb画像Cb0のコピー画像であるCbコピー画像Cb1(図28参照)と、を作成する。さらに、Crコピー画像Cr1およびCbコピー画像Cb1と同一サイズの、Crカウント画像およびCbカウント画像を生成する(ここに、これらのカウント画像は、画素値の初期値を、全画素について1としておく)。   Next, a Cr copy image Cr1 (see FIG. 27) which is a copy image of the original Cr image Cr0 and a Cb copy image Cb1 (see FIG. 28) which is a copy image of the original Cb image Cb0 are created. Further, a Cr count image and a Cb count image having the same size as the Cr copy image Cr1 and the Cb copy image Cb1 are generated (here, in these count images, the initial value of the pixel value is set to 1 for all pixels). .

(ステップS22)
続いて、位相差検出を行うための部分領域を設定する。ここでは、部分領域を、R画像とB画像との内の何れか一方、ここでは例えばR画像に設定する。
(Step S22)
Subsequently, a partial region for performing phase difference detection is set. Here, the partial area is set to one of the R image and the B image, here, for example, the R image.

(ステップS23)
ステップS22で設定された部分領域に対する位相差を検出する。この位相差の検出は、R画像に設定した部分領域を基準画像とし、B画像における基準画像と同一サイズの部分領域を参照画像として、上述したステップS3と同様の処理を図26に示すように行うことにより、R画像とB画像の間で位相差検出を行う。
(Step S23)
A phase difference with respect to the partial region set in step S22 is detected. This phase difference is detected by using the partial area set in the R image as a standard image and the partial area of the B image having the same size as the standard image as a reference image as shown in FIG. By doing so, phase difference detection is performed between the R image and the B image.

(ステップS24)
ステップS23の処理により得られた位相差量に基づいて、G画像の円形ボケの半径(または、R画像およびB画像の半円ボケの半径ということもできる)を取得する。ここに、位相差量とG画像のボケ半径との関係は、テーブルや数式等として撮像装置内に予め保持されている。従って、位相差量に基づいて、テーブル参照したり、数式を用いた演算を行ったりすることにより、ボケ半径を取得することができる。なお、このステップS24の処理を省略して、ステップS23において取得した位相差量をボケ半径に代えて用いる簡易的な方法を適用しても構わない。この場合には、位相差量とボケ半径との関係を撮像装置内に予め保持しておく必要はない。
(Step S24)
Based on the phase difference amount obtained by the process of step S23, the radius of the circular blur of the G image (or the radius of the semicircular blur of the R image and the B image) is acquired. Here, the relationship between the phase difference amount and the blur radius of the G image is held in advance in the imaging apparatus as a table, a mathematical expression, or the like. Therefore, the blur radius can be acquired by referring to a table or performing a calculation using a mathematical formula based on the phase difference amount. Note that the process of step S24 may be omitted, and a simple method using the phase difference amount acquired in step S23 in place of the blur radius may be applied. In this case, the relationship between the phase difference amount and the blur radius need not be held in the imaging apparatus in advance.

(ステップS25)
次に、オリジナルのCr画像Cr0から部分領域を読み出して、ステップS23で検出した位相差量に応じた所定量だけずらしてから、Crコピー画像Cr1にコピー加算する。ここに、部分領域をずらす所定量は、ずらす方向も含む量であり、その大きさは例えばステップS24において取得したボケ半径とする。上述したステップS21においてCrコピー画像Cr1を作成したのは、コピー加算により画素値が変化しているCrコピー画像Cr1とは別に、オリジナルのCr画像Cr0を保持しておく必要があるためである(Cbコピー画像Cb1についても同様)。ただし、部分領域を例えばラスタスキャンの順序でシーケンシャルに処理する代わりに、並列動作により処理する場合などには、コピー画像を用意する必要は必ずしもない。
(Step S25)
Next, a partial region is read from the original Cr image Cr0, shifted by a predetermined amount corresponding to the phase difference detected in step S23, and then copied and added to the Cr copy image Cr1. Here, the predetermined amount for shifting the partial area is an amount including the shifting direction, and the size thereof is, for example, the blur radius acquired in step S24. The reason why the Cr copy image Cr1 is created in the above-described step S21 is that it is necessary to hold the original Cr image Cr0 separately from the Cr copy image Cr1 whose pixel value is changed by copy addition ( The same applies to the Cb copy image Cb1). However, it is not always necessary to prepare a copy image when, for example, partial areas are processed in parallel operation instead of sequentially processing in the order of raster scanning.

(ステップS26)
続いて、Crカウント画像の「ステップS25においてコピー加算処理を行った位置」の領域に、加算された回数が分かるように+1を加算する。このCrカウント画像は、後段のステップS30において、画素値の正規化処理を行うために利用する。
(Step S26)
Subsequently, +1 is added to the area of “the position where the copy addition process was performed in step S25” of the Cr count image so that the number of times of addition can be understood. This Cr count image is used to perform pixel value normalization processing in the subsequent step S30.

(ステップS27)
また、オリジナルのCb画像Cb0における「ステップS25においてCrコピー画像Cr1にコピーした位置」と同一の位置から部分領域を読み出して、Cbコピー画像Cb1の「ステップS25においてオリジナルのCr画像Cr0からコピー元のデータを取得した位置」にコピー加算する。これにより、Cb画像をずらす所定量は、Cr画像をずらす所定量と絶対値が同じで向きが逆となる。
(Step S27)
Further, the partial area is read from the same position as “the position copied to the Cr copy image Cr1 in step S25” in the original Cb image Cb0, and the copy source from the original Cr image Cr0 in “step S25” of the Cb copy image Cb1. A copy is added to “the position from which data was acquired”. Thus, the predetermined amount for shifting the Cb image has the same absolute value as the predetermined amount for shifting the Cr image, but the direction is reversed.

(ステップS28)
そして、Cbカウント画像の「ステップS25においてオリジナルのCr画像Cr0からコピー元のデータを取得した位置」(つまり、ステップS27においてコピー加算処理を行った位置)の領域に、加算された回数が分かるように+1を加算する。このCbカウント画像も、後段のステップS30において、画素値の正規化処理を行うために利用する。
(Step S28)
Then, the number of times of addition can be seen in the region of “the position where the copy source data was acquired from the original Cr image Cr0 in step S25” (that is, the position where the copy addition process was performed in step S27) of the Cb count image. Add +1 to. This Cb count image is also used to perform pixel value normalization processing in the subsequent step S30.

なお、上述したステップS25やステップS27においては、コピー加算処理を画像の部分領域毎に行っているが、この部分領域は、ステップS23において位相差検出処理を行った部分領域と同一であっても良い一方で、位相差検出処理とは異なる大きさの部分領域としても構わない。   In step S25 and step S27 described above, the copy addition process is performed for each partial area of the image, but this partial area may be the same as the partial area for which the phase difference detection process was performed in step S23. On the other hand, it may be a partial area having a size different from that of the phase difference detection process.

また、コピー加算処理に用いる部分領域の大きさは、画像全体で一定(すなわち、グローバルな大きさ)としても構わないが、画像内に設定する各部分領域毎に異ならせても(すなわち、ローカルな大きさとしても)良い。   In addition, the size of the partial area used for the copy addition process may be constant for the entire image (that is, global size), but may be different for each partial area set in the image (that is, local size). (Even if it is a big size).

例えば、ステップS25〜S28で用いる部分領域の大きさを、ステップS23において検出された位相差量に応じて、図29に示すように変化させても良い。   For example, the size of the partial region used in steps S25 to S28 may be changed as shown in FIG. 29 according to the phase difference amount detected in step S23.

この図29に示す例では、位相差量が0である場合に、部分領域の縦サイズおよび横サイズは共に1となり、部分領域は1画素となる。なお、この場合には、位相差量が0であるために上述したコピー加算処理も行わないことになり、実質的に何の処理も行わないことになる。従って、位相差量が0であるか否かに応じて処理を分岐させて、位相差量が0であるときには何の処理も行わないようにしても良い。   In the example shown in FIG. 29, when the phase difference amount is 0, the vertical size and the horizontal size of the partial region are both 1, and the partial region is 1 pixel. In this case, since the phase difference amount is 0, the above-described copy addition process is not performed, and no process is substantially performed. Therefore, the processing may be branched depending on whether or not the phase difference amount is 0, and no processing may be performed when the phase difference amount is 0.

また、図29に示す例では、位相差量に比例して、部分領域の大きさが大きくなるように構成されている。このときの直線の傾きは、光学系の構成に応じて適切に設定することになるために、図29には具体的なスケールを示していない。   In the example shown in FIG. 29, the size of the partial area is increased in proportion to the phase difference amount. Since the inclination of the straight line at this time is appropriately set according to the configuration of the optical system, a specific scale is not shown in FIG.

なお、図29には、位相差量と部分領域の大きさとの関係が比例関係となる例を示しているが、勿論、比例関係とするに限るものではなく、例えば主観的な画質の評価に応じて位相差量に対する部分領域の大きさが適切となるように設計しても良い。   Note that FIG. 29 shows an example in which the relationship between the phase difference amount and the size of the partial area is proportional, but of course, the relationship is not limited to the proportional relationship. For example, for subjective image quality evaluation. Accordingly, the design may be made so that the size of the partial region with respect to the phase difference amount is appropriate.

また、点光源からの光線がボケとなるときの拡散量(PSF(Point Spread Function:点広がり関数)の点拡がりの量)は、ボケが発生している領域内において均一であるとは限らず、例えばボケの周辺部においては中央部よりも拡散量が少ない(つまり、輝度が低い)ことなどが考えられる。そこで、上述したような部分領域のコピー加算を行うときに、ボケの拡散量に応じた重み係数を乗算するようにしても良い。例えば、部分領域の周辺部の各画素には1/2の重み係数を乗算し、部分領域の中央部の各画素には1の重み係数を乗算してから、コピー加算を行うなどである。このときには、ステップS26およびステップS28におけるカウント画像も、部分領域の周辺部については1/2を加算し、部分領域の中央部については1を加算することになる。   Further, the amount of diffusion when the light from the point light source is blurred (the amount of point spread of PSF (Point Spread Function)) is not necessarily uniform in the region where the blur occurs. For example, it is conceivable that the amount of diffusion is smaller (that is, the luminance is lower) in the peripheral portion of the blur than in the central portion. Therefore, when performing copy addition of partial areas as described above, a weighting factor corresponding to the amount of blur diffusion may be multiplied. For example, each pixel in the peripheral part of the partial region is multiplied by a weighting factor of 1/2, each pixel in the central part of the partial region is multiplied by one weighting factor, and then copy addition is performed. At this time, also in the count images in step S26 and step S28, 1/2 is added to the peripheral part of the partial area, and 1 is added to the central part of the partial area.

(ステップS29)
その後、画像内における全ての部分領域に対する処理が完了したか否かを判定する。そして、処理が完了するまで、部分領域の位置をずらしながらステップS22〜S28の処理を繰り返して行う。ここに、部分領域をずらすときのステップは任意の値を設定可能であるが、部分領域の幅よりも小さい値であることが好ましい。
(Step S29)
Thereafter, it is determined whether or not the processing for all the partial areas in the image is completed. Then, the processes in steps S22 to S28 are repeated while shifting the position of the partial area until the process is completed. Here, an arbitrary value can be set as the step for shifting the partial area, but it is preferably a value smaller than the width of the partial area.

(ステップS30)
こうして、ステップS29において全ての部分領域に対する処理が完了したと判定された場合には、同一画素位置毎に、Crコピー画像の画素値をCrカウント画像の画素値で割ることにより正規化されたCrコピー画像を得るとともに、Cbコピー画像の画素値をCbカウント画像の画素値で割ることにより正規化されたCbコピー画像を得る。
(Step S30)
Thus, if it is determined in step S29 that the processing for all the partial areas has been completed, the normalized Cr by dividing the pixel value of the Cr copy image by the pixel value of the Cr count image for each same pixel position. A copy image is obtained, and a normalized Cb copy image is obtained by dividing the pixel value of the Cb copy image by the pixel value of the Cb count image.

(ステップS31)
そして、G画像(またはY画像)と、ステップS30において正規化されたCrコピー画像およびCbコピー画像と、を用いて、R画像、B画像、G画像を生成する。ここに、色差画像の算出に数式3を用いた場合には、
[数5]
R=Cr+G
B=Cb+G
を用いてR画像およびB画像を生成する(なお、G画像は、ステップS22におけるG画像をそのまま用いる)。
(Step S31)
Then, an R image, a B image, and a G image are generated using the G image (or Y image) and the Cr copy image and the Cb copy image normalized in step S30. Here, when Equation 3 is used to calculate the color difference image,
[Equation 5]
R = Cr + G
B = Cb + G
Are used to generate an R image and a B image (the G image in step S22 is used as it is).

また、色差画像の算出に数式4を用いた場合には、
[数6]
R=Y+1.40200Cr
G=Y−0.71414Cr−0.34414Cb
B=Y +1.77200Cb
を用いてR画像、B画像、G画像を生成する。
In addition, when Equation 4 is used to calculate the color difference image,
[Equation 6]
R = Y + 1.40200Cr
G = Y−0.71414Cr−0.34414Cb
B = Y + 1.77200Cb
Is used to generate an R image, a B image, and a G image.

このステップS31において算出されたRGB画像が、色画像生成部37におけるカラー化処理により得られた画像となる。   The RGB image calculated in step S31 is an image obtained by the colorization process in the color image generation unit 37.

このようなカラー化処理の2D実施例2によれば、画像のコピー加算処理により色ズレの補正を行うことにより、上述した2D実施例1とほぼ同様の効果を奏することができる。   According to the 2D embodiment 2 of such colorization processing, effects similar to those of the 2D embodiment 1 described above can be achieved by correcting the color misregistration by the image copy addition processing.

また、コピー加算を行う場合には、フィルタリング処理の場合よりも処理負荷を軽減することが可能となる利点がある。従って、処理回路の低コスト化や、低消費電力化を図ることもできる。
[2D実施例3]
Further, when performing copy addition, there is an advantage that the processing load can be reduced as compared with the filtering process. Therefore, the cost of the processing circuit and the power consumption can be reduced.
[2D Example 3]

図31から図34はカラー化処理の2D実施例3を示したものであり、図31は2D実施例3において位相差量に応じた各色のPSFのテーブルの概要を示す図、図32は2D実施例3において色画像生成部37により行われるカラー化処理の概要を示す図、図33は2D実施例3において色画像生成部37により行われるボケ量コントロールを伴うカラー化処理の概要を示す図、図34は2D実施例3において色画像生成部37により行われるカラー化処理を示すフローチャートである。   FIGS. 31 to 34 show the 2D embodiment 3 of the colorization processing. FIG. 31 is a diagram showing an outline of the PSF table of each color according to the phase difference amount in the 2D embodiment 3. FIG. 32 shows the 2D embodiment. FIG. 33 is a diagram illustrating an outline of colorization processing performed by the color image generation unit 37 in the third embodiment, and FIG. 33 is a diagram illustrating an overview of colorization processing accompanied by blur amount control performed by the color image generation unit 37 in 2D Example 3. FIG. 34 is a flowchart showing the colorization processing performed by the color image generation unit 37 in the 2D embodiment 3.

この2D実施例3において、上述の2D実施例1,2と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In this 2D embodiment 3, parts that are the same as those in the above-described 2D embodiments 1 and 2 are given the same reference numerals, description thereof is omitted, and only differences are mainly described.

本2D実施例は、色画像生成部37におけるカラー化処理を上述した2D実施例1,2と異ならせたものとなっている。すなわち、本2D実施例は、カラー化処理を、ぼけた画像をぼけていない画像に復元する復元処理(逆フィルタリング処理)と、復元されたぼけていない画像を被写体距離に応じた円形のボケ形状が得られるようにするフィルタリング処理と、を組み合わせることにより行うものとなっている。   In this 2D embodiment, the colorization processing in the color image generation unit 37 is different from the 2D embodiments 1 and 2 described above. That is, in the 2D embodiment, the colorization process is a restoration process (inverse filtering process) for restoring a blurred image to a non-blurred image, and a circular blur shape corresponding to the subject distance for the restored non-blurred image. Is combined with a filtering process for obtaining the above.

図3に示したような帯域制限フィルタ12を用いた場合には、位相差量に応じて、RGB各色のPSFは、図31に示すように変化する。なお、この図31において、点光源からの光が到達しない暗部にはハッチングを付している。   When the band limiting filter 12 as shown in FIG. 3 is used, the PSF of each color of RGB changes as shown in FIG. 31 according to the phase difference amount. In FIG. 31, the dark part where the light from the point light source does not reach is hatched.

例えば、R画像のPSFであるPSFrは、位相差量の絶対値が大きくなるほど、大きな半月形状を示し、位相差量が0、つまり合焦位置においては1点に収束する。さらに、合焦位置よりも近距離である場合には図31の上半分に示すように左半月形状であるが、合焦位置よりも遠距離である場合には図31の下半分に示すように右半月形状となる。   For example, PSFr, which is the PSF of the R image, shows a larger half-moon shape as the absolute value of the phase difference increases, and converges to one point when the phase difference is 0, that is, at the in-focus position. Further, when it is closer than the in-focus position, it has a left half moon shape as shown in the upper half of FIG. 31, but when it is far from the in-focus position, it is shown in the lower half of FIG. It becomes a right half moon shape.

同様に、B画像のPSFであるPSFbは、位相差量の絶対値が大きくなるほど、大きな半月形状を示し、位相差量が0、つまり合焦位置においては1点に収束する。さらに、合焦位置よりも近距離である場合には図31の上半分に示すように右半月形状であるが、合焦位置よりも遠距離である場合には図31の下半分に示すように左半月形状となる。   Similarly, PSFb, which is the PSF of the B image, shows a larger half-moon shape as the absolute value of the phase difference increases, and converges to one point when the phase difference is 0, that is, at the in-focus position. Further, when it is closer than the in-focus position, it has a right half moon shape as shown in the upper half of FIG. 31, but when it is far from the in-focus position, it is shown in the lower half of FIG. The left half-moon shape.

さらに、G画像のPSFであるPSFgは、位相差量の絶対値が大きくなるほど、大きな満月形状を示し、位相差量が0、つまり合焦位置においては1点に収束する。また、PSFgは、1点に収束したときを除いて、合焦位置よりも近距離であるか遠距離であるかに関わらず、常に満月形状である。   Further, PSFg, which is the PSF of the G image, shows a larger full moon shape as the absolute value of the phase difference amount increases, and converges to one point when the phase difference amount is 0, that is, at the in-focus position. Further, PSFg is always in a full moon shape regardless of whether it is closer or farther than the in-focus position except when it converges to one point.

この図31に示したような、位相差量に応じた各色のPSFのテーブルが、例えば色画像生成部37内の図示しない不揮発性メモリに予め記憶されているものとする(ただし、図1に示したようなレンズ交換式の撮像装置の場合には、レンズ制御部14内に記憶されているテーブルを、通信により受信して用いても勿論構わない)。   A PSF table for each color corresponding to the phase difference amount as shown in FIG. 31 is assumed to be stored in advance in, for example, a non-illustrated nonvolatile memory in the color image generation unit 37 (however, in FIG. 1). In the case of the lens-interchangeable image pickup apparatus as shown, of course, the table stored in the lens control unit 14 may be received and used by communication).

このようなPSFを用いた復元処理およびフィルタリング処理について、図32を参照して説明する。この図32は、被写体が合焦位置よりも遠距離である場合の例であるが、被写体が合焦位置よりも近距離である場合にも同様の処理を適用することができる。   Such restoration processing and filtering processing using PSF will be described with reference to FIG. FIG. 32 shows an example of the case where the subject is farther than the in-focus position, but the same processing can be applied when the subject is closer than the in-focus position.

まず、R画像にPSFrの逆演算(右肩の−1が逆演算であることを示している。以下同様。)を行うことにより、右半円形状のボケを、点光源が1点に収束するボケのない像(復元第1画像と復元第2画像との何れか一方)に変換する。同様に、B画像にPSFbの逆演算を行うことにより、左半円形状のボケを、点光源が1点に収束するボケのない像(復元第1画像と復元第2画像との何れか他方)に変換する。このような処理により、R画像およびB画像の復元処理を行う。   First, by performing inverse calculation of PSFr on the R image (showing that -1 on the right shoulder is the inverse calculation, the same applies hereinafter), the right semicircular blur is converged to a single point light source. The image is converted into an image having no blur (either one of the restored first image and the restored second image). Similarly, by performing inverse calculation of PSFb on the B image, the left semicircular blur is converted into a non-blurred image in which the point light source converges to one point (the other one of the restored first image and the restored second image). ). By such processing, restoration processing of the R image and the B image is performed.

次に、復元処理されたR画像および復元処理されたB画像に対して、G画像に対するPSFであるPSFgをそれぞれ作用させる。これにより、R画像およびB画像に、G画像と同様の満月形状のボケが生成される。   Next, PSFg which is a PSF for the G image is applied to the restored R image and the restored B image. As a result, full-moon-shaped blur similar to the G image is generated in the R image and the B image.

具体的な処理は、次のようにして行う。   A specific process is performed as follows.

まず、ある画素位置におけるR画像のボケのPSFがPr1、B画像の同一画素位置におけるボケのPSFがPb1、G画像の同一画素位置におけるボケのPSFがPg1であるとする。ボケのPSFは、図31に示したように、R画像とB画像との間の位相差に応じて異なり、位相差は基本的に画素位置毎に異なるために、PSFは各画素位置毎に決定されるものとなる。また、PSFは、着目画素位置を中心として、近傍の複数画素を含む部分領域に対して定義されているものとする(図31参照)。   First, it is assumed that the blur PSF of the R image at a certain pixel position is Pr1, the blur PSF at the same pixel position of the B image is Pb1, and the blur PSF at the same pixel position of the G image is Pg1. As shown in FIG. 31, the blurred PSF differs depending on the phase difference between the R image and the B image, and the phase difference basically differs for each pixel position. Therefore, the PSF is different for each pixel position. To be determined. Further, it is assumed that the PSF is defined for a partial region including a plurality of neighboring pixels with the pixel position of interest at the center (see FIG. 31).

処理を開始すると、着目画素に対して求められた位相差を取得し、図31に示したようなテーブルを参照することにより、R画像における着目画素を中心としたPSFであるPr1と、B画像における同一位置の着目画素を中心としたPSFであるPb1と、G画像における同一位置の着目画素を中心としたPSFであるPg1と、を取得する。   When the processing is started, the phase difference obtained for the pixel of interest is acquired, and by referring to a table as shown in FIG. 31, Pr1 which is a PSF centered on the pixel of interest in the R image and the B image Pb1 that is the PSF centered on the pixel of interest at the same position in Pb1 and Pg1 that is the PSF centered on the pixel of interest at the same position in the G image are acquired.

次に、取得したPr1、Pb1、およびPg1と、R画像における着目画素を中心とする部分領域rと、B画像における着目画素を中心とする部分領域bと、に対して次の数式7に示すように、2次元フーリエ変換FFT2を行い、各変換後の値PR1,PB1,PG1,R,Bを得る。
[数7]
PR1=FFT2(Pr1)
PB1=FFT2(Pb1)
PG1=FFT2(Pg1)
R =FFT2(r)
B =FFT2(b)
Next, for the obtained Pr1, Pb1, and Pg1, the partial region r centered on the target pixel in the R image, and the partial region b centered on the target pixel in the B image, the following Expression 7 is shown. As described above, the two-dimensional Fourier transform FFT2 is performed to obtain values PR1, PB1, PG1, R, and B after the respective transformations.
[Equation 7]
PR1 = FFT2 (Pr1)
PB1 = FFT2 (Pb1)
PG1 = FFT2 (Pg1)
R = FFT2 (r)
B = FFT2 (b)

次に、下記の数式8に示すように、RをPR1で除算し、BをPB1で除算することにより復元処理を行い、さらにそれぞれにPG1を乗算することによりフィルタリング処理を行って、その結果に2次元逆フーリエ変換IFFT2を施し、G画像と同様のボケが得られたR画像r’およびB画像b’を算出する。
[数8]
r’=IFFT2(R×PG1/PR1)
b’=IFFT2(B×PG1/PB1)
Next, as shown in Equation 8 below, R is divided by PR1, B is divided by PB1, restoration processing is performed, and each is multiplied by PG1 to perform filtering processing. Two-dimensional inverse Fourier transform IFFT2 is performed to calculate an R image r ′ and a B image b ′ in which the same blur as the G image is obtained.
[Equation 8]
r ′ = IFFT2 (R × PG1 / PR1)
b ′ = IFFT2 (B × PG1 / PB1)

なお、数式8の逆フィルタリング処理による復元処理をより安定的にするために、以下の数式9のように復元処理の復元量を制御しても構わないものとする(ウィナーフィルターの方式)。
[数9]
r’=IFFT2(R×PG1/PR1×|PR1|^2/(|PR1|^2+Γ))
b’=IFFT2(B×PG1/PB1×|PB1|^2/(|PB1|^2+Γ))
ここに、数式9における記号「^2」は2乗を表し(以下同様)、ΓはPR1、PB1の形状に応じて適切に設定される任意の定数である。
In order to make the restoration process by the inverse filtering process of Expression 8 more stable, the restoration amount of the restoration process may be controlled as shown in Expression 9 below (Wiener filter method).
[Equation 9]
r ′ = IFFT2 (R × PG1 / PR1 × | PR1 | ^ 2 / (| PR1 | ^ 2 + Γ))
b ′ = IFFT2 (B × PG1 / PB1 × | PB1 | ^ 2 / (| PB1 | ^ 2 + Γ))
Here, the symbol “^ 2” in Equation 9 represents the square (the same applies hereinafter), and Γ is an arbitrary constant appropriately set according to the shapes of PR1 and PB1.

この数式9のような処理を採用することにより、復元処理時のノイズの増幅が抑制され、より好ましいR画像、B画像を生成することができる。   By adopting a process such as Equation 9, amplification of noise during the restoration process is suppressed, and more preferable R and B images can be generated.

なお、Γの設定方法として、例えばPR1の周波数係数の絶対値|PR1|、|PB1|と、この絶対値|PR1|、|PB1|に対するΓの好ましい値との関係を撮像装置内に予め保持しておき、この関係に基づいて周波数係数毎にΓを指定する方法が考えられる。また、その他の方法としては、撮像装置の各種パラメータ(ISO値、焦点距離、開口値など)に基づいて、画像に含まれるノイズ量を推定し、推定したノイズ量に応じてΓを変化させる構成(例えば、ISO200の場合Γ=0.01とし、ISO800の場合Γ=0.04とするなど)を採用しても構わない。   As a method for setting Γ, for example, the relationship between the absolute values | PR1 | and | PB1 | of the frequency coefficient of PR1 and the preferable values of Γ with respect to the absolute values | PR1 | and | PB1 | A method of designating Γ for each frequency coefficient based on this relationship can be considered. As another method, a configuration in which the amount of noise included in an image is estimated based on various parameters (ISO value, focal length, aperture value, etc.) of the imaging device, and Γ is changed according to the estimated amount of noise. (For example, Γ = 0.01 for ISO 200 and Γ = 0.04 for ISO 800) may be employed.

上述したような復元処理およびフィルタリング処理は、画像の部分領域毎に行い、ある部分領域で補正処理が完了したら、次に位置を少しずらして部分領域を指定し、指定した部分領域に対して再び同様の復元処理およびフィルタリング処理を行う。このような処理を繰り返して行うことにより、復元処理およびフィルタリング処理を画像の全領域に対して行う。その後、重複して処理された画素位置に関しては、その画素位置で処理された複数の補正画素値の総和を補正回数で割って平均化することにより、正規化された補正画像を得る。   The restoration process and the filtering process as described above are performed for each partial area of the image. When the correction process is completed in a certain partial area, the partial area is designated by slightly shifting the position, and the designated partial area is again displayed. Similar restoration processing and filtering processing are performed. By repeatedly performing such processing, restoration processing and filtering processing are performed on the entire region of the image. Thereafter, with respect to the pixel position processed in duplicate, the sum of a plurality of corrected pixel values processed at the pixel position is divided by the number of corrections and averaged to obtain a normalized corrected image.

なお、復元処理およびフィルタリング処理を行う部分領域の大きさは、ボケの形状よりも大きいことが好ましい。従って、ボケの大きさに応じて、部分領域の大きさを適応的に変化させることが考えられる。あるいは、位相差に応じてボケの形状がどの範囲で変化するかが予め分かっている場合には、そのボケの最大サイズ以上の部分領域を固定的に用いるようにしても良い。   In addition, it is preferable that the size of the partial area for performing the restoration process and the filtering process is larger than the shape of the blur. Therefore, it is conceivable to adaptively change the size of the partial region in accordance with the size of the blur. Alternatively, when it is known in advance in which range the shape of the blur changes according to the phase difference, a partial region having a size larger than the maximum size of the blur may be used in a fixed manner.

次に、図34を参照して、色画像生成部37により行われる上述したような復元処理およびフィルタリング処理によるカラー化処理の流れについて説明する。   Next, with reference to FIG. 34, the flow of the colorization process performed by the color image generation unit 37 by the above-described restoration process and filtering process will be described.

(ステップS41)
この処理を開始すると、初期設定を行う。この初期設定においては、まず、処理対象のRGB画像(つまり、R画像、G画像、およびB画像)の読み込みを行う。次に、R画像のコピーであるRコピー画像と、B画像のコピーであるBコピー画像と、を作成する。
(Step S41)
When this process is started, initialization is performed. In this initial setting, first, an RGB image to be processed (that is, an R image, a G image, and a B image) is read. Next, an R copy image that is a copy of the R image and a B copy image that is a copy of the B image are created.

続いて、Rコピー画像およびBコピー画像と同一サイズの、Rカウント画像およびBカウント画像を生成する(ここに、これらのカウント画像は、画素値の初期値を、全画素について1としておく)。   Subsequently, an R count image and a B count image having the same size as the R copy image and the B copy image are generated (here, in these count images, the initial value of the pixel value is set to 1 for all pixels).

(ステップS42)
続いて、位相差検出を行うための部分領域を設定する。ここでは、部分領域を、R画像とB画像との内の何れか一方、ここでは例えばR画像に設定する。
(Step S42)
Subsequently, a partial region for performing phase difference detection is set. Here, the partial area is set to one of the R image and the B image, here, for example, the R image.

(ステップS43)
ステップS42で設定された部分領域に対する位相差を検出する。この位相差の検出は、R画像に設定した部分領域を基準画像とし、B画像における基準画像と同一サイズの部分領域を参照画像として、上述したステップS3と同様の処理を図26に示したように行うことにより、R画像とB画像の間で位相差検出を行う。
(Step S43)
A phase difference with respect to the partial region set in step S42 is detected. This phase difference is detected by using the partial area set in the R image as a standard image and the partial area of the B image having the same size as the standard image as a reference image, as shown in FIG. By performing the above, phase difference detection is performed between the R image and the B image.

(ステップS44)
ステップS43の処理により得られた位相差量に基づいて、G画像の円形ボケの半径(または、R画像およびB画像の半円ボケの半径ということもできる)を、上述したステップS24と同様にして取得する。
(Step S44)
Based on the amount of phase difference obtained by the process of step S43, the radius of the circular blur of the G image (or the radius of the semicircular blur of the R image and the B image) is set in the same manner as in step S24 described above. Get.

(ステップS45)
次に、オリジナルのR画像に対して、上述したステップS42で指定した部分領域に対して、上述したような復元処理およびフィルタリング処理を行う。こうして得られた処理結果を、Rコピー画像におけるオリジナルのR画像の部分領域と同位置にコピー加算する。なお、ここでは、カラー化処理を行うための部分領域を、位相差検出を行うための部分領域と同一とする例について説明するが、勿論異なる領域を設定しても構わないし、上述したように、検出された位相差に応じた適応的な大きさの部分領域としても良い(後述するB画像についても同様)。
(Step S45)
Next, the above-described restoration process and filtering process are performed on the original R image with respect to the partial region specified in step S42 described above. The processing result obtained in this way is copied and added to the same position as the partial area of the original R image in the R copy image. Here, an example in which the partial area for performing the colorization process is the same as the partial area for performing the phase difference detection will be described, but a different area may be set as a matter of course, as described above. Alternatively, a partial area having an adaptive size according to the detected phase difference may be used (the same applies to the B image described later).

(ステップS46)
続いて、Rカウント画像の「ステップS42で指定した部分領域」に、加算された回数が分かるように+1を加算する。このRカウント画像は、後段のステップS50において、画素値の正規化処理を行うために利用する。
(Step S46)
Subsequently, +1 is added to the “partial region designated in step S42” of the R count image so that the number of times of addition can be understood. This R count image is used to perform pixel value normalization processing in the subsequent step S50.

(ステップS47)
また、オリジナルのB画像に対して、上述したステップS42で指定した部分領域に対して、上述したような復元処理およびフィルタリング処理を行う。こうして得られた処理結果を、Bコピー画像におけるオリジナルのB画像の部分領域と同位置にコピー加算する。
(Step S47)
Further, the restoration process and the filtering process as described above are performed on the original B image with respect to the partial region specified in step S42 described above. The processing result obtained in this way is copied and added at the same position as the partial area of the original B image in the B copy image.

(ステップS48)
そして、Bカウント画像の「ステップS42で指定した部分領域」に、加算された回数が分かるように1を加算する。このBカウント画像も、後段のステップS50において、画素値の正規化処理を行うために利用する。
(Step S48)
Then, 1 is added to the “partial region designated in step S42” of the B count image so that the number of times of addition can be understood. This B count image is also used to perform pixel value normalization processing in the subsequent step S50.

(ステップS49)
その後、画像内における全ての部分領域に対する処理が完了したか否かを判定する。そして、処理が完了するまで、部分領域の位置をずらしながらステップS42〜S48の処理を繰り返して行う。ここに、部分領域をずらすときのステップは任意の値を設定可能であるが、部分領域の幅よりも小さい値であることが好ましい。
(Step S49)
Thereafter, it is determined whether or not the processing for all the partial areas in the image is completed. Then, the processes in steps S42 to S48 are repeated while shifting the position of the partial area until the process is completed. Here, an arbitrary value can be set as the step for shifting the partial area, but it is preferably a value smaller than the width of the partial area.

(ステップS50)
こうして、ステップS49において全ての部分領域に対する処理が完了したと判定された場合には、同一画素位置毎に、Rコピー画像の画素値をRカウント画像の画素値で割ることにより正規化されたRコピー画像を得るとともに、Bコピー画像の画素値をBカウント画像の画素値で割ることにより正規化されたBコピー画像を得る。このステップS50において算出されたRGB画像が、色画像生成部37におけるカラー化処理により得られた画像となる。
(Step S50)
Thus, if it is determined in step S49 that the processing for all the partial areas has been completed, the R value normalized by dividing the pixel value of the R copy image by the pixel value of the R count image for each same pixel position. A copy image is obtained, and a normalized B copy image is obtained by dividing the pixel value of the B copy image by the pixel value of the B count image. The RGB image calculated in step S50 is an image obtained by the colorization process in the color image generation unit 37.

こうして、ステップS50の処理が終了したところで、この図34に示す処理を終了する。   Thus, when the process of step S50 ends, the process shown in FIG. 34 ends.

なお、上述では、フーリエ変換を利用して実空間から周波数空間へ変換した後に、復元処理およびフィルタリング処理を行っている。しかし、これに限るものではなく、実空間における(例えばMAP推定処理などの)復元処理やフィルタリング処理を適用しても構わない。   In the above description, restoration processing and filtering processing are performed after transforming from real space to frequency space using Fourier transform. However, the present invention is not limited to this, and restoration processing or filtering processing (for example, MAP estimation processing) in real space may be applied.

また、上述ではR画像およびB画像のボケ形状をG画像のボケ形状に整合させる処理を行っているが、これに加えて、ボケ量コントロールを行うようにしても構わない。   In the above description, the blurring shape of the R image and the B image is matched with the blurring shape of the G image. However, in addition to this, the blur amount control may be performed.

この場合には、図33に示すように、まず、R画像にPSFrの逆演算を、B画像にPSFbの逆演算を、それぞれ行うとともに、さらに、G画像にPSFgの逆演算を行うことにより円形状のボケを点光源が1点に収束するボケのない像(復元第3画像)に変換する。これにより、R画像、B画像、およびG画像の復元が行われる。   In this case, as shown in FIG. 33, first, the inverse operation of PSFr is performed on the R image, the inverse operation of PSFb is performed on the B image, and further, the inverse operation of PSFg is performed on the G image. The shape blur is converted into a blur-free image (restored third image) in which the point light source converges to one point. Thereby, the R image, the B image, and the G image are restored.

次に、復元処理されたR画像、B画像、およびG画像に対して、G画像に対する所望のPSFであるPSF’gをそれぞれ作用させる。これにより、R画像、B画像、およびG画像に、所望の大きさの満月形状のボケを生成し、ボケ量コントロールを行うことができる。   Next, PSF′g, which is a desired PSF for the G image, is applied to the restored R image, B image, and G image. As a result, a full-moon-shaped blur having a desired size can be generated in the R image, the B image, and the G image, and the blur amount can be controlled.

具体的には、図31に示したようなテーブルを参照することにより、G画像における同一位置の着目画素を中心としたPSFとして、所望のPg1’をさらに取得しておく。   Specifically, by referring to a table as shown in FIG. 31, a desired Pg1 'is further acquired as a PSF centered on the target pixel at the same position in the G image.

次に、上述した数式7の処理に加えて、さらに、取得したPg1’と、G画像における着目画素を中心とする部分領域gと、に対して次の数式10に示すように、2次元フーリエ変換FFT2を行い、各変換後の値PG1’,Gを得る。
[数10]
PG1’=FFT2(Pg1’)
G =FFT2(g)
Next, in addition to the processing of Equation 7 described above, two-dimensional Fourier is obtained as shown in Equation 10 below for the acquired Pg1 ′ and the partial region g centered on the pixel of interest in the G image. A conversion FFT2 is performed to obtain converted values PG1 ′ and G.
[Equation 10]
PG1 ′ = FFT2 (Pg1 ′)
G = FFT2 (g)

そして、下記の数式11に示すように、RをPR1で除算し、BをPB1で除算し、GをPG1で除算することにより復元処理を行い、さらにそれぞれにPG1’を乗算することによりフィルタリング処理を行って、その結果に2次元逆フーリエ変換IFFT2を施し、所望のボケ量のボケが得られたR画像r”、B画像b”、およびG画像g”を算出する。
[数11]
r”=IFFT2(R×PG1’/PR1)
b”=IFFT2(B×PG1’/PB1)
g”=IFFT2(G×PG1’/PG1)
Then, as shown in Equation 11 below, R is divided by PR1, B is divided by PB1, G is divided by PG1, restoration processing is performed, and each is multiplied by PG1 ′ to perform filtering processing. The result is subjected to a two-dimensional inverse Fourier transform IFFT2 to calculate an R image r ″, a B image b ″, and a G image g ″ from which a desired amount of blur has been obtained.
[Equation 11]
r ″ = IFFT2 (R × PG1 ′ / PR1)
b ″ = IFFT2 (B × PG1 ′ / PB1)
g ″ = IFFT2 (G × PG1 ′ / PG1)

なお、上述した数式9と同様に、数式11に代えて、次の数式12に示すようなウィナーフィルターの方式を採用しても構わない。
[数12]
r”=IFFT2(R×PG1’/PR1×|PR1|^2/(|PR1|^2+Γ))
b”=IFFT2(B×PG1’/PB1×|PB1|^2/(|PB1|^2+Γ))
g”=IFFT2(G×PG1’/PG1×|PG1|^2/(|PG1|^2+Γ))
ここに、ΓはPR1、PB1、PG1の形状に応じて適切に設定される任意の定数である。
Note that, similarly to the above-described equation 9, a Wiener filter method as shown in the following equation 12 may be employed instead of the equation 11.
[Equation 12]
r ″ = IFFT2 (R × PG1 ′ / PR1 × | PR1 | ^ 2 / (| PR1 | ^ 2 + Γ))
b ″ = IFFT2 (B × PG1 ′ / PB1 × | PB1 | ^ 2 / (| PB1 | ^ 2 + Γ))
g ″ = IFFT2 (G × PG1 ′ / PG1 × | PG1 | ^ 2 / (| PG1 | ^ 2 + Γ))
Here, Γ is an arbitrary constant appropriately set according to the shapes of PR1, PB1, and PG1.

このようなカラー化処理の2D実施例3によれば、PSFを用いた復元処理およびフィルタリング処理による色ズレ補正を行うことにより、上述した2D実施例1,2とほぼ同様の効果を奏することができる。   According to the 2D embodiment 3 of such colorization processing, the same effects as the 2D embodiments 1 and 2 described above can be obtained by performing color shift correction by restoration processing using PSF and filtering processing. it can.

さらに、G画像についても復元処理を行い、その後にG画像に対する任意のPSFを用いたフィルタリング処理をR画像、B画像、およびG画像に対して行えば、RGBカラー画像のボケ量を所望にコントロールすることも可能となる。   Furthermore, if a restoration process is performed for the G image, and then a filtering process using an arbitrary PSF for the G image is performed on the R image, the B image, and the G image, the amount of blur of the RGB color image is controlled as desired. It is also possible to do.

上述した2D実施例1〜3の何れかの処理を行うことにより、色ズレのない2次元画像が生成される。本3D実施例のステレオ画像生成部40は、この色ズレのない2次元画像と、位相差情報とに基づいて、カラーの立体視画像(3D画像)を生成するものとなっている。   By performing any of the processes of the 2D embodiments 1 to 3 described above, a two-dimensional image without color misregistration is generated. The stereo image generation unit 40 of the 3D embodiment generates a color stereoscopic image (3D image) based on the two-dimensional image without color misregistration and the phase difference information.

図35はカラー化処理後の2次元画像から左目画像および右目画像を生成する様子を示す図、図36はステレオ画像生成部40による立体視画像の生成処理を示すフローチャートである。   FIG. 35 is a diagram illustrating a state in which a left-eye image and a right-eye image are generated from a two-dimensional image after colorization processing, and FIG. 36 is a flowchart illustrating a stereoscopic image generation process by the stereo image generation unit 40.

(ステップS61)
この処理を開始すると、初期設定を行う。この初期設定においては、まず、カラー化処理により色ズレが補正されたカラー画像RGB0(図35参照)の読み込みを行う。次に、処理対象となる画像の各部分領域に対応する位相差量の情報を予め用意しておく。ここに位相差量の情報は、2D実施例1〜3の何れかのカラー化処理において既に取得されているために、この情報を用いるものとする(ただし、位相差量が取得されていない画素がある場合(例えば、デモザイキング前の画像に基づき位相差量が取得された場合や、位相差量を取得することができなかった画素が存在した場合など)には、補間処理等を行うことにより、全画素についての位相差量を生成しておく)。さらに、左目画像RGB−Lおよび右目画像RGB−Rと、左目カウント画像および右目カウント画像とを生成する(ここに、これら4つの各画像は、画素値の初期値を、全画素について0としておく)。
(Step S61)
When this process is started, initialization is performed. In this initial setting, first, a color image RGB0 (see FIG. 35) in which the color misregistration is corrected by the colorization process is read. Next, information on the amount of phase difference corresponding to each partial area of the image to be processed is prepared in advance. Here, since the information on the phase difference amount has already been acquired in any of the colorization processes in the 2D embodiments 1 to 3, this information is used (however, the pixel for which the phase difference amount has not been acquired). If there is (for example, when the phase difference amount is acquired based on the image before demosaicing or when there is a pixel for which the phase difference amount cannot be acquired), interpolation processing or the like is performed. Thus, the phase difference amount for all pixels is generated). Further, a left-eye image RGB-L and a right-eye image RGB-R, and a left-eye count image and a right-eye count image are generated (here, each of these four images has an initial pixel value of 0 for all pixels). ).

(ステップS62)
次に、色ズレが補正されたカラー画像RGB0に、図35に示すように部分領域を設定する。この部分領域の大きさは、位相差量の計測に利用した部分領域と同サイズであってもよいが、任意の大きさであっても構わない。例えば、図29を参照して説明したのと同様に、位相差量に応じて(例えば、比例して)部分領域の大きさが大きくなるようにしても構わない。
(Step S62)
Next, a partial region is set as shown in FIG. 35 in the color image RGB0 in which the color misregistration is corrected. The size of the partial region may be the same size as the partial region used for measuring the phase difference amount, but may be an arbitrary size. For example, as described with reference to FIG. 29, the size of the partial region may be increased in accordance with the amount of phase difference (for example, in proportion).

(ステップS63)
続いて、ステップS61において予め用意しておいた位相差量の情報から、ステップS62において設定した部分領域に対応する位相差量を取得する。
(Step S63)
Subsequently, a phase difference amount corresponding to the partial region set in step S62 is acquired from the information of the phase difference amount prepared in advance in step S61.

(ステップS64)
そして、R画像とB画像との間に生じている位相差量(位相差の方向および位相差の大きさ)に応じて、カラー画像RGB0の部分領域を、左目画像RGB−L内の位相差量の2分の1だけずらした部分領域にコピー加算する(図35参照)。
(Step S64)
Then, according to the phase difference amount (the direction of the phase difference and the magnitude of the phase difference) generated between the R image and the B image, the partial area of the color image RGB0 is converted into the phase difference in the left-eye image RGB-L. Copy addition is performed on the partial area shifted by a half of the amount (see FIG. 35).

(ステップS65)
さらに、左目カウント画像の「ステップS64でコピー加算された部分領域」と同一領域における各画素の画素値に、+1を加算する。この左目カウント画像は、後段のステップS69において、画素値の正規化処理を行うために利用する。
(Step S65)
Further, +1 is added to the pixel value of each pixel in the same area as the “partial area copied and added in step S64” of the left eye count image. This left-eye count image is used to perform pixel value normalization processing in the subsequent step S69.

(ステップS66)
同様に、R画像とB画像との間に生じている位相差量に応じて、カラー画像RGB0の部分領域を、右目画像RGB−R内の位相差量の2分の1だけステップS64とは逆方向にずらした部分領域にコピー加算する(図35参照)。
(Step S66)
Similarly, according to the phase difference amount generated between the R image and the B image, the partial region of the color image RGB0 is set to step S64 by a half of the phase difference amount in the right-eye image RGB-R. Copy addition is performed on the partial area shifted in the reverse direction (see FIG. 35).

(ステップS67)
さらに同様に、右目カウント画像の「ステップS66でコピー加算された部分領域」と同一領域における各画素の画素値に、+1を加算する。この右目カウント画像は、後段のステップS69において、画素値の正規化処理を行うために利用する。
(Step S67)
Similarly, +1 is added to the pixel value of each pixel in the same area as the “partial area copied and added in step S66” of the right eye count image. This right eye count image is used to perform pixel value normalization processing in the subsequent step S69.

(ステップS68)
その後、カラー画像RGB0内における全ての部分領域に対する処理が完了したか否かを判定する。そして、処理が完了するまで、部分領域の位置をずらしながらステップS62〜S67の処理を繰り返して行う。ここに、部分領域をずらすときのステップは任意の値を設定可能であるが、部分領域の幅よりも小さい値であること(すなわち、部分領域が重複しながら順次設定されていくこと)が好ましい。具体例を挙げれば、サイズが51×51[ピクセル]である部分領域に対して、10[ピクセル]ずつずらしながら部分領域を設定する等が挙げられる。ただし、重複しなければならないものではなく、タイルを敷き詰めるように設定しても構わない(例えばサイズが51×51[ピクセル]の部分領域に対して、51[ピクセル]ずつずらしながら部分領域を設定するなど)。
(Step S68)
Thereafter, it is determined whether or not the processing for all the partial areas in the color image RGB0 is completed. Then, the processes in steps S62 to S67 are repeated while shifting the position of the partial area until the process is completed. Here, an arbitrary value can be set as the step for shifting the partial area, but it is preferable that the value be smaller than the width of the partial area (that is, the partial areas should be sequentially set while overlapping). . As a specific example, for example, the partial area may be set while being shifted by 10 [pixel] with respect to the partial area having a size of 51 × 51 [pixel]. However, they do not have to overlap, and may be set so that tiles are laid out (for example, a partial area is set while shifting by 51 [pixels] with respect to a partial area having a size of 51 × 51 [pixels]. Etc.)

(ステップS69)
こうして、ステップS68において全ての部分領域に対する処理が完了したと判定された場合には、同一画素位置毎に、左目画像RGB−Lの画素値を左目カウント画像の画素値で割ることにより正規化された左目画像を得るとともに、右目画像RGB−Rの画素値を右目カウント画像の画素値で割ることにより正規化された右目画像を得る。なお、この処理を終えたところで、画素値が与えられていない画素が残っている場合には、補間処理を行って該画素の画素値を与えるものとする。
(Step S69)
Thus, if it is determined in step S68 that the processing for all the partial regions has been completed, the pixel value of the left eye image RGB-L is normalized by dividing the pixel value of the left eye count image for each same pixel position. In addition to obtaining a left eye image, a normalized right eye image is obtained by dividing the pixel value of the right eye image RGB-R by the pixel value of the right eye count image. In addition, when this process is completed and a pixel to which no pixel value is given remains, an interpolation process is performed to provide the pixel value of the pixel.

こうして、ステップS69の処理が終了したところで、この図34に示す処理を終了する。   Thus, when the process of step S69 is completed, the process shown in FIG. 34 is terminated.

なお、上述では、カラー画像RGB0の部分領域を左目画像RGB−Lおよび右目画像RGB−Rへコピー加算する際に、位相差量の2分の1だけ部分領域をずらしているが、これは、位相差量の2分の1であることが実際に観測された立体視画像の視差量に忠実であり好ましいためである。しかし、これに限るものではない。例えば、取得された位相差量に1よりも大きい所定の定数を乗算した値を補正された位相差量として用いれば、立体感をより際立たせた立体視画像を生成することができる。また、取得された位相差量に1よりも小さい所定の定数を乗算した値を補正された位相差量として用いれば、立体感をより抑制した立体視画像を生成することができる。このような位相差量に乗算する所定の定数は、立体視画像を表示部27に表示しながら、表示された画像を見たユーザが撮像装置の操作部32を操作することにより、好みに応じて調整することができるようにしても良い(GUIを介したユーザによる所望の調整)。あるいは、撮影対象である被写体に応じて(例えば、被写体が人物であるか否かや、被写体までの距離、構図などに応じて)、適切な立体感が得られるようにシステムコントローラ30が自動的に設定するようにしても良い。   In the above description, when the partial area of the color image RGB0 is copied and added to the left-eye image RGB-L and the right-eye image RGB-R, the partial area is shifted by a half of the phase difference amount. This is because it is preferable to be a half of the phase difference amount because it is faithful to the parallax amount of the actually observed stereoscopic image. However, it is not limited to this. For example, if a value obtained by multiplying the acquired phase difference amount by a predetermined constant greater than 1 is used as the corrected phase difference amount, a stereoscopic image with a more pronounced stereoscopic effect can be generated. In addition, if a value obtained by multiplying the acquired phase difference amount by a predetermined constant smaller than 1 is used as the corrected phase difference amount, a stereoscopic image in which the stereoscopic effect is further suppressed can be generated. The predetermined constant by which the phase difference amount is multiplied is determined according to preference by the user viewing the displayed image while operating the operation unit 32 of the imaging apparatus while displaying the stereoscopic image on the display unit 27. It may be possible to make adjustments (desired adjustments by the user via the GUI). Alternatively, depending on the subject to be imaged (for example, depending on whether the subject is a person, the distance to the subject, the composition, etc.), the system controller 30 automatically You may make it set to.

このような3D実施例1によれば、帯域によって撮像光学系の異なる瞳領域を通過した光により撮影された画像から、鑑賞用として好ましいカラーの立体視画像を得ることができる。   According to the 3D Example 1 as described above, a stereoscopic image having a color preferable for viewing can be obtained from an image photographed by light that has passed through different pupil regions of the imaging optical system depending on the band.

さらに、本3D実施例1においてはカラー化処理を行った結果を利用してカラーの立体視画像を生成するようにしているために、処理過程で得られるカラー化処理後の画像を保存しておけば、立体視画像と色ズレの低減されたカラー化後の画像とを両方とも取得し、所望に観察することができる利点がある。
[3D実施例2]
Further, in the 3D embodiment 1, since the color stereoscopic image is generated using the result of the colorization process, the image after the colorization process obtained in the process is stored. In this case, there is an advantage that both the stereoscopic image and the image after colorization with reduced color shift can be acquired and observed as desired.
[3D Example 2]

図37から図40は本発明の実施形態に係る3D実施例2を示したものであり、図37は立体視画像の生成処理において合焦位置よりも遠距離側にある被写体の像から左目画像を生成する際のシフトの様子を示す図、図38は立体視画像の生成処理において合焦位置よりも遠距離側にある被写体の像から右目画像を生成する際のシフトの様子を示す図、図39はシフト後の左目画像における各色のボケ形状を近似させるフィルタ処理を行った後の様子を示す図、図40はシフト後の右目画像における各色のボケ形状を近似させるフィルタ処理を行った後の様子を示す図である。   FIG. 37 to FIG. 40 show 3D Example 2 according to the embodiment of the present invention. FIG. 37 shows the left eye image from the image of the subject on the far side from the in-focus position in the stereoscopic image generation processing. FIG. 38 is a diagram illustrating a shift state when generating a right-eye image from an image of a subject that is farther than the in-focus position in the stereoscopic image generation process. FIG. 39 is a diagram illustrating a state after performing a filter process for approximating the blurred shape of each color in the left-eye image after the shift, and FIG. 40 is a diagram after performing a filter process for approximating the blurred shape of each color in the shifted right-eye image FIG.

この3D実施例2において、上述の3D実施例1と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In this 3D Example 2, the same parts as those in the above-mentioned 3D Example 1 are denoted by the same reference numerals, description thereof will be omitted, and only different points will be mainly described.

上述した3D実施例1は、色画像生成部37によるカラー化処理の結果を利用して立体視画像を生成するものであったが、本3D実施例2は、カラー化処理の結果を要することなく立体視画像を生成するようにしたものである。   In the 3D embodiment 1 described above, a stereoscopic image is generated using the result of the colorization process by the color image generation unit 37. However, the 3D embodiment 2 requires the result of the colorization process. Instead, a stereoscopic image is generated.

以下においても説明を簡単にするために、被写体が合焦位置よりも遠距離側にある場合を例に挙げて説明するが、被写体が合焦位置よりも近距離側にある場合でも以下の処理を適宜変更すれば同様に適用することが可能である。   In order to simplify the description below, the case where the subject is on the far side from the in-focus position will be described as an example, but the following processing is performed even when the subject is on the near side from the in-focus position. It is possible to apply in the same manner by appropriately changing.

まず、図3に示したような帯域制限フィルタ12を用いた場合には、被写体が合焦位置よりも遠距離側にあると、各色画像のボケは図10に示すようになる。   First, when the band limiting filter 12 as shown in FIG. 3 is used, the blur of each color image is as shown in FIG. 10 when the subject is on the far side from the in-focus position.

図3を見れば分かるように、RGフィルタ12rは左目側に位置し、GBフィルタ12bは右目側に位置している。従って、図10に示すR成分の被写体像IMGrの重心位置Crが左目画像における各色成分の重心位置となるべき位置であり、図10に示すB成分の被写体像IMGbの重心位置Cbが右目画像における各色成分の重心位置となるべき位置である。   As can be seen from FIG. 3, the RG filter 12r is located on the left eye side, and the GB filter 12b is located on the right eye side. Accordingly, the center-of-gravity position Cr of the R-component subject image IMGr shown in FIG. 10 is the position to be the center-of-gravity position of each color component in the left-eye image, and the center-of-gravity position Cb of the B-component subject image IMGb shown in FIG. This is the position that should be the center of gravity of each color component.

そこでまず、図26を参照して説明したように、位相差量の検出を行う。   Therefore, first, as described with reference to FIG. 26, the phase difference amount is detected.

そして、左目画像を生成する際には、図37に示すように、B成分の被写体像IMGbを位相差量だけ移動(シフト)させて重心位置をR成分の被写体像IMGrの重心位置Crに一致(あるいは近接)させ、G成分の被写体像IMGgを位相差量の1/2だけ移動させて重心位置をR成分の被写体像IMGrの重心位置Crに一致(あるいは近接)させる。   When generating the left-eye image, as shown in FIG. 37, the B-component subject image IMGb is moved (shifted) by the phase difference amount so that the centroid position matches the centroid position Cr of the R-component subject image IMGr. Then, the G component subject image IMGg is moved by ½ of the phase difference amount so that the center of gravity position coincides (or approaches) the center of gravity position Cr of the R component subject image IMGr.

同様に、右目画像を生成する際には、図38に示すように、R成分の被写体像IMGrを位相差量だけ移動(シフト)させて重心位置をB成分の被写体像IMGbの重心位置Cbに一致(あるいは近接)させ、G成分の被写体像IMGgを位相差量の1/2だけ移動させて重心位置をB成分の被写体像IMGbの重心位置Cbに一致(あるいは近接)させる。   Similarly, when generating the right-eye image, as shown in FIG. 38, the R-component subject image IMGr is moved (shifted) by the phase difference amount to change the center-of-gravity position to the center-of-gravity position Cb of the B-component subject image IMGb. The G component subject image IMGg is moved by ½ of the phase difference amount to match (or approach) the center of gravity position to the center of gravity position Cb of the B component subject image IMGb.

こうして、図37、図38に示したシフトが行われた後のカラー画像が、シフトカラー画像である。   Thus, the color image after the shift shown in FIGS. 37 and 38 is a shift color image.

次に、シフト後の左目画像におけるR画像およびB画像に対して、例えば図20に示したような円型ガウシアンフィルタ、あるいは図21や図22に示したような楕円型ガウシアンフィルタ等のフィルタカーネルを有するボケフィルタを作用させることにより、図39に示すように、ボケ形状をG画像に近似させる。   Next, a filter kernel such as a circular Gaussian filter as shown in FIG. 20 or an elliptic Gaussian filter as shown in FIGS. 21 and 22 is applied to the R image and B image in the left-eye image after the shift. As shown in FIG. 39, the blur shape is approximated to the G image by applying the blur filter having the.

さらに、シフト後の右目画像におけるR画像およびB画像に対して、左目画像と同様の図20に示したような円型ガウシアンフィルタ、あるいは図21や図22に示したような楕円型ガウシアンフィルタ等のフィルタカーネルを有するボケフィルタを作用させることにより、図40に示すように、ボケ形状をG画像に近似させる。   Further, for the R image and the B image in the shifted right eye image, the circular Gaussian filter as shown in FIG. 20 similar to the left eye image, or the elliptical Gaussian filter as shown in FIG. 21 and FIG. By applying a blur filter having the filter kernels, the blur shape is approximated to a G image as shown in FIG.

なお、楕円型ガウシアンフィルタを用いる場合に、例えば表3に示したように、位相差に応じてフィルタ形状を変化させながらフィルタリング処理を行うことは、上述と同様である。   When using an elliptical Gaussian filter, for example, as shown in Table 3, the filtering process is performed while changing the filter shape according to the phase difference, as described above.

また、ここではR画像およびB画像のボケ形状をG画像のボケ形状に近似させるためにボケフィルタを用いる例を説明したが、カラー化処理の2D実施例3に対して図31〜図34を参照して説明したのとほぼ同様に、復元処理とフィルタリング処理とを組み合わせることにより、ボケの形状を近似させ、あるいはさらにボケの大きさをコントロールするようにしても構わない。   Further, here, an example in which the blur filter is used to approximate the blur shape of the R image and the B image to the blur shape of the G image has been described, but FIGS. 31 to 34 are illustrated with respect to the 2D embodiment 3 of the color processing. In substantially the same manner as described with reference to the above description, the shape of the blur may be approximated or the size of the blur may be controlled by combining the restoration process and the filtering process.

さらに、本3D実施例2においても、シフトさせる移動量を、補正された位相差量(位相差量に所定の定数を乗算した値)に基づき大きくしたり小さくしたりするようにして、立体感をより際立たせたり、立体感をより抑制したりしても構わない。   Further, also in the 3D embodiment 2, the amount of movement to be shifted is increased or decreased based on the corrected phase difference amount (a value obtained by multiplying the phase difference amount by a predetermined constant). May be made more prominent or the stereoscopic effect may be further suppressed.

このような3D実施例2によれば、上述した3D実施例1とほぼ同様の効果を奏するとともに、カラー化処理を行う必要がないために、立体視画像のみを取得したい場合に処理の負荷を軽減することが可能となる。
[実施形態1]
According to the 3D Example 2 as described above, the same effect as the 3D Example 1 described above can be obtained, and since it is not necessary to perform the colorization process, the processing load is increased when only a stereoscopic image is to be acquired. It becomes possible to reduce.
[Embodiment 1]

図41および図42は本発明の実施形態1を示したものであり、図41は撮像装置の表示部に表示される位相差画像の例を示す図、図42は撮像装置における表示処理を示すフローチャートである。   41 and 42 show the first embodiment of the present invention, FIG. 41 is a diagram showing an example of a phase difference image displayed on the display unit of the imaging apparatus, and FIG. 42 shows display processing in the imaging apparatus. It is a flowchart.

本実施形態の撮像装置は、図1に示したように構成されており、複数の波長帯域の光をそれぞれ受光して光電変換し、第1の帯域の第1の画像と第2の帯域の第2の画像と第3の帯域の第3の画像とを生成するカラーの撮像素子22と、被写体像を撮像素子22に結像する撮像光学系9と、撮像光学系9を経て撮像素子22に至る撮影光束の光路上に配設されていて、撮像光学系9の瞳領域の一部である第1の領域を通過しようとする撮影光束中の第1の帯域の光を遮断し第2の帯域および第3の帯域の光を通過させる第1の帯域制限と、撮像光学系9の瞳領域の他の一部である第2の領域を通過しようとする撮影光束中の第2の帯域の光を遮断し第1の帯域および第3の帯域の光を通過させる第2の帯域制限と、を行う帯域制限フィルタ12と、第1の画像と第2の画像との位相差量を演算する距離演算部39と、距離演算部39により演算された位相差量に基づき、第2の画像および第3の画像のボケの重心位置を第1の画像のボケの重心位置の方向へ移動させた一の片目用カラー画像を生成するとともに、第1の画像および第3の画像のボケの重心位置を第2の画像のボケの重心位置の方向へ移動させた他の片目用カラー画像を生成することにより、カラーの立体視画像を生成するステレオ画像生成部40と、第1の画像と第2の画像との位相差を示す位相差画像として、一の片目用カラー画像と他の片目用カラー画像とを同時に表示する表示部27と、を備えている。   The imaging apparatus according to the present embodiment is configured as illustrated in FIG. 1, and receives and photoelectrically converts light in a plurality of wavelength bands, and performs the first image in the first band and the second band. A color imaging device 22 that generates a second image and a third image in the third band, an imaging optical system 9 that forms a subject image on the imaging device 22, and the imaging device 22 via the imaging optical system 9. Is disposed on the optical path of the imaging light flux reaching to, and blocks the first band light in the imaging light flux that attempts to pass through the first area that is a part of the pupil area of the imaging optical system 9. And a second band in the imaging light flux that attempts to pass through a second region that is another part of the pupil region of the imaging optical system 9. Band-limiting filter 1 that performs the second band limitation that blocks the light of the first band and allows the light of the first band and the third band to pass. And a distance calculation unit 39 for calculating a phase difference amount between the first image and the second image, and a blur of the second image and the third image based on the phase difference amount calculated by the distance calculation unit 39. A one-eye color image in which the center of gravity position of the first image is moved in the direction of the center of gravity position of the blur of the first image is generated, and the center of gravity position of the blur of the first image and the third image is generated. A stereo image generator 40 that generates a color stereoscopic image by generating another one-eye color image moved in the direction of the center of gravity of the blur, and a phase difference between the first image and the second image And a display unit 27 for simultaneously displaying one color image for one eye and another color image for one eye.

ここに、本実施形態においては、例えば上述したように、第1の帯域と第2の帯域との内の、一方の帯域が青(B)の帯域、他方の帯域が赤(R)の帯域であり、第3の帯域は緑(G)の帯域である。   Here, in the present embodiment, for example, as described above, one of the first band and the second band is a blue (B) band and the other band is a red (R) band. And the third band is a green (G) band.

そして、図41に示すように、表示部27が画面27aに表示する位相差画像は、ステレオ画像生成部40により生成されたカラーの左目画像とカラーの右目画像とを重畳した画像である。   As shown in FIG. 41, the phase difference image displayed on the screen 27a by the display unit 27 is an image in which the color left-eye image and the color right-eye image generated by the stereo image generation unit 40 are superimposed.

この場合には、上述したように、合焦位置にある被写体OBJcはカラーの2重像とはならず、合焦位置よりも遠距離側または近距離側にある被写体OBJf,OBJnが、合焦位置からのズレ量に応じたスプリットを示すカラーの2重像となる。従って、どの被写体が合焦し、どの被写体が非合焦であるかを、目視により容易に確認することが可能となっている。   In this case, as described above, the subject OBJc at the in-focus position does not become a color double image, and the subjects OBJf and OBJn at the far side or near-distance side from the in-focus position are in focus. A color double image showing a split according to the amount of deviation from the position is obtained. Accordingly, it is possible to easily confirm visually which subject is in focus and which subject is out of focus.

このような画像を表示するための処理を、図42を参照して説明する。この図42に示す処理は、既に詳細に説明したステップを幾つか含んでいるために、簡潔に説明する。   Processing for displaying such an image will be described with reference to FIG. The process shown in FIG. 42 includes a number of steps already described in detail, and will be described briefly.

この処理を開始すると、まず、行う表示がライブビュー表示であるか否かを判定する(ステップS71)。   When this process is started, first, it is determined whether or not the display to be performed is a live view display (step S71).

ここで、ライブビュー表示であると判定された場合には、さらに、フォーカスモードがマニュアルフォーカスモードに設定されているか否かを判定する(ステップS72)。   If it is determined that the live view display is selected, it is further determined whether or not the focus mode is set to the manual focus mode (step S72).

マニュアルフォーカスモードに設定されていると判定された場合には、撮像素子22から画像を入力して(ステップS73)、色間補正部36により色間補正を行うとともに画像処理部25によりデモザイキングを行い(ステップS74)、デモザイキングされたR画像とB画像とに基づいて距離演算部39が位相差量の検出を行う(ステップS75)。   If it is determined that the manual focus mode is set, an image is input from the image sensor 22 (step S73), the intercolor correction unit 36 performs intercolor correction, and the image processing unit 25 performs demosaicing. In step S74, the distance calculator 39 detects the phase difference based on the demosaiced R image and B image (step S75).

そして、ステレオ画像生成部40が例えば3D実施例1により立体視画像を生成する場合には、まず、色画像生成部37によりカラー化処理を行う(ステップS76)。ただし、ステレオ画像生成部40が上述した3D実施例2の技術により立体視画像を生成する場合には、このステップS76のカラー化処理を不要とすることが可能である。   When the stereo image generation unit 40 generates a stereoscopic image according to the 3D embodiment 1, for example, first, the color image generation unit 37 performs colorization processing (step S76). However, when the stereo image generation unit 40 generates a stereoscopic image by the technique of the 3D embodiment 2 described above, it is possible to eliminate the colorization process in step S76.

続いて、カラー化処理の結果に基づき、ステレオ画像生成部40が、カラーの左目画像データを作成するとともに(ステップS77)、カラーの右目画像データを作成する(ステップS78)。   Subsequently, based on the result of the colorization process, the stereo image generation unit 40 creates color left-eye image data (step S77) and creates color right-eye image data (step S78).

さらに、作成された左目画像と右目画像とを画像合成して(ステップS79)、合成された画像を画像処理部25により表示データに変換した後に(ステップS80)、表示部27の画面27aに例えば図41に示したように表示する(ステップS81)。   Furthermore, the generated left-eye image and right-eye image are combined (step S79), and the combined image is converted into display data by the image processing unit 25 (step S80). The display is as shown in FIG. 41 (step S81).

また、ステップS72においてマニュアルフォーカスモードに設定されていないと判定された場合には、オートフォーカスモードであると判定して、色画像生成部37によりカラー化処理が行われた色ズレのない2次元(2D)ライブ画像を表示部27の画面27aに表示する(ステップS82)。   If it is determined in step S72 that the manual focus mode is not set, it is determined that the mode is the autofocus mode, and the color image generation unit 37 performs the colorization process to perform two-dimensional without color misregistration. (2D) The live image is displayed on the screen 27a of the display unit 27 (step S82).

ステップS81またはステップS82の処理を行ったら、ライブビュー表示を終了するか否かを判定し(ステップS83)、終了しない場合にはステップS71へ戻って上述したような処理を行う。   If the process of step S81 or step S82 is performed, it is determined whether or not to end the live view display (step S83). If not, the process returns to step S71 to perform the above-described process.

一方、ステップS71において、ライブビュー表示でないと判定された場合には、撮影された画像を再生する再生表示を行い(ステップS84)、再生表示が終了するまで(ステップS85)、ステップS84の再生表示を繰り返して行う。   On the other hand, if it is determined in step S71 that it is not live view display, reproduction display for reproducing the captured image is performed (step S84), and reproduction display in step S84 is performed until the reproduction display ends (step S85). Repeat this step.

ステップS83においてライブビュー表示を終了すると判定された場合、またはステップS85において再生表示を終了すると判定された場合には、この処理を終了する。   If it is determined in step S83 that the live view display is to be ended, or if it is determined in step S85 that the reproduction display is to be ended, this process is ended.

このような実施形態1によれば、合焦位置にある被写体は2重像とはならず、合焦位置にない被写体は2重像となるために、画像中の合焦部と非合焦部とを目視で容易に確認することができる。しかも、合焦位置にない被写体は合焦位置からのズレ量に応じたスプリットを示す2重像となるために、合焦位置からどの程度ずれているかを感覚的に把握することが容易となる。加えて、位相差画像がカラー画像であるために、自然な感覚で被写体を認識することができる。そして、撮像素子22として汎用の撮像素子を利用することができるために、画素上に遮光膜を形成した専用の撮像素子を用いる場合に比べて、製造コストを抑制することが可能となる。
[実施形態2]
According to the first embodiment, the subject at the in-focus position is not a double image, and the subject not at the in-focus position is a double image. Therefore, the in-focus portion in the image is not in focus. The part can be easily confirmed visually. In addition, since the subject that is not in the in-focus position becomes a double image that indicates the split according to the amount of deviation from the in-focus position, it is easy to sensuously grasp how much the image is out of the in-focus position. . In addition, since the phase difference image is a color image, the subject can be recognized with a natural feeling. Since a general-purpose image sensor can be used as the image sensor 22, the manufacturing cost can be reduced as compared with the case where a dedicated image sensor in which a light shielding film is formed on a pixel is used.
[Embodiment 2]

図43および図44は本発明の実施形態2を示したものであり、図43は撮像装置の表示部に表示される位相差画像の例を示す図、図44は撮像装置における表示処理を示すフローチャートである。   43 and 44 show the second embodiment of the present invention, FIG. 43 is a diagram showing an example of a phase difference image displayed on the display unit of the imaging apparatus, and FIG. 44 shows display processing in the imaging apparatus. It is a flowchart.

この実施形態2において、上述の実施形態1と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the second embodiment, parts that are the same as those in the first embodiment are given the same reference numerals and description thereof is omitted, and only differences are mainly described.

本実施形態の撮像装置の構成は、上述した実施形態1と同様に、図1に示したものとなっている。   The configuration of the imaging apparatus of this embodiment is the same as that of the first embodiment described above, as shown in FIG.

ただし、本実施形態においては、ステレオ画像生成部40が、距離演算部39により演算された位相差量に1よりも大きい所定の係数を乗算した補正位相差量に基づき、立体感を強調したカラーの立体視画像を生成するものとなっている。   However, in the present embodiment, the stereo image generation unit 40 is a color in which the stereoscopic effect is enhanced based on the corrected phase difference amount obtained by multiplying the phase difference amount calculated by the distance calculation unit 39 by a predetermined coefficient larger than 1. The stereoscopic image is generated.

すなわち、上述した実施形態1の図41に示した例えば遠距離側にある被写体OBJfの左目画像と右目画像とのずれ量がzであるとすると、本実施形態においては図43に示すように、1よりも大きい所定の係数kをzに乗算したk×zが被写体OBJfの左目画像と右目画像とのずれ量となるように位相差画像の表示が行われる。   That is, assuming that the amount of deviation between the left eye image and the right eye image of the subject OBJf on the far side shown in FIG. 41 of the first embodiment described above is z, in this embodiment, as shown in FIG. The phase difference image is displayed so that k × z obtained by multiplying z by a predetermined coefficient k greater than 1 is the amount of deviation between the left eye image and the right eye image of the subject OBJf.

このような画像を表示するための処理は、図44に示すようになる。この処理は、ほぼ図42に示した処理と同様であるが、左目画像データを作成する際に位相差強調を行い(ステップS77A)、右目画像データを作成する際に位相差強調を行う(ステップS78A)点が異なっている。   The processing for displaying such an image is as shown in FIG. This process is almost the same as the process shown in FIG. 42, but phase difference enhancement is performed when creating left-eye image data (step S77A), and phase difference enhancement is performed when creating right-eye image data (step S77A). S78A) is different.

このような実施形態2によれば、上述した実施形態1とほぼ同様の効果を奏するとともに、位相差が強調され、合焦位置にない被写体の合焦位置からのズレ量が大きくなるために、画像中の合焦部と非合焦部とをより容易に目視で確認することが可能となる。
[実施形態3]
According to the second embodiment, the effects similar to those of the first embodiment described above are obtained, the phase difference is emphasized, and the amount of deviation from the in-focus position of the subject that is not in the in-focus position increases. It is possible to more easily visually check the in-focus portion and the out-of-focus portion in the image.
[Embodiment 3]

図45から図47は本発明の実施形態3を示したものであり、図45は撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図、図46は撮像装置の表示部に表示される位相差画像の例を示す図、図47は撮像装置における表示処理を示すフローチャートである。   45 to 47 show the third embodiment of the present invention. FIG. 45 is a block diagram showing the detailed configuration of the image processing unit and the system controller in the imaging apparatus. FIG. 46 is a display on the display unit of the imaging apparatus. FIG. 47 is a flowchart showing display processing in the imaging apparatus.

この実施形態3において、上述の実施形態1,2と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the third embodiment, parts that are the same as those in the first and second embodiments are given the same reference numerals, description thereof is omitted, and only differences are mainly described.

図45に示すように、本実施形態の画像処理部25は、スプリット画像生成部45を備えたものとなっている。なお、画像処理部25中にステレオ画像生成部40は図示していないが、設けられていても構わないし、省略されていても良い。   As shown in FIG. 45, the image processing unit 25 of the present embodiment includes a split image generation unit 45. The stereo image generation unit 40 is not shown in the image processing unit 25, but may be provided or omitted.

スプリット画像生成部45は、撮像素子22により撮像され、色間補正部36により色間補正が行われ、画像処理部25によりデモザイキングが行われた、第1の帯域の色の第1の画像と第2の帯域の色の第2の画像とを合成して、スプリット画像を生成するものである。具体的には、スプリット画像生成部45は、デモザイキング後のR画像とB画像とを合成して、スプリット画像を生成する。   The split image generation unit 45 is picked up by the image sensor 22, subjected to inter-color correction by the inter-color correction unit 36, and demosaiced by the image processing unit 25. And a second image of the second band color are combined to generate a split image. Specifically, the split image generation unit 45 combines the R image after the demosaicing and the B image to generate a split image.

従って、表示部27の画面27aに表示される位相差画像はスプリット画像となり、合焦位置にある被写体OBJcはR画像とB画像とが重畳しているが、合焦位置よりも遠距離側または近距離側にある被写体OBJf,OBJnは合焦位置からのズレ量に応じてR画像とB画像とがスプリットした色ズレを示す2重像となる。   Therefore, the phase difference image displayed on the screen 27a of the display unit 27 is a split image, and the R image and the B image are superimposed on the subject OBJc at the in-focus position. The subjects OBJf and OBJn on the short distance side become a double image indicating a color shift in which the R image and the B image are split according to the shift amount from the in-focus position.

このような画像を表示するための処理を、図47を参照して説明する。   Processing for displaying such an image will be described with reference to FIG.

この処理を開始して、ステップS74までの処理を行ったものとする。   Assume that this processing is started and the processing up to step S74 is performed.

すると次に、R画像およびB画像のみを画像合成するか、これらに加えてさらにG画像も画像合成するかを判定する(ステップS91)。ここに、R画像およびB画像のみを画像合成した位相差画像は非合焦部を明確に確認することができる利点があり、R画像、B画像、およびG画像を画像合成した位相差画像は全体的な色が通常のカラー画像と同様であり違和感が少ない利点がある。そこで、操作部32からの入力により、画像合成にG画像も加えるか否かをユーザが所望に選択することができるように構成されている。従って、ここでは、ユーザによる設定がどうなっているかを判定する。   Then, next, it is determined whether only the R image and the B image are to be combined, or in addition to these, the G image is also combined (step S91). Here, the phase difference image obtained by synthesizing only the R image and the B image has an advantage that the unfocused portion can be clearly confirmed, and the phase difference image obtained by synthesizing the R image, the B image, and the G image is obtained. There is an advantage that the overall color is the same as that of a normal color image and there is little uncomfortable feeling. Therefore, the user can select as desired whether or not to add the G image to the image composition by inputting from the operation unit 32. Therefore, it is determined here how the setting by the user is.

そして、スプリット画像生成部45は、G画像を画像合成すると判定された場合には、デモザイキング後のR画像、B画像、およびG画像を画像合成し(ステップS92)、G画像を画像合成しないと判定された場合には、デモザイキング後のR画像およびB画像のみを画像合成する(ステップS93)。   When it is determined that the G image is to be combined, the split image generation unit 45 combines the R image, the B image, and the G image after demosaicing (step S92), and does not combine the G image. If it is determined, only the R image and B image after demosaicing are combined (step S93).

その後は、ステップS80以降の処理を上述したように行う。   Thereafter, the processing after step S80 is performed as described above.

このような実施形態3によれば、上述した実施形態1,2とほぼ同様の効果を奏するとともに、非合焦部に発生する色ズレにより、どの被写体が合焦し、どの被写体が非合焦であるかを、目視により容易に確認することが可能となる。さらに、色ズレの程度により、合焦位置からのズレ量を把握することができる。加えて、色ズレの左右位置(R画像とB画像の何れが左側にあり、他の何れが右側にあるか)によって、対象被写体が近距離側にあるか遠距離側にあるかを把握することができる。   According to the third embodiment, substantially the same effect as in the first and second embodiments described above is obtained, and which subject is in focus and which subject is out of focus due to the color shift generated in the out-of-focus portion. It can be easily confirmed by visual inspection. Furthermore, the amount of deviation from the in-focus position can be grasped based on the degree of color deviation. In addition, the right / left position of the color misregistration (whether the R image or the B image is on the left side and the other is on the right side) grasps whether the target subject is on the near side or the far side. be able to.

また、カラー立体視画像を作成する処理が不要となるために、画像処理がより簡易となり、処理負荷を軽減することが可能となる。
[実施形態4]
In addition, since a process for creating a color stereoscopic image is not required, the image processing becomes simpler and the processing load can be reduced.
[Embodiment 4]

図48から図50は本発明の実施形態4を示したものであり、図48は撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図、図49は撮像装置の表示部に表示される位相差画像の例を示す図、図50は撮像装置における表示処理を示すフローチャートである。   48 to 50 show the fourth embodiment of the present invention, FIG. 48 is a block diagram showing the detailed configuration of the image processing unit and the system controller in the imaging apparatus, and FIG. 49 is displayed on the display unit of the imaging apparatus. FIG. 50 is a flowchart illustrating display processing in the imaging apparatus.

この実施形態4において、上述の実施形態1〜3と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the fourth embodiment, the same parts as those in the first to third embodiments are denoted by the same reference numerals, description thereof is omitted, and only different points will be mainly described.

図48に示すように、本実施形態の画像処理部25は、モノクロスプリット画像生成部46を備えたものとなっている。なお、画像処理部25中にステレオ画像生成部40は図示していないが、設けられていても構わないし、省略されていても良い。   As shown in FIG. 48, the image processing unit 25 of the present embodiment includes a monochrome split image generation unit 46. The stereo image generation unit 40 is not shown in the image processing unit 25, but may be provided or omitted.

モノクロスプリット画像生成部46は、撮像素子22により撮像され、色間補正部36により色間補正が行われて、画像処理部25によりデモザイキングが行われた、第1の画像と第2の画像とをモノクロ画像として合成し、モノクロスプリット画像を生成するものである。具体的には、モノクロスプリット画像生成部46は、各画素値を輝度値であると見なして、色間補正により正規化されたデモザイキング後のR画像とB画像とを画像合成し、モノクロスプリット画像を生成する。   The monochrome split image generation unit 46 is a first image and a second image that are captured by the image sensor 22, corrected between colors by the intercolor correction unit 36, and demosaiced by the image processing unit 25. Are combined as a monochrome image to generate a monochrome split image. Specifically, the monochrome split image generation unit 46 regards each pixel value as a luminance value, combines the R and B images after demosaicing normalized by inter-color correction, and performs monochrome splitting. Generate an image.

従って、表示部27の画面27aに表示される位相差画像はモノクロスプリット画像となる。このモノクロスプリット画像において、合焦位置にある被写体OBJcはモノクロ2重像とはならず(図49に示す完全重畳した像mrb)、合焦位置よりも遠距離側または近距離側にある被写体OBJf,OBJnは合焦位置からのズレ量に応じたスプリットを示すモノクロ2重像(図49に示すように、R画像に基づくモノクロ画像mrと、B画像に基づくモノクロ画像mbと、のモノクロ2重像)となる。   Accordingly, the phase difference image displayed on the screen 27a of the display unit 27 is a monochrome split image. In this monochrome split image, the subject OBJc at the in-focus position is not a monochrome double image (completely superimposed image mrb shown in FIG. 49), but the subject OBJf at the far side or near side from the in-focus position. , OBJn is a monochrome double image showing a split according to the amount of deviation from the in-focus position (as shown in FIG. 49, a monochrome double image of a monochrome image mr based on the R image and a monochrome image mb based on the B image). Image).

このような画像を表示するための処理を、図50を参照して説明する。   Processing for displaying such an image will be described with reference to FIG.

この処理を開始して、ステップS74までの処理を行ったものとする。   Assume that this processing is started and the processing up to step S74 is performed.

すると次に、各画素の画素値を輝度値と見なして、色間補正部36により、R画像の輝度値の正規化を行うと共に(ステップS101)、B画像の輝度値の正規化を行う(ステップS102)。   Then, the pixel value of each pixel is regarded as a luminance value, the inter-color correction unit 36 normalizes the luminance value of the R image (step S101), and normalizes the luminance value of the B image (step S101). Step S102).

そして、モノクロスプリット画像生成部46は、正規化されたR画像の画素値とB画像の画素値とを画素位置毎に加算(あるいは加算平均)して、モノクロ画像合成を行う(ステップS103)。   Then, the monochrome split image generation unit 46 adds the normalized pixel value of the R image and the pixel value of the B image for each pixel position (or addition average), and performs monochrome image synthesis (step S103).

その後は、ステップS80以降の処理を上述したように行う。   Thereafter, the processing after step S80 is performed as described above.

なお、モノクロ画像合成にG画像の画素値も用いると、非合焦部に発生するのが輝度の3重像となるために、ズレが不明確にならないように本実施形態ではG画像の画素値は用いていない。しかし、必要に応じて(例えば、違和感のない自然なモノクロ画像を得るために)用いるようにしても構わない。   Note that if the pixel value of the G image is also used for the monochrome image composition, the luminance image is generated in the out-of-focus portion, and therefore the pixel of the G image is used in this embodiment so that the deviation is not unclear. No value is used. However, it may be used as necessary (for example, to obtain a natural monochrome image without a sense of incongruity).

このような実施形態4によれば、上述した実施形態1〜3とほぼ同様の効果を奏するとともに、非合焦部に発生する輝度の2重像により、どの被写体が合焦し、どの被写体が非合焦であるかを、目視により容易に確認することが可能となる。さらに、2重像のズレの程度により、合焦位置からのズレ量を把握することができる。そして、実施形態3と同様に、カラー立体視画像を作成する処理が不要となるために、画像処理がより簡易となり、処理負荷を軽減することが可能となる。加えて、モノクロ処理であるために、実施形態3と比べても処理がより軽くなり、短時間での表示が可能となる。
[実施形態5]
According to the fourth embodiment, the same effects as those of the first to third embodiments described above can be obtained, and which subject is in focus and which subject is focused by the brightness double image generated in the out-of-focus portion. Whether or not it is out of focus can be easily confirmed visually. Furthermore, the amount of deviation from the in-focus position can be grasped based on the degree of deviation of the double image. And since the process which produces a color stereoscopic vision image becomes unnecessary similarly to Embodiment 3, image processing becomes simpler and it becomes possible to reduce a processing load. In addition, since it is a monochrome process, the process is lighter than in the third embodiment, and a display in a short time is possible.
[Embodiment 5]

図51から図54は本発明の実施形態5を示したものであり、図51は撮像装置における画像処理部およびシステムコントローラの詳細な構成を示すブロック図、図52は撮像装置の表示部に表示される位相差画像の例を示す図、図53は撮像装置における表示処理を示すフローチャート、図54は位相差量の大きさに応じて予め定められた色の一例を示す線図である。   51 to 54 show Embodiment 5 of the present invention. FIG. 51 is a block diagram showing the detailed configuration of the image processing unit and the system controller in the imaging apparatus. FIG. 52 is a display on the display unit of the imaging apparatus. FIG. 53 is a flowchart showing display processing in the imaging apparatus, and FIG. 54 is a diagram showing an example of a color predetermined according to the magnitude of the phase difference amount.

この実施形態5において、上述の実施形態1〜4と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the fifth embodiment, the same parts as those in the first to fourth embodiments are denoted by the same reference numerals, description thereof is omitted, and only different points will be mainly described.

図51に示すように、本実施形態の画像処理部25は、疑似カラー画像生成部47を備えたものとなっている。なお、画像処理部25中にステレオ画像生成部40は図示していないが、設けられていても構わないし、省略されていても良い。   As shown in FIG. 51, the image processing unit 25 of this embodiment includes a pseudo color image generation unit 47. The stereo image generation unit 40 is not shown in the image processing unit 25, but may be provided or omitted.

まず、距離演算部39は、画像全体に対して、第1の画像と第2の画像との位相差量、具体的には、R画像とB画像との位相差量を演算するようになっている。   First, the distance calculation unit 39 calculates the phase difference amount between the first image and the second image, specifically, the phase difference amount between the R image and the B image with respect to the entire image. ing.

そして、疑似カラー画像生成部47は、図54に示すような位相差量の大きさに応じて予め定められた色を、位相差量が演算された画像全体に適用することにより、疑似カラー画像を生成するものである。   Then, the pseudo color image generation unit 47 applies a predetermined color according to the magnitude of the phase difference amount as shown in FIG. 54 to the entire image for which the phase difference amount has been calculated, thereby producing a pseudo color image. Is generated.

図54に示す具体的な色割り当ては、各色が8ビット階調、つまり0〜255の値を取る場合の例を示している。   The specific color assignment shown in FIG. 54 shows an example in which each color takes an 8-bit gradation, that is, a value from 0 to 255.

まず、位相差0、つまり合焦している被写体についてはB:G:R=0:255:0の色が割り当てられ、緑色で表示される。   First, a phase difference of 0, that is, a focused subject is assigned a color of B: G: R = 0: 255: 0 and is displayed in green.

合焦位置よりも近距離側にある被写体については、合焦位置から近距離側へ離れるに従って、まずB成分の値が増加され、B成分が255となったところでG成分の減少が開始されて、至近距離に対応する位相差−MAXNにおいてG成分が0となり、B:G:R=255:0:0の色が割り当てられ、青色で表示される。   For a subject that is closer to the in-focus position than the in-focus position, the B component value is first increased as the distance from the in-focus position decreases, and when the B component reaches 255, the G component starts decreasing. In the phase difference -MAXN corresponding to the close distance, the G component becomes 0, the color of B: G: R = 255: 0: 0 is assigned, and is displayed in blue.

また、合焦位置よりも遠距離側にある被写体については、合焦位置から遠距離側へ離れるに従って、まずR成分の値が増加され、R成分が255となったところでG成分の減少が開始されて、無限遠距離に対応する位相差+MAXFにおいてG成分が0となり、B:G:R=0:0:255の色が割り当てられ、赤色で表示される。   For a subject that is farther away than the in-focus position, the R component value is first increased as the distance from the in-focus position is further away, and when the R component reaches 255, the G component starts decreasing. Thus, the G component becomes 0 in the phase difference + MAXF corresponding to the infinity distance, and the color of B: G: R = 0: 0: 255 is assigned and displayed in red.

このような色割り当てを行うことにより、緑色であれば合焦位置もしくはその近傍にあること、および青色成分を高い純度で含むほど合焦位置よりも近距離側にあり、赤色成分を高い純度で含むほど合焦位置よりも遠距離側にあることを、目視により容易に確認することが可能となる。   By performing such color assignment, if it is green, it is at or near the in-focus position, and the higher the purity of the blue component, the closer to the in-focus position, and the higher the purity of the red component. It can be easily confirmed visually that it is farther from the in-focus position as it is included.

こうして疑似カラー画像生成部47により生成された疑似カラー画像は、表示部27の画面27aに表示される。すなわち、例えば図52に示すように、合焦位置にある被写体OBJcは緑色領域Agとして表され、合焦位置よりも遠距離側にある被写体OBJfは合焦位置からのズレ量に応じた赤色成分を含む領域Arとして表され、合焦位置よりも近距離側にある被写体OBJnは合焦位置からのズレ量に応じた青色成分を含む領域Abとして表される。   The pseudo color image generated by the pseudo color image generation unit 47 is displayed on the screen 27 a of the display unit 27. That is, for example, as shown in FIG. 52, the subject OBJc at the in-focus position is represented as a green region Ag, and the subject OBJf at the far side from the in-focus position is a red component corresponding to the amount of deviation from the in-focus position. The subject OBJn that is closer to the in-focus position than the in-focus position is expressed as an area Ab that includes a blue component corresponding to the amount of deviation from the in-focus position.

このような画像を表示するための処理を、図53を参照して説明する。   Processing for displaying such an image will be described with reference to FIG.

この処理を開始して、ステップS75までの処理を行ったものとする。   Assume that this processing is started and the processing up to step S75 is performed.

するとこの時点で、画像全体の各画素位置における位相差量の分布が得られていることになる。   At this point, the distribution of the phase difference amount at each pixel position in the entire image is obtained.

そこで、疑似カラー画像生成部47が、画素位置の位相差量に応じて図54に示すような色を割り当てる疑似カラー画像生成の処理を行う(ステップS111)。これにより、例えば図52に示したような疑似カラー画像が生成される。   Therefore, the pseudo color image generation unit 47 performs a pseudo color image generation process for assigning colors as shown in FIG. 54 according to the phase difference amount of the pixel position (step S111). Thereby, for example, a pseudo color image as shown in FIG. 52 is generated.

その後は、ステップS80以降の処理を上述したように行う。   Thereafter, the processing after step S80 is performed as described above.

なお、上述では合焦位置にG色、近距離側にB色、遠距離側にR色を割り当てる例を示したが、勿論これは一例であり、その他の色配合を適用しても構わないし、ユーザが所望に設定することができるようにしても構わない。   In the above description, the G color is assigned to the in-focus position, the B color is assigned to the short distance side, and the R color is assigned to the long distance side. However, this is only an example, and other color combinations may be applied. The user may set it as desired.

このような実施形態5によれば、上述した実施形態1〜4とほぼ同様の効果を奏するとともに、色を見ることにより、どの被写体が合焦し、どの被写体が非合焦であるかを、目視により容易に確認することが可能となる。このような擬似カラー表示は、合焦部位を瞬時に判別し易い利点がある。しかも、R成分を含むかB成分を含むかによって、遠距離側であるか近距離側であるかを容易に判別することができる。さらに、R成分またはB成分をどの程度の純度で含むかによって、合焦位置から離れている程度を容易に認識することができる。加えて、実施形態3、4と同様に、カラー立体視画像を作成する処理が不要となるために、画像処理がより簡易となり、処理負荷を軽減することが可能となる。   According to the fifth embodiment, the same effects as those of the first to fourth embodiments described above can be obtained, and by looking at the color, which subject is in focus and which subject is out of focus, It can be easily confirmed visually. Such pseudo color display has an advantage that it is easy to determine the in-focus portion instantaneously. Moreover, it is possible to easily determine whether it is the long distance side or the short distance side depending on whether it includes the R component or the B component. Further, the degree of separation from the in-focus position can be easily recognized depending on the purity of the R component or the B component. In addition, as in the third and fourth embodiments, the process of creating a color stereoscopic image is not necessary, so that the image processing becomes simpler and the processing load can be reduced.

なお、本発明は上述した実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化することができる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成することができる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除しても良い。さらに、異なる実施形態にわたる構成要素を適宜組み合わせても良い。このように、発明の主旨を逸脱しない範囲内において種々の変形や応用が可能であることは勿論である。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. Moreover, various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, you may delete some components from all the components shown by embodiment. Furthermore, the constituent elements over different embodiments may be appropriately combined. Thus, it goes without saying that various modifications and applications are possible without departing from the spirit of the invention.

1…レンズユニット
2…ボディユニット
9…撮像光学系
10…レンズ(フォーカスレンズを含む)
11…絞り
12…帯域制限フィルタ
12b…GBフィルタ
12r…RGフィルタ
12g,12g1,12g2…Gフィルタ
12w…Wフィルタ
14…レンズ制御部
15…レンズ側通信コネクタ
18…色選択透過素子
18L…第1色選択透過素子
18R…第2色選択透過素子
21…シャッタ
22…撮像素子(カラーの撮像素子)
23…撮像回路
24…撮像駆動部
25…画像処理部
26…画像メモリ
27…表示部
27a…画面
28…インターフェース(IF)
29…記録媒体
30,30A…システムコントローラ
31…センサ部
32,32A…操作部
33…ストロボ制御回路
34…ストロボ
35…ボディ側通信コネクタ
36…色間補正部
37…色画像生成部
38…コントラストAF制御部
38a…AFアシスト制御部
39…距離演算部
40…ステレオ画像生成部
41…画像処理装置
42…記録部
45…スプリット画像生成部
46…モノクロスプリット画像生成部
47…疑似カラー画像生成部
DESCRIPTION OF SYMBOLS 1 ... Lens unit 2 ... Body unit 9 ... Imaging optical system 10 ... Lens (a focus lens is included)
DESCRIPTION OF SYMBOLS 11 ... Aperture 12 ... Band-limiting filter 12b ... GB filter 12r ... RG filter 12g, 12g1, 12g2 ... G filter 12w ... W filter 14 ... Lens control part 15 ... Lens side communication connector 18 ... Color selective transmission element 18L ... First color Selective transmission element 18R ... Second color selective transmission element 21 ... Shutter 22 ... Imaging element (color imaging element)
DESCRIPTION OF SYMBOLS 23 ... Imaging circuit 24 ... Imaging drive part 25 ... Image processing part 26 ... Image memory 27 ... Display part 27a ... Screen 28 ... Interface (IF)
DESCRIPTION OF SYMBOLS 29 ... Recording medium 30, 30A ... System controller 31 ... Sensor part 32, 32A ... Operation part 33 ... Strobe control circuit 34 ... Strobe 35 ... Body side communication connector 36 ... Inter-color correction part 37 ... Color image generation part 38 ... Contrast AF Control unit 38a ... AF assist control unit 39 ... Distance calculation unit 40 ... Stereo image generation unit 41 ... Image processing device 42 ... Recording unit 45 ... Split image generation unit 46 ... Monochrome split image generation unit 47 ... Pseudo color image generation unit

Claims (7)

複数の波長帯域の光をそれぞれ受光して光電変換し、第1の帯域の第1の画像と第2の帯域の第2の画像と第3の帯域の第3の画像とを生成するカラーの撮像素子と、
被写体像を前記撮像素子に結像する撮像光学系と、
前記撮像光学系を経て前記撮像素子に至る撮影光束の光路上に配設されていて、前記撮像光学系の瞳領域の一部である第1の領域を通過しようとする撮影光束中の前記第1の帯域の光を遮断し前記第2の帯域および前記第3の帯域の光を通過させる第1の帯域制限と、前記撮像光学系の瞳領域の他の一部である第2の領域を通過しようとする撮影光束中の第2の帯域の光を遮断し前記第1の帯域および前記第3の帯域の光を通過させる第2の帯域制限と、を行う帯域制限フィルタと、
前記第1の画像と前記第2の画像との位相差を示す位相差画像を表示する表示部と、
を具備したことを特徴とする撮像装置。
Receiving light of a plurality of wavelength bands, photoelectrically converting them, and generating a first image in the first band, a second image in the second band, and a third image in the third band An image sensor;
An imaging optical system that forms a subject image on the imaging device;
The first part of the photographing light beam that is disposed on the optical path of the photographing light beam that passes through the image pickup optical system and reaches the image pickup element and that attempts to pass through a first region that is a part of the pupil region of the image pickup optical system. A first band limitation that blocks light in one band and allows light in the second band and the third band to pass; and a second area that is another part of the pupil area of the imaging optical system. A band-limiting filter that performs a second band limitation that blocks light in the second band in the imaging light flux to be passed and allows the light in the first band and the third band to pass;
A display unit for displaying a phase difference image indicating a phase difference between the first image and the second image;
An imaging apparatus comprising:
前記第1の画像と前記第2の画像との位相差量を演算する距離演算部と、
前記距離演算部により演算された位相差量に基づき、前記第2の画像および前記第3の画像のボケの重心位置を前記第1の画像のボケの重心位置の方向へ移動させた一の片目用カラー画像を生成するとともに、前記第1の画像および前記第3の画像のボケの重心位置を前記第2の画像のボケの重心位置の方向へ移動させた他の片目用カラー画像を生成することにより、カラーの立体視画像を生成するステレオ画像生成部と、
をさらに具備し、
前記表示部は、前記位相差画像として、前記一の片目用カラー画像と前記他の片目用カラー画像とを同時に表示するものであることを特徴とする請求項1に記載の撮像装置。
A distance calculation unit for calculating a phase difference amount between the first image and the second image;
One eye in which the center of gravity position of the second image and the third image is moved in the direction of the center position of the blur of the first image based on the phase difference amount calculated by the distance calculation unit. And a color image for another eye in which the position of the center of gravity of the blur of the first image and the third image is moved in the direction of the position of the center of gravity of the blur of the second image. A stereo image generator that generates a color stereoscopic image;
Further comprising
The imaging apparatus according to claim 1, wherein the display unit simultaneously displays the one-eye color image and the other one-eye color image as the phase difference image.
前記ステレオ画像生成部は、前記距離演算部により演算された位相差量に1よりも大きい所定の係数を乗算した補正位相差量に基づき、立体感を強調したカラーの立体視画像を生成するものであることを特徴とする請求項2に記載の撮像装置。   The stereo image generating unit generates a color stereoscopic image with enhanced stereoscopic effect based on a corrected phase difference amount obtained by multiplying the phase difference amount calculated by the distance calculating unit by a predetermined coefficient larger than 1. The imaging apparatus according to claim 2, wherein: 前記第1の帯域の色の前記第1の画像と、前記第2の帯域の色の前記第2の画像と、を合成してスプリット画像を生成するスプリット画像生成部をさらに具備し、
前記表示部は、前記位相差画像として、前記スプリット画像を表示するものであることを特徴とする請求項1に記載の撮像装置。
A split image generating unit configured to generate a split image by combining the first image of the first band color and the second image of the second band color;
The imaging apparatus according to claim 1, wherein the display unit displays the split image as the phase difference image.
前記第1の画像と前記第2の画像とをモノクロ画像として合成し、モノクロスプリット画像を生成するモノクロスプリット画像生成部をさらに具備し、
前記表示部は、前記位相差画像として、前記モノクロスプリット画像を表示するものであることを特徴とする請求項1に記載の撮像装置。
A monochrome split image generation unit configured to combine the first image and the second image as a monochrome image to generate a monochrome split image;
The imaging apparatus according to claim 1, wherein the display unit displays the monochrome split image as the phase difference image.
前記第1の画像と前記第2の画像との位相差量を演算する距離演算部と、
位相差量の大きさに応じて予め定められた色を、位相差量が演算された画像全体に適用することにより、疑似カラー画像を生成する疑似カラー画像生成部と、
をさらに具備し、
前記表示部は、前記位相差画像として、前記疑似カラー画像を表示するものであることを特徴とする請求項1に記載の撮像装置。
A distance calculation unit for calculating a phase difference amount between the first image and the second image;
A pseudo color image generation unit that generates a pseudo color image by applying a predetermined color according to the magnitude of the phase difference amount to the entire image in which the phase difference amount is calculated;
Further comprising
The imaging apparatus according to claim 1, wherein the display unit displays the pseudo color image as the phase difference image.
前記第1の帯域と前記第2の帯域との内の、一方の帯域は青(B)の帯域、他方の帯域は赤(R)の帯域であり、前記第3の帯域は緑(G)の帯域であることを特徴とする請求項1の撮像装置。   Of the first band and the second band, one band is a blue (B) band, the other band is a red (R) band, and the third band is green (G). The imaging apparatus according to claim 1, wherein the imaging device has a bandwidth of 1.
JP2011180890A 2011-08-22 2011-08-22 Imaging apparatus Withdrawn JP2013044806A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2011180890A JP2013044806A (en) 2011-08-22 2011-08-22 Imaging apparatus
PCT/JP2012/067486 WO2013027504A1 (en) 2011-08-22 2012-07-09 Imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011180890A JP2013044806A (en) 2011-08-22 2011-08-22 Imaging apparatus

Publications (1)

Publication Number Publication Date
JP2013044806A true JP2013044806A (en) 2013-03-04

Family

ID=47746255

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011180890A Withdrawn JP2013044806A (en) 2011-08-22 2011-08-22 Imaging apparatus

Country Status (2)

Country Link
JP (1) JP2013044806A (en)
WO (1) WO2013027504A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014235237A (en) * 2013-05-31 2014-12-15 株式会社ニコン Focus detection device and focus adjustment device
WO2014208178A1 (en) * 2013-06-26 2014-12-31 オリンパス株式会社 Image pickup device and image pickup method
JP2015081846A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
JP2015082033A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
JP2018084802A (en) * 2016-11-11 2018-05-31 株式会社東芝 Imaging device, imaging system, and distance information acquisition method
WO2018193546A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capturing device and endoscope device
WO2018193552A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capture device and endoscope device
WO2018193544A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capturing device and endoscope device
US10145994B2 (en) 2014-11-28 2018-12-04 Kabushiki Kaisha Toshiba Lens device and image capturing device for acquiring distance information at high accuracy
US10620425B2 (en) 2017-08-31 2020-04-14 Olympus Corporation Measurement apparatus and method of operating measurement apparatus
US11172174B2 (en) 2017-12-21 2021-11-09 Olympus Corporation Imaging apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001021792A (en) * 1999-07-09 2001-01-26 Olympus Optical Co Ltd Focus detection system
JP5043626B2 (en) * 2007-12-13 2012-10-10 キヤノン株式会社 Imaging device

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014235237A (en) * 2013-05-31 2014-12-15 株式会社ニコン Focus detection device and focus adjustment device
CN105359024A (en) * 2013-06-26 2016-02-24 奥林巴斯株式会社 Image pickup device and image pickup method
WO2014208178A1 (en) * 2013-06-26 2014-12-31 オリンパス株式会社 Image pickup device and image pickup method
JP2015011058A (en) * 2013-06-26 2015-01-19 オリンパス株式会社 Imaging device and imaging method
EP3015892A4 (en) * 2013-06-26 2017-01-25 Olympus Corporation Image pickup device and image pickup method
US9525856B2 (en) 2013-06-26 2016-12-20 Olympus Corporation Imaging device and imaging method
CN105659054A (en) * 2013-10-23 2016-06-08 奥林巴斯株式会社 Imaging device and phase difference detection method
WO2015059970A1 (en) * 2013-10-23 2015-04-30 オリンパス株式会社 Imaging device and phase difference detection method
WO2015059971A1 (en) * 2013-10-23 2015-04-30 オリンパス株式会社 Imaging device and phase difference detection method
JP2015082033A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
JP2015081846A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
US10145994B2 (en) 2014-11-28 2018-12-04 Kabushiki Kaisha Toshiba Lens device and image capturing device for acquiring distance information at high accuracy
JP2018084802A (en) * 2016-11-11 2018-05-31 株式会社東芝 Imaging device, imaging system, and distance information acquisition method
WO2018193546A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capturing device and endoscope device
WO2018193552A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capture device and endoscope device
WO2018193544A1 (en) * 2017-04-19 2018-10-25 オリンパス株式会社 Image capturing device and endoscope device
US10778948B2 (en) 2017-04-19 2020-09-15 Olympus Corporation Imaging apparatus and endoscope apparatus
US10620425B2 (en) 2017-08-31 2020-04-14 Olympus Corporation Measurement apparatus and method of operating measurement apparatus
US11172174B2 (en) 2017-12-21 2021-11-09 Olympus Corporation Imaging apparatus

Also Published As

Publication number Publication date
WO2013027504A1 (en) 2013-02-28

Similar Documents

Publication Publication Date Title
WO2013027504A1 (en) Imaging device
US9247227B2 (en) Correction of the stereoscopic effect of multiple images for stereoscope view
JP5066851B2 (en) Imaging device
US8885026B2 (en) Imaging device and imaging method
CN101884222B (en) The image procossing presented for supporting solid
US8520059B2 (en) Stereoscopic image taking apparatus
US8786676B2 (en) Imaging device for generating stereoscopic image
WO2013005489A1 (en) Image capture device and image processing device
CN108462830B (en) Image pickup apparatus and control method of image pickup apparatus
JP5469258B2 (en) Imaging apparatus and imaging method
US10992854B2 (en) Image processing apparatus, imaging apparatus, image processing method, and storage medium
JP6951917B2 (en) Imaging device
WO2014192300A1 (en) Imaging element, imaging device, and image processing device
JP2017184217A (en) Image processing device, imaging apparatus, method for controlling them, and program
JP2014026051A (en) Image capturing device and image processing device
JP5348258B2 (en) Imaging device
JP2013003159A (en) Imaging apparatus
JP2017005689A (en) Image processing system and image processing method
JP2013097154A (en) Distance measurement device, imaging apparatus, and distance measurement method
JP6595797B2 (en) Imaging apparatus and control method thereof
JP2014026050A (en) Image capturing device and image processing device
JP6056160B2 (en) Automatic focusing device, automatic focusing method and program
JP2013037294A (en) Image pickup apparatus
JP2012124650A (en) Imaging apparatus, and imaging method
JP5901780B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20141104