JP2019047145A - Image processing system, imaging apparatus, control method and program of image processing system - Google Patents

Image processing system, imaging apparatus, control method and program of image processing system Download PDF

Info

Publication number
JP2019047145A
JP2019047145A JP2017164421A JP2017164421A JP2019047145A JP 2019047145 A JP2019047145 A JP 2019047145A JP 2017164421 A JP2017164421 A JP 2017164421A JP 2017164421 A JP2017164421 A JP 2017164421A JP 2019047145 A JP2019047145 A JP 2019047145A
Authority
JP
Japan
Prior art keywords
contrast value
image processing
region
image
area
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.)
Granted
Application number
JP2017164421A
Other languages
Japanese (ja)
Other versions
JP6961423B2 (en
JP2019047145A5 (en
Inventor
文貴 中山
Fumitaka Nakayama
文貴 中山
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
Priority to JP2017164421A priority Critical patent/JP6961423B2/en
Publication of JP2019047145A publication Critical patent/JP2019047145A/en
Publication of JP2019047145A5 publication Critical patent/JP2019047145A5/en
Application granted granted Critical
Publication of JP6961423B2 publication Critical patent/JP6961423B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

To provide an image processing system capable of reducing the blur included in an image obtained by capturing images of different focal positions and synthesizing.SOLUTION: An image processing system has acquisition means for acquiring contrast values from multiple regions of an image, respectively, and synthesis means setting a synthesis ratio according to the contrast value of each region for multiple images, and generating a composite image by synthesizing the multiple images on the basis of the set synthesis ratio. When the variation of the contrast value of the first region, out of the multiple regions, goes below a predetermined first threshold level, and a second region having variation of the contrast value larger than a second threshold level exists near the first region, the synthesis means sets the synthesis ratio on the basis of the contrast value of the second region.SELECTED DRAWING: Figure 6

Description

本発明は、ピント位置の異なる複数の画像を合成する画像処理装置に関するものである。   The present invention relates to an image processing apparatus that combines a plurality of images with different focus positions.

デジタルカメラなどの撮像装置からの距離が互いに大きく異なる複数の被写体を撮像する場合や、奥行き方向に長い被写体を撮像する場合に、被写界深度が足りないために被写体の一部にしかピントを合わせられない場合がある。これを解決するため、特許文献1には、ピント位置の異なる複数の画像を撮像し、各画像から合焦領域のみを抽出して1枚の画像に合成し、撮像領域全体に合焦している合成画像を生成する、所謂、深度合成の技術が開示されている。そこで、特許文献1では、それぞれの画像の同じ位置にある領域の中で、コントラスト値の最も高い領域を合焦領域とする。   When imaging a plurality of subjects whose distances from an imaging device such as a digital camera are largely different from each other, or when imaging a subject long in the depth direction, the focus is limited to only a part of the subjects because the depth of field is insufficient. May not fit. In order to solve this, according to Patent Document 1, a plurality of images having different focus positions are taken, only the in-focus area is extracted from each image, synthesized into one image, and the entire imaging area is focused. A technique of so-called depth composition, which generates a composite image, is disclosed. So, in patent document 1, let the area | region where the contrast value is the highest be a focusing area | region in the area | region in the same position of each image.

特開2015−216532号公報JP, 2015-216532, A

しかし、上述したような深度合成の方法を用いると、合成画像のエッジ部においてぼけ領域が出る場合がある。   However, when the above-described method of depth composition is used, a blurred region may appear at the edge 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 describing an example of performing imaging for depth combination. In the case shown in FIG. 10, the imaging device captures five images 1010 to 1050 while changing the focus position of an X-type object in front of a white background, and combines the captured images And a composite image 1000 is generated. In the images 1010 to 1050, the pixels 1011 to 1051 are at the same position, and the pixels 1012 to 1052 are at the same position. When a composite image is created using the technology disclosed in Patent Document 1, the one with the highest contrast value is selected from the pixels 1011 to 1051 and used at the same position of the composite image. Therefore, the imaging device is illustrated to use the pixel 1031 for the composite image 1000. However, if the imaging apparatus selects the highest contrast value among the pixels 1012 to 1052 in the same manner and uses it in the same position of the composite image, the pixel 1012 or 1052 is selected and used for the composite image. As a result, as illustrated, in the composite image 1000, blurring occurs around the edge portion. This is not limited to the imaging device, and is a common problem to all image processing devices having a function of acquiring a plurality of images captured with different focus positions and combining the plurality of images.

本発明は、上記の課題を鑑みてなされたものであり、ピント位置の異なる複数の画像を用いて合成した画像に含まれるぼけを低減することができる画像処理装置を提供することを目的とする。   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 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 acquisition means for acquiring contrast values from each of a plurality of regions of an image, for a plurality of images of which at least a part of the angle of view overlaps and which have different focus positions. And combining means for setting a combining ratio corresponding to the contrast value acquired by the acquisition means for each region, and combining the plurality of images based on the set combining ratio to generate a combined image. And the combining means is configured to adjust the change amount of the contrast value of the first region among the plurality of regions to be equal to or less than a predetermined first threshold value, and to set the contrast value in the vicinity of the first region. When there is a second region in which the amount of change of the second region is larger than a second threshold value, the combining ratio of the first region is set based on the contrast value of the second region. The To provide an image processing apparatus.

本発明の構成によれば、ピント位置の異なる複数の画像を撮像して合成した画像に含まれるぼけを低減することができる画像処理装置を提供することができる。   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 combining a plurality of images having different focus positions.

本発明の実施形態に係るデジタルカメラの構造を示すブロック図である。It is a block diagram showing the structure of the digital camera concerning the embodiment of the present invention. 本発明の実施形態における合成画像の生成について説明するためのフローチャートである。It is a flowchart for demonstrating the production | generation of the synthesized image in embodiment of this invention. 本発明の実施形態における撮像について説明するためのフローチャートである。It is a flowchart for demonstrating the imaging in embodiment of this invention. 本発明の実施形態における位置合わせについて説明するためのフローチャートである。It is a flowchart for demonstrating the alignment in embodiment of this invention. 本発明の実施形態における画像の合成について説明するためのフローチャートである。It is a flow chart for explaining composition of a picture in an embodiment of the present invention. 第1の実施形態における合成マップの補正について説明するためのフローチャートである。It is a flowchart for demonstrating correction | amendment of the synthetic | combination map in 1st Embodiment. 本発明の実施形態におけるコントラスト値の変化量を説明するための図である。It is a figure for demonstrating the variation | change_quantity of the contrast value in embodiment of this invention. 本発明の実施形態における点広がり関数を説明するための図である。It is a figure for demonstrating the point spread function in embodiment of this invention. 第2の実施形態における合成マップの補正について説明するためのフローチャートである。It is a flowchart for demonstrating correction | amendment of the synthetic | combination map in 2nd Embodiment. 深度合成のための撮像を行う一例を説明するための図である。It is a figure for demonstrating an example which performs imaging for depth composition.

以下では、添付の図面を参照しながら、本発明の好適な実施形態について詳細に説明する。   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 the structure of a digital camera as an image processing apparatus according to the present embodiment. The digital camera 100 can capture a still image, can record information on the in-focus position, and can calculate contrast values and combine images. Furthermore, the digital camera 100 can perform enlargement processing or reduction processing on an image captured and stored or an image input from the outside.

制御部101は、例えばCPUやMPUなどのシグナルプロセッサであり、予め後述するROM105に内蔵されたプログラムを読み出しながら、デジタルカメラ100の各部分を制御する。たとえば、後述するように、制御部101が、後述する撮像部104に対して撮像の開始と終了について指令を出す。または、後述する画像処理部107に対して、ROM105に内蔵されたプログラムに基づいて、画像処理の指令を出す。ユーザによる指令は、後述する操作部110によってデジタルカメラ100に入力され、制御部101を通して、デジタルカメラ100の各部分に達する。   The control unit 101 is, for example, a signal processor such as a CPU or an MPU, and controls each part of the digital camera 100 while reading a program stored in advance in the ROM 105 described later. For example, as described later, the control unit 101 instructs the imaging unit 104 described later about start and end of imaging. Alternatively, an instruction for image processing is issued to an image processing unit 107 described later based on a program built in the ROM 105. The command from the user is input to the digital camera 100 by the operation unit 110 described later, and reaches each part of the digital camera 100 through the control unit 101.

駆動部102は、モーターなどによって構成され、制御部101の指令の下で、後述する光学系103を機械的に動作させる。たとえば、制御部101の指令に基づいて、駆動部102が光学系103に含まれるフォーカスレンズの位置を移動させ、光学系103の焦点距離を調整する。   The driving unit 102 is configured by a motor or the like, and mechanically operates an optical system 103 described later under the command of the control unit 101. For example, based on a command from the control unit 101, the drive unit 102 moves the position of the focus lens included in the optical system 103 to adjust the focal length of the optical system 103.

光学系103は、ズームレンズ、フォーカスレンズ、および絞りなどにより構成される。絞りは、透過する光量を調整する機構である。レンズの位置を変えることによって、合焦位置を変えることができる。   The optical system 103 is configured by a zoom lens, a focus lens, an aperture, and the like. The aperture is a mechanism for adjusting the amount of light to be transmitted. By changing the position of the lens, the in-focus position can be changed.

撮像部104は、光電変換素子であり、入射された光信号を電気信号に変換する光電変換を行うものである。たとえば、撮像部104に、CCDセンサやCMOSセンサなどを適用することができる。撮像部104は、動画撮像モードを設け、時間的に連続する複数の画像を動画の各々のフレームとして、撮像することができる。   The imaging unit 104 is a photoelectric conversion element, and performs photoelectric conversion to convert an incident light signal into an electric signal. For example, a CCD sensor or a CMOS sensor can be applied to the imaging unit 104. The imaging unit 104 can provide a moving image capturing mode, and can capture a plurality of temporally continuous images as each frame of the moving image.

ROM105は、記録媒体としての読み出し専用の不揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶している。RAM106は、書き換え可能な揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。   The ROM 105 is a read-only nonvolatile memory as a recording medium, and stores parameters necessary for the operation of each block in addition to the operation program of each block included in the digital camera 100. The RAM 106 is a rewritable volatile memory, and is used as a temporary storage area of data output in the operation of each block included in the digital camera 100.

画像処理部107は、撮像部104から出力された画像、あるいは後述する内蔵メモリ109に記録されている画像信号のデータに対して、ホワイトバランス調整、色補間、フィルタリングなど、様々な画像処理を行う。また、撮像部104が撮像した画像信号のデータに対して、JPEGなどの規格で、圧縮処理を行う。   An image processing unit 107 performs various image processing such as white balance adjustment, color interpolation, and filtering on an image output from the imaging unit 104 or data of an image signal recorded in an internal memory 109 described later. . Also, compression processing is performed on data of an image signal captured by the imaging unit 104 according to a standard such as JPEG.

画像処理部107は、特定の処理を行う回路を集めた集積回路(ASIC)で構成される。あるいは、制御部101がROM105から読み出したプログラムに従って処理することで、制御部101が画像処理部107の機能の一部または全部を兼用するようにしてもよい。制御部101が画像処理部107の全ての機能を兼用する場合には、画像処理部107をハードウェアとして有する必要はなくなる。   The image processing unit 107 is configured by an integrated circuit (ASIC) in which circuits performing specific processing are collected. Alternatively, the control unit 101 may share some or all of the functions of the image processing unit 107 by processing according to a program read out from the ROM 105 by the control unit 101. When the control unit 101 shares all functions of the image processing unit 107, it is not necessary to have the image processing unit 107 as hardware.

表示部108は、RAM106に一時保存されている画像、または、後述する内蔵メモリ109に保存されている画像、あるいは、デジタルカメラ100の設定画面などを表示するための液晶ディスプレイや有機ELディスプレイなどである。   The display unit 108 is a liquid crystal display, an organic EL display, or the like for displaying an image temporarily stored in the RAM 106, an image stored in an internal memory 109 described later, or a setting screen of the digital camera 100. is there.

内蔵メモリ109は、撮像部104が撮像した画像や画像処理部107の処理を得た画像、および、画像撮像時の合焦位置の情報などを記録する場所である。内蔵メモリの代わりに、メモリカードなどを用いてもよい。   The built-in memory 109 is a place for recording an image captured by the imaging unit 104, an image obtained by the processing of the image processing unit 107, and information of a focusing position at the time of capturing an image. A memory card or the like may be used instead of the built-in memory.

操作部110は、たとえば、デジタルカメラ100につけるボタンやスイッチ、キー、モードダイアルなど、あるいは、表示部108に兼用されるタッチパネルなどである。ユーザによる指令は、操作部110を経由して、制御部101に達する。   The operation unit 110 is, for example, a button, a switch, a key, a mode dial or the like attached to the digital camera 100, or a touch panel shared with the display unit 108 or the like. The instruction by the user reaches the control unit 101 via the operation unit 110.

図2は、本実施形態における合成画像の生成について説明するためのフローチャートである。ステップS201では、撮像部104は、ピント位置の異なる複数の画像を撮像する。ステップS202では、制御部101は、ステップS201で撮像部104が撮像した複数の画像に対して位置合わせを行う。ステップS203で、画像処理部107は、位置合わせを行った後の画像に対して合成を行い、合成画像を生成する。以下では、それぞれのステップについて詳細に説明する。   FIG. 2 is a flowchart for explaining generation of a composite image in the present embodiment. In step S201, the imaging unit 104 captures a plurality of images having different focus positions. In step S202, the control unit 101 aligns the plurality of images captured by the imaging unit 104 in step S201. In step S203, the image processing unit 107 performs composition on the image after alignment, and generates a composite image. Each step will be described in detail below.

図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 control unit 101 sets a focus position. For example, the user designates the in-focus position through the touch panel shared by the display unit 108, and designates a plurality of focus positions at equal intervals before and after the optical axis direction of the in-focus position corresponding to the in-focus position. At the same time, the control unit 101 determines the imaging order in order of distance at the set focus position.

ステップS302で、撮像部104は、ステップS301で設定したピント位置のうち、未撮像のものの中で、撮像順番が最も先のピント位置において撮像する。   In step S302, the imaging unit 104 captures an image at the first focus position in the imaging order among the unfocused positions among the focus positions set in step S301.

ステップS303で、制御部101は、ステップS301で設定したすべてのピント位置において撮像を行ったかどうかについて判断する。すべてのピント位置に撮像した場合は、このフローチャートでの処理を終了し、まだ撮像していないピント位置があれば、ステップS302に戻る。   In step S303, the control unit 101 determines whether imaging has been performed at all of the focus positions set in step S301. If imaging is performed at all focus positions, the processing in this flowchart is ended, and if there is a focus position that has not been imaged yet, the process returns to step S302.

図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 control unit 101 acquires a reference image of alignment from among the images captured by the imaging unit 104 in step S201. The reference image for alignment is assumed to be the earliest in the imaging order. Alternatively, by capturing an image while changing the focus position, the angle of view changes slightly between the captured images, so the angle of view may be the narrowest among the captured images.

ステップS402では、制御部101は、位置合わせの処理の対象画像を取得する。対象画像は、ステップS401で取得した基準画像以外の画像で、位置合わせの処理が済んでいないものとする。制御部101は、撮像順番が最も早いものを基準画像とするならば、撮像した順番で順次に対象画像を取得すればよい。   In step S402, the control unit 101 acquires a target image of alignment processing. The target image is an image other than the reference image acquired in step S401, and it is assumed that the alignment processing has not been completed. The control unit 101 may obtain the target images sequentially in the order in which the images were taken, if the reference image is the one with the earliest imaging order.

ステップ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 control unit 101 calculates the amount of positional deviation between the reference image and the target image. An example of the calculation method is described below. First, the control unit 101 sets a plurality of blocks in the reference image. Preferably, the control unit 101 sets each block so as to have the same size. Next, the control unit 101 sets a search range that is wider than the block of the reference image at the same position as each block of the reference image in the target image. Finally, the control unit 101 calculates, in each search range of the target image, a corresponding point at which the sum of absolute differences of luminance with the block of the reference image (Sum of Absolute Difference, hereinafter referred to as SAD) is minimum. . The control unit 101 calculates the displacement of the position in step S403 as a vector from the center of the block of the reference image and the corresponding point described above. The control unit 101 uses sum of squared difference (hereinafter referred to as SSD), normalized cross correlation (hereinafter referred to as NCC), etc. in addition to SAD in the calculation of corresponding points described above. May be

ステップS404で、制御部101で、基準画像と対象画像との位置のずれ量から変換係数を算出する。制御部101は、変換係数として、例えば射影変換係数を用いる。ただし、変換係数として射影変換係数だけに限定するわけではなく、アフィン変換係数や水平垂直シフトのみの簡略化した変換係数を用いてもよい。   In step S404, the control unit 101 calculates a conversion coefficient from the amount of positional deviation between the reference image and the target image. The control unit 101 uses, for example, a projective transformation coefficient as a transformation coefficient. However, the conversion coefficients are not limited to only projection conversion coefficients, and affine conversion coefficients or simplified conversion coefficients of only horizontal and vertical shifts may be used.

ステップS405で、画像処理部107は、ステップS404で算出した変換係数を用いて対象画像に対して変換を行う。   In step S405, the image processing unit 107 converts the target image using the conversion coefficient calculated in step S404.

たとえば、制御部101は、(式1)に示した式を用いて変形を行うことができる。   For example, the control unit 101 can perform the transformation using the equation shown in (Equation 1).

(式1)では、(x´、y´)は変形を行った後の座標を示し、(x、y)は変形を行う前の座標を示す。行列AはステップS404で制御部101が算出した変形係数を示す。   In (Expression 1), (x ', y') indicate coordinates after deformation, and (x, y) indicate coordinates before deformation. The matrix A indicates the deformation coefficients calculated by the control unit 101 in step S404.

ステップS406で、制御部101は、基準画像以外のすべての画像に対して位置合わせを行ったかどうかについて判断する。基準画像以外のすべての画像に対して位置合わせを行った場合は、このフローチャートでの処理を終了し、まだ処理していない画像があれば、ステップS402に戻る。   In step S406, the control unit 101 determines whether alignment has been performed on all images other than the reference image. If alignment is performed on all the images other than the reference image, the processing in this flowchart is ended, and if there is an image that has not been processed yet, the processing returns to step S402.

図5は、本実施形態におけるステップS203での画像の合成について説明するためのフローチャートである。   FIG. 5 is a flowchart for explaining the composition of the image 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 image processing unit 107 calculates contrast values for each image (including a reference image) after alignment. As an example of the method of calculating the contrast value, for example, the image processing unit 107 first calculates the luminance Y from the color signals Sr, Sg, Sb of the respective pixels using the following (Expression 2).
Y = 0.299 Sr + 0.587 Sg + 0.114 Sb (Equation 2)

次に、3×3の画素の輝度Yの行列Lに、下記の(式3)乃至(式5)に示したように、ソーベルフィルタを用いてコントラスト値Iを算出する。   Next, a contrast value I is calculated using a Sobel filter, as shown in the following (Expression 3) to (Expression 5), in the matrix L of luminance Y of 3 × 3 pixels.

また、上述のコントラスト値の計算方法は一例にすぎず、たとえば、使用するフィルタをラプラシアンフィルタ等のエッジ検出フィルタや所定の帯域を通過するバンドパスフィルタを用いることも可能である。   Further, the method of calculating the contrast value described above is merely an example, and it is also possible to use, for example, an edge detection filter such as a Laplacian filter or a band pass filter which passes a predetermined band.

ステップS502で、画像処理部107は、合成マップを生成する。合成マップの生成方法としては、画像処理部107は、それぞれの画像の同じ位置にある画素のコントラスト値を比較し、コントラスト値の最も高い画素の合成比率を100%とし、同じ位置にあるほかの画素の合成比率を0%とする。画像処理部107は、こうした合成比率の設定を、画像のすべての位置に対して行う。   In step S502, the image processing unit 107 generates a composite map. As a method of generating a composite map, the image processing unit 107 compares the contrast values of the pixels at the same position in each image, and sets the composite ratio of the pixel with the highest contrast value to 100%. The composition ratio of the pixels is 0%. The image processing unit 107 performs such setting of the composition ratio for all positions of the image.

ステップS503で、制御部101は、ステップS502で画像処理部107が生成した合成マップに対して補正を行う。具体的な補正方法は後述する。   In step S503, the control unit 101 corrects the composite map generated by the image processing unit 107 in step S502. The specific correction method will be described later.

ステップS504では、画像処理部107は、ステップS503で制御部101が補正した合成マップに従い画素の置き換えを行い、合成画像を生成する。なお、このようにして算出した合成比率に対して、隣接画素間で合成比率が0%から100%に変化(あるいは100%から0%に変化)すると、合成境界での不自然さが目立つようになる。そのため、合成マップに対して所定の画素数(タップ数)を持つフィルタをかけ、隣接画素間で合成比率が急激に変化しないようにする。   In step S504, the image processing unit 107 performs pixel replacement in accordance with the composite map corrected by the control unit 101 in step S503, and generates a composite image. In addition, when the composition ratio changes from 0% to 100% between adjacent pixels (or changes from 100% to 0%) with respect to the composition ratio calculated in this manner, unnaturalness at the composition boundary is noticeable become. Therefore, a filter having a predetermined number of pixels (the number of taps) is applied to the synthesis map so that the synthesis ratio does not change rapidly between adjacent pixels.

以下では、ステップS503での合成マップの補正について詳細に説明する。   Hereinafter, the correction of the combined map in step S503 will be described in detail.

図6は、本実施形態におけるステップS503での合成マップの補正について説明するためのフローチャートである。ステップS601で、制御部101は、未処理の画素から着目画素を選定する。   FIG. 6 is a flowchart for explaining the correction of the combined map in step S503 in the present embodiment. In step S601, the control unit 101 selects a target pixel from unprocessed pixels.

次に、ステップS602で、制御部101は、着目画素のコントラスト値の変化量を算出する。ここでいうコントラスト値の変化量を、位置合わせを行った後のそれぞれの画像(基準画像を含む)において、着目画素と同じ位置にある画素のうち、コントラスト値の最大値と最小値との差を指す。   Next, in step S602, the control unit 101 calculates the amount of change in the contrast value of the pixel of interest. In each image (including the reference image) after alignment, the amount of change in the contrast value mentioned here is the difference between the maximum value and the minimum value of the contrast value among the pixels at the same position as the pixel of interest. Point to

ステップS603で、制御部101は、ステップS602で算出したコントラスト値の変化量を予め定められた閾値と比較し、閾値以下であれば、ステップS604に進み、着目画素の合成比率の変更を行う。一方、閾値以下でなければ、ステップS605に進む。ここでは、制御部101は、コントラスト値の変化量が閾値以下の画素は、図10の画素1001のように、被写体のエッジボケである可能性が高いと判断した。   In step S603, the control unit 101 compares the change amount of the contrast value calculated in step S602 with a predetermined threshold value. If the amount is less than the threshold value, the process advances to step S604 to change the composition ratio of the pixel of interest. On the other hand, if it is not the threshold or less, the process proceeds to step S605. Here, the control unit 101 determines that the pixel whose change amount of the contrast value is equal to or less than the threshold is highly likely to be the edge blur of the subject as the pixel 1001 in FIG.

ステップS604で、制御部101は、着目画素の合成比率を変更する。ここで、制御部101は、着目画素の合成比率を、その近傍の、コントラスト値の変化量が閾値よりも大きい画素を参照して変更する。たとえば、制御部101は、着目画素の合成比率を、その近傍のコントラスト値の変化量が閾値よりも大きい画素のうち、最も大きいものの合成比率にする。または、その近傍のコントラスト値の変化量が閾値よりも大きい画素のうち、最も近いものの合成比率にする。このステップS604における閾値は、ステップS603で比較に用いた閾値と同じ値としてもよいし、ステップS603で比較に用いた閾値よりも大きな値としてもよい。近傍にコントラスト値の変化量が閾値より大きくなる画素が存在しなければ、その画素の近傍にはエッジが無く、その画素がエッジボケである可能性は低いとして、合成比率の補正は行わない。なお、ここでいう「近傍」の範囲については、後述する。図8は、本実施形態におけるコントラスト値の変化量を説明するためのである。図7(a)では、複数の画像の同じ位置にある画素711乃至715のコントラスト値と画像撮像時のピント位置との関係を示している。画素713がある画像を撮像したときのコントラスト値が最大であり、このピント位置においてこの画素はピントが合っていると判断し、このピント位置をベストピントとも呼ぶ。ここで、コントラスト値の最も大きい画素513のコントラスト値と、コントラスト値の最も小さい画素715のコントラスト値の差、つまり前述したコントラスト値の変化量を算出し、前述した閾値より大きいと仮定する。   In step S604, the control unit 101 changes the composition ratio of the pixel of interest. Here, the control unit 101 changes the composition ratio of the target pixel with reference to a pixel in the vicinity thereof where the change amount of the contrast value is larger than the threshold. For example, the control unit 101 sets the synthesis ratio of the pixel of interest as the synthesis ratio of the largest one of the pixels in which the change amount of the contrast value in the vicinity thereof is larger than the threshold. Alternatively, the composite ratio of the closest pixels among the pixels whose variation of the contrast value in the vicinity is larger than the threshold is set. The threshold value in this step S604 may be the same value as the threshold value used in the comparison in step S603, or may be a larger value than the threshold value used in the comparison in step S603. If there is no pixel in the vicinity where the change amount of the contrast value is larger than the threshold, there is no edge in the vicinity of the pixel and the pixel is unlikely to be edge blurred, so the correction of the composition ratio is not performed. In addition, the range of the "nearby" said here is mentioned later. FIG. 8 is for explaining the change amount of the contrast value in the present embodiment. FIG. 7A shows the relationship between the contrast values of the pixels 711 to 715 located at the same position of a plurality of images and the focus position at the time of image capturing. The image has a maximum contrast value when the pixel 713 captures an image, and it is determined that this pixel is in focus at this in-focus position, and this in-focus position is also referred to as the best focus. Here, the difference between the contrast value of the pixel 513 having the largest contrast value and the contrast value of the pixel 715 having the smallest contrast value, that is, the change amount of the contrast value described above is calculated, and it is assumed to be larger than the aforementioned threshold.

一方で、図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 of the pixels 721 to 725 located at the same position in the vicinity of each of the pixels 711 to 715 and the focus position. In FIG. 7B, although the contrast value of the pixel 725 is the highest, the difference between it and the contrast value of the pixel 723 having the lowest contrast value, that is, the variation of the contrast value is less than or equal to the threshold. If the amount of change in the contrast value is less than or equal to the threshold value, as described above, the control unit may locate this pixel at the position of the subject region with a small contrast value and may be affected by the blurring of the edge of the surrounding subject Change the composition ratio as there is a difference. As a method of changing, the control unit 101 determines the focus position to be the best focus of the pixel 711 in FIG. 7A as the best focus at the pixel 723 in FIG. 7B. Then, the control unit 101 sets the combining ratio of the pixel 723 at the in-focus position to 100%, and sets the combining ratio of pixels at the same position in other images including the pixel 725 to 0%. Such a change is similar to that of FIG. 10, when the image processing unit 107 creates the composite image 1000, the pixel 1031 is used for the composite image instead of the pixel 1051 of FIG. Become.

ステップS605で、制御部101は、すべての画素を処理したかどうかについて判断する。すべての画素を処理した場合このフローを終了し、まだ処理していない画素があれば、ステップS601に戻る。   In step S605, the control unit 101 determines whether all pixels have been processed. If all pixels have been processed, this flow is ended, and if there is any pixel not yet processed, the process returns to step S601.

なお、前述したように、上記処理は、図7(a)に示した画素は図7(b)に示した画素の近傍にあることを前提にしている。ここでいう「近傍」の判断は、点広がり関数(Point spread function、以下PSFをいう)を用いて行うことができる。   As described above, the above process is premised on the pixel shown in FIG. 7A being in the vicinity of the pixel shown in FIG. 7B. The determination of “nearby” as used herein 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 the PSF in the present embodiment. In FIG. 8, the horizontal axis indicates the coordinates of the pixel, and the vertical axis indicates the contrast value. Although the actual PSF has a two-dimensional spread, it is expressed in one dimension in FIG. 8 for the sake of simplicity. FIG. 8A shows PSF when a point image is formed at the best focus position using an ideal lens. In FIG. 8B, the image formed in the defocused state (state in which the position of the imaging surface moves away from the position of the best focus) in which the focus position is moved is as shown by a curve 820, and an image is spread (blurring is spread) The number N is as shown in the distance 821. In FIG. 8C, when the defocus amount further increases, the imaging becomes a curve 830, and the number N of pixels in which the image spreads becomes the distance 831.

デフォーカス量(ピント位置の変更量)はステップS301での設定から計算することができるので、PSFに応じて像がどれだけ広がるかを計算することが可能である。前述した着目画素の「近傍」を、この画素数Nに収めるように設定するとよい。つまり、制御部101は、着目画素のコントラスト値の変化量が閾値以下であれば、予め計算したPSFに基づいて設定した範囲において、コントラスト値の変化量が閾値より大きい画素があるかどうかを確かめる。着目画素の近傍にあれば、制御部101は、前述した合成比率の変更を行う。   Since the defocus amount (change amount of focus position) can be calculated from the setting in step S301, it is possible to calculate how much the image expands according to the PSF. The “nearby” of the noted pixel described above may be set to be within the number N of pixels. That is, if the change amount of the contrast value of the pixel of interest is equal to or less than the threshold value, the control unit 101 confirms whether or not there is a pixel whose change amount of contrast value is larger than the threshold value in the range set based on PSF calculated in advance. . If it is in the vicinity of the pixel of interest, the control unit 101 changes the combination ratio described above.

なお、上述した近傍の決め方は一例にすぎず、様々な変更をすることができる。たとえば、PSFの広がりで得られた画素数Nで判断したうえで、さらに、被写体の距離情報を用いて判断する。つまり、図7(a)と図7(b)とに示した画素の被写体距離の差が所定量以下でないと、制御部101は、その2つの画素は「近傍」にあると判断しない。距離情報は公知の技術で算出することが可能で、一例として1つの画素に複数の光電変換部を有する撮像素子が取得するステレオ画像から算出することができる。   In addition, how to determine the vicinity mentioned above is only an example, and can be variously changed. For example, after judging by the number N of pixels obtained by the spread of PSF, the judgment is further performed using distance information of the subject. That is, the control unit 101 does not determine that the two pixels are “nearby” unless the difference between the subject distances of the pixels shown in FIGS. 7A and 7B is equal to or less than a predetermined amount. The distance information can be calculated by a known technique, and can be calculated from a stereo image acquired by an imaging device having a plurality of photoelectric conversion units in one pixel as an example.

さらに、上記の「近傍」と判断された画素のうち、コントラスト値の変化の特性を考慮することも可能である。たとえば、図7(a)に示した画素はベストピントの位置でコントラスト値が最大で、ピント位置が変化するとコントラスト値が減少する特性を持っている。それに対して、エッジボケ画素は図7(a)のベストピントの位置でコントラスト値が最小で、ピント位置が変化するとコントラスト値が増加する特性をもつ可能性が高い。そのため、着目画素のコントラスト値の変化特性と逆のコントラスト値の変化特性をもつ画素のみ用いて、着目画素の合成比率の補正を行うようにするようにしても良い。   Furthermore, 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 the characteristic that the contrast value is maximum at the position of best focus and the contrast value decreases when the focus position changes. On the other hand, the edge blurred pixel has a minimum contrast value at the position of the best focus in FIG. 7A, and it is highly likely that the contrast value increases when the focus position changes. Therefore, the composition ratio of the pixel of interest may be corrected using only pixels having a characteristic of change in contrast value that is opposite to the characteristic of change in contrast value of the pixel of interest.

第1の実施形態によれば、画素のコントラスト値の変化量を計算し、閾値以下の画素の合成比率を変更することによって、エッジボケを低減することができる。   According to the first embodiment, it is possible to reduce the edge blurring by calculating the amount of change in the contrast value of the pixel and changing the composition ratio of the pixels below the threshold.

(第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 less than or equal to the threshold, the composition ratio of the pixel of interest is changed. However, 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 differences from the first embodiment. The same parts as those in the first embodiment are omitted.

図9は、本実施形態におけるステップS503での合成マップの補正について説明するためのフローチャートである。ステップS901で、制御部101は、未処理の画素から着目画素を選定する。   FIG. 9 is a flowchart for explaining the correction of the combined map in step S503 in the present embodiment. In step S901, the control unit 101 selects a pixel of interest from unprocessed pixels.

ステップS902で、制御部101は、着目画素のコントラスト値の変化量を算出する。算出の方法は第1の実施形態のステップS602と同様である。   In step S902, the control unit 101 calculates the amount of change in the contrast value of the pixel of interest. The method of calculation is the same as step S602 in the first embodiment.

ステップS903で、制御部101は、ステップS902で算出したコントラスト値の変化量が予め定められた閾値以上であれば、ステップS904に進み、閾値より小さければ、ステップS905に進む。ここでいう「閾値」は、第1の実施形態の合成マップの補正についての説明での「閾値」と異なるものである。   In step S903, the control unit 101 proceeds to step S904 if the change amount of the contrast value calculated in step S902 is equal to or larger than a predetermined threshold, and proceeds to step S905 if smaller than the threshold. The “threshold value” here is different from the “threshold value” in the description of the correction of the composite map of the first embodiment.

ステップS904で、制御部101は、着目画素の合成比率を参照し、近傍画素の合成比率を変更する。たとえば、制御部101は、着目画素の近傍の画素のうちコントラスト値の変化量が閾値以下である画素の合成比率を、着目画素と同じ合成比率にする。ここで、その近傍の画素に対して、着目画素よりも近い位置に、コントラスト値の変化量が予め定められた閾値以上となる他の画素が存在するならば、その画素に基づく合成比率を優先するようにしてもよい。また、着目画素の近傍に、コントラスト値の変化量が閾値以下の画素となる画素が無い場合には、この近傍の範囲において合成比率の変更は行わない。ここでいう「近傍」の判断方法は、第1の実施形態のステップS604で説明した方法と同様でよい。   In step S904, the control unit 101 changes the combining ratio of neighboring pixels with reference to the combining ratio of the pixel of interest. For example, the control unit 101 sets the composition ratio of pixels in which the variation of the contrast value is equal to or less than the threshold among the pixels in the vicinity of the pixel of interest to the same composition ratio as the pixel of interest. Here, if there is another pixel whose amount of change in contrast value is equal to or greater than a predetermined threshold at a position closer to the pixel in the vicinity than the pixel of interest, the composition ratio based on that pixel is prioritized. You may do it. In addition, when there is no pixel in the vicinity of the pixel of interest that is a pixel whose change amount of the contrast value is less than or equal to the threshold, the combination ratio is not changed in the vicinity of this pixel. The determination method of “nearby” here may be the same as the method described in step S604 of the first embodiment.

ステップS905で、制御部101は、すべての画素を処理したかどうかについて判断する。すべての画素を処理した場合このフローを終了し、まだ処理していない画素があれば、ステップS901に戻る。   In step S905, the control unit 101 determines whether all the pixels have been processed. If all pixels have been processed, this flow ends, and if there are any pixels not yet processed, the process returns to step S901.

ステップS903では、着目画素のコントラスト値が閾値以上である場合、ピント位置を変更することでエッジボケが広がる可能性が高く、近傍画素において単純にコントラスト値の最大値で合成比率を決定するとエッジボケした画像を出力する可能性がある。そのため、閾値以上のコントラスト値をもつ画素を検出した場合は、近傍にエッジボケの影響を受けやすいコントラスト値の変化量が小さな画素があれば、その画素の合成比率を着目画素と同じ合成比率に変更するようにする。   In step S903, when the contrast value of the pixel of interest is equal to or greater than the threshold, changing the focus position is highly likely to cause edge blurring to spread, and if the composition ratio is simply determined based on the maximum contrast value in neighboring pixels, the edge blurred image There is a possibility to output Therefore, when a pixel having a contrast value equal to or higher than the threshold is detected, if there is a pixel in the vicinity of which the variation of the contrast value susceptible to edge blurring is small, the composition ratio of that pixel is changed to the same composition ratio as the target pixel. To do.

第2の実施形態によれば、画素のコントラスト値の変化量を計算し、閾値以上の画素の近傍画素の合成比率を変更することによって、エッジボケを低減することができる。   According to the second embodiment, the edge blurring can be reduced by calculating the amount of change in the contrast value of the pixel and changing the composition ratio of the neighboring pixels of the pixel equal to or more than the threshold.

(その他の実施形態)
以上の実施形態は、デジタルカメラでの実施をもとに説明したが、デジタルカメラに限定するものではない。たとえば、撮像素子が内蔵した携帯機器などで実施してもよく、画像を撮像することができるネットワークカメラなどでもよい。
(Other embodiments)
The above embodiments have been described based on the implementation in a digital camera, but the present invention is not limited to the digital camera. For example, the present invention may be performed by a portable device or the like in which the imaging element is built in, or may be a network camera or the like capable of capturing an image.

なお、本発明は、上述の実施形態の1つ以上の機能を実現するプログラムを、ネットワークまたは記憶媒体を介してシステムまたは装置に供給し、そのシステムまたは装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読み出し作動させる処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus execute the program. Can be realized by processing for reading out and operating. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

100 デジタルカメラ
101 制御部
102 駆動部
103 光学系
104 撮像部
105 ROM
106 RAM
107 画像処理部
108 表示部
109 内蔵メモリ
110 操作部
100 digital camera 101 control unit 102 drive unit 103 optical system 104 imaging unit 105 ROM
106 RAM
107 image processing unit 108 display unit 109 built-in memory 110 operation unit

Claims (14)

画像の複数の領域のそれぞれからコントラスト値を取得する取得手段と、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、
前記合成手段は、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記コントラスト値に基づいて設定することを特徴とする画像処理装置。
Acquisition means for acquiring a contrast value from each of a plurality of areas of the image;
A combination ratio according to the contrast value acquired by the acquisition unit is set for each region with respect to a plurality of images having different at least part of the angle of view and different focus positions, and based on the set combination ratio And combining means for combining the plurality of images to generate a combined image;
The combining means is configured such that a change amount of the contrast value of a first area of the plurality of areas is equal to or less than a predetermined first threshold value, and the contrast value of the contrast value in the vicinity of the first area is When there is a second area in which the amount of change is larger than a second threshold, the combining ratio of the first area is set based on the contrast value of the second area. Image processing device.
前記合成手段は、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい領域が存在しない場合は、前記第1の領域の前記合成比率を、前記第1の領域の前記コントラスト値に基づいて設定することを特徴とする請求項1に記載の画像処理装置。   The combining means is configured such that a change amount of the contrast value of a first area of the plurality of areas is equal to or less than a predetermined first threshold value, and the contrast value of the contrast value in the vicinity of the first area is When there is no area where the amount of change is larger than a second threshold, the combining ratio of the first area is set based on the contrast value of the first area. The image processing apparatus according to claim 1. 前記合成手段は、前記複数の領域のうちの第3の領域の前記コントラスト値の変化量が前記第1の閾値より大きい場合は、前記第3の領域の前記合成比率を、前記第3の領域の前記コントラスト値に基づいて設定することを特徴とする請求項1または2に記載の画像処理装置。   The combining means is configured to set the combining ratio of the third region to the third region when the amount of change in the contrast value of the third region of the plurality of regions is larger than the first threshold. The image processing apparatus according to claim 1, wherein the image processing apparatus is set based on the contrast value of 前記第2の閾値は、前記第1の閾値と同じ値か、前記第1の閾値より大きい値であることを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 3, wherein the second threshold is the same value as the first threshold or a value larger than the first threshold. 前記領域は1つの画素からなる領域であることを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 4, wherein the area is an area consisting of one pixel. 前記領域の前記コントラスト値の変化量は、前記領域に対応する前記複数の画像の領域のコントラスト値の最大値と最小値との差であることを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。   The variation amount of the contrast value of the area is a difference between the maximum value and the minimum value of the contrast values of the areas of the plurality of images corresponding to the area. An image processing apparatus according to claim 1. 前記領域に対応する前記複数の画像の領域は、それぞれの前記画像において同じ位置にある領域であることを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 6, wherein areas of the plurality of images corresponding to the areas are areas located at the same position in each of the images. 前記合成手段は、点広がり関数を用いて前記近傍の範囲を定めることを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 7, wherein the combining unit determines the range of the vicinity using a point spread function. 前記合成手段は、被写体の距離情報を用いて前記近傍の範囲を定めることを特徴とする請求項1乃至8のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 8, wherein the combining unit determines the range of the vicinity using distance information of a subject. 前記合成手段は、前記コントラスト値の変化特性を用いて前記近傍の範囲を定めることを特徴とする請求項1乃至9のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 9, wherein the combining unit determines the range of the vicinity using a change characteristic of the contrast value. 前記ピント位置は、光軸方向で等間隔に設定されることを特徴とする請求項1乃至10のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 10, wherein the focus positions are set at equal intervals in the optical axis direction. 画像を撮像する撮像手段を有し、
前記画像の複数の領域のそれぞれからコントラスト値を取得する取得手段と、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記取得手段が取得した前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成手段と、を有し、
前記合成手段は、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記コントラスト値に基づいて設定することを特徴とする画像処理装置。
Having an imaging means for capturing an image;
Acquisition means for acquiring contrast values from each of a plurality of regions of the image;
A combination ratio according to the contrast value acquired by the acquisition unit is set for each region with respect to a plurality of images having different at least part of the angle of view and different focus positions, and based on the set combination ratio And combining means for combining the plurality of images to generate a combined image;
The combining means is configured such that a change amount of the contrast value of a first area of the plurality of areas is equal to or less than a predetermined first threshold value, and the contrast value of the contrast value in the vicinity of the first area is When there is a second area in which the amount of change is larger than a second threshold, the combining ratio of the first area is set based on the contrast value of the second area. Image processing device.
画像の複数の領域のそれぞれからコントラスト値を取得する取得ステップと、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成ステップと、を有し、
前記合成ステップにおいては、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記コントラスト値に基づいて設定することを特徴とする画像処理装置の制御方法。
Obtaining a contrast value from each of a plurality of regions of the image;
For a plurality of images having different at least part of the angle of view and different focus positions, a composition ratio corresponding to the contrast value is set for each area, and the plurality of images are set based on the set composition ratio. Compositing to generate a composite image;
In the combining step, the amount of change in the contrast value of the first region of the plurality of regions is equal to or less than a predetermined first threshold value, and the contrast value is in the vicinity of the first region When there is a second region in which the amount of change of the second region is larger than a second threshold value, the combining ratio of the first region is set based on the contrast value of the second region. Control method of the image processing apparatus.
画像処理装置のコンピュータに動作させるコンピュータのプログラムであって、
画像の複数の領域のそれぞれからコントラスト値を取得する取得ステップと、
少なくとも一部の画角が重なり、かつ、ピント位置の異なる複数の画像に対して、領域ごとに前記コントラスト値に応じた合成比率を設定し、設定した前記合成比率に基づいて前記複数の画像の合成を行って合成画像を生成する合成ステップと、を行わせ、
前記合成ステップにおいては、前記複数の領域のうちの第1の領域の前記コントラスト値の変化量が予め定められた第1の閾値以下であり、かつ、前記第1の領域の近傍に前記コントラスト値の変化量が第2の閾値よりも大きい第2の領域が存在する場合は、前記第1の領域の前記合成比率を、前記第2の領域の前記コントラスト値に基づいて設定することを特徴とする画像処理装置の制御方法。
A computer program that causes a computer of an image processing apparatus to operate,
Obtaining a contrast value from each of a plurality of regions of the image;
For a plurality of images having different at least part of the angle of view and different focus positions, a composition ratio corresponding to the contrast value is set for each area, and the plurality of images are set based on the set composition ratio. Performing combining to generate a combined image,
In the combining step, the amount of change in the contrast value of the first region of the plurality of regions is equal to or less than a predetermined first threshold value, and the contrast value is in the vicinity of the first region When there is a second region in which the amount of change of the second region is larger than a second threshold value, the combining ratio of the first region is set based on the contrast value of the second region. Control method of the image processing apparatus.
JP2017164421A 2017-08-29 2017-08-29 Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media Active JP6961423B2 (en)

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 true JP2019047145A (en) 2019-03-22
JP2019047145A5 JP2019047145A5 (en) 2020-08-06
JP6961423B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
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

Citations (2)

* Cited by examiner, † Cited by third party
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
WO2015020038A1 (en) * 2013-08-07 2015-02-12 シャープ株式会社 Imaging device

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
WO2015020038A1 (en) * 2013-08-07 2015-02-12 シャープ株式会社 Imaging device

Cited By (1)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
JP6961423B2 (en) 2021-11-05

Similar Documents

Publication Publication Date Title
US11470257B2 (en) Dual aperture zoom digital camera
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
JP6833498B2 (en) Imaging device, imaging method and computer program
JP2018107526A (en) Image processing device, imaging apparatus, image processing method and computer program
JPWO2012002071A1 (en) Imaging apparatus, image processing apparatus, and image processing method
JP6786311B2 (en) Image processing equipment, image processing methods, computer programs and storage media
JP6752685B2 (en) Imaging equipment, imaging methods and programs
US20130083169A1 (en) Image capturing apparatus, image processing apparatus, image processing method and program
JP5889022B2 (en) Imaging apparatus, image processing apparatus, image processing method, and program
JP6961423B2 (en) Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media
JP6728020B2 (en) Image processing apparatus, image processing method and program
JP2020160773A (en) Image processing device, imaging device, image processing method, and program
JP7214368B2 (en) Image processing device, imaging device, image processing method, program and recording medium
JP7409604B2 (en) Image processing device, imaging device, image processing method, program and recording medium
JP7458769B2 (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
JP7262940B2 (en) IMAGE PROCESSING DEVICE, IMAGING DEVICE, CONTROL METHOD AND PROGRAM FOR IMAGE PROCESSING DEVICE
JP6818734B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP6828069B2 (en) Imaging equipment, imaging methods and programs
JP2024002631A (en) Image processing device, imaging apparatus, image processing method, computer program, and recording medium
JP6833772B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP6827778B2 (en) Image processing equipment, image processing methods and programs
JP2024036872A (en) Imaging device, imaging method, program and recording medium
JP2018046372A (en) Imaging apparatus, system, and program

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