JP6961423B2 - Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media - Google Patents
Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media Download PDFInfo
- Publication number
- JP6961423B2 JP6961423B2 JP2017164421A JP2017164421A JP6961423B2 JP 6961423 B2 JP6961423 B2 JP 6961423B2 JP 2017164421 A JP2017164421 A JP 2017164421A JP 2017164421 A JP2017164421 A JP 2017164421A JP 6961423 B2 JP6961423 B2 JP 6961423B2
- Authority
- JP
- Japan
- Prior art keywords
- region
- image
- contrast value
- composition ratio
- 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.)
- Active
Links
- 238000003384 imaging method Methods 0.000 title claims description 28
- 238000000034 method Methods 0.000 title claims description 26
- 239000000203 mixture Substances 0.000 claims description 59
- 230000008859 change Effects 0.000 claims description 48
- 239000002131 composite material Substances 0.000 claims description 34
- 230000015572 biosynthetic process Effects 0.000 claims description 14
- 238000003786 synthesis reaction Methods 0.000 claims description 12
- 230000003287 optical effect Effects 0.000 claims description 8
- 230000002194 synthesizing effect Effects 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims 1
- 238000006243 chemical reaction Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 2
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
Images
Landscapes
- Focusing (AREA)
- Automatic Focus Adjustment (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Description
本発明は、ピント位置の異なる複数の画像を合成する画像処理装置に関するものである。 The present invention relates to an image processing device that synthesizes a plurality of images having different focus positions.
デジタルカメラなどの撮像装置からの距離が互いに大きく異なる複数の被写体を撮像する場合や、奥行き方向に長い被写体を撮像する場合に、被写界深度が足りないために被写体の一部にしかピントを合わせられない場合がある。これを解決するため、特許文献1には、ピント位置の異なる複数の画像を撮像し、各画像から合焦領域のみを抽出して1枚の画像に合成し、撮像領域全体に合焦している合成画像を生成する、所謂、深度合成の技術が開示されている。そこで、特許文献1では、それぞれの画像の同じ位置にある領域の中で、コントラスト値の最も高い領域を合焦領域とする。 When shooting multiple subjects whose distances from imagers such as digital cameras are significantly different from each other, or when shooting a subject that is long in the depth direction, the depth of field is insufficient, so focus is only on a part of the subject. It may not be possible to match. In order to solve this problem, in Patent Document 1, a plurality of images having different focus positions are captured, only the focusing region is extracted from each image, combined into one image, and the entire imaging region is focused. A so-called depth-of-field composition technique for generating a composite image is disclosed. Therefore, in Patent Document 1, among the regions at the same position of each image, the region having the highest contrast value is defined as the focusing region.
しかし、上述したような深度合成の方法を用いると、合成画像のエッジ部においてぼけ領域が出る場合がある。 However, when the method of depth composition as described above is used, a blurred region may appear at the edge portion of the composite image.
図10は、深度合成のための撮像を行う一例を説明するための図である。図10に示した場合では、撮像装置は、白地の背景の前にあるX型の被写体に対して、ピント位置を変えながら5枚の画像1010乃至1050を撮像し、撮像した画像に対して合成を行い、合成画像1000を生成したとする。画像1010乃至1050では、画素1011乃至1051は同じ位置にあり、画素1012乃至1052は同じ位置にあるとする。特許文献1に開示された技術を用いて合成画像を作成すると、画素1011乃至1051の中から最もコントラスト値の高いものを選んで合成画像の同じ位置に使う。そこで、撮像装置は、画素1031を合成画像1000に使うことが図示されている。しかしながら、撮像装置は、同様な方法で画素1012乃至1052の中から最もコントラスト値の高いものを選んで合成画像の同じ位置に使うと、画素1012または1052を選んで合成画像に使ってしまう。その結果、図示されているように、合成画像1000には、エッジ部の周辺にボケが生じてしまう。これは撮像装置に限らず、ピント位置を変えて撮像された複数の画像を取得し、これら複数の画像を合成する機能を有する画像処理装置全般に共通する課題である。
FIG. 10 is a diagram for explaining an example of performing imaging for depth synthesis. In the case shown in FIG. 10, the imaging device captures five
本発明は、上記の課題を鑑みてなされたものであり、ピント位置の異なる複数の画像を用いて合成した画像に含まれるぼけを低減することができる画像処理装置を提供することを目的とする。 The present invention has been made in view of the above problems, and an object of the present invention is to provide an image processing apparatus capable of reducing blur included in an image synthesized by using a plurality of images having different focus positions. ..
上記課題を解決するため、本願発明は、画像の複数の領域のそれぞれからコントラスト値を取得する取得手段と、少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、前記合成手段は、前記合成手段は、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記合成比率と等しく設定することを特徴とする画像処理装置を提供する。 In order to solve the above problems, the present invention relates to an acquisition means for acquiring contrast values from each of a plurality of regions of an image, and for a plurality of images having at least a part of the angle of view overlapping and different focus positions. Each region has a compositing means that sets a compositing ratio according to the contrast value acquired by the acquisition means and synthesizes the plurality of images based on the set compositing ratio to generate a compositing image. The synthesis means is such that the amount of change in the contrast value between the first regions of the plurality of images is equal to or less than a predetermined first threshold value, and the first region When there is a second region in the vicinity of the image in which the amount of change in the contrast value between the regions of the plurality of images is larger than the second threshold value, the composition ratio of the first region is set to the above. Provided is an image processing apparatus characterized in that the composition ratio is set to be equal to the composition ratio of the second region.
本発明の構成によれば、ピント位置の異なる複数の画像を撮像して合成した画像に含まれるぼけを低減することができる画像処理装置を提供することができる。 According to the configuration of the present invention, it is possible to provide an image processing apparatus capable of reducing blur included in an image obtained by capturing and synthesizing a plurality of images having different focus positions.
以下では、添付の図面を参照しながら、本発明の好適な実施形態について詳細に説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.
(第1の実施形態)
図1は本実施形態に係る画像処理装置としてのデジタルカメラの構造を示すブロック図である。デジタルカメラ100は、静止画を撮像することができ、かつ、合焦位置の情報を記録し、コントラスト値の算出および画像の合成が可能なものである。さらに、デジタルカメラ100は、撮像して保存した画像、または、外部から入力した画像に対して、拡大処理または縮小処理を行うことができる。
(First Embodiment)
FIG. 1 is a block diagram showing a structure of a digital camera as an image processing device according to the present embodiment. The digital camera 100 can capture a still image, record information on the in-focus position, calculate a contrast value, and synthesize an image. Further, the digital camera 100 can perform enlargement processing or reduction processing on an image captured and saved or an image input from the outside.
制御部101は、例えばCPUやMPUなどのシグナルプロセッサであり、予め後述するROM105に内蔵されたプログラムを読み出しながら、デジタルカメラ100の各部分を制御する。たとえば、後述するように、制御部101が、後述する撮像部104に対して撮像の開始と終了について指令を出す。または、後述する画像処理部107に対して、ROM105に内蔵されたプログラムに基づいて、画像処理の指令を出す。ユーザによる指令は、後述する操作部110によってデジタルカメラ100に入力され、制御部101を通して、デジタルカメラ100の各部分に達する。
The
駆動部102は、モーターなどによって構成され、制御部101の指令の下で、後述する光学系103を機械的に動作させる。たとえば、制御部101の指令に基づいて、駆動部102が光学系103に含まれるフォーカスレンズの位置を移動させ、光学系103の焦点距離を調整する。
The drive unit 102 is composed of a motor or the like, and mechanically operates the
光学系103は、ズームレンズ、フォーカスレンズ、および絞りなどにより構成される。絞りは、透過する光量を調整する機構である。レンズの位置を変えることによって、合焦位置を変えることができる。
The
撮像部104は、光電変換素子であり、入射された光信号を電気信号に変換する光電変換を行うものである。たとえば、撮像部104に、CCDセンサやCMOSセンサなどを適用することができる。撮像部104は、動画撮像モードを設け、時間的に連続する複数の画像を動画の各々のフレームとして、撮像することができる。
The
ROM105は、記録媒体としての読み出し専用の不揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶している。RAM106は、書き換え可能な揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。
The
画像処理部107は、撮像部104から出力された画像、あるいは後述する内蔵メモリ109に記録されている画像信号のデータに対して、ホワイトバランス調整、色補間、フィルタリングなど、様々な画像処理を行う。また、撮像部104が撮像した画像信号のデータに対して、JPEGなどの規格で、圧縮処理を行う。
The
画像処理部107は、特定の処理を行う回路を集めた集積回路(ASIC)で構成される。あるいは、制御部101がROM105から読み出したプログラムに従って処理することで、制御部101が画像処理部107の機能の一部または全部を兼用するようにしてもよい。制御部101が画像処理部107の全ての機能を兼用する場合には、画像処理部107をハードウェアとして有する必要はなくなる。
The
表示部108は、RAM106に一時保存されている画像、または、後述する内蔵メモリ109に保存されている画像、あるいは、デジタルカメラ100の設定画面などを表示するための液晶ディスプレイや有機ELディスプレイなどである。
The
内蔵メモリ109は、撮像部104が撮像した画像や画像処理部107の処理を得た画像、および、画像撮像時の合焦位置の情報などを記録する場所である。内蔵メモリの代わりに、メモリカードなどを用いてもよい。
The built-in
操作部110は、たとえば、デジタルカメラ100につけるボタンやスイッチ、キー、モードダイアルなど、あるいは、表示部108に兼用されるタッチパネルなどである。ユーザによる指令は、操作部110を経由して、制御部101に達する。
The
図2は、本実施形態における合成画像の生成について説明するためのフローチャートである。ステップS201では、撮像部104は、ピント位置の異なる複数の画像を撮像する。ステップS202では、制御部101は、ステップS201で撮像部104が撮像した複数の画像に対して位置合わせを行う。ステップS203で、画像処理部107は、位置合わせを行った後の画像に対して合成を行い、合成画像を生成する。以下では、それぞれのステップについて詳細に説明する。
FIG. 2 is a flowchart for explaining the generation of the composite image in the present embodiment. In step S201, the
図3は、本実施形態におけるステップS201での撮像について説明するためのフローチャートである。 FIG. 3 is a flowchart for explaining the imaging in step S201 in the present embodiment.
ステップS301で、制御部101は、ピント位置の設定を行う。たとえば、ユーザは表示部108が兼用するタッチパネルを通して合焦位置を指定し、その合焦位置に相当するピント位置の光軸方向の前後に等間隔に複数のピント位置を指定する。同時に、制御部101は、設定したピント位置において、距離順に撮像順番を決める。
In step S301, the
ステップS302で、撮像部104は、ステップS301で設定したピント位置のうち、未撮像のものの中で、撮像順番が最も先のピント位置において撮像する。
In step S302, the
ステップS303で、制御部101は、ステップS301で設定したすべてのピント位置において撮像を行ったかどうかについて判断する。すべてのピント位置に撮像した場合は、このフローチャートでの処理を終了し、まだ撮像していないピント位置があれば、ステップS302に戻る。
In step S303, the
図4は、本実施形態におけるステップS202での位置合わせについて説明するためのフローチャートである。 FIG. 4 is a flowchart for explaining the alignment in step S202 in the present embodiment.
ステップS401では、制御部101は、ステップS201で撮像部104が撮像した画像のうちから、位置合わせの基準画像を取得する。位置合わせの基準画像は、撮像順番が最も早いものとする。あるいは、ピント位置を変えながら撮像することで、わずかながら撮像された画像間で画角が変化するため、撮像した画像の中で画角が最も狭いものにしてもよい。
In step S401, the
ステップS402では、制御部101は、位置合わせの処理の対象画像を取得する。対象画像は、ステップS401で取得した基準画像以外の画像で、位置合わせの処理が済んでいないものとする。制御部101は、撮像順番が最も早いものを基準画像とするならば、撮像した順番で順次に対象画像を取得すればよい。
In step S402, the
ステップS403では、制御部101は、基準画像と対象画像との位置のずれ量を算出する。算出方法の一例は、以下に述べる。まず、制御部101は、基準画像に、複数のブロックを設定する。制御部101は、各々のブロックのサイズが同じになるように設定することが好ましい。次に、制御部101は、対象画像の、基準画像のそれぞれのブロックと同じ位置に、基準画像のブロックよりも広い範囲を、探索範囲を設定する。最後に、制御部101は、対象画像のそれぞれの探索範囲に、基準画像のブロックとの輝度の差分絶対値和(Sum of Absolute Difference、以下、SADをいう)が最小となる対応点を算出する。制御部101は、基準画像のブロックの中心と前述した対応点から、ステップS403でいう位置のずれをベクトルとして算出する。制御部101は、前述する対応点の算出において、SADのほかに、差分二乗和(Sum of Squared Difference、以下SSDをいう)や正規化相互相関(Normalized Cross Correlation、以下NCCをいう)などを用いてもよい。
In step S403, the
ステップS404で、制御部101で、基準画像と対象画像との位置のずれ量から変換係数を算出する。制御部101は、変換係数として、例えば射影変換係数を用いる。ただし、変換係数として射影変換係数だけに限定するわけではなく、アフィン変換係数や水平垂直シフトのみの簡略化した変換係数を用いてもよい。
In step S404, the
ステップS405で、画像処理部107は、ステップS404で算出した変換係数を用いて対象画像に対して変換を行う。
In step S405, the
たとえば、制御部101は、(式1)に示した式を用いて変形を行うことができる。
For example, the
(式1)では、(x´、y´)は変形を行った後の座標を示し、(x、y)は変形を行う前の座標を示す。行列AはステップS404で制御部101が算出した変形係数を示す。
In (Equation 1), (x', y') indicates the coordinates after the transformation, and (x, y) indicates the coordinates before the transformation. The matrix A shows the deformation coefficient calculated by the
ステップS406で、制御部101は、基準画像以外のすべての画像に対して位置合わせを行ったかどうかについて判断する。基準画像以外のすべての画像に対して位置合わせを行った場合は、このフローチャートでの処理を終了し、まだ処理していない画像があれば、ステップS402に戻る。
In step S406, the
図5は、本実施形態におけるステップS203での画像の合成について説明するためのフローチャートである。 FIG. 5 is a flowchart for explaining the composition of images in step S203 in the present embodiment.
ステップ501で、画像処理部107は、位置合わせを行った後のそれぞれの画像(基準画像を含む)に対してコントラスト値を算出する。コントラスト値の算出方法の一例としては、たとえば、まず、画像処理部107は、それぞれの画素の色信号Sr、Sg、Sbから、下記の(式2)を用いて輝度Yを算出する。
Y = 0.299Sr + 0.587Sg + 0.114Sb・・・(式2)
In step 501, the
Y = 0.299Sr + 0.587Sg + 0.114Sb ... (Equation 2)
次に、3×3の画素の輝度Yの行列Lに、下記の(式3)乃至(式5)に示したように、ソーベルフィルタを用いてコントラスト値Iを算出する。 Next, the contrast value I is calculated using the Sobel filter in the matrix L of the brightness Y of the 3 × 3 pixels as shown in the following (Equation 3) to (Equation 5).
また、上述のコントラスト値の計算方法は一例にすぎず、たとえば、使用するフィルタをラプラシアンフィルタ等のエッジ検出フィルタや所定の帯域を通過するバンドパスフィルタを用いることも可能である。 Further, the above-mentioned method of calculating the contrast value is only an example, and for example, an edge detection filter such as a Laplacian filter or a bandpass filter that passes through a predetermined band can be used as the filter to be used.
ステップS502で、画像処理部107は、合成マップを生成する。合成マップの生成方法としては、画像処理部107は、それぞれの画像の同じ位置にある画素のコントラスト値を比較し、コントラスト値の最も高い画素の合成比率を100%とし、同じ位置にあるほかの画素の合成比率を0%とする。画像処理部107は、こうした合成比率の設定を、画像のすべての位置に対して行う。
In step S502, the
ステップS503で、制御部101は、ステップS502で画像処理部107が生成した合成マップに対して補正を行う。具体的な補正方法は後述する。
In step S503, the
ステップS504では、画像処理部107は、ステップS503で制御部101が補正した合成マップに従い画素の置き換えを行い、合成画像を生成する。なお、このようにして算出した合成比率に対して、隣接画素間で合成比率が0%から100%に変化(あるいは100%から0%に変化)すると、合成境界での不自然さが目立つようになる。そのため、合成マップに対して所定の画素数(タップ数)を持つフィルタをかけ、隣接画素間で合成比率が急激に変化しないようにする。
In step S504, the
以下では、ステップS503での合成マップの補正について詳細に説明する。 Hereinafter, the correction of the composite map in step S503 will be described in detail.
図6は、本実施形態におけるステップS503での合成マップの補正について説明するためのフローチャートである。ステップS601で、制御部101は、未処理の画素から着目画素を選定する。
FIG. 6 is a flowchart for explaining the correction of the composite map in step S503 in the present embodiment. In step S601, the
次に、ステップS602で、制御部101は、着目画素のコントラスト値の変化量を算出する。ここでいうコントラスト値の変化量を、位置合わせを行った後のそれぞれの画像(基準画像を含む)において、着目画素と同じ位置にある画素のうち、コントラスト値の最大値と最小値との差を指す。
Next, in step S602, the
ステップS603で、制御部101は、ステップS602で算出したコントラスト値の変化量を予め定められた閾値と比較し、閾値以下であれば、ステップS604に進み、着目画素の合成比率の変更を行う。一方、閾値以下でなければ、ステップS605に進む。ここでは、制御部101は、コントラスト値の変化量が閾値以下の画素は、図10の画素1001のように、被写体のエッジボケである可能性が高いと判断した。
In step S603, the
ステップS604で、制御部101は、着目画素の合成比率を変更する。ここで、制御部101は、着目画素の合成比率を、その近傍の、コントラスト値の変化量が閾値よりも大きい画素を参照して変更する。たとえば、制御部101は、着目画素の合成比率を、その近傍のコントラスト値の変化量が閾値よりも大きい画素のうち、最も大きいものの合成比率にする。または、その近傍のコントラスト値の変化量が閾値よりも大きい画素のうち、最も近いものの合成比率にする。このステップS604における閾値は、ステップS603で比較に用いた閾値と同じ値としてもよいし、ステップS603で比較に用いた閾値よりも大きな値としてもよい。近傍にコントラスト値の変化量が閾値より大きくなる画素が存在しなければ、その画素の近傍にはエッジが無く、その画素がエッジボケである可能性は低いとして、合成比率の補正は行わない。なお、ここでいう「近傍」の範囲については、後述する。図8は、本実施形態におけるコントラスト値の変化量を説明するためのである。図7(a)では、複数の画像の同じ位置にある画素711乃至715のコントラスト値と画像撮像時のピント位置との関係を示している。画素713がある画像を撮像したときのコントラスト値が最大であり、このピント位置においてこの画素はピントが合っていると判断し、このピント位置をベストピントとも呼ぶ。ここで、コントラスト値の最も大きい画素513のコントラスト値と、コントラスト値の最も小さい画素715のコントラスト値の差、つまり前述したコントラスト値の変化量を算出し、前述した閾値より大きいと仮定する。
In step S604, the
一方で、図7(b)は、画素711乃至715のそれぞれの近傍にある同じ位置の画素721乃至725のコントラスト値とピント位置との関係を示している。図7(b)では、画素725のコントラスト値が最も高いが、それと、コントラスト値の最も低い画素723のコントラスト値との差、つまり、コントラスト値の変化量は閾値以下とする。コントラスト値の変化量が閾値以下である場合、前述したように、制御部は、この画素はコントラスト値の小さな被写体の領域の位置にあり、周囲の被写体のエッジのボケの影響を受けている可能性があるとして、合成比率の変更を行う。変更の方法として、制御部101は、図7(a)の画素711のベストピントとなるピント位置を、図7(b)の画素723におけるベストピントと判断する。そして、制御部101は、このピント位置にある画素723の合成比率を100%にし、画素725を含むほかの画像の同じ位置の画素の合成比率を0%にする。このような変更は、図10に例えると、画像処理部107は合成画像1000を作成するとき、図10の画素1051の代わりに、画素1031を合成画像に使うことになり、エッジボケを防ぐことになる。
On the other hand, FIG. 7B shows the relationship between the contrast value and the focus position of the
ステップS605で、制御部101は、すべての画素を処理したかどうかについて判断する。すべての画素を処理した場合このフローを終了し、まだ処理していない画素があれば、ステップS601に戻る。
In step S605, the
なお、前述したように、上記処理は、図7(a)に示した画素は図7(b)に示した画素の近傍にあることを前提にしている。ここでいう「近傍」の判断は、点広がり関数(Point spread function、以下PSFをいう)を用いて行うことができる。 As described above, the above processing is based on the premise that the pixels shown in FIG. 7A are in the vicinity of the pixels shown in FIG. 7B. The determination of "neighborhood" here can be performed using a point spread function (hereinafter referred to as PSF).
図8は、本実施形態におけるPSFを説明するための図である。図8では、横軸が画素の座標、縦軸がコントラスト値を示している。なお、実際のPSFは2次元的な広がりを持っているが、図8では簡略のため、1次元で表現している。図8(a)は理想的なレンズを用いて点像をベストピントの位置で結像させた場合のPSFを示している。図8(b)では、ピント位置を動かしたデフォーカス状態(撮像面の位置がベストピントの位置から離れる状態)での結像は曲線820のようになり、像の広がる(ボケが広がる)画素数Nは距離821に示したようになる。図8(c)では、さらにデフォーカス量が大きくなると結像は曲線830になり、像の広がる画素数Nは距離831になる。
FIG. 8 is a diagram for explaining PSF in this embodiment. In FIG. 8, the horizontal axis represents the pixel coordinates and the vertical axis represents the contrast value. Although the actual PSF has a two-dimensional spread, it is represented in one dimension in FIG. 8 for the sake of brevity. FIG. 8A shows a PSF when a point image is formed at the best focus position using an ideal lens. In FIG. 8B, the image formation in the defocused state (the state where the position of the imaging surface is separated from the best focus position) in which the focus position is moved becomes as shown by the
デフォーカス量(ピント位置の変更量)はステップS301での設定から計算することができるので、PSFに応じて像がどれだけ広がるかを計算することが可能である。前述した着目画素の「近傍」を、この画素数Nに収めるように設定するとよい。つまり、制御部101は、着目画素のコントラスト値の変化量が閾値以下であれば、予め計算したPSFに基づいて設定した範囲において、コントラスト値の変化量が閾値より大きい画素があるかどうかを確かめる。着目画素の近傍にあれば、制御部101は、前述した合成比率の変更を行う。
Since the defocus amount (change amount of the focus position) can be calculated from the setting in step S301, it is possible to calculate how much the image spreads according to the PSF. It is preferable to set the "neighborhood" of the pixel of interest described above to be within this number of pixels N. That is, if the amount of change in the contrast value of the pixel of interest is equal to or less than the threshold value, the
なお、上述した近傍の決め方は一例にすぎず、様々な変更をすることができる。たとえば、PSFの広がりで得られた画素数Nで判断したうえで、さらに、被写体の距離情報を用いて判断する。つまり、図7(a)と図7(b)とに示した画素の被写体距離の差が所定量以下でないと、制御部101は、その2つの画素は「近傍」にあると判断しない。距離情報は公知の技術で算出することが可能で、一例として1つの画素に複数の光電変換部を有する撮像素子が取得するステレオ画像から算出することができる。
It should be noted that the above-mentioned method of determining the neighborhood is only an example, and various changes can be made. For example, after making a judgment based on the number of pixels N obtained by spreading the PSF, the judgment is made using the distance information of the subject. That is, unless the difference between the subject distances of the pixels shown in FIGS. 7 (a) and 7 (b) is equal to or less than a predetermined amount, the
さらに、上記の「近傍」と判断された画素のうち、コントラスト値の変化の特性を考慮することも可能である。たとえば、図7(a)に示した画素はベストピントの位置でコントラスト値が最大で、ピント位置が変化するとコントラスト値が減少する特性を持っている。それに対して、エッジボケ画素は図7(a)のベストピントの位置でコントラスト値が最小で、ピント位置が変化するとコントラスト値が増加する特性をもつ可能性が高い。そのため、着目画素のコントラスト値の変化特性と逆のコントラスト値の変化特性をもつ画素のみ用いて、着目画素の合成比率の補正を行うようにするようにしても良い。 Further, it is also possible to consider the characteristics of the change in the contrast value among the pixels determined to be "nearby". For example, the pixel shown in FIG. 7A has a characteristic that the contrast value is maximum at the best focus position and the contrast value decreases when the focus position changes. On the other hand, the edge-blurred pixel has a characteristic that the contrast value is the minimum at the best focus position in FIG. 7 (a) and the contrast value increases when the focus position changes. Therefore, the composition ratio of the pixel of interest may be corrected by using only the pixel having the characteristic of changing the contrast value opposite to that of the pixel of interest.
第1の実施形態によれば、画素のコントラスト値の変化量を計算し、閾値以下の画素の合成比率を変更することによって、エッジボケを低減することができる。 According to the first embodiment, the edge blur can be reduced by calculating the amount of change in the contrast value of the pixels and changing the composition ratio of the pixels below the threshold value.
(第2の実施形態)
第1の実施形態では、着目画素のコントラスト値の変化量が閾値以下である場合に、その着目画素の合成比率を変更したが、第2の実施形態では、着目画素のコントラスト値の変化量が閾値より大きい場合に、その周辺画素の合成比率を変更するものである。以下では、第2の実施形態について、第1の実施形態と異なる所を中心に説明する。なお、第1の実施形態と同様な所は省略する。
(Second Embodiment)
In the first embodiment, when the amount of change in the contrast value of the pixel of interest is equal to or less than the threshold value, the composition ratio of the pixel of interest is changed, but in the second embodiment, the amount of change in the contrast value of the pixel of interest is When it is larger than the threshold value, the composition ratio of the peripheral pixels is changed. Hereinafter, the second embodiment will be described focusing on the points different from those of the first embodiment. The same parts as in the first embodiment will be omitted.
図9は、本実施形態におけるステップS503での合成マップの補正について説明するためのフローチャートである。ステップS901で、制御部101は、未処理の画素から着目画素を選定する。
FIG. 9 is a flowchart for explaining the correction of the composite map in step S503 in the present embodiment. In step S901, the
ステップS902で、制御部101は、着目画素のコントラスト値の変化量を算出する。算出の方法は第1の実施形態のステップS602と同様である。
In step S902, the
ステップS903で、制御部101は、ステップS902で算出したコントラスト値の変化量が予め定められた閾値以上であれば、ステップS904に進み、閾値より小さければ、ステップS905に進む。ここでいう「閾値」は、第1の実施形態の合成マップの補正についての説明での「閾値」と異なるものである。
In step S903, the
ステップS904で、制御部101は、着目画素の合成比率を参照し、近傍画素の合成比率を変更する。たとえば、制御部101は、着目画素の近傍の画素のうちコントラスト値の変化量が閾値以下である画素の合成比率を、着目画素と同じ合成比率にする。ここで、その近傍の画素に対して、着目画素よりも近い位置に、コントラスト値の変化量が予め定められた閾値以上となる他の画素が存在するならば、その画素に基づく合成比率を優先するようにしてもよい。また、着目画素の近傍に、コントラスト値の変化量が閾値以下の画素となる画素が無い場合には、この近傍の範囲において合成比率の変更は行わない。ここでいう「近傍」の判断方法は、第1の実施形態のステップS604で説明した方法と同様でよい。
In step S904, the
ステップS905で、制御部101は、すべての画素を処理したかどうかについて判断する。すべての画素を処理した場合このフローを終了し、まだ処理していない画素があれば、ステップS901に戻る。
In step S905, the
ステップS903では、着目画素のコントラスト値が閾値以上である場合、ピント位置を変更することでエッジボケが広がる可能性が高く、近傍画素において単純にコントラスト値の最大値で合成比率を決定するとエッジボケした画像を出力する可能性がある。そのため、閾値以上のコントラスト値をもつ画素を検出した場合は、近傍にエッジボケの影響を受けやすいコントラスト値の変化量が小さな画素があれば、その画素の合成比率を着目画素と同じ合成比率に変更するようにする。 In step S903, when the contrast value of the pixel of interest is equal to or greater than the threshold value, there is a high possibility that the edge blur will spread by changing the focus position, and if the composition ratio is simply determined by the maximum value of the contrast value in the neighboring pixels, the edge blurred image will be obtained. May be output. Therefore, when a pixel with a contrast value equal to or higher than the threshold value is detected, if there is a pixel in the vicinity where the amount of change in the contrast value that is easily affected by edge blur is small, the composition ratio of that pixel is changed to the same composition ratio as the pixel of interest. To do.
第2の実施形態によれば、画素のコントラスト値の変化量を計算し、閾値以上の画素の近傍画素の合成比率を変更することによって、エッジボケを低減することができる。 According to the second embodiment, the edge blur can be reduced by calculating the amount of change in the contrast value of the pixels and changing the composition ratio of the neighboring pixels of the pixels above the threshold value.
(その他の実施形態)
以上の実施形態は、デジタルカメラでの実施をもとに説明したが、デジタルカメラに限定するものではない。たとえば、撮像素子が内蔵した携帯機器などで実施してもよく、画像を撮像することができるネットワークカメラなどでもよい。
(Other embodiments)
Although the above embodiments have been described based on the implementation with a digital camera, the above embodiment is not limited to the digital camera. For example, it may be carried out by a portable device having a built-in image sensor, or may be a network camera capable of capturing an image.
なお、本発明は、上述の実施形態の1つ以上の機能を実現するプログラムを、ネットワークまたは記憶媒体を介してシステムまたは装置に供給し、そのシステムまたは装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読み出し作動させる処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 In the present invention, a program that realizes one or more functions of the above-described embodiment is supplied to a system or device via a network or a storage medium, and one or more processors in the computer of the system or device program. It can also be realized by the process of reading and operating. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
100 デジタルカメラ
101 制御部
102 駆動部
103 光学系
104 撮像部
105 ROM
106 RAM
107 画像処理部
108 表示部
109 内蔵メモリ
110 操作部
100
106 RAM
107
Claims (16)
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、
前記合成手段は、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記合成比率と等しく設定することを特徴とする画像処理装置。 An acquisition method for acquiring contrast values from each of a plurality of areas of an image,
For a plurality of images in which at least a part of the angles of view overlap and the focus positions are different, a composition ratio is set for each area according to the contrast value acquired by the acquisition means, and the composition ratio is based on the set composition ratio. It has a compositing means for generating a composite image by compositing the plurality of images.
The combining means, the amount of change in the contrast value between each of the first region of the plurality of images is equal to or less than the first threshold value predetermined and, in the vicinity of the first region, said plurality When there is a second region in which the amount of change in the contrast value between the respective regions of the image is larger than the second threshold value, the composite ratio of the first region is used as the composition ratio of the second region. An image processing device characterized in that it is set to be equal to the composition ratio.
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、
前記合成手段は、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記コントラスト値に基づいて設定し、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい領域が存在しない場合は、前記第1の領域の前記合成比率を、前記第1の領域の前記コントラスト値に基づいて設定することを特徴とする画像処理装置。 An acquisition method for acquiring contrast values from each of a plurality of areas of an image,
For a plurality of images in which at least a part of the angles of view overlap and the focus positions are different, a composition ratio is set for each area according to the contrast value acquired by the acquisition means, and the composition ratio is based on the set composition ratio. It has a compositing means for generating a composite image by compositing the plurality of images.
The combining means, the amount of change in the contrast value between each of the first region of the plurality of images is equal to or less than the first threshold value predetermined and, in the vicinity of the first region, said plurality When there is a second region in which the amount of change in the contrast value between the regions of the image is larger than the second threshold value, the composite ratio of the first region is used as the composition ratio of the second region. The contrast value is set based on the contrast value, and the amount of change in the contrast value in the first region of the plurality of regions is equal to or less than a predetermined first threshold value and is located in the vicinity of the first region. When there is no region in which the amount of change in the contrast value is larger than the second threshold value, the synthesis ratio of the first region is set based on the contrast value of the first region. Image processing device.
前記画像の複数の領域のそれぞれからコントラスト値を取得する取得手段と、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、
前記合成手段は、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記合成比率と等しく設定することを特徴とする画像処理装置。 It has an imaging means for capturing an image,
An acquisition means for acquiring a contrast value from each of a plurality of regions of the image, and
For a plurality of images in which at least a part of the angles of view overlap and the focus positions are different, a composition ratio is set for each area according to the contrast value acquired by the acquisition means, and the composition ratio is based on the set composition ratio. It has a compositing means for generating a composite image by compositing the plurality of images.
The combining means, the amount of change in the contrast value between each of the first region of the plurality of images is equal to or less than the first threshold value predetermined and, in the vicinity of the first region, said plurality When there is a second region in which the amount of change in the contrast value between the respective regions of the image is larger than the second threshold value, the composite ratio of the first region is used as the composition ratio of the second region. An image processing device characterized in that it is set to be equal to the composition ratio.
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成ステップと、を有し、
前記合成ステップにおいては、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記合成比率と等しく設定することを特徴とする画像処理装置の制御方法。 An acquisition step to acquire contrast values from each of multiple areas of the image,
For a plurality of images in which at least a part of the angles of view overlap and the focus positions are different, a composition ratio is set according to the contrast value for each region, and the composition ratio of the plurality of images is set based on the set composition ratio. It has a compositing step to perform compositing and generate a compositing image,
In the above synthesis step, the is a plurality of first threshold value or less amount of change in the contrast value between each of the first region of the image is predetermined, and, in the vicinity of the first region, the When there is a second region in which the amount of change in the contrast value between the respective regions of the plurality of images is larger than the second threshold value, the composite ratio of the first region is set to that of the second region. A control method for an image processing apparatus, characterized in that the composition ratio is set to be equal to the composition ratio.
画像の複数の領域のそれぞれからコントラスト値を取得する取得ステップと、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成ステップと、を行わせ、
前記合成ステップにおいては、前記複数の画像のそれぞれの第1の領域間の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に、前記複数の画像のそれぞれの領域間の前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記合成比率と等しく設定することを特徴とするプログラム。 A computer program that runs on the computer of an image processing device.
An acquisition step to acquire contrast values from each of multiple areas of the image,
For a plurality of images in which at least a part of the angles of view overlap and the focus positions are different, a composition ratio according to the contrast value is set for each region, and the composition ratio of the plurality of images is set based on the set composition ratio. Perform the compositing step to generate a compositing image by compositing,
In the above synthesis step, the is a plurality of first threshold value or less amount of change in the contrast value between each of the first region of the image is predetermined, and, in the vicinity of the first region, the When there is a second region in which the amount of change in the contrast value between the respective regions of the plurality of images is larger than the second threshold value, the composite ratio of the first region is set to that of the second region. A program characterized in that it is set to be equal to the synthesis ratio.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017164421A JP6961423B2 (en) | 2017-08-29 | 2017-08-29 | Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017164421A JP6961423B2 (en) | 2017-08-29 | 2017-08-29 | Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2019047145A JP2019047145A (en) | 2019-03-22 |
JP2019047145A5 JP2019047145A5 (en) | 2020-08-06 |
JP6961423B2 true JP6961423B2 (en) | 2021-11-05 |
Family
ID=65814777
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017164421A Active JP6961423B2 (en) | 2017-08-29 | 2017-08-29 | Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6961423B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7409604B2 (en) * | 2019-12-18 | 2024-01-09 | キヤノン株式会社 | Image processing device, imaging device, image processing method, program and recording medium |
JP7558656B2 (en) * | 2020-01-06 | 2024-10-01 | キヤノン株式会社 | Image processing device, imaging device, image processing method, program, and recording medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014067142A (en) * | 2012-09-25 | 2014-04-17 | Olympus Corp | Image processing apparatus, image processing method, imaging apparatus, and imaging method |
JP6147347B2 (en) * | 2013-08-07 | 2017-06-14 | シャープ株式会社 | Imaging device |
-
2017
- 2017-08-29 JP JP2017164421A patent/JP6961423B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2019047145A (en) | 2019-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10917576B2 (en) | Dual aperture zoom camera with video support and switching / non-switching dynamic control | |
JP6838994B2 (en) | Imaging device, control method and program of imaging device | |
JP6800797B2 (en) | Image pickup device, image processing device, control method and program of image pickup device | |
CN109040553A (en) | Based on Dual-Aperture zoom digital camera | |
JP6833498B2 (en) | Imaging device, imaging method and computer program | |
JP2018107526A (en) | Image processing device, imaging apparatus, image processing method and computer program | |
JP6786311B2 (en) | Image processing equipment, image processing methods, computer programs and storage media | |
JP6961423B2 (en) | Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media | |
CN110784642B (en) | Image processing apparatus, control method thereof, storage medium, and imaging apparatus | |
JP6748847B2 (en) | Imaging device | |
JP2020160773A (en) | Image processing device, imaging device, image processing method, and program | |
JP7458769B2 (en) | Image processing device, imaging device, image processing method, program and recording medium | |
JP6728020B2 (en) | Image processing apparatus, image processing method and program | |
JP7214368B2 (en) | Image processing device, imaging device, image processing method, program and recording medium | |
JP2008053787A (en) | Multiple-lens electronic camera and parallax correcting method of multi-lens electronic camera | |
JP2022083147A (en) | Imaging equipment, imaging methods, programs and recording media | |
JP2021180366A (en) | Image pickup device, its control method, and program | |
JP7409604B2 (en) | Image processing device, imaging device, image processing method, program and recording medium | |
JP6953594B2 (en) | Image processing equipment, imaging equipment, image processing methods, programs and recording media | |
JP6828069B2 (en) | Imaging equipment, imaging methods and programs | |
JP6818734B2 (en) | Image processing equipment, imaging equipment, image processing methods and programs | |
JP7608119B2 (en) | Image processing device, image processing method, imaging device, program, and recording medium | |
JP6833772B2 (en) | Image processing equipment, imaging equipment, image processing methods and programs | |
JP2024002631A (en) | Image processing device, imaging apparatus, image processing method, computer program, and recording medium | |
JP2024036872A (en) | Imaging device, imaging method, program, and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200622 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200622 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210513 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210525 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210721 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20210914 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211013 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6961423 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |