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

Image processing apparatus, image processing method and program Download PDF

Info

Publication number
JP2019186905A
JP2019186905A JP2018242178A JP2018242178A JP2019186905A JP 2019186905 A JP2019186905 A JP 2019186905A JP 2018242178 A JP2018242178 A JP 2018242178A JP 2018242178 A JP2018242178 A JP 2018242178A JP 2019186905 A JP2019186905 A JP 2019186905A
Authority
JP
Japan
Prior art keywords
image
recovery
eye image
phase difference
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018242178A
Other languages
Japanese (ja)
Inventor
彰人 今井
Akihito Imai
彰人 今井
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Publication of JP2019186905A publication Critical patent/JP2019186905A/en
Pending legal-status Critical Current

Links

Images

Abstract

To execute recovery processing for appropriately recovering a blur caused by an optical system, on an image.SOLUTION: The image processing apparatus, correcting image quality deterioration caused by an optical system, includes: acquisition means for acquiring a right eye image and a left eye image; calculation means for calculating a phase difference amount of a subject for each region in the right eye image and the left eye image; setting means for setting a recovery filter on the basis of the phase difference amount; and recovery processing means for executing recovery processing on the right eye image and the left eye image, using a recovery filter set by the setting means.SELECTED DRAWING: Figure 3

Description

本発明は、撮像装置や出力装置などの光学系によって生じる画像のぼけを補正する技術に関する。   The present invention relates to a technique for correcting image blur caused by an optical system such as an imaging device or an output device.

光学系を介して取得される画像において、光学系に起因するぼけを補正する方法として、光学系の点像強度分布を二次元フーリエ変換した光学伝達関数(Optical Transfer Function:OTF)を用いた補正方法が知られている。   As a method for correcting blur caused by an optical system in an image acquired via the optical system, correction using an optical transfer function (OTF) obtained by two-dimensional Fourier transform of the point image intensity distribution of the optical system. The method is known.

この補正方法は「画像回復」や「画像復元」と呼ばれる。画像回復においては一般に、OTFの逆特性を持つ逆フィルタを回復フィルタとして画像に適用する。   This correction method is called “image restoration” or “image restoration”. In image restoration, generally, an inverse filter having an inverse characteristic of OTF is applied to an image as a restoration filter.

また、光学系に起因するぼけに限定せず、撮像装置あるいはプリンタ等の出力装置の装置全体に起因する画像のぼけ度合いを表した空間周波数特性(Spatial Frequency Response:SFR)を用いることもある。   In addition, the spatial frequency characteristic (SFR) representing the degree of blurring of an image caused by the entire output device such as an imaging device or a printer may be used without being limited to the blur caused by the optical system.

SFRは例えば、縦横それぞれのエッジ画像を撮影あるいは出力した画像の輝度・濃度分布を一次元フーリエ変換した結果として得ることができる。   The SFR can be obtained, for example, as a result of one-dimensional Fourier transform of the luminance / density distribution of an image obtained by capturing or outputting vertical and horizontal edge images.

特許文献1に記載された方法では、画像における被写体までの距離に応じて回復フィルタを設定することで、領域毎に光学系に起因するぼけを回復するための回復フィルタを生成する方法を記載している。   The method described in Patent Document 1 describes a method of generating a recovery filter for recovering blur caused by the optical system for each region by setting a recovery filter according to the distance to the subject in the image. ing.

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

しかしながら被写体の距離が同じであっても、絞り値などの撮影条件によっては画像におけるぼけの度合いが異なる場合がある。そのため従来においては、画像に対して領域ごとに適切な回復フィルタを設定できない場合があった。   However, even if the subject distance is the same, the degree of blur in the image may differ depending on the shooting conditions such as the aperture value. For this reason, conventionally, there has been a case where an appropriate restoration filter cannot be set for each region of an image.

そこで本発明は、画像に対して、光学系に起因するぼけを回復するための回復処理を適切に実行することを目的とする。   Accordingly, an object of the present invention is to appropriately execute a recovery process for recovering blur caused by an optical system on an image.

上記課題を解決するため本発明は、光学系に起因する画質劣化を補正する画像処理装置であって、右眼用画像と左眼用画像を取得する取得手段と、前記右眼用画像と前記左眼用画像における領域ごとに、被写体の位相差量を算出する算出手段と、前記位相差量に基づいて、回復フィルタを設定する設定手段と、前記設定手段に設定された回復フィルタを用いて、前記右眼用画像と前記左眼用画像に対して回復処理を実行する回復処理手段と、を有することを特徴とする。   In order to solve the above-described problems, the present invention is an image processing apparatus that corrects image quality degradation caused by an optical system, an acquisition unit that acquires a right-eye image and a left-eye image, the right-eye image, and the right-eye image. For each region in the image for the left eye, a calculation unit that calculates the phase difference amount of the subject, a setting unit that sets a recovery filter based on the phase difference amount, and a recovery filter that is set in the setting unit And recovery processing means for executing recovery processing on the right-eye image and the left-eye image.

本発明によれば、画像に対して、光学系に起因するぼけを回復するための回復処理を適切に実行することが可能となる。   According to the present invention, it is possible to appropriately execute a recovery process for recovering blur caused by an optical system on an image.

第1の実施形態における撮像装置の構成を示す図。1 is a diagram illustrating a configuration of an imaging device according to a first embodiment. 第1の実施形態におけるセンサアレイおよびマイクロレンズの構造と光学的な特性を説明するための模式図。The schematic diagram for demonstrating the structure and optical characteristic of a sensor array and a micro lens in 1st Embodiment. 第1の実施形態における信号処理部の論理的な構成を示すブロック図。The block diagram which shows the logical structure of the signal processing part in 1st Embodiment. 第1の実施形態における撮像方法の処理の流れを示すフローチャート。6 is a flowchart showing a flow of processing of an imaging method according to the first embodiment. 第1の実施形態における被写体の合焦状態と絞り値、位相差量の関係示す模式図。FIG. 3 is a schematic diagram illustrating a relationship between a focused state of an object, an aperture value, and a phase difference amount in the first embodiment. 第1の実施形態における画像回復処理の流れを示すフローチャート。5 is a flowchart showing a flow of image restoration processing in the first embodiment. 第1の実施形態における位相差量と画像回復強度の関係を示す図。The figure which shows the relationship between the phase difference amount and image restoration intensity | strength in 1st Embodiment. 第2の実施形態における画像処理装置の構成を示す図。The figure which shows the structure of the image processing apparatus in 2nd Embodiment. 第2の実施形態における画像処理装置の論理的な構成を示すブロック図。The block diagram which shows the logical structure of the image processing apparatus in 2nd Embodiment. 第2の実施形態におけるプリンタのSFRを示す図The figure which shows SFR of the printer in 2nd Embodiment. 第2の実施形態における画像回復処理および画像出力の流れを示すフローチャート。9 is a flowchart showing a flow of image restoration processing and image output in the second embodiment.

以下、添付の図面を参照して、本発明を好適な実施形態に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例にすぎず、本発明は図示された構成に必ずしも限定されるものではない。   Hereinafter, the present invention will be described in detail based on preferred embodiments with reference to the accompanying drawings. The configurations shown in the following embodiments are merely examples, and the present invention is not necessarily limited to the illustrated configurations.

<第1の実施形態>
(撮像装置)
図1は、本実施形態に係る撮像装置の構成の一例を示す図である。撮像装置は、撮像光学系104、イメージセンサ105、A/D変換部106、信号処理部108、エンコーダ109、メディアインターフェース(メディアI/F)110を有する。また、撮像装置は、撮像系制御部107、CPU101、ROM102、RAM103、操作部111、表示部112を有する。CPU101は、各構成における処理を制御する。CPU101は、ROM102やRAM103に格納された命令を順に読み込み、解釈し、その結果に従って各種の処理を実行する。また、ROM102とRAM103は、各処理に必要なプログラム、データ、作業領域などをCPU101に提供する。
<First Embodiment>
(Imaging device)
FIG. 1 is a diagram illustrating an example of a configuration of an imaging apparatus according to the present embodiment. The imaging apparatus includes an imaging optical system 104, an image sensor 105, an A / D conversion unit 106, a signal processing unit 108, an encoder 109, and a media interface (media I / F) 110. The imaging apparatus includes an imaging system control unit 107, a CPU 101, a ROM 102, a RAM 103, an operation unit 111, and a display unit 112. The CPU 101 controls processing in each configuration. The CPU 101 sequentially reads and interprets instructions stored in the ROM 102 and RAM 103, and executes various processes according to the results. The ROM 102 and RAM 103 provide the CPU 101 with programs, data, work areas, and the like necessary for each process.

撮像光学系104は、ズームレンズ、フォーカスレンズ、ぶれ補正レンズ、及び絞りなどから構成される。撮像光学系104は、被写体から発せられた光束をイメージセンサ105に導く。なお撮像光学系104は、撮像系制御部107の指示に基づいてフォーカスレンズの位置を調整することにより、焦点距離を変化させることができる。   The imaging optical system 104 includes a zoom lens, a focus lens, a shake correction lens, a diaphragm, and the like. The imaging optical system 104 guides the light beam emitted from the subject to the image sensor 105. The imaging optical system 104 can change the focal length by adjusting the position of the focus lens based on an instruction from the imaging system control unit 107.

イメージセンサ105はシャッター、光学ローパスフィルタ、iRカットフィルタ、カラーフィルタ、CMOSやCCD等を配列したセンサアレイ、信号読み出し回路から構成される。イメージセンサ105は、撮像光学系104を通して撮像装置に入射した光束を画素ごとの光量を示す電気信号に変換する。センサアレイおよび信号読み出し回路の詳細については後述する。A/D変換部106は、イメージセンサ105より得られた画素ごとの光量を示す電気信号をデジタル値に変換し、RAW画像を生成する。   The image sensor 105 includes a shutter, an optical low-pass filter, an iR cut filter, a color filter, a sensor array in which a CMOS, a CCD, and the like are arranged, and a signal readout circuit. The image sensor 105 converts the light beam incident on the imaging device through the imaging optical system 104 into an electrical signal indicating the amount of light for each pixel. Details of the sensor array and the signal readout circuit will be described later. The A / D conversion unit 106 converts an electrical signal indicating the amount of light for each pixel obtained from the image sensor 105 into a digital value, and generates a RAW image.

撮像系制御部107は、CPU101からの指示に基づき、フォーカスの調整、シャッターの開閉、絞りの調節など、撮像光学系104およびイメージセンサ105を制御する。信号処理部108は、A/D変換部106から出力されたRAW画像に対して画像回復処理(以降、回復処理とも呼ぶ)を含む種々の画像処理を施す。画像回復処理の詳細については後述する。また、信号処理部108は、生成されたRAW画像に基づいてデフォーカス量(焦点ずれ量)を算出する。   The imaging system control unit 107 controls the imaging optical system 104 and the image sensor 105 such as focus adjustment, shutter opening / closing, and aperture adjustment based on an instruction from the CPU 101. The signal processing unit 108 performs various image processing including image restoration processing (hereinafter also referred to as restoration processing) on the RAW image output from the A / D conversion unit 106. Details of the image restoration processing will be described later. Further, the signal processing unit 108 calculates a defocus amount (a defocus amount) based on the generated RAW image.

エンコーダ109は、信号処理部108が生成した画像データに対してタグ情報を付加したり、画像データを圧縮したりして、画像データを所定のフォーマットのファイルに変換する。メディアI/F110は、撮像装置をパーソナルコンピューターや各種のメディア(例えば、ハードディスク、メモリーカード、CFカード、SDカード、USBメモリ)に接続するためのインターフェースである。操作部111は、ボタンやモードダイヤルなどが該当し、これらを介して入力されたユーザー指示を受け取る。表示部112は、撮影画像の表示やユーザーへの各種情報の提供を行う。一般的には、液晶ディスプレイが広く表示部112として用いられている。また表示部112は、タッチスクリーン機能を有していても良い。表示部112がタッチスクリーン機能を有している場合は、表示部112がユーザー指示を受け付けることもできる。   The encoder 109 converts the image data into a file of a predetermined format by adding tag information to the image data generated by the signal processing unit 108 or compressing the image data. The media I / F 110 is an interface for connecting the imaging apparatus to a personal computer and various media (for example, a hard disk, a memory card, a CF card, an SD card, and a USB memory). The operation unit 111 corresponds to a button, a mode dial, and the like, and receives a user instruction input via these buttons. The display unit 112 displays captured images and provides various information to the user. In general, a liquid crystal display is widely used as the display unit 112. The display unit 112 may have a touch screen function. When the display unit 112 has a touch screen function, the display unit 112 can accept a user instruction.

(センサアレイ)
以下、イメージセンサ105の一部であるセンサアレイおよび信号読み出し回路の詳細について説明する。まず、センサアレイの詳細について説明を行う。本実施形態で使用するセンサアレイは二次元の画素配列を持つ。以下、説明のため二次元の画素配列が並んでいる方向をX軸およびY軸、センサアレイに垂直な方向(すなわち光軸方向)をZ軸とする。センサアレイの上には、各画素に1色が対応するようにベイヤ配列されたカラーフィルタが積層されている。また、カラーフィルタの上に各画素に1つのマイクロレンズが対応する形でマイクロレンズアレイが積層されている。
(Sensor array)
Details of the sensor array and the signal readout circuit that are part of the image sensor 105 will be described below. First, details of the sensor array will be described. The sensor array used in this embodiment has a two-dimensional pixel array. Hereinafter, for the sake of explanation, the direction in which the two-dimensional pixel array is arranged is defined as the X axis and the Y axis, and the direction perpendicular to the sensor array (that is, the optical axis direction) is defined as the Z axis. On the sensor array, color filters arranged in a Bayer array so that one color corresponds to each pixel are stacked. A microlens array is stacked on the color filter so that one microlens corresponds to each pixel.

図2は、本実施形態におけるセンサアレイおよびマイクロレンズの構造と光学的な特性の一例を説明するための模式図である。図2(a)は、撮像光学系の射出瞳面201をZ軸方向から観察した時の瞳領域を示している。図2(b)は、センサアレイの1つの画素202および対応するマイクロレンズ203をY軸方向から観察した時の断面の構造を示している。センサアレイにおける各画素は、X軸方向に2分割された204Aと204Bの2つの光電変換素子を持つ。各光電変換素子と撮像光学系の射出瞳面201はマイクロレンズ203によって共役関係となるように設計されている。瞳領域205a,bはそれぞれ光電変換素子204A,Bと対応している。すなわち、入射する光束のうち射出瞳面上の瞳領域205aを通過するものは光電変換素子204Aに入射する。また瞳領域205bを通過する光束は光電変換素子204Bに入射する。   FIG. 2 is a schematic diagram for explaining an example of the structure and optical characteristics of the sensor array and the microlens in the present embodiment. FIG. 2A shows a pupil region when the exit pupil plane 201 of the imaging optical system is observed from the Z-axis direction. FIG. 2B shows a cross-sectional structure when one pixel 202 of the sensor array and the corresponding microlens 203 are observed from the Y-axis direction. Each pixel in the sensor array has two photoelectric conversion elements 204A and 204B divided into two in the X-axis direction. Each photoelectric conversion element and the exit pupil plane 201 of the imaging optical system are designed to have a conjugate relationship by the microlens 203. The pupil regions 205a and 205b correspond to the photoelectric conversion elements 204A and 204B, respectively. That is, the incident light flux that passes through the pupil region 205a on the exit pupil plane enters the photoelectric conversion element 204A. A light beam passing through the pupil region 205b is incident on the photoelectric conversion element 204B.

光電変換素子204Aおよび204Bは不図示の読み出し回路を通じてA/D変換部106に接続されている。読み出し回路は、2つの光電変換素子からの電気信号を、個別にあるいは加算してA/D変換部106に出力する。読み出し回路は、イメージセンサ105上の画素配列を走査し、各画素からの電気信号を読み出してA/D変換することによりRAW画像が形成される。ここで、2つの光電変換素子からの電気信号を個別に読み出した場合、同一の被写体に対して位相差のある2つの画像が生成される。撮影者から見て右半分の瞳領域205aを通過し、光電変換素子204Aによって出力された画像を右眼用画像と呼ぶ。また、左半分の瞳領域205bを通過し、光電変換素子204Bによって出力された画像を左眼用画像と呼ぶ。一方読み出し回路が2つの光電変換素子からの電気信号を加算して出力した場合は、位相差のない1つの画像が生成される。本実施形態においてA/D変換部106は、位相差のある画像ペア(以降、位相差画像ペアと呼ぶ)と、位相差のない通常の画像(以降、通常画像と呼ぶ)を生成し出力する。   The photoelectric conversion elements 204A and 204B are connected to the A / D conversion unit 106 through a readout circuit (not shown). The reading circuit outputs the electrical signals from the two photoelectric conversion elements to the A / D conversion unit 106 individually or after addition. The readout circuit scans the pixel array on the image sensor 105, reads out electrical signals from each pixel, and performs A / D conversion to form a RAW image. Here, when the electrical signals from the two photoelectric conversion elements are individually read out, two images having a phase difference are generated for the same subject. An image that passes through the pupil region 205a on the right half as viewed from the photographer and is output by the photoelectric conversion element 204A is referred to as a right-eye image. An image that passes through the left half pupil region 205b and is output by the photoelectric conversion element 204B is referred to as a left-eye image. On the other hand, when the readout circuit adds and outputs the electrical signals from the two photoelectric conversion elements, one image without a phase difference is generated. In this embodiment, the A / D conversion unit 106 generates and outputs an image pair having a phase difference (hereinafter referred to as a phase difference image pair) and a normal image having no phase difference (hereinafter referred to as a normal image). .

(信号処理部)
次に、信号処理部108の構成の詳細について説明する。本実施形態において信号処理部108の処理は、ROM102あるいはRAM103に記憶されたプログラムをCPU101が実行することによってソフトウェアとして実装される。図3は、信号処理部108の詳細な論理構成を示すブロック図である。位相差量算出部301は、A/D変換部106から位相差画像ペアのRAW画像信号を受け取り、領域ごとの位相差量を算出する。ここで領域とは、1画素あるいは隣接する複数の画素を単位として分割された画像の部分領域を指す。本実施形態においては16画素×16画素の矩形領域を1つの領域とする。
(Signal processing part)
Next, details of the configuration of the signal processing unit 108 will be described. In the present embodiment, the processing of the signal processing unit 108 is implemented as software by the CPU 101 executing a program stored in the ROM 102 or the RAM 103. FIG. 3 is a block diagram showing a detailed logical configuration of the signal processing unit 108. The phase difference calculation unit 301 receives the RAW image signal of the phase difference image pair from the A / D conversion unit 106 and calculates the phase difference amount for each region. Here, the region refers to a partial region of an image divided in units of one pixel or a plurality of adjacent pixels. In the present embodiment, a rectangular area of 16 pixels × 16 pixels is defined as one area.

デフォーカス量算出部302は、位相差量算出部301が算出した領域ごとの位相差量と撮像光学系104の絞り値等の撮像パラメータに基づいて、主要被写体に対する撮像光学系104のデフォーカス量を算出する。デフォーカス量とは、合焦している位置までの距離(合焦距離)と被写体までの距離との差分の絶対値であり、被写体が合焦位置より奥にあるか手前にあるかに関わらず、被写体が合焦位置と離れているほど、デフォーカス量は大きくなる。なお、撮像系制御部107は、ピントを合わせたい被写体のデフォーカス量が大きい場合は、被写体のデフォーカス量が小さくなるように合焦位置を制御することでピントを調整する。   The defocus amount calculation unit 302 is based on the phase difference amount for each region calculated by the phase difference amount calculation unit 301 and the imaging parameters such as the aperture value of the imaging optical system 104 and the defocus amount of the imaging optical system 104 with respect to the main subject. Is calculated. The defocus amount is the absolute value of the difference between the distance to the focused position (focus distance) and the distance to the subject, regardless of whether the subject is behind or in front of the focused position. First, the farther the subject is from the in-focus position, the greater the defocus amount. Note that when the defocus amount of the subject to be focused is large, the imaging system control unit 107 adjusts the focus by controlling the focus position so that the defocus amount of the subject is small.

画像回復部303は、A/D変換部106から通常画像を受け取り、撮像系の光学特性によって生じた画質劣化を補正するための画像回復処理を施す。画像回復処理に際し、画像回復部303は、位相差量算出部301が算出した領域ごとの位相差量や、撮像光学系104の構成、合焦距離等を参照する。回復フィルタ記憶部304には画像回復部303が使用する回復フィルタが保存されている。回復フィルタは撮像光学系104の種類や、後述する回復の強度を示す係数αに応じ複数の種類が格納されている。   The image restoration unit 303 receives a normal image from the A / D conversion unit 106 and performs image restoration processing for correcting image quality degradation caused by the optical characteristics of the imaging system. In the image restoration process, the image restoration unit 303 refers to the phase difference amount for each region calculated by the phase difference amount calculation unit 301, the configuration of the imaging optical system 104, the focusing distance, and the like. The recovery filter storage unit 304 stores a recovery filter used by the image recovery unit 303. A plurality of types of recovery filters are stored in accordance with the type of the imaging optical system 104 and a coefficient α indicating the strength of recovery described later.

画像処理部305は、画像回復部303から回復処理済みの画像を受け取り、種々の画像処理を施して画素ごとにR,G,Bの3色に対応した値を持つRGB画像データを生成する。ここでいう画像処理には例えばデモザイキング、ノイズリダクション、ホワイトバランス制御、色変換、ガンマ変換などが含まれる。これらの画像処理については既知の手法が適用可能であるため、ここでの説明は省略する。   The image processing unit 305 receives the restored image from the image restoration unit 303, performs various image processes, and generates RGB image data having values corresponding to the three colors R, G, and B for each pixel. The image processing here includes, for example, demosaicing, noise reduction, white balance control, color conversion, gamma conversion, and the like. Since a known method can be applied to these image processes, description thereof is omitted here.

(回復フィルタ)
以下、本実施形態における画像回復処理に使用する回復フィルタの概要について説明する。まず、撮像光学系104を通って光学特性によって劣化した画像g(x,y)と、光学特性による劣化のない理想的な画像をf(x,y)とすると、画像g(x,y)と画像f(x,y)には式(1)が成り立つ。
(Recovery filter)
Hereinafter, an outline of a recovery filter used for image recovery processing in the present embodiment will be described. First, assuming that an image g (x, y) that has been deteriorated due to optical characteristics through the imaging optical system 104 and an ideal image that is not deteriorated due to optical characteristics is f (x, y), the image g (x, y). And the image f (x, y) holds the expression (1).

g(x,y)=h(x,y)*f(x,y)・・・(1)
式(1)においてh(x,y)は、撮像光学系104のOTF(Optical Transfer Function:光学伝達関数)のフーリエ変換ペアである点像分布関数(PSF)である。また、*はコンボリューション(畳み込み積分、積和)を示し、(x,y)は画像上の画素位置を示す。次に、式(1)をフーリエ変換して周波数領域により表現する形式に変換すると、以下の式(2)のように、周波数ごとの積の形式で示される。
g (x, y) = h (x, y) * f (x, y) (1)
In Expression (1), h (x, y) is a point spread function (PSF) that is a Fourier transform pair of an OTF (Optical Transfer Function) of the imaging optical system 104. Also, * indicates convolution (convolution integration, product sum), and (x, y) indicates the pixel position on the image. Next, when the expression (1) is Fourier-transformed and converted into a form expressed in the frequency domain, it is expressed in the form of a product for each frequency as shown in the following expression (2).

G(u,v)=H(u,v)・F(u,v)・・・(2)
式(2)において、H(u,v)は式(1)におけるPSFであるh(x,y)をフーリエ変換した関数であり、OTFである。またG(u,v)、F(u,v)はそれぞれg,fをフーリエ変換したものである。なお、(u,v)は2次元周波数領域での座標、すなわち周波数を示す。ここで、撮影によって取得される画像g(x,y)から、劣化のない理想的な画像f(x,y)を得るためには、以下の式(3)に示すように、式(2)の両辺をH(u,v)により除算すればよい。
G (u, v) = H (u, v) · F (u, v) (2)
In Expression (2), H (u, v) is a function obtained by Fourier transforming h (x, y), which is PSF in Expression (1), and is OTF. G (u, v) and F (u, v) are obtained by Fourier transform of g and f, respectively. Note that (u, v) indicates coordinates in a two-dimensional frequency domain, that is, a frequency. Here, in order to obtain an ideal image f (x, y) without deterioration from the image g (x, y) acquired by photographing, as shown in the following expression (3), the expression (2) ) May be divided by H (u, v).

G(u,v)/H(u,v)=F(u,v)・・・(3)
式(3)におけるG(u,v)/H(u,v)を逆フーリエ変換して空間領域に戻すことで、画像f(x,y)が光学特性による劣化を回復した画像として得られる。ここで、1/H(u,v)を逆フーリエ変換したものをrとする。すると式(3)式は、式(4)に変換される。
G (u, v) / H (u, v) = F (u, v) (3)
G (u, v) / H (u, v) in equation (3) is subjected to inverse Fourier transform and returned to the spatial domain, whereby image f (x, y) can be obtained as an image in which deterioration due to optical characteristics has been recovered. . Here, r is obtained by inverse Fourier transform of 1 / H (u, v). Then, Expression (3) is converted to Expression (4).

g(x,y)*r(x,y)=f(x,y)・・・(4)
式(4)によれば、空間領域での画像に対するコンボリューション処理を行うことで、画像f(x,y)を取得できることが示されている。このように、OTFをフーリエ変換した結果の逆数を、さらに逆フーリエ変換することで得られる逆フィルタr(x,y)を、回復フィルタとして用いる。
g (x, y) * r (x, y) = f (x, y) (4)
According to Expression (4), it is shown that the image f (x, y) can be acquired by performing the convolution process on the image in the spatial domain. As described above, the inverse filter r (x, y) obtained by further performing inverse Fourier transform on the inverse of the result of Fourier transform of the OTF is used as the recovery filter.

さらに本実施形態では、このような逆フィルタを用いた回復処理、すなわち式(4)に示す演算において、領域ごとの位相差量に基づいてフィルタの強度を調整する。具体的には、周波数領域での回復処理を示した上記式(3)に対して、回復の強度を示す係数αを追加し、式(5)のように演算する。   Further, in the present embodiment, the strength of the filter is adjusted based on the phase difference amount for each region in the recovery process using such an inverse filter, that is, the calculation shown in Expression (4). Specifically, a coefficient α indicating the strength of recovery is added to the above equation (3) showing the recovery process in the frequency domain, and calculation is performed as in equation (5).

G(u,v)/{αH(u,v)+(1−α)}=F(u,v)・・・(5)
式(5)に示す通り、回復フィルタの強度αは、OTFをフーリエ変換した結果の逆数に乗算する係数である。式(5)において、α=0とする場合は、G(u,v)=F(u,v)となり、実質的な回復が行われない。また、α=1と設定すると式(4)と同等の回復が行われることになる。従って、領域毎に0から1の範囲で視差量に応じたαの値を設定することよって、回復の度合いを滑らかに変化させる。
G (u, v) / {αH (u, v) + (1−α)} = F (u, v) (5)
As shown in Expression (5), the strength α of the recovery filter is a coefficient that multiplies the reciprocal of the result of Fourier transform of the OTF. In the equation (5), when α = 0, G (u, v) = F (u, v), and no substantial recovery is performed. Further, when α = 1 is set, recovery equivalent to Equation (4) is performed. Therefore, by setting the value of α corresponding to the amount of parallax in the range of 0 to 1 for each region, the degree of recovery is changed smoothly.

本実施形態では、予め複数の値をαとして回復フィルタr(x,y)を算出し、回復フィルタ記憶部304に格納しておく。画像回復部303は、領域ごとに位相差量に応じてαを導出し、導出したαに対応する回復フィルタを回復フィルタ記憶部304から選択する。画像回復部303は、αを用いて回復フィルタの強度を制御することで、回復処理の度合いを調整する。   In the present embodiment, the recovery filter r (x, y) is calculated in advance by using a plurality of values as α and stored in the recovery filter storage unit 304. The image restoration unit 303 derives α according to the phase difference amount for each region, and selects a restoration filter corresponding to the derived α from the restoration filter storage unit 304. The image restoration unit 303 adjusts the degree of the restoration process by controlling the strength of the restoration filter using α.

(撮像方法)
次に、撮像装置を使用した撮像方法について説明する。図4は、本実施形態における撮像方法の処理の流れを示すフローチャートである。なお以下の各工程(ステップ)を「S」を用いて表記することとする。
(Imaging method)
Next, an imaging method using the imaging device will be described. FIG. 4 is a flowchart showing the flow of processing of the imaging method in the present embodiment. The following steps (steps) will be expressed using “S”.

S401において信号処理部108が、位相差画像ペアを取得する。ここでは2つの光電変換素子について電気信号が個別に読みだされ、左眼用画像のRAW画像データと右眼用画像のRAW画像データが生成される。   In S401, the signal processing unit 108 acquires a phase difference image pair. Here, electrical signals are individually read for the two photoelectric conversion elements, and RAW image data for the left eye image and RAW image data for the right eye image are generated.

S402において位相差量算出部301は、S401で生成した位相差画像ペアのRAW画像データにおける領域ごとに位相差量を算出する。   In S402, the phase difference amount calculation unit 301 calculates the phase difference amount for each region in the RAW image data of the phase difference image pair generated in S401.

図5は、点光源を被写体として仮定した場合のある領域における位相差画像のX軸方向の輝度分布を模式的に示した図である。説明の簡便のため、ここではRGB3色のうちGのチャンネルについてのみ説明する。横軸はX方向における画素位置である。縦軸は、X座標ごとにRGBのうちGの画素を抜き出し、Y軸方向に平均した輝度である。前述の通り、デフォーカス量とは、合焦距離と被写体距離との差分の絶対値であり、被写体が合焦位置と離れているほど、デフォーカス量は大きくなる。   FIG. 5 is a diagram schematically showing a luminance distribution in the X-axis direction of a phase difference image in a certain region when a point light source is assumed as a subject. For ease of explanation, only the G channel of the three RGB colors will be described here. The horizontal axis is the pixel position in the X direction. The vertical axis represents the luminance averaged in the Y-axis direction by extracting G pixels from RGB for each X coordinate. As described above, the defocus amount is an absolute value of the difference between the focus distance and the subject distance, and the defocus amount increases as the subject is farther from the focus position.

また絞り値とは、絞りの開き具合を調整するための値であり、レンズを通る光の量を制御する。絞り値を大きくすると、絞りが絞られてレンズを通る光の量が少なくなるため暗くなり、さらに合焦しているように見える領域が広がる。   The aperture value is a value for adjusting the opening degree of the aperture, and controls the amount of light passing through the lens. When the aperture value is increased, the amount of light passing through the lens is reduced because the aperture is reduced, and the area becomes darker, and the area that appears to be in focus is expanded.

図5(a)では、絞り値として大きい値を設定して撮像した状態で、被写体が合焦距離より奥側に存在している場合の輝度分布を示している。位相差量算出部301は、左眼用画像と右眼用画像それぞれの輝度分布に対してガウスフィッティングを行い、各々のピーク位置のX軸座標を取得する。単位は画素数であるが、ピーク位置をサブピクセル単位で検出可能であれば、座標を小数値として取得することが望ましい。ここで、右眼用画像のピーク位置の座標から左眼用画像のピーク位置の座標を減算した結果を位相差量とする。被写体が合焦距離より手前側にある場合、被写体が合焦距離より奥側にある場合と左眼用画像と右眼用画像のX軸上での位置関係が反転する。そのため、被写体が合焦距離より手前側にあるか奥側にあるかによって、位相差量の値の正負も反転する。ここでは、被写体が合焦距離より奥側にある場合に位相差量が正の値をとるものして、以降の説明を行う。   FIG. 5A shows the luminance distribution in the case where the subject is located behind the in-focus distance with a large aperture value set and imaged. The phase difference calculation unit 301 performs Gaussian fitting on the luminance distribution of each of the left-eye image and the right-eye image, and acquires the X-axis coordinates of each peak position. The unit is the number of pixels, but if the peak position can be detected in sub-pixel units, it is desirable to obtain the coordinates as decimal values. Here, the result of subtracting the coordinates of the peak position of the image for the left eye from the coordinates of the peak position of the image for the right eye is defined as a phase difference amount. When the subject is on the near side of the in-focus distance, the positional relationship on the X axis between the left-eye image and the right-eye image is reversed when the subject is behind the in-focus distance. Therefore, the sign of the value of the phase difference amount is also reversed depending on whether the subject is on the near side or the far side from the in-focus distance. Here, the following description will be given on the assumption that the amount of phase difference takes a positive value when the subject is behind the in-focus distance.

図5(b)は、図5(a)に対し、被写体が奥側にあり、かつより合焦距離に近い位置にある(デフォーカス量が小さい)場合の輝度分布を示している。図5(a)の場合、左眼用画像の輝度分布の位置と右眼用画像の輝度分布の位置は、図5(b)と比べて大きく異なっている。図5(b)の場合、右眼用画像と左眼用画像の輝度分布の間隔が狭まり、図5(a)の状態に対し位相差量が低減する。また、右眼用画像と左眼用画像の輝度値を加算した波形(合成波)が、最終的な撮影画像における輝度分布となる。図5(b)では右眼用画像と左眼用画像の合成波が、図5(a)の合成波よりシャープな形状となり、被写体が合焦位置に近づくことによって画像のぼけ量が小さくなっていることがわかる。   FIG. 5B shows a luminance distribution in the case where the subject is on the back side and closer to the focusing distance (the defocus amount is small) as compared to FIG. 5A. In the case of FIG. 5A, the position of the luminance distribution of the image for the left eye and the position of the luminance distribution of the image for the right eye are greatly different from those in FIG. In the case of FIG. 5B, the interval between the luminance distributions of the right-eye image and the left-eye image is narrowed, and the phase difference amount is reduced with respect to the state of FIG. Further, a waveform (synthetic wave) obtained by adding the luminance values of the right-eye image and the left-eye image is the luminance distribution in the final captured image. In FIG. 5B, the composite wave of the right-eye image and the left-eye image has a sharper shape than the composite wave of FIG. 5A, and the amount of blur of the image decreases as the subject approaches the in-focus position. You can see that

図5(c)では、図5(a)における被写体と合焦距離の関係は同じであり、絞り値を小さくした場合の輝度分布を示している。この場合、絞りの解放によって輝度分布のガウスフィッティング時の半値幅が拡大する。さらに、ピーク位置がずれることで、位相差量も増大する。また、絞りの解放によって錯乱円が拡大するため、撮像画像のぼけ量も増大する。   In FIG. 5C, the relationship between the subject and the focusing distance in FIG. 5A is the same, and the luminance distribution when the aperture value is reduced is shown. In this case, the half width at the time of Gaussian fitting of the luminance distribution is expanded by releasing the aperture. Furthermore, the amount of phase difference increases as the peak position shifts. In addition, since the circle of confusion expands due to the opening of the diaphragm, the blur amount of the captured image also increases.

図5(d)は、図5(b)における被写体と合焦距離の関係は同じであり、絞り値を図5(c)と同様に小さくした場合の輝度分布を示している。この場合も、図5(b)に対して位相差量が増大するとともに、撮影画像のぼけ量も増大する。また、図5(c)に対しては、位相差量が低減するとともに被写体が合焦位置に近づくことによって画像のぼけ量が小さくなる。   FIG. 5 (d) shows the luminance distribution when the relationship between the subject and the focusing distance in FIG. 5 (b) is the same, and the aperture value is reduced as in FIG. 5 (c). Also in this case, the amount of phase difference increases with respect to FIG. 5B, and the amount of blur of the captured image also increases. Further, with respect to FIG. 5C, the amount of phase difference is reduced and the amount of blurring of the image is reduced as the subject approaches the in-focus position.

ここで、図5(a)および(d)のデフォーカス量は互いに異なるが、検出される位相差量はともに図5(b)より大きく、図5(c)より小さい。また、画像のぼけ量も同様に、図5(a)および図5(d)ともに図5(b)より大きく、図5(c)より小さい。従来、ピント位置から離れるほど被写体はぼけるため、被写体距離やデフォーカス量を用いて、ぼけを回復する回復フィルタを設定する方法もあった。しかしながらぼけ量は、レンズの絞り値の影響もうけるため、同じデフォーカス量であっても異なるぼけ量である場合もある。そのため、デフォーカス量に基づいて回復処理の強度を制御すると、必ずしも適切な回復フィルタを設定できない。そこで本実施形態では、位相差量に基づいて、回復フィルタを制御する。図5に示すように、位相差量が大きいほど画像のぼけ量も大きく、位相差量は撮像時の画像のぼけ量との相関が高いことがわかる。画像のぼけ量は位相差量が0のときに最小となり、正方向、負方向ともに、位相差量の絶対値の増加に伴い画像のぼけ量も増加する。   Here, although the defocus amounts in FIGS. 5A and 5D are different from each other, the detected phase difference amounts are both larger than those in FIG. 5B and smaller than those in FIG. Similarly, the blur amount of the image is larger than that of FIG. 5B and smaller than that of FIG. 5C in both FIG. 5A and FIG. Conventionally, since the subject becomes blurred as the distance from the focus position increases, there has been a method of setting a recovery filter that recovers the blur using the subject distance and the defocus amount. However, since the blur amount is affected by the aperture value of the lens, the blur amount may be different even with the same defocus amount. Therefore, if the strength of the recovery process is controlled based on the defocus amount, it is not always possible to set an appropriate recovery filter. Therefore, in this embodiment, the recovery filter is controlled based on the phase difference amount. As shown in FIG. 5, it can be seen that the larger the phase difference amount, the larger the blur amount of the image and the higher the correlation between the phase difference amount and the blur amount of the image at the time of imaging. The blur amount of the image is minimized when the phase difference amount is 0, and the blur amount of the image increases with an increase in the absolute value of the phase difference amount in both the positive direction and the negative direction.

なお、図5では説明の簡便のため被写体を点光源と仮定したが、自然画像中の被写体を対象として位相差量を算出する場合は、ハイパスフィルター等を用いて画像のピーク位置を検出することで位相差量を検出できる。   In FIG. 5, the subject is assumed to be a point light source for simplicity of explanation, but when calculating the phase difference amount for the subject in the natural image, the peak position of the image is detected using a high-pass filter or the like. Can detect the amount of phase difference.

ここで図4に戻り、S403において、S403において算出した領域ごとの位相差量に基づいて、デフォーカス量算出部302は主要被写体のデフォーカス量を算出する。上述したように、位相差量の大小はデフォーカス量の大小とは単純には一致しない。そのため、デフォーカス量算出部302は撮像系制御部107を通じて撮像光学系104の現在の合焦距離や絞り値等のパラメータを取得し、合焦距離や絞り値等のパラメータに基づいて、デフォーカス量を算出する。位相差量を用いたデフォーカス量の算出については既知の手法が適用可能であるため、ここでの詳細な説明は省略する。   Here, returning to FIG. 4, in S403, the defocus amount calculation unit 302 calculates the defocus amount of the main subject based on the phase difference amount for each region calculated in S403. As described above, the magnitude of the phase difference amount does not simply match the magnitude of the defocus amount. Therefore, the defocus amount calculation unit 302 acquires parameters such as the current focusing distance and aperture value of the imaging optical system 104 through the imaging system control unit 107, and defocusing based on the parameters such as the focusing distance and aperture value. Calculate the amount. Since a known method can be applied to the calculation of the defocus amount using the phase difference amount, a detailed description thereof is omitted here.

S404において撮像系制御部107は、S403において算出したデフォーカス量に基づき、撮像光学系104のフォーカスレンズの位置を調整する。   In step S404, the imaging system control unit 107 adjusts the position of the focus lens of the imaging optical system 104 based on the defocus amount calculated in step S403.

S405においてCPU101は、AF(オートフォーカス)処理が終了したか否かを判定する。撮像光学系104が主要被写体に合焦していると判断される場合、処理はS406へ進む。そうでない場合、S401に戻り再度フォーカスの調整を行う。   In step S <b> 405, the CPU 101 determines whether AF (autofocus) processing has ended. If it is determined that the imaging optical system 104 is in focus on the main subject, the process proceeds to S406. Otherwise, the process returns to S401 and the focus is adjusted again.

S406において位相差量算出部301は、AF処理完了時の各領域の位相差量をRAM103に一時保存する。   In step S <b> 406, the phase difference amount calculation unit 301 temporarily stores the phase difference amount of each area when the AF process is completed in the RAM 103.

S407において信号処理部108は、通常画像を取得する。前述の通り通常画像とは、各画素について2つの光電変換素子からの加算された電気信号が読みだされることで生成されたRAW画像である。   In step S407, the signal processing unit 108 acquires a normal image. As described above, the normal image is a RAW image generated by reading the added electrical signals from the two photoelectric conversion elements for each pixel.

S408において画像回復部303は、S407において取得されたRAW画像に対し、回復フィルタを用いてフィルタ処理することで、回復処理を施す。回復処理の詳細については後述する。   In S <b> 408, the image restoration unit 303 performs a restoration process by filtering the RAW image acquired in S <b> 407 using a restoration filter. Details of the recovery process will be described later.

S409において画像処理部305は、S408において回復処理が施されたRAW画像に対し、種々の一般的な画像処理を施し、R(レッド)、G(グリーン)、B(ブルー)それぞれに対応するカラー画像を生成する。   In step S409, the image processing unit 305 performs various general image processing on the RAW image that has been subjected to the recovery process in step S408, so that colors corresponding to R (red), G (green), and B (blue) respectively. Generate an image.

S410においてエンコーダ109は、S409において生成されたRGB画像を所定のフォーマットにエンコードし、メディアI/F 110を通じて予め指定されたメディアに保存する。また、必要に応じて、左眼用画像、右眼用画像、S406において算出した位相差量、回復フィルタ強度αの値等を保存してもよい。   In S <b> 410, the encoder 109 encodes the RGB image generated in S <b> 409 into a predetermined format, and stores it in a medium designated in advance through the media I / F 110. Further, if necessary, the left-eye image, the right-eye image, the phase difference amount calculated in S406, the value of the recovery filter strength α, and the like may be stored.

(回復処理の詳細)
以下、本実施形態のS408において画像回復部303が実施する回復処理の詳細について、詳細に説明する。図6は、本実施形態における画像回復処理の流れを示すフローチャートである。CPU101は、図6に示すフローチャートを実現可能なプログラムを読み出し実行することで、各構成が実現される。
(Details of recovery processing)
Hereinafter, details of the recovery processing performed by the image recovery unit 303 in S408 of the present embodiment will be described in detail. FIG. 6 is a flowchart showing the flow of image restoration processing in the present embodiment. Each configuration is realized by the CPU 101 reading and executing a program capable of realizing the flowchart shown in FIG.

S601において画像回復部303は、撮像光学系104の種類に応じ、回復フィルタ記憶部304から回復フィルタテーブルを取得する。回復フィルタテーブルとは、ある撮像光学系の構成と合焦距離に対応した、複数のα値(例えば、α=0.0からα=1.0まで0.1刻み)それぞれの回復フィルタのセットである。撮像光学系104の構成や合焦距離に関する情報は、撮像系制御部107によって提供される。たとえばここでは、ズームレンズであるレンズ1、固定焦点のレンズ2を想定するものとする。この場合回復フィルタ記憶部304は、レンズ1のズーム時に対応する回復フィルタについて、上記α=0.0からα=1.0まで0.1刻みの11段階のうち、互いに異なるα値が設定された11個のフィルタと有する。そして、レンズ1のワイド時に対応する回復フィルタについて、先と同様に互いに異なるα値が設定された11個のフィルタを有する。また、レンズ2に対応する回復フィルタについても、先と同様に互いに異なるα値が設定された11個のフィルタを有する。画像回復部303は、レンズの型番とズームかワイドか、および位相差量に基づいて、フィルタを選択する。   In step S <b> 601, the image restoration unit 303 acquires a restoration filter table from the restoration filter storage unit 304 according to the type of the imaging optical system 104. A recovery filter table is a set of recovery filters for each of a plurality of α values (for example, 0.1 increments from α = 0.0 to α = 1.0) corresponding to the configuration and focusing distance of a certain imaging optical system. It is. Information relating to the configuration and focusing distance of the imaging optical system 104 is provided by the imaging system control unit 107. For example, it is assumed here that the lens 1 is a zoom lens and the lens 2 has a fixed focus. In this case, the recovery filter storage unit 304 sets different α values among the 11 steps of 0.1 increments from α = 0.0 to α = 1.0 for the recovery filter corresponding to the zoom of the lens 1. With 11 filters. Then, the recovery filter corresponding to the wide lens 1 has eleven filters in which different α values are set as before. Also, the recovery filter corresponding to the lens 2 has eleven filters in which different α values are set as in the previous case. The image restoration unit 303 selects a filter based on the lens model number, zoom or wide, and the phase difference amount.

S602において画像回復部303は、一時保存されたAF処理完了時の各領域の位相差量を読み出し、各領域のα値を決定する。図7は、位相差量とα値の関係の一例を示した図である。位相差量がゼロ、すなわち被写体に合焦している状態ではα=1とし、手前側、奥側ともに、位相差量の増大に伴ってα値が減少する。位相差量が所定値を超えた時点でα=0となり、所定値より位相差の大きい領域では回復処理は行われない。   In step S <b> 602, the image restoration unit 303 reads the phase difference amount of each area when the AF processing that has been temporarily stored is completed, and determines the α value of each area. FIG. 7 is a diagram showing an example of the relationship between the phase difference amount and the α value. When the phase difference amount is zero, that is, when the subject is in focus, α = 1 is set, and the α value decreases as the phase difference amount increases on both the near side and the back side. When the amount of phase difference exceeds a predetermined value, α = 0, and no recovery processing is performed in a region where the phase difference is larger than the predetermined value.

続くS603およびS604の処理は、全ての領域に対し反復的に実行される。   The subsequent processes of S603 and S604 are repeatedly executed for all regions.

S603において画像回復部303は、S602において算出したα値に応じ、各領域に適用する回復フィルタを回復フィルタテーブルから選択し、設定する。本実施形態においては処理対象とする領域に対して決定されたα値に最も近いα値の回復フィルタを選択するものとする。なお、α値については近傍の画素領域間で補間演算を行い、画素ごとに連続的に変化するようなα値を改めて算出してもよい。また回復フィルタついても、算出されたα値に近いα値を持つ複数の回復フィルタをテーブルから取得し、補間演算等によって所望のα値に対応する回復フィルタを設定してもよい。   In S603, the image restoration unit 303 selects and sets a restoration filter to be applied to each region from the restoration filter table in accordance with the α value calculated in S602. In the present embodiment, it is assumed that a recovery filter having an α value closest to the α value determined for the region to be processed is selected. Note that the α value may be calculated again by performing an interpolation operation between neighboring pixel regions and continuously changing for each pixel. As for the recovery filter, a plurality of recovery filters having an α value close to the calculated α value may be acquired from the table, and the recovery filter corresponding to a desired α value may be set by interpolation or the like.

S604において画像回復部303は、領域に含まれる各画素に対してS503において取得した回復フィルタを用いたフィルタ処理(畳み込み演算)を行い、回復処理後の画素値を算出する。   In step S604, the image restoration unit 303 performs a filter process (convolution operation) using the restoration filter acquired in step S503 on each pixel included in the region, and calculates a pixel value after the restoration process.

以上で、本実施形態における回復処理が完了する。これにより領域ごとに、画像のぼけ量に応じた強度の回復処理を実施することができる。   Thus, the recovery process in the present embodiment is completed. As a result, it is possible to carry out intensity recovery processing corresponding to the blur amount of the image for each region.

先述の通り、画像における各領域の位相差量は、画像のぼけ量との相関が高い。そのため、位相差量の大きい領域は被写体がぼけていて回復処理の効果が低いか、撮影者によって意図的にぼけを生じさせている可能性が高い。従って、本実施形態に従い、位相差量の小さい(ぼけていない)領域に集中的に回復処理を行うことで、ノイズ成分の強調を抑制することが可能となる。   As described above, the phase difference amount of each region in the image has a high correlation with the blur amount of the image. Therefore, it is highly likely that the subject is blurred and the effect of the recovery process is low in the region where the phase difference amount is large, or that the photographer intentionally causes the blur. Therefore, according to the present embodiment, it is possible to suppress enhancement of noise components by performing recovery processing in a concentrated manner in a region where the amount of phase difference is small (not blurred).

<第2の実施形態>
第1の実施形態では、撮像装置に起因する画質劣化を補正する例を示したが、本発明はプリンタやモニタなどの出力装置に起因する画質劣化を補正する方法としても実施可能である。第2の実施形態では、一般的なパーソナルコンピューター上で、プリンタ出力に伴う画質劣化を出力前にあらかじめ補正する手法について説明する。
<Second Embodiment>
In the first embodiment, the example of correcting the image quality deterioration caused by the image pickup apparatus has been described. However, the present invention can also be implemented as a method for correcting the image quality deterioration caused by the output apparatus such as a printer or a monitor. In the second embodiment, a method for correcting image quality deterioration accompanying printer output in advance on a general personal computer before output will be described.

(画像処理装置)
図8は、本発明を構成する画像処理装置の構成を示すブロック図である。801は、第1の実施形態で説明したものと同等の撮像装置である。また、802はプリンタである。本実施形態では、プリンタ802に起因する画質劣化を補正する画像回復処理を行う。
(Image processing device)
FIG. 8 is a block diagram showing the configuration of the image processing apparatus constituting the present invention. Reference numeral 801 denotes an imaging apparatus equivalent to that described in the first embodiment. Reference numeral 802 denotes a printer. In the present embodiment, image restoration processing for correcting image quality degradation caused by the printer 802 is performed.

804から809は画像処理装置803の構成要素である。画像処理装置803は一般的なパーソナルコンピューターとその周辺機器であり、画像表示部804、キーボードやマウス等のUI部805を備える。またCPU806、メインメモリ807、HDDやSSD等のデータ保存部808、外部のデバイスやネットワーク等に接続可能なUSBやWi−Fi等の通信部809、メインバス810を備える。また、通信部809を介して撮像装置801およびプリンタ802と接続されている。   Reference numerals 804 to 809 denote components of the image processing apparatus 803. The image processing apparatus 803 is a general personal computer and its peripheral devices, and includes an image display unit 804 and a UI unit 805 such as a keyboard and a mouse. Further, a CPU 806, a main memory 807, a data storage unit 808 such as an HDD or an SSD, a communication unit 809 such as USB or Wi-Fi that can be connected to an external device or a network, and a main bus 810 are provided. In addition, the imaging device 801 and the printer 802 are connected via the communication unit 809.

本実施形態における画像回復処理は、上記ハードウェア構成における汎用OS上で動作する画像処理アプリケーション上で実現される。尚、本実施例における汎用OS、並びに画像処理アプリケーションは、公知の技術によって達成可能なソフトウェアプログラムによって実現可能である。よって、画像処理アプリケーションが汎用OS上で動作する詳細については、説明を省略する。   The image restoration process in the present embodiment is realized on an image processing application that operates on a general-purpose OS in the hardware configuration. Note that the general-purpose OS and the image processing application in the present embodiment can be realized by a software program that can be achieved by a known technique. Therefore, the details of the operation of the image processing application on the general-purpose OS will be omitted.

図9は、本発明を構成する画像処理装置の論理構成を示すブロック図である。データ保存部808には、撮像装置801から出力された通常画像および、各領域の位相差情報が保存されている。この通常画像および位相差情報は、第一の実施形態のS410の処理で出力されたものである。また、プリンタ802の種々の出力条件における縦および横方向のSFRが保存されている。   FIG. 9 is a block diagram showing a logical configuration of the image processing apparatus constituting the present invention. The data storage unit 808 stores a normal image output from the imaging device 801 and phase difference information of each region. The normal image and the phase difference information are output in the process of S410 of the first embodiment. Also, vertical and horizontal SFRs for various output conditions of the printer 802 are stored.

901は、画像回復処理を行うアプリケーションソフトウェアである。   Reference numeral 901 denotes application software that performs image restoration processing.

画像取得部902は、データ保存部808から画像回復処理の対象となる画像を読みだす。   The image acquisition unit 902 reads an image to be subjected to image restoration processing from the data storage unit 808.

位相差量取得部903は、データ保存部808から対象の画像の、領域ごとの位相差量情報を読み出す。   The phase difference amount acquisition unit 903 reads phase difference amount information for each region of the target image from the data storage unit 808.

出力条件取得部904は、UI部805を通じ、ユーザーの指示に基づき、プリンタ802の機種や使用する用紙の種類、印刷品質などの出力条件を取得する。   The output condition acquisition unit 904 acquires output conditions such as the model of the printer 802, the type of paper to be used, and print quality based on a user instruction through the UI unit 805.

SFR取得部905は、出力条件取得部904が取得した出力条件に基づき、データ保存部808から対応したSFR情報を読み出す。   The SFR acquisition unit 905 reads the corresponding SFR information from the data storage unit 808 based on the output condition acquired by the output condition acquisition unit 904.

回復フィルタ設定部906は、SFR情報と各領域の位相差量情報に基づき、各領域で使用する回復フィルタを作成する。SFR情報と回復フィルタの詳細については後述する。   The recovery filter setting unit 906 creates a recovery filter to be used in each region based on the SFR information and the phase difference amount information of each region. Details of the SFR information and the recovery filter will be described later.

画像回復部907は、回復フィルタ設定部906が設定した各領域の回復フィルタを用いて画像の各領域の回復処理を行い、回復処理後の領域を連結して出力用の画像を生成する。   The image restoration unit 907 performs restoration processing for each region of the image using the restoration filter for each region set by the restoration filter setting unit 906, and generates an output image by connecting the regions after the restoration processing.

画像出力部908は、画像回復部907が生成した出力用の画像を所定のフォーマットに変換し、プリンタ802を駆動して、出力条件取得部904が取得した出力条件での出力を行う。   The image output unit 908 converts the output image generated by the image recovery unit 907 into a predetermined format, drives the printer 802, and performs output under the output condition acquired by the output condition acquisition unit 904.

(プリンタのSFR)
以下、本実施形態で回復フィルタの設定に使用するSFR情報の概要について説明する。図10は、プリンタ802のSFRの一例を示した図である。実線は出力画像の縦方向、破線は横方向の周波数ごとの伝達率を示しており、画像の低周波成分は劣化が小さく、より高周波ほど劣化(ぼけ)が大きくなることを示している。
(Printer SFR)
Hereinafter, an outline of the SFR information used for setting the recovery filter in the present embodiment will be described. FIG. 10 is a diagram illustrating an example of the SFR of the printer 802. The solid line indicates the transmission rate for each frequency in the vertical direction of the output image, and the broken line indicates the transmission rate for each frequency in the horizontal direction. The low frequency component of the image is less deteriorated, and the deterioration (blur) is greater at higher frequencies.

以下、プリンタのある出力条件におけるSFRを取得する方法について説明する。まず、縦横それぞれのエッジ画像(白から黒へ不連続に変化する画像)を該当の出力条件で出力し、出力物をイメージスキャナで輝度画像データとして取り込む。続いて、取り込んだ画像のエッジと平行な方向の輝度平均を取り、エッジと垂直な方向のエッジ断面の輝度分布を得る。続いて、ラインの輝度分布の各画素と隣接画素の差分を算出し、輝度傾き分布を得る。その後、輝度傾き分布の一次元フーリエ変換を行い、各周波数の振幅と位相の二乗和平方根を取ったリニアスペクトルを算出する。各ラインのリニアスペクトルの平均値を算出し、DC成分で全体を除算して正規化することで、図10に示すような形状の減衰曲線を得ることができる。   Hereinafter, a method for obtaining the SFR under certain output conditions of the printer will be described. First, vertical and horizontal edge images (images that discontinuously change from white to black) are output under the corresponding output conditions, and the output is captured as luminance image data by an image scanner. Subsequently, the luminance average in the direction parallel to the edge of the captured image is taken to obtain the luminance distribution of the edge cross section in the direction perpendicular to the edge. Subsequently, a difference between each pixel of the luminance distribution of the line and an adjacent pixel is calculated to obtain a luminance gradient distribution. Thereafter, a one-dimensional Fourier transform of the luminance gradient distribution is performed to calculate a linear spectrum that takes the square sum of squares of the amplitude and phase of each frequency. The average value of the linear spectrum of each line is calculated, and the whole is divided by the DC component and normalized, whereby an attenuation curve having a shape as shown in FIG. 10 can be obtained.

このSFR特性はプリンタ出力による劣化とスキャナによる劣化の双方を含んでいる。別途、理想的なエッジに近い印刷物をスキャンしてスキャナ単体のSFR特性を算出し、プリンタ出力物から算出したSFR特性をスキャナ単体のSFR特性で除算することで、プリンタ単体のSFR特性を算出することができる。   This SFR characteristic includes both degradation due to printer output and degradation due to the scanner. Separately, the SFR characteristic of the single scanner is calculated by scanning a printed material close to an ideal edge, and the SFR characteristic of the single printer is calculated by dividing the SFR characteristic calculated from the printer output by the SFR characteristic of the single scanner. be able to.

(回復フィルタ)
以下、本実施形態で画像回復処理に使用する回復フィルタの概要について説明する。本実施形態における回復フィルタは、対象の画像領域を離散フーリエ変換(Discrete Fourier Transform:DFT)した周波数空間上で、各周波数成分に乗算される係数群である。回復フィルタの各係数は、プリンタの縦および横方向のSFRと、フィルタ係数αに基づいて算出される。
(Recovery filter)
Hereinafter, an outline of a recovery filter used for image recovery processing in the present embodiment will be described. The restoration filter in the present embodiment is a group of coefficients that are multiplied by each frequency component in a frequency space obtained by performing discrete Fourier transform (DFT) on a target image region. Each coefficient of the recovery filter is calculated based on the SFR in the vertical and horizontal directions of the printer and the filter coefficient α.

ある周波数成分の縦方向の周波数をu、横方向の周波数をvとする。縦方向のSFRをSFRY(v)、横方向のSFRをSFRX(u)とした場合、プリンタへの入力画像をフーリエ変換したものをF(u,v)、出力画像をフーリエ変換したものをG(u,v)とする。プリンタによる画質の劣化は式(6)のように表現できる
G(u,v)=SFRX(u)・SFRY(v)・F(u,v)・・・(6)
ここで、プリンタによる劣化を回復するための回復フィルタをk(u,v)とすると、回復処理は式(8)のように表すことができ、回復フィルタk(u,v)の各要素は式(7)のように算出される。
Let u be the vertical frequency and v be the horizontal frequency of a certain frequency component. When the vertical SFR is SFRY (v) and the horizontal SFR is SFRX (u), the input image to the printer is Fourier transformed F (u, v), and the output image is Fourier transformed G (U, v). The image quality degradation due to the printer can be expressed as equation (6): G (u, v) = SFRX (u) · SFRY (v) · F (u, v) (6)
Here, if the recovery filter for recovering the deterioration due to the printer is k (u, v), the recovery process can be expressed as in equation (8). Each element of the recovery filter k (u, v) is It is calculated as in equation (7).

F(u,v)=k(fx,fy)・G(u,v)・・・(7)
k(fx,fy)=1/SFRX(u)/SFRY(v)・・・(8)
本実施形態においても、領域ごとの位相差量に基づいて回復処理の強度を調整するため、回復の強度を示す係数αを用いて、回復処理の式(7)を次式(9)のように補正する。
F (u, v) = k (fx, fy) .G (u, v) (7)
k (fx, fy) = 1 / SFRX (u) / SFRY (v) (8)
Also in this embodiment, in order to adjust the strength of the recovery processing based on the phase difference amount for each region, the recovery processing equation (7) is expressed by the following equation (9) using the coefficient α indicating the recovery strength. To correct.

F(u,v)=k(fx,fy)^α・G(u,v)・・・(9)
式(9)において、α=0とする場合は、G(u,v)=F(u,v)となり、実質的な回復が行われない。また、α=1と設定すると式(7)と同等の回復が行われることになる。従って、領域毎に0から1の範囲で視差量に応じたαの値を設定することよって、回復の度合いを滑らかに変化させる。あるいは、第1の実施形態の式(5)に倣い、式(10)のようにしてもよい。
F (u, v) = k (fx, fy) ^ α · G (u, v) (9)
In the equation (9), when α = 0, G (u, v) = F (u, v), and no substantial recovery is performed. Further, when α = 1 is set, recovery equivalent to equation (7) is performed. Therefore, by setting the value of α corresponding to the amount of parallax in the range of 0 to 1 for each region, the degree of recovery is changed smoothly. Or you may make it like Formula (10) according to Formula (5) of 1st Embodiment.

G(u,v)・{αk(u,v)+(1−α)}=F(u,v)・・・(10)
回復フィルタの強度は光学系の光学伝達関数をフーリエ変換した結果の逆数を底とした際の冪指数である。その強度は回復フィルタを適用した画像と回復フィルタを適用しない画像との線形和を取る際の係数であっても良い。
G (u, v) · {αk (u, v) + (1−α)} = F (u, v) (10)
The strength of the recovery filter is a power index when the reciprocal of the result of Fourier transform of the optical transfer function of the optical system is used as the base. The intensity may be a coefficient for taking a linear sum of an image to which the recovery filter is applied and an image to which the recovery filter is not applied.

(画像回復処理および画像出力)
以下、本実施形態における画像処理の方法について説明する。図11は、本実施形態における画像回復処理および画像出力の流れを示すフローチャートである。
(Image recovery processing and image output)
Hereinafter, an image processing method in the present embodiment will be described. FIG. 11 is a flowchart showing the flow of image restoration processing and image output in the present embodiment.

S1101において、画像取得部902はデータ保存部808から通常画像を読み出す。   In step S <b> 1101, the image acquisition unit 902 reads a normal image from the data storage unit 808.

S1102において、ユーザーは出力条件取得部904に対し、UI部805を通じて出力条件の指示を行う。SFR取得部905は出力条件取得部904が受け取った出力条件に基づき、データ保存部808から該当するSFR情報を読み出す。   In step S1102, the user instructs the output condition acquisition unit 904 through the UI unit 805 to specify the output condition. The SFR acquisition unit 905 reads the corresponding SFR information from the data storage unit 808 based on the output condition received by the output condition acquisition unit 904.

S1103は、入力画像の各領域に対して、以下のS1104からS1108の処理を反復して実行するためのループ制御である。ここで各領域は、S1101で読み出した通常画像内の64画素×64画素の矩形領域である。各領域は、第一の実施形態で説明した16画素×16画素の矩形領域(以下、小領域と呼ぶ)を16個含んでおり、領域の境界は端部の小領域の境界と一致する。各領域と隣接する領域は16画素の幅で重なっている。領域のサイズや配置は一例であり、異なるサイズであったり、隣接領域との重複の幅が異なったり、隣接領域と重複しない配置であったりしても良い。   S1103 is loop control for repeatedly executing the following processes of S1104 to S1108 for each region of the input image. Here, each area is a rectangular area of 64 pixels × 64 pixels in the normal image read in S1101. Each region includes 16 16 × 16 pixel rectangular regions (hereinafter referred to as small regions) described in the first embodiment, and the boundaries of the regions coincide with the boundaries of the small regions at the ends. A region adjacent to each region overlaps with a width of 16 pixels. The size and arrangement of the areas are examples, and may be different sizes, may have different overlap widths with adjacent areas, or may not be overlapped with adjacent areas.

S1104において、位相差量取得部903は、領域の位相差量を算出する。具体的には、領域内の小領域のうち内側に位置する4つの小領域の位相差量をデータ保存部808から読み出し、平均値を算出する。   In step S1104, the phase difference amount acquisition unit 903 calculates the phase difference amount of the region. Specifically, the phase difference amounts of four small regions located inside among the small regions in the region are read from the data storage unit 808, and an average value is calculated.

S1105において、回復フィルタ設定部906は、S1104で算出した位相差量に基づき、S602と同様にα値の算出を行う。   In step S1105, the recovery filter setting unit 906 calculates an α value in the same manner as in step S602 based on the phase difference amount calculated in step S1104.

S1106において、画像回復部907は、領域の画像のフーリエ変換を行う。   In step S <b> 1106, the image restoration unit 907 performs a Fourier transform of the region image.

S1107において、画像回復部907は、フーリエ変換によって得られた画像の周波数成分に対し、S1105で算出したα値とS1102で取得したSFR情報に基づき、式(9)で示した回復処理を行う。回復フィルタの強度は、光学伝達関数をフーリエ変換した結果の逆数を底とした際の冪指数である。   In step S <b> 1107, the image restoration unit 907 performs the restoration process represented by Expression (9) on the frequency component of the image obtained by the Fourier transform, based on the α value calculated in step S <b> 1105 and the SFR information acquired in step S <b> 1102. The strength of the recovery filter is a power index when the inverse of the result of Fourier transform of the optical transfer function is used as the base.

S1108において、画像回復部907は、回復処理後の周波数成分の逆フーリエ変換を行い、回復処理後の領域の画像を算出する。   In step S1108, the image restoration unit 907 performs inverse Fourier transform on the frequency component after the restoration process, and calculates an image of the area after the restoration process.

S1109において、画像回復部907は、各領域の回復処理後の画像を連結し、入力画像全体の回復処理後の画像を生成する。連結に際し、領域と隣接領域との重複部分については、各領域端からの距離に応じた重みづけで線形結合を行う。これにより、連結後の画像において、領域ごとの回復強度αの差に起因する視覚的な段差が生じないようにする。   In step S <b> 1109, the image recovery unit 907 connects the images after the recovery processing of each region, and generates an image after the recovery processing of the entire input image. At the time of connection, a linear combination is performed with weighting according to the distance from the end of each region for the overlapping portion between the region and the adjacent region. This prevents a visual step due to the difference in the recovery intensity α for each region from occurring in the connected images.

S1110において、画像出力部908はプリンタ802を駆動し、S1109で生成した画像をS1102で取得した出力条件で出力する。   In step S1110, the image output unit 908 drives the printer 802 and outputs the image generated in step S1109 under the output condition acquired in step S1102.

以上で、本実施形態における画像回復処理および画像の出力が完了する。これにより、画像のプリンタ出力を行う場合においても、領域ごとの画像のぼけ量に応じた強度の回復処理を実施することができる。   Thus, the image restoration process and the image output in this embodiment are completed. As a result, even when an image is output to the printer, it is possible to perform a strength recovery process corresponding to the amount of image blur for each region.

なお、上記したS1104では各小領域の位相差量をデータ保存部808から読み出したが、予めデータ保存部808に撮像装置801が算出した各小領域のα値を保存し、それを位相差量の代わりに読み出しても良い。この場合、領域内の小領域のうち内側に位置する4つの小領域のα値を読み出して平均を取り、その値をS1107の処理に用いる。   In S1104 described above, the phase difference amount of each small region is read from the data storage unit 808. However, the α value of each small region calculated by the imaging device 801 is stored in the data storage unit 808 in advance, and the phase difference amount is stored. You may read instead of. In this case, the α values of the four small areas located inside the small areas in the area are read and averaged, and the values are used for the processing of S1107.

あるいは、アプリケーションソフトウェア901がデータ保存部808から左眼用画像および右眼用画像を読み出し、撮像装置801の代わりに位相差量の算出や通常画像の生成を行っても良い。   Alternatively, the application software 901 may read the left-eye image and the right-eye image from the data storage unit 808 and calculate the phase difference amount or generate the normal image instead of the imaging device 801.

本実施形態に従い、位相差量の小さい領域に集中的に回復処理を行うことで、画像を出力する場合においても、ノイズ成分の強調を抑制することが可能となる。   According to the present embodiment, by performing recovery processing intensively in a region with a small amount of phase difference, it is possible to suppress enhancement of noise components even when an image is output.

<その他の実施形態>
第1の実施形態では射出瞳面をX軸方向に2分割した光電変換素子を使用する例について説明した。しかし、画素あるいは領域ごとの像面位相差検出が可能であれば、光電変換素子の構成はこれに限定されない。例えば、より多くの光電変換素子を用いて3つ以上に射出瞳面を分割し、それらを組み合わせて位相差を検出してもよい。また、分割の方向もX軸方向に限らない。
<Other embodiments>
In the first embodiment, the example in which the photoelectric conversion element in which the exit pupil plane is divided into two in the X-axis direction is used has been described. However, the configuration of the photoelectric conversion element is not limited to this as long as the image plane phase difference can be detected for each pixel or region. For example, the exit pupil plane may be divided into three or more using more photoelectric conversion elements, and the phase difference may be detected by combining them. Further, the dividing direction is not limited to the X-axis direction.

また、第1の実施形態では画像生成時、光電変換素子から得た電気信号を加算した後にA/D変換を行っているが、光電変換素子ごとにA/D変換を行い、得られたデジタル値を加算して通常画像を生成してもよい。   Further, in the first embodiment, at the time of image generation, A / D conversion is performed after adding electrical signals obtained from the photoelectric conversion elements. However, A / D conversion is performed for each photoelectric conversion element, and the obtained digital signal is obtained. A normal image may be generated by adding values.

また、第1の実施形態ではRAW画像に対して回復処理を行っているが、処理の順序を変更し、RAW画像をデモザイキングした後のRGB画像それぞれに対して回復処理を行ってもよい。あるいは、他の任意の色空間に変換した上で回復処理を行ってもよい。   In the first embodiment, the recovery process is performed on the RAW image. However, the process order may be changed and the recovery process may be performed on each of the RGB images after demosaicing the RAW image. Alternatively, the restoration process may be performed after conversion to another arbitrary color space.

また、第1の実施形態および第2の実施形態では、取得した通常画像に対して画像回復処理を行っているが、合成前の位相差画像ペアの左眼用画像および右眼用画像に対して回復処理を行っても良い。また、回復処理後の位相差画像ペアを用いて通常画像を生成しても良い。   In the first embodiment and the second embodiment, the image restoration process is performed on the acquired normal image. However, the left-eye image and the right-eye image of the phase difference image pair before synthesis are processed. Recovery processing may be performed. Further, the normal image may be generated using the phase difference image pair after the recovery process.

また、第1の実施形態では、信号処理部108における各種処理はソフトウェアとして実装されるものとしたが、信号処理の各構成の一部または全部がチップ上に構成された電子回路によって実装されていても良い。   In the first embodiment, the various processes in the signal processing unit 108 are implemented as software. However, part or all of each component of the signal processing is implemented by an electronic circuit configured on a chip. May be.

また、第1の実施形態では撮像装置を例に説明したが、これに限定されない。例えば、信号処理部108を撮像装置とは異なる画像処理装置に内蔵してもよい。より具体的には、一般的なパーソナルコンピューター上で第1の実施形態に示す回復処理のコンピュータープログラムを実行し、外部から取得した撮像画像と位相差情報を読み込んで回復処理を実行することもできる。   In the first embodiment, the imaging apparatus has been described as an example, but the present invention is not limited to this. For example, the signal processing unit 108 may be built in an image processing device different from the imaging device. More specifically, the recovery processing computer program shown in the first embodiment can be executed on a general personal computer, and the captured image and phase difference information acquired from the outside can be read to execute the recovery processing. .

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は少なくとも1つ以上のメモリまたは記憶媒体を介してシステム又は装置に供給する。そのシステム又は装置のコンピュータにおける少なくとも1つ以上のプロセッサがそのプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   The present invention supplies a program realizing one or more functions of the above-described embodiments to a system or apparatus via a network or at least one memory or storage medium. It can also be realized by a process in which at least one processor in the computer of the system or apparatus reads and executes the program. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

301 位相差量算出部
303 画像回復部
304 回復フィルタ記憶部
305 画像処理部
301 phase difference amount calculation unit 303 image restoration unit 304 restoration filter storage unit 305 image processing unit

Claims (15)

撮像装置あるいは出力装置に起因する画質劣化を補正する画像処理装置であって、
右眼用画像と左眼用画像を取得する第一の取得手段と、
前記右眼用画像と前記左眼用画像における領域ごとに、被写体の位相差量を算出する算出手段と、
前記位相差量に基づいて、回復フィルタを設定する設定手段と、
前記設定手段に設定された回復フィルタを用いて、前記右眼用画像と前記左眼用画像に対して回復処理を実行する回復処理手段と、
を有することを特徴とする画像処理装置。
An image processing device that corrects image quality degradation caused by an imaging device or an output device,
First acquisition means for acquiring a right-eye image and a left-eye image;
Calculating means for calculating a phase difference amount of a subject for each region in the right-eye image and the left-eye image;
Setting means for setting a recovery filter based on the phase difference amount;
Recovery processing means for executing recovery processing on the right-eye image and the left-eye image using the recovery filter set in the setting means;
An image processing apparatus comprising:
撮像装置あるいは出力装置に起因する画質劣化を補正する画像処理装置であって、
右眼用画像と左眼用画像を取得する第一の取得手段と、
前記右眼用画像と前記左眼用画像における領域ごとに、被写体の位相差量を算出する算出手段と、
通常画像を取得する第二の取得手段と、
前記位相差量に基づいて、回復フィルタを設定する設定手段と、
前記設定手段に設定された回復フィルタを用いて、前記通常画像に対して回復処理を実行する回復処理手段と、
を有することを特徴とする画像処理装置。
An image processing device that corrects image quality degradation caused by an imaging device or an output device,
First acquisition means for acquiring a right-eye image and a left-eye image;
Calculating means for calculating a phase difference amount of a subject for each region in the right-eye image and the left-eye image;
A second acquisition means for acquiring a normal image;
Setting means for setting a recovery filter based on the phase difference amount;
Recovery processing means for executing recovery processing on the normal image using the recovery filter set in the setting means;
An image processing apparatus comprising:
前記設定手段は、前記位相差量に基づいて、前記光学系に起因する劣化を補正する回復フィルタの強度を決定し、前記強度に応じた回復フィルタを設定することを特徴とする請求項1乃至2のいずれか一項に記載の画像処理装置。   The said setting means determines the intensity | strength of the recovery filter which correct | amends the deterioration resulting from the said optical system based on the said phase difference amount, and sets the recovery filter according to the said intensity | strength. The image processing apparatus according to claim 1. 前記設定手段は、前記領域の位相差量が大きいほど、該領域に施す回復処理の強度を小さくすることを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the setting unit decreases the strength of the recovery process applied to the region as the phase difference amount of the region increases. 前記回復フィルタは、前記撮像装置の光学系の光学伝達関数の逆数であることを特徴とする請求項1乃至4の何れか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the recovery filter is an inverse number of an optical transfer function of an optical system of the imaging apparatus. 前記回復フィルタは、前記撮像装置あるいは入力装置の空間周波数の特性の逆数であることを特徴とする請求項1乃至4の何れか一項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the recovery filter is a reciprocal of a spatial frequency characteristic of the imaging apparatus or the input apparatus. 前記回復フィルタは、前記光学伝達関数あるいは空間周波数の特性の逆数を、逆フーリエ変換することで得られるフィルタであることを特徴とする請求項1乃至4の何れか一項に記載の画像処理装置。   5. The image processing apparatus according to claim 1, wherein the recovery filter is a filter obtained by performing an inverse Fourier transform on an inverse of the optical transfer function or spatial frequency characteristic. 6. . 前記強度は、前記撮像装置の光学系の光学伝達関数をフーリエ変換した結果の逆数を底とした際の冪指数であることを特徴とする請求項6又は7に記載の画像処理装置。   The image processing apparatus according to claim 6, wherein the intensity is a power exponent when a reciprocal of a result of Fourier transform of an optical transfer function of the optical system of the imaging apparatus is used as a base. 前記強度は、回復フィルタを適用した画像と回復フィルタを適用しない画像の線形和を取る際の係数であることを特徴とする請求項6又は7に記載の画像処理装置。   The image processing apparatus according to claim 6, wherein the intensity is a coefficient for calculating a linear sum of an image to which the recovery filter is applied and an image to which the recovery filter is not applied. 前記算出手段は、前記右眼用画像と前記左眼用画像それぞれにおいて、被写体に対応する輝度分布を検出し、前記輝度分布それぞれのピーク位置のずれ量を位相差量として算出することを特徴とする請求項1乃至9の何れか一項に記載の画像処理装置。   The calculating means detects a luminance distribution corresponding to a subject in each of the right-eye image and the left-eye image, and calculates a shift amount of a peak position of each of the luminance distributions as a phase difference amount. The image processing apparatus according to any one of claims 1 to 9. 前記算出手段は、前記右眼用画像と前記左眼用画像それぞれに対してハイパスフィルターを用いたフィルタ処理をすることで、被写体に対応するピーク位置を検出し、前記右眼用画像と前記左眼用画像それぞれのピーク位置の差分を位相差量をとして算出することを特徴とする請求項1乃至10の何れか一項に記載の画像処理装置。   The calculation means detects a peak position corresponding to a subject by performing a filtering process using a high-pass filter for each of the right-eye image and the left-eye image, and the right-eye image and the left-eye image are detected. The image processing apparatus according to claim 1, wherein the difference between the peak positions of the respective ophthalmic images is calculated as a phase difference amount. さらに、複数の強度に応じた回復フィルタを記憶する記憶手段を有し、
前記設定手段は、前記記憶手段が記憶する回復フィルタから、前記強度に対応する回復フィルタを選択することを特徴とする請求項1乃至11の何れか一項に記載の画像処理装置。
Furthermore, it has a memory | storage means to memorize | store the recovery filter according to several intensity | strength,
The image processing apparatus according to claim 1, wherein the setting unit selects a recovery filter corresponding to the strength from a recovery filter stored in the storage unit.
コンピュータを請求項1乃至12のいずれか1項に記載の画像処理装置として機能させるためのプログラム。   A program for causing a computer to function as the image processing apparatus according to any one of claims 1 to 12. 撮像装置あるいは出力装置に起因する画質劣化を補正する画像処理方法あって、
右眼用画像と左眼用画像を取得し、前記右眼用画像と前記左眼用画像における領域ごとに、被写体の位相差量を算出し、
前記位相差量に基づいて、回復処理の強度を決定し、
前記強度に基づいて回復フィルタを設定し、
前記設定された回復フィルタを用いて、前記右眼用画像と前記左眼用画像に対して回復処理を実行することを特徴とする画像処理方法。
An image processing method for correcting image quality degradation caused by an imaging device or an output device,
Acquiring a right-eye image and a left-eye image, calculating a phase difference amount of a subject for each region in the right-eye image and the left-eye image;
Based on the phase difference amount, determine the strength of the recovery process,
Set a recovery filter based on the intensity,
An image processing method, wherein recovery processing is executed on the right-eye image and the left-eye image using the set recovery filter.
撮像装置あるいは出力装置に起因する画質劣化を補正する画像処理方法あって、
右眼用画像と左眼用画像を取得し、前記右眼用画像と前記左眼用画像における領域ごとに、被写体の位相差量を算出し、
通常画像を取得し、
前記位相差量に基づいて、回復処理の強度を決定し、
前記強度に基づいて回復フィルタを設定し、
前記設定された回復フィルタを用いて、前記通常画像に対して回復処理を実行することを特徴とする画像処理方法。
An image processing method for correcting image quality degradation caused by an imaging device or an output device,
Acquiring a right-eye image and a left-eye image, calculating a phase difference amount of a subject for each region in the right-eye image and the left-eye image;
Get a normal image,
Based on the phase difference amount, determine the strength of the recovery process,
Set a recovery filter based on the intensity,
An image processing method, wherein a recovery process is performed on the normal image using the set recovery filter.
JP2018242178A 2018-03-30 2018-12-26 Image processing apparatus, image processing method and program Pending JP2019186905A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018066924 2018-03-30
JP2018066924 2018-03-30

Publications (1)

Publication Number Publication Date
JP2019186905A true JP2019186905A (en) 2019-10-24

Family

ID=68337817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018242178A Pending JP2019186905A (en) 2018-03-30 2018-12-26 Image processing apparatus, image processing method and program

Country Status (1)

Country Link
JP (1) JP2019186905A (en)

Similar Documents

Publication Publication Date Title
US8754957B2 (en) Image processing apparatus and method
JP5235642B2 (en) Image processing apparatus and method
CN108462830B (en) Image pickup apparatus and control method of image pickup apparatus
KR102157491B1 (en) Image processing apparatus, imaging apparatus and control method thereof, storage medium
JP5237978B2 (en) Imaging apparatus and imaging method, and image processing method for the imaging apparatus
JPWO2013042440A1 (en) Image processing apparatus, method and program, stereoscopic imaging apparatus, portable electronic device, printer, and stereoscopic image reproducing apparatus
JP5984493B2 (en) Image processing apparatus, image processing method, imaging apparatus, and program
JP5451894B2 (en) Stereo imaging device and shading correction method
EP2533198A1 (en) Imaging device and method, and image processing method for imaging device
JP7234057B2 (en) Image processing method, image processing device, imaging device, lens device, program, storage medium, and image processing system
JPWO2012002071A1 (en) Imaging apparatus, image processing apparatus, and image processing method
JP2014026051A (en) Image capturing device and image processing device
JP2015115733A (en) Image processing method, image processor, imaging device, and image processing program
JP2020088403A (en) Image processing apparatus, control method therefor and program
JP2019016975A (en) Image processing system and image processing method, imaging apparatus, program
JP2009047734A (en) Imaging apparatus and image processing program
CN107979715B (en) Image pickup apparatus
JP7183015B2 (en) Image processing device, image processing method, and program
JP2019186905A (en) Image processing apparatus, image processing method and program
JP7134666B2 (en) Image processing device, image processing method, and program
JP2018032982A (en) Image processing apparatus, imaging device, image processing method and program
JP2010283527A (en) Image processor and method of the same
JP2019208214A (en) Image processing apparatus, image processing method, program, and imaging apparatus
JP6585890B2 (en) Image processing apparatus, image processing method and program, and imaging apparatus
JP2019047145A (en) Image processing system, imaging apparatus, control method and program of image processing system