[go: up one dir, main page]

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

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP2018037857A
JP2018037857A JP2016169614A JP2016169614A JP2018037857A JP 2018037857 A JP2018037857 A JP 2018037857A JP 2016169614 A JP2016169614 A JP 2016169614A JP 2016169614 A JP2016169614 A JP 2016169614A JP 2018037857 A JP2018037857 A JP 2018037857A
Authority
JP
Japan
Prior art keywords
images
image
focus position
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.)
Granted
Application number
JP2016169614A
Other languages
Japanese (ja)
Other versions
JP6786311B2 (en
JP2018037857A5 (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 JP2016169614A priority Critical patent/JP6786311B2/en
Publication of JP2018037857A publication Critical patent/JP2018037857A/en
Publication of JP2018037857A5 publication Critical patent/JP2018037857A5/en
Priority to JP2020147126A priority patent/JP6953594B2/en
Application granted granted Critical
Publication of JP6786311B2 publication Critical patent/JP6786311B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Details Of Cameras Including Film Mechanisms (AREA)
  • Automatic Focus Adjustment (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

【課題】 合焦位置を変えながら、撮像した複数の画像を合成するとき、被写体のコントラスト値の分布より、被写体の前後位置関係が正しく反映できないことがある。【解決手段】 画像処理装置は、光学系の合焦位置を変えながら撮像した複数の画像の各々の領域に対して合成比率を設定し、該合成比率を用いて複数の画像の合成を行い、合成画像を生成する合成手段と、複数の画像の各々の領域に対して、コントラスト値を算出するコントラスト値の算出手段と、を有し、合成手段は、合成を行う際に複数の画像の位置が重なる領域ごとに複数の画像のコントラスト値を比較した結果と、複数の画像を撮像した際の合焦位置に基づいて、合成比率を設定することを特徴とする。【選択図】 図3PROBLEM TO BE SOLVED: When a plurality of captured images are synthesized while changing an in-focus position, the front-rear positional relationship of the subject may not be correctly reflected from the distribution of the contrast value of the subject. An image processing apparatus sets a composition ratio for each region of a plurality of images captured while changing an in-focus position of an optical system, performs composition of the plurality of images using the composition ratio, A synthesis unit that generates a composite image; and a contrast value calculation unit that calculates a contrast value for each region of the plurality of images. The composition ratio is set based on the result of comparing the contrast values of a plurality of images for each region where the images overlap and the in-focus position when the plurality of images are captured. [Selection] Figure 3

Description

本発明は、画像合成に用いる画像処理装置に関するものである。   The present invention relates to an image processing apparatus used for image composition.

近年、自分が気に入ったものを撮像し、ソーシャルメディアにアップロードする作業が高い頻度で行われている。例えば、身近にある小さなものを撮像する場合、撮像条件によっては、被写体深度が浅くなってしまうため、被写体全体に合焦させることが難しい場合がある。そのため、被写体の一部がボケた画像しか得られず、撮像者が満足する画像にならないケースがあった。あるいは、家族や仲間と写真を撮像しようとする場合に、全員が被写界深度内に入らなければ、全員に合焦させた状態の画像を得ることができなかった。そのため、全員に合焦させた画像を撮像しようとすると、必然的に人物の配置の自由度に制限が生じてしまっていた。   In recent years, there has been a high frequency of taking pictures of things that you like and uploading them to social media. For example, when imaging a small object that is close to the user, depending on the imaging conditions, the depth of the subject may become shallow, and it may be difficult to focus on the entire subject. For this reason, only a blurred image of a part of the subject can be obtained, and there are cases where the image is not satisfactory for the photographer. Alternatively, when taking a picture with a family member or a friend, if all the members do not fall within the depth of field, an image in a state where all the members are in focus cannot be obtained. For this reason, when trying to capture an image focused on everyone, the degree of freedom of arrangement of the person inevitably has been limited.

そこで、これらの課題を解決するため、合焦位置を変えながら撮像した複数の画像を合成し、被写体全体に合焦するような合成画像を生成する技術が、特許文献1に開示されている。特許文献1では、撮像された複数の画像の位置合わせを行い、複数の画像のそれぞれにおいて、合成を行う際に重なる位置に存在する画素の画素値を、それぞれの画素のコントラスト値に応じた合成比率を用いて合成を行う。コントラスト値が大きな画像に対して大きな合成比率を与えることで、合焦状態にある画像の比率が大きくなるように画像の合成が行われる。   Therefore, in order to solve these problems, Patent Document 1 discloses a technique for generating a composite image that combines a plurality of images captured while changing the focus position and focuses the entire subject. In Patent Document 1, a plurality of captured images are aligned, and in each of the plurality of images, pixel values of pixels existing at overlapping positions when combining are combined according to the contrast value of each pixel. Synthesis is performed using the ratio. By giving a large composition ratio to an image with a large contrast value, the images are combined so that the ratio of the image in focus is increased.

特開2014−17539号公報JP 2014-17539 A

しかしながら、特許文献1に記載の技術を用いて画像合成を行うと、以下のような課題が生じることがある。図8は、合焦位置の異なる複数の画像を合成する処理を説明するための図である。図8では、画像上の同じ位置に、カメラからの距離が異なる複数の被写体が存在しているものとする。図8(a)は撮像構図であり、被写体801が前方被写体、被写体802が後方被写体である。図8(b)は前方被写体801に合焦した際の撮像画像、図8(c)は後方被写体802に合焦した際の撮像画像、図8(d)は被写体801と被写体802とが重なる領域に注目した図である。図8(b)のように前方被写体801に合焦した場合、後方被写体802は前方被写体801に遮蔽されているが、図8(c)のように後方被写体802に合焦した場合、前方被写体801がぼけることで後方被写体802が透けて見えてしてしまうことがある。合焦状態である前方被写体801のコントラスト値よりも、合焦状態である後方被写体802のコントラスト値が高い場合、特許文献1に記載の方法で合成を行うと、図8(e)に示すように後方被写体が出力されてしまうことになる。そのため、手前にある被写体の一部分が欠落した合成画像が生成されてしまう。   However, when image synthesis is performed using the technique described in Patent Document 1, the following problems may occur. FIG. 8 is a diagram for explaining processing for combining a plurality of images with different in-focus positions. In FIG. 8, it is assumed that there are a plurality of subjects having different distances from the camera at the same position on the image. FIG. 8A shows an imaging composition, where the subject 801 is a front subject and the subject 802 is a rear subject. 8B is a captured image when the front subject 801 is focused, FIG. 8C is a captured image when the rear subject 802 is focused, and FIG. 8D is a view where the subject 801 and the subject 802 overlap. It is the figure which paid its attention to the area | region. When the front subject 801 is focused as shown in FIG. 8B, the rear subject 802 is shielded by the front subject 801. However, when the rear subject 802 is focused as shown in FIG. When the subject 801 is blurred, the rear subject 802 may be seen through. When the contrast value of the rear subject 802 in the in-focus state is higher than the contrast value of the front subject 801 in the in-focus state, combining is performed according to the method described in Patent Document 1, as shown in FIG. The rear subject is output at the same time. Therefore, a composite image in which a part of the subject in front is missing is generated.

本発明は、このような状況に鑑みてなされたものであり、合焦位置を変えながら撮像した複数の画像を合成する場合、手前の被写体の一部が欠落して奥の被写体が透けたような画像となることを抑制できる画像処理装置を提供することを目的とする。   The present invention has been made in view of such a situation, and when combining a plurality of images taken while changing the focus position, a part of the subject in the foreground is missing and the subject in the back is seen through. An object of the present invention is to provide an image processing apparatus that can suppress the formation of a correct image.

本発明は、光学系の合焦位置を変えながら撮像した複数の画像の各々の領域に対して合成比率を設定し、該合成比率を用いて前記複数の画像の合成を行い、合成画像を生成する合成手段と、前記複数の画像の各々の領域に対して、コントラスト値を算出するコントラスト値の算出手段と、を有し、前記合成手段は、前記合成を行う際に、前記複数の画像の位置が重なる領域ごとに前記複数の画像のコントラスト値を比較した結果と、前記複数の画像を撮像した際の合焦位置に基づいて、前記合成比率を設定することを特徴とする画像処理装置を提供する。   The present invention sets a composition ratio for each region of a plurality of images captured while changing the focus position of the optical system, and combines the plurality of images using the composition ratio to generate a composite image. Synthesizing means, and contrast value calculating means for calculating a contrast value for each region of the plurality of images, and the synthesizing means performs the synthesis of the plurality of images. An image processing apparatus, wherein the composition ratio is set based on a result of comparing contrast values of the plurality of images for each region where positions overlap and a focus position when the plurality of images are captured. provide.

本発明によれば、合焦位置を変えながら、複数の画像を撮像してから合成する場合に、手前の被写体の一部が欠落して奥の被写体が透けたような画像となることを抑制することができる。   According to the present invention, when a plurality of images are captured and combined while changing the in-focus position, it is possible to suppress an image in which a part of the subject in front is lost and the subject in the back is transparent. can do.

本発明の実施形態におけるデジタルカメラのブロック図である。It is a block diagram of a digital camera in an embodiment of the present invention. 本発明の実施形態を説明するためのフローチャートである。It is a flowchart for demonstrating embodiment of this invention. 本発明の実施形態における合成マップの作成を説明するための図である。It is a figure for demonstrating preparation of the synthetic | combination map in embodiment of this invention. 本発明の第1の実施形態における複数の画像の対応する画素のコントラスト値を示す図である。It is a figure which shows the contrast value of the corresponding pixel of the some image in the 1st Embodiment of this invention. 本発明の第1の実施形態における合成比率の対象画素の判断処理を説明するためのフローチャートである。It is a flowchart for demonstrating the judgment process of the object pixel of a composition ratio in the 1st Embodiment of this invention. 本発明の第2の実施形態における合成比率の対象画素の判断処理を説明するためのフローチャートである。It is a flowchart for demonstrating the judgment process of the object pixel of a composition ratio in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるコントラスト値の補正を説明するための図である。It is a figure for demonstrating correction | amendment of the contrast value in the 2nd Embodiment of this invention. 合焦位置の異なる複数の画像を合成する処理を説明するための図である。It is a figure for demonstrating the process which synthesize | combines several image from which a focus position differs.

以下では、添付の図面を参照しながら、本発明の好適な実施形態について詳細に説明する。なお、以下の説明では、デジタルカメラを例にあげて説明を行うが、デジタルカメラに限定されるわけでなく、合焦位置の情報の取り入れ、コントラスト値の算出および画像の合成ができる画像処理装置を用いれば、本発明を適用することができる。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, a digital camera will be described as an example. However, the present invention is not limited to a digital camera, and is not limited to a digital camera, and is an image processing apparatus capable of taking in focus position information, calculating a contrast value, and synthesizing an image. If is used, the present invention can be applied.

(第1の実施形態)
図1は本実施形態に係るデジタルカメラの構造を示すブロック図である。デジタルカメラ100は、静止画を撮像することができ、かつ、合焦位置の情報を記録し、コントラスト値の算出および画像の合成が可能なものである。さらに、デジタルカメラ100は、撮像して保存した画像、または、外部から入力した画像に対して、拡大処理または縮小処理を行うことができる。
(First embodiment)
FIG. 1 is a block diagram showing the structure of a digital camera according to this embodiment. The digital camera 100 can capture a still image, records information on the in-focus position, and can calculate a contrast value and synthesize an image. Furthermore, the digital camera 100 can perform an enlargement process or a reduction process 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 a signal processor such as a CPU or an MPU, for example, and controls each part of the digital camera 100 while reading a program built in the ROM 105 described later. For example, as will be described later, the control unit 101 instructs the imaging unit 104 described later to start and end imaging. Alternatively, an image processing command is issued to an image processing unit 107 described later based on a program built in the ROM 105. A user command is input to the digital camera 100 by an 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 drive unit 102 is configured by a motor or the like, and mechanically operates an optical system 103 to be described later under a command from the control unit 101. For example, based on a command from the control unit 101, the driving unit 102 moves the position of the focus lens included in the optical system 103 and adjusts the focal length of the optical system 103.

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

撮像部104は、光電変換素子であり、入射された光信号を電気信号に変換する光電変換を行うものである。たとえば、撮像部104に、CCDセンサやCMOSセンサなどを適用することができる。撮像部104は、動画撮像モードを設け、時間的に連続する複数の画像を動画の各々のフレームとして、撮像することができる。   The imaging unit 104 is a photoelectric conversion element, and performs photoelectric conversion that converts an incident optical signal into an electrical signal. For example, a CCD sensor or a CMOS sensor can be applied to the imaging unit 104. The imaging unit 104 is provided with 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 and the like necessary for the operation of each block in addition to the operation program for each block provided in the digital camera 100. The RAM 106 is a rewritable volatile memory, and is used as a temporary storage area for data output in the operation of each block included in the digital camera 100.

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

画像処理部107は、特定の処理を行う回路を集めた集積回路(ASIC)で構成される。あるいは、制御部101がROM105から読み出したプログラムに従って処理することで、制御部101が画像処理部107の機能の一部または全部を兼用するようにしてもよい。制御部101が画像処理部107の全ての機能を兼用する場合には、画像処理部107をハードウェアとして有する必要はなくなる。   The image processing unit 107 includes an integrated circuit (ASIC) that collects circuits for performing specific processing. Alternatively, the control unit 101 may perform some or all of the functions of the image processing unit 107 by performing processing according to a program read from the ROM 105. When the control unit 101 has all the 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 an image temporarily stored in the RAM 106, an image stored in an internal memory 109, which will be described later, or a liquid crystal display or an organic EL display for displaying 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 image capturing unit 104, an image obtained by the processing of the image processing unit 107, information on a focus position at the time of image capturing, and the like. 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, switch, key, or mode dial attached to the digital camera 100, or a touch panel that is also used as the display unit 108. A command from the user reaches the control unit 101 via the operation unit 110.

図2は、本実施形態を説明するためのフローチャートである。   FIG. 2 is a flowchart for explaining the present embodiment.

ステップS201で、デジタルカメラ100は、ユーザからの撮像指示に応じて、合焦位置を所定量ずつ自動的に変えながら、複数の画像を撮像する。撮像部104が光学系103を介して被写体を撮像し、制御部101が撮像した画像を内蔵メモリ109に保存するとともに、それぞれの画像を撮像したときの光学系103の合焦位置の情報を取得し、内蔵メモリ109に保存する。なお、ユーザが手動でズームリングを回すことで、合焦位置を変えながら複数回撮像するようにしてもよい。なお、本実施形態では、駆動部102が光学系103に設けるレンズを駆動させることで合焦位置を変えるが、これに限らず、たとえば、複数のデジタルカメラを用いて、それぞれのデジタルカメラを異なる位置で合焦させた状態で撮像するようにしてもよい。ただし、この場合、複数のデジタルカメラで得られた画像間の視差が大きくならないように、それぞれのデジタルカメラの光軸を近づけるように工夫する必要がある。   In step S201, the digital camera 100 captures a plurality of images while automatically changing the in-focus position by a predetermined amount in accordance with an imaging instruction from the user. The imaging unit 104 captures an image of the subject via the optical system 103, saves the image captured by the control unit 101 in the built-in memory 109, and acquires information on the in-focus position of the optical system 103 when each image is captured. And stored in the built-in memory 109. Note that the user may manually rotate the zoom ring to capture images a plurality of times while changing the focus position. In this embodiment, the driving unit 102 changes the in-focus position by driving a lens provided in the optical system 103. However, the present invention is not limited to this, and for example, a plurality of digital cameras are used, and each digital camera is different. You may make it image-capture in the state focused on the position. However, in this case, it is necessary to devise so that the optical axes of the respective digital cameras are close to each other so that the parallax between images obtained by a plurality of digital cameras does not increase.

ステップS202で、画像処理部107は、ステップS201で撮像した複数の画像に対して、位置合わせの処理を行う。位置合わせの方法の一例を以下に述べる。位置合わせの対象となる2つの画像の相対位置をずらしながら、これら複数の画像の画素の出力の差の絶対値総和(SAD:Sum Of Absolute Difference)を求める。この絶対値総和の値が最も小さくなるときの、2つの画像の相対的な移動量と移動方向を求める。そして、求めた移動量と移動方向に応じたアフィン変換もしくは射影変換の変換係数を算出した後、変換係数による移動量と絶対値総和から算出した移動量との誤差が最小となるように、最小二乗法を用いて変換係数を最適化する。その最適化された変換係数に基づいて、位置合わせの対象となる画像に対して、変形処理を行う。   In step S202, the image processing unit 107 performs alignment processing on the plurality of images captured in step S201. An example of the alignment method will be described below. While shifting the relative positions of the two images to be aligned, the sum of absolute values (SAD: Sum Of Absolute Difference) of the output differences of the pixels of the plurality of images is obtained. The relative moving amount and moving direction of the two images when the absolute value sum is the smallest are obtained. Then, after calculating the conversion coefficient of the affine transformation or projective transformation according to the obtained movement amount and the movement direction, minimize the error between the movement amount by the conversion coefficient and the movement amount calculated from the absolute value sum. Optimize transform coefficients using the square method. Based on the optimized conversion coefficient, a deformation process is performed on the image to be aligned.

ステップS203で、制御部101は、各々の画像の撮像時の合焦位置を内蔵メモリ109から読み出し、撮像した画像を、それぞれの画像を撮像したときの合焦位置に基づいて並べ、番号を付与する。   In step S203, the control unit 101 reads out the in-focus position at the time of capturing each image from the built-in memory 109, arranges the captured images based on the in-focus position when each image is captured, and assigns numbers. To do.

ステップS204で、画像処理部107は、撮像した複数の画像に対して、コントラスト値の算出を行う。コントラスト値の算出の方法の一例としては、画素の出力にエッジ検出用のフィルタをかけ、その結果をコントラスト値とする。このエッジ検出用のフィルタとしては、たとえば、バンドパスフィルタ、ソーベルフィルタ、およびラプラシアンフィルタなどが用いられる。   In step S204, the image processing unit 107 calculates a contrast value for a plurality of captured images. As an example of the contrast value calculation method, an edge detection filter is applied to the pixel output, and the result is used as the contrast value. As the edge detection filter, for example, a band pass filter, a Sobel filter, a Laplacian filter, or the like is used.

ステップS205で、画像処理部107はステップS204で算出したコントラスト値の比較結果に基づいて、合成マップを作成する。具体的には、画像処理部107は、合焦位置を変えながら撮像した複数の画像のそれぞれの対応する画素の中で、まずは、コントラスト値が最も高くなる画像の画素の合成比率を100%、それ以外の画像の画素を0%に設定する。ここでいう対応する画素とは、ステップS202の位置合わせを行った結果、複数の画像間で、同じ位置、あるいは、重畳する位置になる画素を意味する。以下の処理では、各画素のコントラスト値に基づいて、各画素に与える合成比率について説明する。   In step S205, the image processing unit 107 creates a composite map based on the contrast value comparison result calculated in step S204. Specifically, the image processing unit 107 first sets the composition ratio of the pixels of the image with the highest contrast value to 100% among the corresponding pixels of each of the plurality of images captured while changing the focus position. The other image pixels are set to 0%. The corresponding pixel here means a pixel that is located at the same position or overlapping position among a plurality of images as a result of the alignment in step S202. In the following processing, the composition ratio given to each pixel will be described based on the contrast value of each pixel.

図3は、合成マップの作成を説明するための図である。図4は、撮像した複数の画像の対応する画素のコントラスト値を示す図である。図3(a)では、ある撮像シーンの被写体構図を示している。図3(a)の部分304は、被写体301のうちの一部であって、被写体302とは重なっていない部分である。   FIG. 3 is a diagram for explaining creation of a composite map. FIG. 4 is a diagram illustrating contrast values of corresponding pixels of a plurality of captured images. FIG. 3A shows the subject composition of a certain imaging scene. A portion 304 in FIG. 3A is a portion of the subject 301 and does not overlap the subject 302.

図4(a)は画像の並び順と、各画像を撮像したときの光学系103の合焦位置を示す。図4(b)は、部分304に含まれるいずれか1つの画素のコントラスト値を示す図であって、並び順1番から8番までの画像に含まれる対応する画素を、それぞれ画素411から418として示す。この図4(b)では、デジタルカメラ100が図3(b)の並び順が2番である合焦位置312に合焦させて撮像した画像において、部分304に含まれる画素412のコントラスト値が最も高くなることを示す。そのため、画像処理部107は、部分304の位置においては、並び順2番の画像に含まれる画素412の合成比率を100%とする。同時に、画像処理部107は並び順1番の画素411、および3番乃至8番の画像の対応する画素413〜418の合成比率を0%とする。画像処理部107は、このような合成比率の設定を、各画像のそれぞれ対応する画素に対して行う。なお、隣接画素間で合成比率が0%から100%に急に変化(あるいは100%から0%に変化)すると、合成境界での不自然さが目立つようになる。そのため、画像処理部107は合成マップに対して所定の画素数(タップ数)を持つフィルタをかけて、隣接画素間で合成比率が段階的に変化するようにする。   FIG. 4A shows the arrangement order of the images and the in-focus position of the optical system 103 when each image is captured. FIG. 4B is a diagram showing the contrast value of any one pixel included in the portion 304. Corresponding pixels included in the images from the first to the eighth array are shown as pixels 411 to 418, respectively. As shown. In FIG. 4B, the contrast value of the pixel 412 included in the portion 304 in the image captured by the digital camera 100 in focus at the in-focus position 312 in FIG. Indicates that it will be the highest. Therefore, the image processing unit 107 sets the composition ratio of the pixels 412 included in the second image in the arrangement order to 100% at the position of the portion 304. At the same time, the image processing unit 107 sets the combination ratio of the first pixel 411 in the arrangement order and the corresponding pixels 413 to 418 of the third to eighth images to 0%. The image processing unit 107 performs such a composition ratio setting for each corresponding pixel of each image. Note that if the composition ratio suddenly changes from 0% to 100% (or changes from 100% to 0%) between adjacent pixels, unnaturalness at the composition boundary becomes conspicuous. Therefore, the image processing unit 107 applies a filter having a predetermined number of pixels (number of taps) to the composite map so that the composite ratio changes stepwise between adjacent pixels.

なお、上述した合成マップの作成方法は一例にすぎず、適宜に変形することもできる。たとえば、画像処理部107は、コントラスト値が最も高い画像の合成比率を100%にする代わりに、コントラスト値の高い画素ほど合成比率が大きくなるように、複数の画像に対して0以外の合成比率を設定するようにしてもよい。   Note that the above-described method for creating a composite map is merely an example, and can be modified as appropriate. For example, instead of setting the composition ratio of the image with the highest contrast value to 100%, the image processing unit 107 performs composition ratios other than 0 for a plurality of images so that the composition ratio becomes larger as the pixel with the higher contrast value. May be set.

ステップS206で、制御部101は、合成比率の調整を行う画素の判断を行う。図5は、合成比率の調整処理を説明するためのフローチャートである。まず、ステップS501で、図4(b)に示したように、制御部101は、画像の並び順と、各々の画像の対応する画素のコントラスト値との関係から、極大値を検出する。図4(a)の場合、並び順2番の画像の対応する画素におけるコントラスト値が極大値となる。図4(b)の場合、並び順2番と7番との画像の対応する画素におけるコントラスト値が極大値となる。   In step S <b> 206, the control unit 101 determines a pixel for adjusting the composition ratio. FIG. 5 is a flowchart for explaining the synthesis ratio adjustment processing. First, in step S501, as illustrated in FIG. 4B, the control unit 101 detects a local maximum value from the relationship between the arrangement order of the images and the contrast value of the corresponding pixel of each image. In the case of FIG. 4A, the contrast value in the corresponding pixel of the image in the second order is the maximum value. In the case of FIG. 4B, the contrast value in the corresponding pixel of the images in the second and seventh order is the maximum value.

次に、ステップS502では、制御部101は、対応する画素において極大値が2つ以上存在しているかどうかについて判断する。極大値が2つ以上存在している場合は、ステップS503に移り、処理中の画素は合成比率の調整の必要がある画素と判断し、極大値が2つ以上存在していない場合、ステップS504に移り、処理中の画素が合成比率の調整の必要がない画素と判断する。たとえば、図4(b)の場合、対応する画素において、並び順の2番と7番の画像に対応する画素のコントラスト値が極大値となる。制御部101は、こうした画素が合成比率の調整の必要がある画素であると判断する。   Next, in step S502, the control unit 101 determines whether there are two or more local maximum values in the corresponding pixel. If there are two or more local maximum values, the process proceeds to step S503, and it is determined that the pixel being processed is a pixel that needs to be adjusted in the composition ratio. If two or more local maximum values do not exist, step S504 is performed. Then, it is determined that the pixel being processed is a pixel that does not require adjustment of the composition ratio. For example, in the case of FIG. 4B, in the corresponding pixels, the contrast values of the pixels corresponding to the second and seventh images in the arrangement order are the maximum values. The control unit 101 determines that these pixels are pixels that require adjustment of the composition ratio.

以上の処理の理由を、図3を用いて簡単に説明する。たとえば、図3(a)のように、被写体301と被写体302とが存在し、図3(c)は被写体301に合焦するときに撮像した画像を示し、図3(d)は被写体302に合焦するときに撮像した画像を示す。ただし、図3(c)の被写体321と図3(d)の被写体331は被写体301の一部(頭部)とし、被写体301に合焦すると被写体421にも合焦すると仮定する。同様に、図3(c)の被写体322と図3(d)の被写体332とは被写体302の一部とし、被写体302に合焦すると被写体332にも合焦すると仮定する。被写体301に合焦するとき、被写体321に相当する領域のコントラスト値が高くなり、被写体302に合焦するとき、被写体332に相当する領域のコントラスト値が高くなる。被写体301と被写体302とが重なる領域323の画素のコントラスト値は、合焦位置を図4(b)の合焦位置311から318に変化させるとき、合焦位置312と317との2つの位置で極大値になる。合焦位置に基づく並び順とコントラスト値との関係をグラフにすると、2つの極大値を持つ。一方、1つの被写体しか存在していない領域324の画素では、2つ以上の極大値が存在することがない。したがって、上述した処理では、極大値が2つ以上存在する場合に、制御部201は、合成比率の調整の必要がある画素と判断する。   The reason for the above processing will be briefly described with reference to FIG. For example, as shown in FIG. 3A, a subject 301 and a subject 302 exist, FIG. 3C shows an image captured when focusing on the subject 301, and FIG. An image taken when focusing is shown. However, it is assumed that the subject 321 in FIG. 3C and the subject 331 in FIG. 3D are a part (head) of the subject 301, and when the subject 301 is focused, the subject 421 is also focused. Similarly, it is assumed that the subject 322 in FIG. 3C and the subject 332 in FIG. 3D are part of the subject 302, and that when the subject 302 is focused, the subject 332 is also focused. When focusing on the subject 301, the contrast value of the region corresponding to the subject 321 increases, and when focusing on the subject 302, the contrast value of the region corresponding to the subject 332 increases. The contrast value of the pixel in the region 323 where the subject 301 and the subject 302 overlap is the two focus positions 312 and 317 when the focus position is changed from the focus position 311 to 318 in FIG. Maximum value. When the relationship between the arrangement order based on the focus position and the contrast value is graphed, it has two local maximum values. On the other hand, in the pixel of the region 324 where only one subject exists, two or more local maximum values do not exist. Therefore, in the above-described processing, when there are two or more maximum values, the control unit 201 determines that the pixel needs to be adjusted in the synthesis ratio.

以上が、ステップS206での合成比率の調整を行う画素の判断処理である。   The above is the pixel determination process for adjusting the composition ratio in step S206.

ステップS207で、画像処理部107は、合成マップの補正を行う。ここでは、ステップS206で、制御部101が判断した合成比率の調整の必要があると判断された画素の合成比率の変更を行う。具体的に、画像処理部107は、ステップS206で合成比率の調整の必要があると判断した画素に対して、極大値を有する最も至近側の画像の画素の合成比率を上げる。たとえば、図4(b)で、並び順の2番の画素の合成比率を100%にする。かくして、図3(e)のように、被写体321の合成比率を100%にし、後方にある被写体332を完全に隠すことができる。または、被写体321の合成比率を上げるが、縁部の画素の合成比率を100%までとせずにやや抑え気味にすることで、合成後の画像をボケ味のある画像にすることができる。   In step S207, the image processing unit 107 corrects the composite map. Here, in step S206, the composition ratio of the pixel determined to be necessary to adjust the composition ratio determined by the control unit 101 is changed. Specifically, the image processing unit 107 increases the combination ratio of the pixels of the closest image having the maximum value with respect to the pixels determined to need adjustment of the combination ratio in step S206. For example, in FIG. 4B, the composition ratio of the second pixel in the arrangement order is set to 100%. Thus, as shown in FIG. 3E, the composition ratio of the subject 321 can be set to 100%, and the subject 332 behind can be completely hidden. Alternatively, although the composition ratio of the subject 321 is increased, the composition ratio of the pixels at the edge portion is not limited to 100% and is slightly suppressed, so that the image after composition can be made a blurred image.

なお、図4(c)のように、ほかの極大値と比べて、両側の画素とのコントラスト値の差がきわめて小さい極大値432が存在する場合がある。こうした値は、ノイズなどによる影響の可能性が高いと考えられるため、最も至近側にあったとしても合成比率を100%には設定しない。このような場合は、極大値432以外の極大値のうち、最も至近側の画像の対応する画素の合成比率を100%にする。図4(c)の場合では、並び順の4番の画素の合成比率を100%にする。   As shown in FIG. 4C, there may be a local maximum 432 in which the difference in contrast between the pixels on both sides is extremely small compared to other local maximums. Since these values are considered to be highly likely to be affected by noise or the like, the composition ratio is not set to 100% even if it is closest. In such a case, among the maximum values other than the maximum value 432, the composition ratio of the corresponding pixels of the closest image is set to 100%. In the case of FIG. 4C, the composition ratio of the fourth pixel in the arrangement order is set to 100%.

具体的に、制御部101は、予め閾値を定め、極大値と両側とのコントラスト値の差の平均が閾値より小さい場合、前述するコントラスト値の比較と調整とを行う。   Specifically, the control unit 101 determines a threshold value in advance, and compares and adjusts the contrast value described above when the average of the difference between the maximum value and the contrast value between both sides is smaller than the threshold value.

ステップS207での処理が終わると、ステップS208で制御部101は、すべての画素に対する合成マップの補正処理が終了したかどうかについて判断する。終了していなければ、画像処理部107には、次の画素を内蔵メモリ109から入力され、ステップS206からの処理を行う。終了していれば、ステップS210に入り、合成マップに基づいて、画像の合成を行う。また、ここでも、前述するステップS205と同様に、必要に応じ、画像処理部107はステップS207で補正済みの合成マップに対して所定の画素数を持つフィルタをかけて、隣接画素間で合成比率が段階的に変化するようにする。   When the processing in step S207 is completed, in step S208, the control unit 101 determines whether or not the composite map correction processing for all the pixels has been completed. If not completed, the image processing unit 107 receives the next pixel from the built-in memory 109 and performs the processing from step S206. If completed, the process enters step S210, and the images are combined based on the combination map. Also in this case, similarly to step S205 described above, the image processing unit 107 applies a filter having a predetermined number of pixels to the composite map corrected in step S207 as necessary, and combines the adjacent pixels with a composite ratio. To gradually change.

第1の実施形態によれば、合焦位置を変えて撮像した複数の画像を用いて合成するとき、合成時に位置が重なる画素の複数の画像間での合成比率を調整することで、被写体の前後の位置関係を正しく反映する合成画像を生成することができる。なお、ここでは画素ごとにコントラスト値および合成比率を求める構成を例に挙げて説明したが、処理負荷を軽減するため、複数の画素からなるブロックごとにコントラスト値および合成比率を求めても構わない。すなわち、画像に含まれる複数の領域ごとに、コントラスト値と合成比率を求める構成であれば、その領域の大きさは、処理負荷や画質を考慮して任意の大きさに設定することが可能である。   According to the first embodiment, when synthesizing using a plurality of images picked up by changing the in-focus position, by adjusting the composition ratio between the plurality of images of pixels whose positions overlap at the time of composition, A composite image that correctly reflects the positional relationship before and after can be generated. Here, the configuration for obtaining the contrast value and the composition ratio for each pixel has been described as an example. However, in order to reduce the processing load, the contrast value and the composition ratio may be obtained for each block composed of a plurality of pixels. . In other words, if the configuration is such that a contrast value and a composition ratio are obtained for each of a plurality of regions included in an image, the size of each region can be set to an arbitrary size in consideration of processing load and image quality. is there.

(第2の実施形態)
第2の実施形態では、第1の実施形態と異なり、画像処理部107が算出したコントラスト値を、補正係数を用いる補正を経て、合成比率の調整の必要がある画素の判断に用いる。第2の実施形態での全体処理は、第1の実施形態の図2に示したフローチャートと同じであるが、ステップS206での合成比率の調整処理は、第1の実施形態と異なる。以下では、合成比率の調整処理を中心に、第2の実施形態について説明する。なお、第1の実施形態と同様な処理については、説明を省略する。
(Second Embodiment)
In the second embodiment, unlike the first embodiment, the contrast value calculated by the image processing unit 107 is used for determination of a pixel that needs to be adjusted in the composition ratio through correction using a correction coefficient. The overall processing in the second embodiment is the same as the flowchart shown in FIG. 2 of the first embodiment, but the composition ratio adjustment processing in step S206 is different from that in the first embodiment. In the following, the second embodiment will be described focusing on the adjustment process of the synthesis ratio. Note that description of processing similar to that of the first embodiment is omitted.

図6は、第2の実施形態における合成比率の調整処理を説明するための図である。ステップS601で、制御部101は、第1の実施形態のステップS501と同様に、コントラスト値の極大値を検出する。ステップS602で、制御部101は、第1の実施形態のステップS502と同様に、コントラスト値の極大値を検出する。   FIG. 6 is a diagram for explaining a synthesis ratio adjustment process according to the second embodiment. In step S601, the control unit 101 detects the maximum value of the contrast value as in step S501 of the first embodiment. In step S602, the control unit 101 detects the maximum value of the contrast value as in step S502 of the first embodiment.

ステップS603で、制御部101は、各々の画像の対応する画素のコントラスト値に対して、補正を行う。図7は、コントラスト値の補正を説明するための図である。図7(a)では、並び順の2番と7番との画像でそれぞれ前方被写体と後方被写体とに合焦し、図7(b)では、並び順の5番と7番との画像でそれぞれ前方被写体と後方被写体とに合焦する。図7(a)および(b)で、前方被写体に合焦するときのコントラスト値をそれぞれC_near1とC_near2とし、後方被写体に合焦するときのコントラスト値をともにC_farとする。   In step S603, the control unit 101 corrects the contrast value of the corresponding pixel of each image. FIG. 7 is a diagram for explaining the correction of the contrast value. In FIG. 7A, the front subject and the rear subject are focused on the second and seventh images in the order of arrangement, and in FIG. 7B, the fifth and seventh images in the order of arrangement are shown. Focus on the front subject and the rear subject, respectively. 7A and 7B, the contrast values when focusing on the front subject are C_near1 and C_near2, respectively, and the contrast values when focusing on the rear subject are both C_far.

合成比率の調整の必要がある画素において、前後の被写体のどちらか一方に合焦するとき、もう一方のボケ具合は、前後の被写体の間の距離が大きいほど、大きくなる。したがって、合焦位置を考慮し、ステップS601で算出したコントラスト値に対して補正を行う。その一例としては、至近側の画像の画素のコントラスト値に対して、補正係数をかけ、その結果を修正後のコントラスト値とする。図7(c)では、並び順2番の番号を持つ画素のコントラスト値C_near1に対して、補正係数W_near1をかけ、補正後のコントラスト値C_near1´が得られる。同様に、図7(d)並び順5番の番号を持つ画素のコントラスト値C_near2に対して、補正係数W_near2をかけ、補正後のコントラスト値C_near2´が得られる。図7(c)および(d)では、後方において、同じく並び順の7番の画像に合焦しているが、図7(c)は、図7(d)と比べ、前方被写体と後方被写体との距離が大きい。図7(c)において、並び順の2番の画像のボケ具合はより大きく、合成画像における被写体の前後位置の乱れが発生しやすいため、補正係数を大きくする必要がある。つまり、制御部101は、補正係数W_near1が補正係数W_near2より大きくなるように設定する。具体的に、図7(c)と図7(d)では、コントラスト値が極大値となる対応する画素のうち、最も無限側となる画素との距離に応じて、1より大きな補正係数を与える。一方、コントラスト値が極大値となる対応する画素のうち、最も無限側となる画素には、補正係数として1を与える、あるいは、補正を行わない。   When focusing on one of the front and rear subjects in a pixel that requires adjustment of the composition ratio, the other degree of blur increases as the distance between the front and rear subjects increases. Therefore, the contrast value calculated in step S601 is corrected in consideration of the in-focus position. As an example, a correction coefficient is applied to the contrast value of the pixel of the closest image, and the result is used as a corrected contrast value. In FIG. 7C, the correction value W_near1 is applied to the contrast value C_near1 of the pixel having the second number in the arrangement order to obtain a corrected contrast value C_near1 ′. Similarly, the correction coefficient W_near2 is applied to the contrast value C_near2 of the pixel having the number 5 in the arrangement order in FIG. 7D to obtain a corrected contrast value C_near2 ′. In FIGS. 7 (c) and (d), the seventh image in the rearrangement order is focused in the rear, but FIG. 7 (c) is a front subject and a rear subject as compared with FIG. 7 (d). The distance to is large. In FIG. 7C, the degree of blurring of the second image in the arrangement order is larger, and the front-rear position of the subject in the composite image is likely to be disturbed. Therefore, it is necessary to increase the correction coefficient. That is, the control unit 101 sets the correction coefficient W_near1 to be larger than the correction coefficient W_near2. Specifically, in FIG. 7C and FIG. 7D, a correction coefficient larger than 1 is given according to the distance from the most infinite pixel among the corresponding pixels having the maximum contrast value. . On the other hand, among the corresponding pixels having the maximum contrast value, 1 is given as a correction coefficient to the most infinite pixel, or no correction is performed.

ステップS604で、制御部101は、最も至近側のコントラスト値の極大値が最大値であるかどうかについて判断する。図7(c)のように、最も至近側の極大値が最大値である場合、ステップS605に移り、制御部101は、処理中の画素が合成比率の調整の必要がある画素であると判断する。図7(d)のように、最も至近側の極大値が最大値でない場合、ステップS606に移り、制御部101は、処理中の画素が合成比率の調整の必要がある画素でないと判断する。   In step S604, the control unit 101 determines whether or not the local maximum contrast value is the maximum value. As shown in FIG. 7C, when the local maximum on the closest side is the maximum value, the process proceeds to step S605, and the control unit 101 determines that the pixel being processed is a pixel that needs to be adjusted in the composition ratio. To do. As shown in FIG. 7D, when the local maximum on the nearest side is not the maximum value, the process proceeds to step S606, and the control unit 101 determines that the pixel being processed is not a pixel that needs to be adjusted in the composition ratio.

以上の判断の理由について説明する。最も至近側の極大値702をもつ画素の合焦位置は、ほかの極大値を持つ画素と比べ、後方被写体との距離がより大きく、前述する補正係数がより大きく設定されている。前方被写体の画像の対応する画素のコントラスト値702に十分大きい補正係数をかける以上、後方被写体に合焦するときの画像の対応する画素のコントラスト値703より大きくなるはずである。それにもかかわらず、前方被写体の画像の対応する画素のコントラスト値702の補正後の値712が、後方の画像の対応する画素のコントラスト値703より小さいことがあるとしたら、ノイズなどの影響による値と考えられる。つまり、そもそもコントラスト値702は、前方被写体に合焦していなく、コントラスト値802が極大値となるのは、ノイズなどの影響による値と考えられる。したがって、かくした場合、処理中の画素の合成比率の調整処理をしない。   The reason for the above determination will be described. The in-focus position of the pixel having the local maximum value 702 on the closest side is set to have a larger distance from the rear subject and a larger correction coefficient as described above than the pixels having other local maximum values. As long as a sufficiently large correction coefficient is applied to the contrast value 702 of the corresponding pixel of the front subject image, the contrast value 703 of the corresponding pixel of the image when focusing on the rear subject should be larger. Nevertheless, if the corrected value 712 of the contrast value 702 of the corresponding pixel of the front subject image may be smaller than the contrast value 703 of the corresponding pixel of the rear image, the value due to the influence of noise or the like. it is conceivable that. That is, the contrast value 702 is not focused on the front subject in the first place, and it is considered that the contrast value 802 is the maximum value due to the influence of noise or the like. Therefore, in such a case, the adjustment process of the composition ratio of the pixel being processed is not performed.

第2の実施形態によれば、合焦位置を変えて撮像した複数の画像を用いて合成するとき、被写体の間の距離によるボケ具合とノイズとの影響を考慮し、被写体の前後位置関係を正しく反映することができる。   According to the second embodiment, when synthesizing using a plurality of images picked up by changing the in-focus position, the influence of the blur condition due to the distance between the subjects and the influence of noise is considered, and the front-rear positional relationship of the subjects is determined. It can be reflected correctly.

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

なお、本発明は、上述の実施形態の1つ以上の機能を実現するプログラムを、ネットワークまたは記憶媒体を介してシステムまたは装置に供給し、そのシステムまたは装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読み出し作動させる処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   Note that the present invention supplies a program that realizes 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. It can also be realized by a 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 操作部
DESCRIPTION OF SYMBOLS 100 Digital camera 101 Control part 102 Drive part 103 Optical system 104 Imaging part 105 ROM
106 RAM
107 Image processing unit 108 Display unit 109 Built-in memory 110 Operation unit

Claims (12)

光学系の合焦位置を変えながら撮像した複数の画像の各々の領域に対して合成比率を設定し、該合成比率を用いて前記複数の画像の合成を行い、合成画像を生成する合成手段と、
前記複数の画像の各々の領域に対して、コントラスト値を算出するコントラスト値の算出手段と、を有し、
前記合成手段は、前記合成を行う際に、前記複数の画像の位置が重なる領域ごとに前記複数の画像のコントラスト値を比較した結果と、前記複数の画像を撮像した際の合焦位置に基づいて、前記合成比率を設定することを特徴とする画像処理装置。
Synthesizing means for setting a synthesis ratio for each region of a plurality of images captured while changing the focus position of the optical system, and synthesizing the plurality of images using the synthesis ratio to generate a synthesized image; ,
Contrast value calculating means for calculating a contrast value for each region of the plurality of images,
The synthesizing unit, based on a result of comparing the contrast values of the plurality of images for each region where the positions of the plurality of images overlap, and a focus position at the time of capturing the plurality of images when performing the synthesis. An image processing apparatus, wherein the composition ratio is set.
前記合成手段は、前記領域ごとに前記複数の画像のコントラスト値を比較し、前記領域ごとに、前記複数の画像のうち前記コントラスト値が最も大きくなる画像の前記合成比率を最も高くすることを特徴とする請求項1に記載の画像処理装置。   The synthesizing unit compares the contrast values of the plurality of images for each of the regions, and makes the composition ratio of the image having the largest contrast value among the plurality of images highest for each of the regions. The image processing apparatus according to claim 1. 前記合成手段は、前記領域ごとに、前記光学系の前記合焦位置の順で前記複数の画像の前記コントラスト値を並べた際に、前記コントラスト値の極大値が2つ以上存在する場合には、前記複数の画像のうち前記極大値に対応するいずれかの画像の前記合成比率を最も高く設定することを特徴とする請求項1または2に記載の画像処理装置。   When the contrast value of the plurality of images is arranged in the order of the in-focus position of the optical system for each region, the synthesizing unit has two or more maximum values of the contrast value. The image processing apparatus according to claim 1, wherein the composition ratio of any one of the plurality of images corresponding to the maximum value is set to be the highest. 前記合成手段は、前記領域ごとに、前記光学系の前記合焦位置の順で前記複数の画像の前記コントラスト値を並べた際に、前記コントラスト値の極大値に対応する複数の画像のうち、前記合焦位置が最も至近側に位置する画像の前記合成比率を最も高く設定することを特徴とする請求項3項に記載の画像処理装置。   The combining means, for each of the regions, when arranging the contrast values of the plurality of images in the order of the in-focus position of the optical system, among the plurality of images corresponding to the maximum value of the contrast value, The image processing apparatus according to claim 3, wherein the composition ratio of an image in which the in-focus position is closest to the closest side is set to be the highest. 前記合成手段は、前記コントラスト値の極大値が2つ以上存在する場合に、予め定められた閾値より小さい値となる極大値を除いて、前記合焦位置が最も至近側に位置する画像の前記合成比率を最も高く設定することを特徴とする請求項4に記載の画像処理装置。   The synthesizing means, when there are two or more maximum values of the contrast value, except for a maximum value that is smaller than a predetermined threshold, the image of the image in which the in-focus position is closest to the closest side. The image processing apparatus according to claim 4, wherein the composition ratio is set to be the highest. 前記合成手段は、前記複数の画像のうち前記極大値に対応するいずれかの画像の前記合成比率を1とし、他の画像の前記合成比率を0とすることを特徴とする請求項3乃至5のいずれか1項に記載の画像処理装置。   6. The composition means, wherein the composition ratio of one of the plurality of images corresponding to the maximum value is set to 1, and the composition ratio of another image is set to 0. The image processing apparatus according to any one of the above. 前記合成手段は、前記コントラスト値の極大値が2つ以上存在する場合に、1つ以上の極大値に対して補正係数を用いて補正を行い、補正後の極大値に基づいて、前記複数の画像のうち前記極大値に対応するいずれかの画像の前記合成比率を最も高く設定することを特徴とする請求項3に記載の画像処理装置。   The combining means corrects one or more maximum values using a correction coefficient when two or more maximum values of the contrast value exist, and based on the corrected maximum values, the plurality of the maximum values The image processing apparatus according to claim 3, wherein the composition ratio of any one of the images corresponding to the maximum value is set to be the highest. 前記合成手段は、前記合焦位置が最も至近側に位置する画像の補正後の極大値が、他の極大値よりも大きい場合に、前記合焦位置が最も至近側に位置する画像の前記合成比率を最も高く設定することを特徴とする請求項7に記載の画像処理装置。   The synthesizing unit is configured to combine the image having the in-focus position closest to the closest position when the corrected maximum value of the image having the in-focus position closest to the closest position is larger than the other maximum values. The image processing apparatus according to claim 7, wherein the ratio is set to be the highest. 前記合成手段は、前記コントラスト値の極大値が2つ以上存在する場合に、それぞれの極大値に対応する画像の前記合焦位置に基づいて、前記補正係数を設定することを特徴とする請求項7または8に記載の画像処理装置。   The composition unit, when there are two or more maximum values of the contrast value, sets the correction coefficient based on the in-focus position of an image corresponding to each maximum value. The image processing apparatus according to 7 or 8. 前記合成手段は、前記コントラスト値の極大値が2つ以上存在する場合に、前記合焦位置が最も至近側に位置する画像の極大値に対する補正係数を、最も大きくすることを特徴とする請求項9に記載の画像処理装置。   The composition means, when there are two or more local maximum values of the contrast value, makes the correction coefficient for the local maximum value of the image in which the in-focus position is located closest to the largest value. The image processing apparatus according to 9. 光学系の合焦位置を変えながら撮像した複数の画像の各々の領域に対して合成比率を設定し、該合成比率を用いて前記複数の画像の合成を行い、合成画像を生成する合成ステップと、
前記複数の画像の各々の領域に対して、コントラスト値を算出するコントラスト値の算出ステップと、を有し、
前記合成ステップにおいて、前記合成を行う際に、前記複数の画像の位置が重なる領域ごとに前記複数の画像のコントラスト値を比較した結果と、前記複数の画像を撮像した際の合焦位置に基づいて、前記合成比率を設定することを特徴とする画像処理方法。
A composition step of setting a composition ratio for each region of the plurality of images captured while changing the focus position of the optical system, and performing composition of the plurality of images using the composition ratio to generate a composite image; ,
A contrast value calculating step for calculating a contrast value for each region of the plurality of images,
In the synthesis step, when performing the synthesis, based on the result of comparing the contrast values of the plurality of images for each region where the positions of the plurality of images overlap, and the focus position when the plurality of images are captured. An image processing method characterized in that the composition ratio is set.
画像処理装置のコンピュータに動作させるプログラムであって、
光学系の合焦位置を変えながら撮像した複数の画像の各々の領域に対して合成比率を設定し、該合成比率を用いて前記複数の画像の合成を行い、合成画像を生成する合成ステップと、
前記複数の画像の各々の領域に対して、コントラスト値を算出するコントラスト値の算出ステップと、を有し、
前記合成ステップにおいて、前記合成を行う際に、前記複数の画像の位置が重なる領域ごとに前記複数の画像のコントラスト値を比較した結果と、前記複数の画像を撮像した際の合焦位置に基づいて、前記合成比率を設定することを特徴とするコンピュータのプログラム。
A program for causing a computer of an image processing apparatus to operate,
A composition step of setting a composition ratio for each region of the plurality of images captured while changing the focus position of the optical system, and performing composition of the plurality of images using the composition ratio to generate a composite image; ,
A contrast value calculating step for calculating a contrast value for each region of the plurality of images,
In the synthesis step, when performing the synthesis, based on the result of comparing the contrast values of the plurality of images for each region where the positions of the plurality of images overlap, and the focus position when the plurality of images are captured. And a computer program for setting the composition ratio.
JP2016169614A 2016-08-31 2016-08-31 Image processing equipment, image processing methods, computer programs and storage media Active JP6786311B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2016169614A JP6786311B2 (en) 2016-08-31 2016-08-31 Image processing equipment, image processing methods, computer programs and storage media
JP2020147126A JP6953594B2 (en) 2016-08-31 2020-09-01 Image processing equipment, imaging equipment, image processing methods, programs and recording media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016169614A JP6786311B2 (en) 2016-08-31 2016-08-31 Image processing equipment, image processing methods, computer programs and storage media

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2020147126A Division JP6953594B2 (en) 2016-08-31 2020-09-01 Image processing equipment, imaging equipment, image processing methods, programs and recording media

Publications (3)

Publication Number Publication Date
JP2018037857A true JP2018037857A (en) 2018-03-08
JP2018037857A5 JP2018037857A5 (en) 2019-08-15
JP6786311B2 JP6786311B2 (en) 2020-11-18

Family

ID=61566153

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016169614A Active JP6786311B2 (en) 2016-08-31 2016-08-31 Image processing equipment, image processing methods, computer programs and storage media

Country Status (1)

Country Link
JP (1) JP6786311B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020005243A (en) * 2018-06-26 2020-01-09 キヤノン株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
JP2020031324A (en) * 2018-08-22 2020-02-27 キヤノン株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
EP3799420A1 (en) 2019-09-26 2021-03-31 Canon Kabushiki Kaisha Image processing apparatus, method of processing image and program
JP2021097351A (en) * 2019-12-18 2021-06-24 キヤノン株式会社 Image processing device, imaging device, image processing method, program, and recording medium
US11206350B2 (en) * 2019-12-18 2021-12-21 Canon Kabushiki Kaisha Image processing apparatus, image pickup apparatus, image processing method, and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008271241A (en) * 2007-04-20 2008-11-06 Fujifilm Corp Imaging apparatus, image processing apparatus, imaging method, and image processing method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008271241A (en) * 2007-04-20 2008-11-06 Fujifilm Corp Imaging apparatus, image processing apparatus, imaging method, and image processing method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020005243A (en) * 2018-06-26 2020-01-09 キヤノン株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
JP2020031324A (en) * 2018-08-22 2020-02-27 キヤノン株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
US11127118B2 (en) 2018-08-22 2021-09-21 Canon Kabushiki Kaisha Image processing apparatus, image pickup apparatus, control method to control an image processing apparatus, and storage medium
EP3799420A1 (en) 2019-09-26 2021-03-31 Canon Kabushiki Kaisha Image processing apparatus, method of processing image and program
US11330190B2 (en) 2019-09-26 2022-05-10 Canon Kabushiki Kaisha Image processing apparatus, method of processing image and storage medium
JP2021097351A (en) * 2019-12-18 2021-06-24 キヤノン株式会社 Image processing device, imaging device, image processing method, program, and recording medium
US11206350B2 (en) * 2019-12-18 2021-12-21 Canon Kabushiki Kaisha Image processing apparatus, image pickup apparatus, image processing method, and storage medium
JP7458769B2 (en) 2019-12-18 2024-04-01 キヤノン株式会社 Image processing device, imaging device, image processing method, program and recording medium

Also Published As

Publication number Publication date
JP6786311B2 (en) 2020-11-18

Similar Documents

Publication Publication Date Title
US10326942B2 (en) Dual aperture zoom digital camera
JP4900401B2 (en) Imaging apparatus and program
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
JP6906947B2 (en) Image processing equipment, imaging equipment, image processing methods and computer programs
JP2008306651A (en) Imaging system and program
JP6786311B2 (en) Image processing equipment, image processing methods, computer programs and storage media
JP2018037857A5 (en) Image processing apparatus, image processing method, computer program, and storage medium
JP2017143354A (en) Image processing apparatus and image processing method
JP6961423B2 (en) Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media
JP2018148512A (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
CN113079313B (en) Image processing apparatus, image pickup apparatus, image processing method, and storage medium
JP7458769B2 (en) Image processing device, imaging device, image processing method, program and recording medium
CN110784642B (en) Image processing apparatus, control method thereof, storage medium, and imaging apparatus
CN111698389A (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP2022083147A (en) Imaging apparatus, imaging method, program, and recording medium
JP2020160773A (en) Image processing device, imaging device, image processing method, and program
JP2007096588A (en) Imaging device and method for displaying image
JP6953594B2 (en) Image processing equipment, imaging equipment, image processing methods, programs and recording media
JP7608119B2 (en) Image processing device, image processing method, imaging device, program, and recording medium
JP6245847B2 (en) Image processing apparatus and image processing method
JP6828069B2 (en) Imaging equipment, imaging methods and programs
JP6157274B2 (en) Imaging apparatus, information processing method, and program
JP2017183983A (en) Imaging apparatus, control method and control program of the same
JP2014236244A (en) Image processing system, image processing program, and digital camera

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190704

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190704

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200310

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200428

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200602

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200901

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20200910

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201028

R151 Written notification of patent or utility model registration

Ref document number: 6786311

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151