JP6818734B2 - Image processing equipment, imaging equipment, image processing methods and programs - Google Patents

Image processing equipment, imaging equipment, image processing methods and programs Download PDF

Info

Publication number
JP6818734B2
JP6818734B2 JP2018242851A JP2018242851A JP6818734B2 JP 6818734 B2 JP6818734 B2 JP 6818734B2 JP 2018242851 A JP2018242851 A JP 2018242851A JP 2018242851 A JP2018242851 A JP 2018242851A JP 6818734 B2 JP6818734 B2 JP 6818734B2
Authority
JP
Japan
Prior art keywords
images
image
adjustment
contrast
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018242851A
Other languages
Japanese (ja)
Other versions
JP2020005243A (en
Inventor
文貴 中山
文貴 中山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Publication of JP2020005243A publication Critical patent/JP2020005243A/en
Application granted granted Critical
Publication of JP6818734B2 publication Critical patent/JP6818734B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

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

デジタルカメラなどを用いて距離が互いに大きく異なる複数の被写体を撮像する場合や、奥行き方向に長い被写体を撮像する場合に、被写界深度が足りないために被写体の一部にしかピントを合わせられない場合がある。これを解決するため、特許文献1には、撮像された複数の画像のそれぞれにおいて、合成を行う際に重なる位置に存在する画素の画素値を、それぞれの画素のコントラスト値に応じた合成比率を用いて合成を行う技術が開示されている。コントラスト値が大きな画像に対して大きな合成比率を与えることで、合焦状態にある画像の比率が大きくなるように画像の合成が行われる。 When using a digital camera or the like to capture multiple subjects whose distances are significantly different from each other, or when capturing a subject that is long in the depth direction, the depth of field is insufficient, so only a part of the subject can be focused. It may not be. In order to solve this problem, Patent Document 1 describes the pixel values of pixels existing at overlapping positions when compositing in each of a plurality of captured images, and the compositing ratio according to the contrast value of each pixel. A technique for synthesizing using is disclosed. By giving a large composition ratio to an image having a large contrast value, the images are combined so that the ratio of the images in the in-focus state becomes large.

特開2014−17539号公報Japanese Unexamined Patent Publication No. 2014-17539

しかしながら、特許文献1に記載の技術を用いて画像合成を行うと、以下のような遠近競合の課題および合成画像のエッジ部にボケ領域が出る課題が生じることがある。 However, when image composition is performed using the technique described in Patent Document 1, the following problems of perspective competition and a problem that a blurred region appears at the edge portion of the composite image may occur.

図15は、遠近競合について説明するための図である。図15では、画像上の同じ位置に、カメラからの距離が異なる複数の被写体が存在しているものとする。図15(a)は撮像構図であり、被写体1501が前方被写体、被写体1502が後方被写体である。図15(b)は前方被写体1501に合焦した際の撮像画像、図15(c)は後方被写体1502に合焦した際の撮像画像、図15(d)は被写体1501と被写体1502とが重なる領域に注目した図である。図15(b)のように前方被写体1501に合焦した場合、後方被写体1502は前方被写体1501に遮蔽されている。一方、図15(c)のように後方被写体1502に合焦した場合、前方被写体1501がぼけることで後方被写体1502が透けて見えてしてしまうことがある。合焦状態である前方被写体1501のコントラスト値よりも、合焦状態である後方被写体1502のコントラスト値が高い場合、特許文献1に記載の方法で合成を行うと、図15(e)に示すように後方被写体が出力されてしまうことになる。そのため、手前にある被写体の一部分が欠落した合成画像が生成されてしまう。 FIG. 15 is a diagram for explaining perspective competition. In FIG. 15, it is assumed that a plurality of subjects having different distances from the camera exist at the same position on the image. FIG. 15A is an imaging composition, in which the subject 1501 is the front subject and the subject 1502 is the rear subject. 15 (b) is an image captured when the front subject 1501 is in focus, FIG. 15 (c) is an image captured when the rear subject 1502 is in focus, and FIG. 15 (d) is an image in which the subject 1501 and the subject 1502 overlap. It is a figure focusing on the area. When the front subject 1501 is focused as shown in FIG. 15B, the rear subject 1502 is shielded by the front subject 1501. On the other hand, when the rear subject 1502 is in focus as shown in FIG. 15C, the rear subject 1502 may be seen through due to the blur of the front subject 1501. When the contrast value of the rear subject 1502 in the focused state is higher than the contrast value of the front subject 1501 in the focused state, the composition is performed by the method described in Patent Document 1, as shown in FIG. 15 (e). The rear subject will be output. Therefore, a composite image in which a part of the subject in the foreground is missing is generated.

図16は、合成画像のエッジ部にボケ領域が出る一例を説明するための図である。図16に示した場合では、デジタルカメラ100は、白地の背景の前にあるX型の被写体に対して、ピント位置1601乃至1605で5枚の画像1610から1650を撮像し、撮像した画像に対して合成を行い、合成画像1600を生成したものとする。画像1610はピント位置1601で撮像されたものであり、画像1620から1650はピント位置1602乃至1605に対応するものとする。画像1610から1650に位置合わせが行われた後、画素1611から1651は同じ位置にあり、画素1612から1652は同じ位置にあるとする。特許文献1に開示された技術を用いて合成画像を作成すると、画素1612から1652の中から最もコントラスト値の高いものを選んで合成画像の同じ位置に使う。そこで、デジタルカメラは、画素1632を合成画像1600に使うことが図示されている。しかしながら、デジタルカメラは、同様な方法で画素1611から1651の中から最もコントラスト値の高いものを選んで合成画像の同じ位置に使うと、画素1631のコントラスト値よりも、画素1611または画素1651のコントラスト値が高くなる。そのため、画素1611または画素1651を選んで合成画像に使ってしまう。その結果、図示されているように、合成画像1600には、エッジ部の周辺にボケ領域が生じてしまう。 FIG. 16 is a diagram for explaining an example in which a blurred region appears at an edge portion of a composite image. In the case shown in FIG. 16, the digital camera 100 captures five images 1610 to 1650 at focus positions 1601 to 1605 with respect to an X-shaped subject in front of a white background, and with respect to the captured images. It is assumed that the composite image 1600 is generated by the synthesis. The image 1610 is taken at the focus position 1601, and the images 1620 to 1650 correspond to the focus positions 1602 to 1605. After the images 1610 to 1650 have been aligned, the pixels 1611 to 1651 are in the same position and the pixels 1612 to 1652 are in the same position. When a composite image is created using the technique disclosed in Patent Document 1, the pixel 1612 to 1652 having the highest contrast value is selected and used at the same position in the composite image. Therefore, it is illustrated that the digital camera uses the pixel 1632 for the composite image 1600. However, when a digital camera selects the pixel 1611 to 1651 having the highest contrast value and uses it at the same position in the composite image in the same manner, the contrast value of the pixel 1611 or the pixel 1651 is higher than the contrast value of the pixel 1631. The value will be higher. Therefore, the pixel 1611 or the pixel 1651 is selected and used for the composite image. As a result, as shown in the figure, the composite image 1600 has a blurred region around the edge portion.

本発明は、上記の課題を鑑みてなされたものであり、ピント位置の異なる複数の画像を用いて合成した画像においてエッジ部のボケ領域を低減すると同時に、遠近競合の悪化を防げる画像処理装置を提供するものである。 The present invention has been made in view of the above problems, and an image processing apparatus capable of reducing the blurred region of an edge portion in an image synthesized by using a plurality of images having different focus positions and at the same time preventing deterioration of perspective competition. It is to provide.

上記課題を解決するため、本願発明は、複数の画像のコントラスト値を検出する検出手段と、前記複数の画像の前記コントラスト値に基づいて、遠近競合の度合いの判定を行う判定手段と、前記判定手段が前記判定を行った後の前記複数の画像の少なくとも一部の画像のそれぞれにおけるエッジ部のコントラスト値の変化を滑らかになるように、該画像のコントラスト値に対して第1の調整を行い、複数の調整の結果を生成する第1の調整手段と、前記第1の調整手段が前記第1の調整を行った後のコントラスト値を有する前記画像のそれぞれにおいて、前記遠近競合の度合いがより強い位置に、より小さくなるようなゲインを算出し、前記ゲインを前記複数の調整の結果にかけてから統合した値を生成するように第2の調整を行う第2の調整手段であって、1つの前記画像の1つの前記位置に対して1つの前記統合した値を生成する第2の調整手段と、前記複数の画像のそれぞれに対応する位置の前記統合した値に応じて、前記複数の画像の合成比率を設定する設定手段と、前記合成比率に基づいて、前記複数の画像に対して合成を行い、合成画像を生成する生成手段と、を有することを特徴とする画像処理装置を提供する。 In order to solve the above problems, the present invention comprises a detection means for detecting contrast values of a plurality of images, a determination means for determining the degree of perspective competition based on the contrast values of the plurality of images, and the determination. The first adjustment is made to the contrast value of the image so that the change of the contrast value of the edge portion in each of at least a part of the images of the plurality of images after the means makes the determination is smooth. , The degree of perspective competition is higher in each of the first adjusting means for generating the result of the plurality of adjustments and the image having the contrast value after the first adjusting means has made the first adjustment. It is a second adjusting means that calculates a smaller gain at a strong position, applies the gain to the results of the plurality of adjustments, and then makes a second adjustment so as to generate an integrated value. A second adjusting means for generating one integrated value for one position of the image and the integrated value of the position corresponding to each of the plurality of images. Provided is an image processing apparatus comprising: a setting means for setting a composition ratio and a generation means for generating a composite image by synthesizing the plurality of images based on the composition ratio.

本発明の構成によれば、ピント位置の異なる複数の画像を撮像して合成した画像において、エッジ部のボケを低減するとともに、遠近競合による後方被写体の透過の深刻化を防ぐ画像処理装置を提供することができる。 According to the configuration of the present invention, there is provided an image processing device that reduces blurring of an edge portion and prevents serious transmission of a rear subject due to perspective competition in an image obtained by capturing and synthesizing a plurality of images having different focus positions. can do.

本発明の実施形態に係るデジタルカメラの構造を示すブロック図である。It is a block diagram which shows the structure of the digital camera which concerns on embodiment of this invention. 本発明の第1の実施形態における合成画像の生成について説明するためのフローチャートである。It is a flowchart for demonstrating the generation of the composite image in 1st Embodiment of this invention. 本発明の第1の実施形態における撮像について説明するためのフローチャートである。It is a flowchart for demonstrating the imaging in 1st Embodiment of this invention. 本発明の第1の実施形態における位置合わせについて説明するためのフローチャートである。It is a flowchart for demonstrating the alignment in 1st Embodiment of this invention. 本発明の第1の実施形態における画像の合成について説明するためのフローチャートである。It is a flowchart for demonstrating composition of an image in 1st Embodiment of this invention. 本発明の第1の実施形態における合成マップの生成について説明するためのフローチャートである。It is a flowchart for demonstrating the generation of the synthetic map in 1st Embodiment of this invention. 本発明の第1の実施形態における合成マップの生成について説明するためのブロック図である。It is a block diagram for demonstrating the generation of the synthetic map in 1st Embodiment of this invention. 本発明の第1の実施形態におけるコントラスト値を説明するための図である。It is a figure for demonstrating the contrast value in 1st Embodiment of this invention. 本発明の第1の実施形態における遠近競合の判定を説明するための図である。It is a figure for demonstrating the determination of perspective competition in the 1st Embodiment of this invention. 本発明の第1の実施形態における遠近競合を説明するための図である。It is a figure for demonstrating the perspective competition in the 1st Embodiment of this invention. 本発明の第1の実施形態における遠近競合の有無とコントラスト値の変化との関係を説明するためのグラフである。It is a graph for demonstrating the relationship between the presence / absence of perspective competition and the change of contrast value in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるゲインと遠近競合の度合いとの関係を示すグラフである。It is a graph which shows the relationship between the gain and the degree of perspective competition in the 1st Embodiment of this invention. 本発明の第2の実施形態における合成マップの生成について説明するためのフローチャートである。It is a flowchart for demonstrating the generation of the synthetic map in the 2nd Embodiment of this invention. 本発明の第2の実施形態における合成マップの生成について説明するためのブロック図である。It is a block diagram for demonstrating the generation of the synthetic map in the 2nd Embodiment of this invention. 遠近競合について説明するための図である。It is a figure for demonstrating the perspective competition. 合成画像のエッジ部にボケ領域が出る一例を説明するための図である。It is a figure for demonstrating an example in which a blurred region appears at the edge part of a composite image.

以下では、添付の図面を参照しながら、本発明の好適な実施形態について詳細に説明する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

(第1の実施形態)
図1は本実施形態に係る画像処理装置としてのデジタルカメラの構造を示すブロック図である。デジタルカメラ100は、静止画を撮像することができ、かつ、合焦位置の情報を記録し、コントラスト値の算出および画像の合成が可能なものである。さらに、デジタルカメラ100は、撮像して保存した画像、または、外部から入力した画像に対して、拡大処理または縮小処理を行うことができる。
(First Embodiment)
FIG. 1 is a block diagram showing a structure of a digital camera as an image processing device according to the present embodiment. The digital camera 100 can capture a still image, record information on the in-focus position, calculate a contrast value, and synthesize an image. Further, the digital camera 100 can perform enlargement processing or reduction processing on an image captured and saved or an image input from the outside.

制御部101は、例えばCPUやMPUなどのシグナルプロセッサであり、予め後述するROM105に内蔵されたプログラムを読み出しながら、デジタルカメラ100の各部分を制御する。たとえば、後述するように、制御部101が、後述する撮像部104に対して撮像の開始と終了について指令を出す。または、後述する画像処理部107に対して、ROM105に内蔵されたプログラムに基づいて、画像処理の指令を出す。ユーザによる指令は、後述する操作部110によってデジタルカメラ100に入力され、制御部101を通して、デジタルカメラ100の各部分に達する。 The 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 built in the ROM 105 described later in advance. For example, as will be described later, the control unit 101 issues a command to the imaging unit 104, which will be described later, regarding the start and end of imaging. Alternatively, an image processing command is issued to the image processing unit 107, which will be described later, based on the 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 drive unit 102 is composed of a motor or the like, and mechanically operates the optical system 103 described later under the command of the control unit 101. For example, based on the command of 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 includes a zoom lens, a focus lens, an aperture, and the like. The diaphragm is a mechanism for adjusting the amount of transmitted light. The focusing 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 electric signal. For example, a CCD sensor, a CMOS sensor, or the like can be applied to the image pickup unit 104. The imaging unit 104 is provided with a moving image imaging mode, and can capture a plurality of temporally continuous images as frames of the moving image.

ROM105は、記録媒体としての読み出し専用の不揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶している。RAM106は、書き換え可能な揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。 The ROM 105 is a read-only non-volatile memory as a recording medium, and stores, in addition to the operation program of each block included in the digital camera 100, parameters and the like necessary for the operation of each block. 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 image pickup unit 104 or the image signal data recorded in the built-in memory 109 described later. .. Further, the image signal data captured by the imaging unit 104 is compressed according to a standard such as JPEG.

画像処理部107は、特定の処理を行う回路を集めた集積回路(ASIC)で構成される。あるいは、制御部101がROM105から読み出したプログラムに従って処理することで、制御部101が画像処理部107の機能の一部または全部を兼用するようにしてもよい。制御部101が画像処理部107の全ての機能を兼用する場合には、画像処理部107をハードウェアとして有する必要はなくなる。 The image processing unit 107 is composed of an integrated circuit (ASIC) that is a collection of circuits that perform specific processing. Alternatively, the control unit 101 may perform processing according to the program read from the ROM 105 so that the control unit 101 also has a part or all of the functions of the image processing unit 107. When the control unit 101 also 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 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 the built-in memory 109 described later, a setting screen of the digital camera 100, or the like. 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 processed by the image processing unit 107, information on the focusing position at the time of image imaging, 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, a switch, a key, a mode dial, or the like attached to the digital camera 100, or a touch panel that is also used as the display unit 108. The command from 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 the generation of the 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 so that the angles of view match. In step S203, the image processing unit 107 synthesizes the image after the alignment is performed, 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 the focus position. For example, the user specifies the focusing position through the touch panel that is also used by the display unit 108, and specifies a plurality of focusing positions at equal intervals before and after the focus position corresponding to the focusing position in the optical axis direction. At the same time, the control unit 101 determines the imaging order in the order of distance at the set focus position.

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

ステップS303で、制御部101は、ステップS301で設定したすべてのピント位置において撮像を行ったかどうかについて判断する。すべてのピント位置に撮像した場合は、図3に示したフローチャートでの処理を終了し、まだ撮像していないピント位置があれば、ステップS302に戻る。 In step S303, the control unit 101 determines whether or not imaging has been performed at all the focus positions set in step S301. When the images are taken at all the focus positions, the process according to the flowchart shown in FIG. 3 is finished, 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 for alignment from the images captured by the imaging unit 104 in step S201. The reference image for alignment shall have the earliest imaging order. Alternatively, since the angle of view changes slightly between the captured images by taking an image while changing the focus position, the angle of view may be the narrowest among the captured images.

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

ステップ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 displacement between the reference image and the target image. An example of the calculation method will be described below. First, the control unit 101 sets a plurality of blocks on the reference image. The control unit 101 is preferably set so that the size of each block is the same. Next, the control unit 101 sets a range wider than the block of the reference image as a search range at the same position as each block of the reference image of the target image. In each search range of the target image, the control unit 101 calculates a corresponding point at which the sum of the absolute differences in brightness from the block of the reference image (Su of Absolute Difference, hereinafter referred to as SAD) is minimized. The control unit 101 calculates the deviation 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. In addition to SAD, the control unit 101 uses Sum of Squared Difference (hereinafter referred to as SSD), normalized cross-correlation (hereinafter referred to as NCC), and the like in the calculation of the corresponding points described above. You may.

ステップS404で、制御部101で、基準画像と対象画像との位置のずれ量から変換係数を算出する。制御部101は、変換係数として、例えば射影変換係数を用いる。ただし、変換係数として射影変換係数だけに限定するわけではなく、アフィン変換係数や水平垂直シフトのみの簡略化した変換係数を用いてもよい。 In step S404, the control unit 101 calculates the conversion coefficient from the amount of displacement between the reference image and the target image. The control unit 101 uses, for example, a projective conversion coefficient as the conversion coefficient. However, the conversion coefficient is not limited to the projection conversion coefficient, and a simplified conversion coefficient of only the affine transformation coefficient or the horizontal / vertical shift 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 be transformed by using the equation shown in (Equation 1).

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

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

図5は、本実施形態におけるステップS203での画像の合成について説明するためのフローチャートである。 FIG. 5 is a flowchart for explaining the composition of images in step S203 in the present embodiment.

ステップ501で、画像処理部107は、位置合わせを行った後のそれぞれの画像(基準画像を含む)に対してコントラスト値を算出する。コントラスト値の算出方法の一例としては、たとえば、まず、画像処理部107は、それぞれの画素の色信号Sr、Sg、Sbから、下記の(式2)を用いて輝度Yを算出する。
Y=0.299Sr+0.587Sg+0.114Sb・・・(式2)
In step 501, the image processing unit 107 calculates the contrast value for each image (including the reference image) after the alignment is performed. As an example of the method of calculating the contrast value, for example, first, the image processing unit 107 calculates the brightness Y from the color signals Sr, Sg, and Sb of each pixel by using the following (Equation 2).
Y = 0.299Sr + 0.587Sg + 0.114Sb ... (Equation 2)

次に、注目画素を含む3×3の画素範囲の輝度Yの行列Lに、下記の(式3)乃至(式5)に示したように、ソーベルフィルタを用いて、注目画素におけるコントラスト値Iを算出する。 Next, as shown in the following (Equation 3) to (Equation 5), the contrast value in the pixel of interest is added to the matrix L of the brightness Y in the pixel range of 3 × 3 including the pixel of interest by using the Sobel filter. Calculate I.

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

ステップS502で、画像処理部107は合成マップを生成する。合成マップの具体的な生成方法は後述する。 In step S502, the image processing unit 107 generates a composite map. The specific method of generating the composite map will be described later.

ステップS503では、画像処理部107は、ステップS502で算出した合成マップに従い、合成画像を生成する。なお、このようにして算出した合成比率に対して、隣接画素間で合成比率が0%から100%に変化(あるいは100%から0%に変化)すると、合成境界での不自然さが目立つようになる。そのため、画像処理部107は、隣接画素間で合成比率が急激に変化しないように、適宜隣接画素間での合成比率を調整する。 In step S503, the image processing unit 107 generates a composite image according to the composite map calculated in step S502. When the composition ratio changes from 0% to 100% (or changes from 100% to 0%) between adjacent pixels with respect to the composition ratio calculated in this way, the unnaturalness at the composition boundary becomes conspicuous. become. Therefore, the image processing unit 107 appropriately adjusts the composition ratio between the adjacent pixels so that the composition ratio does not suddenly change between the adjacent pixels.

<合成マップの生成>
以下では、ステップS502での合成マップの生成について詳細に説明する。
<Generation of composite map>
In the following, the generation of the composite map in step S502 will be described in detail.

図6は、本実施形態におけるステップS502での合成マップの生成について説明するためのフローチャットである。 FIG. 6 is a flow chat for explaining the generation of the composite map in step S502 in the present embodiment.

ステップS601で、画像処理部107は、遠近競合の判断を行う。ステップS602では、画像処理部107は、遠近競合の判断の結果に基づいて、ゲインGain[k]を算出する。遠近競合の判断は、従来技術を用いてよく、詳細は後述する。 In step S601, the image processing unit 107 determines the perspective conflict. In step S602, the image processing unit 107 calculates the gain Gain [k] based on the result of the determination of perspective competition. The conventional technique may be used to determine the perspective competition, and the details will be described later.

ステップS603で、画像処理部107は、ステップS501で算出した各画素に対応するコントラスト値に対してフィルタ処理を行う。フィルタの種類としては、タップ数にて規定される参照範囲内のコントラスト値の最大値を出力するMAXフィルタや平均値フィルタなどが挙げられる。なおかつ、ステップS603で、画像処理部107は、コントラスト値に対してタップ数の異なるフィルタを別々にかけて、コントラスト値を平滑化した複数のデータを得る。ここで説明の便宜上、N[0]、N[1]の2種類のフィルタをかけることとするが、フィルタの数は2つに限らない。N[0]のフィルタのタップ数は、N[1]よりも少ないとする。つまり、N[0]のフィルタの参照範囲は、N[1]よりも狭い。N[0]のフィルタを、スルー出力(入力と出力が同じ信号)にする形態でも良いものとする。 In step S603, the image processing unit 107 performs filter processing on the contrast value corresponding to each pixel calculated in step S501. Examples of the filter type include a MAX filter and an average value filter that output the maximum value of the contrast value within the reference range defined by the number of taps. Moreover, in step S603, the image processing unit 107 separately applies filters having different numbers of taps to the contrast value to obtain a plurality of data in which the contrast value is smoothed. Here, for convenience of explanation, two types of filters, N [0] and N [1], are applied, but the number of filters is not limited to two. It is assumed that the number of taps of the filter of N [0] is smaller than that of N [1]. That is, the reference range of the filter of N [0] is narrower than that of N [1]. The filter of N [0] may be in the form of a through output (a signal having the same input and output).

図7は、本実施形態におけるステップS502での合成マップの生成について説明するためのブロック図である。図7において、コントラスト値701(Cm(x,y))は、座標(x,y)のコントラスト値を意味する。コントラスト値は画素ごとに算出された場合、座標(x,y)が位置するブロックのコントラスト値を座標(x,y)のコントラスト値とする。なお、演算負荷を軽便するために、各画素に対応するコントラスト値に複数のブロックに分割し、ブロックごとの代表コントラスト値(例えば、コントラスト値の平均値)を求めるようにしてもよい。画像処理部107は、Cm(x,y)に対してフィルタ711(N[0])とフィルタ712(N[1])とのそれぞれをかける。このような処理で、後述する評価値の算出のため、コントラスト値の変動をなだらかにし、コントラスト値の山を周辺に広げることができる。 FIG. 7 is a block diagram for explaining the generation of the composite map in step S502 in the present embodiment. In FIG. 7, the contrast value 701 (Cm (x, y)) means the contrast value of the coordinates (x, y). When the contrast value is calculated for each pixel, the contrast value of the block in which the coordinates (x, y) are located is taken as the contrast value of the coordinates (x, y). In order to reduce the calculation load, the contrast value corresponding to each pixel may be divided into a plurality of blocks, and the representative contrast value for each block (for example, the average value of the contrast values) may be obtained. The image processing unit 107 applies the filter 711 (N [0]) and the filter 712 (N [1]) to Cm (x, y), respectively. In such a process, the fluctuation of the contrast value can be smoothed and the peak of the contrast value can be expanded to the periphery for the calculation of the evaluation value described later.

図8は、本実施形態におけるコントラスト値を説明するための図である。以下では、図8を用いてフィルタをかける前後のコントラスト値について説明する。 FIG. 8 is a diagram for explaining the contrast value in the present embodiment. In the following, the contrast values before and after applying the filter will be described with reference to FIG.

図8(a)と図8(b)に示したような一様な模様を有する被写体を撮像する場合について考える。図8(a)は被写体に合焦しているときの撮像画像を示し、図8(b)は被写体に合焦していないときの撮像画像を示している。簡略のため、図8(a)と図8(b)に示した被写体の中心を通るx軸におけるコントラスト値を、一次元的に分析する。 Consider a case where a subject having a uniform pattern as shown in FIGS. 8 (a) and 8 (b) is imaged. FIG. 8A shows a captured image when the subject is in focus, and FIG. 8B shows a captured image when the subject is not in focus. For simplicity, the contrast values on the x-axis passing through the center of the subject shown in FIGS. 8 (a) and 8 (b) are analyzed one-dimensionally.

図8(c)は、図8(a)に示している合焦している被写体のコントラスト値とx軸座標との関係を示し、図8(d)は、図8(b)に示している合焦していない被写体のコントラスト値とx軸座標との関係を示す。図8(a)では、被写体に一様な模様があるので、図8(c)では、x座標が被写体内にあたるとき、コントラスト値が一様の値を示す。一方で、図8(b)のように被写体がボケると、x座標が被写体内にあたるときのコントラスト値が図8(a)と比べて下がる。図8(b)では、被写体の周りにボケが出るので、図8(d)でのコントラスト値が、図8(c)のように両側に急激に下がらず、緩やかに減少している様子を示す。 8 (c) shows the relationship between the contrast value of the in-focus subject shown in FIG. 8 (a) and the x-axis coordinates, and FIG. 8 (d) is shown in FIG. 8 (b). The relationship between the contrast value of the in-focus subject and the x-axis coordinates is shown. Since the subject has a uniform pattern in FIG. 8 (a), the contrast value shows a uniform value when the x-coordinate hits the subject in FIG. 8 (c). On the other hand, when the subject is blurred as shown in FIG. 8B, the contrast value when the x-coordinate hits the inside of the subject is lower than that in FIG. 8A. In FIG. 8 (b), since blurring appears around the subject, the contrast value in FIG. 8 (d) does not decrease sharply on both sides as in FIG. 8 (c), but gradually decreases. Shown.

図8(c)と図8(d)とを比較すると、範囲801のうちでは、図8(c)に示すコントラスト値が図8(d)よりも高く、範囲801の外では、図8(c)に示すコントラスト値が図8(d)よりも低いことがわかる。背景で述べた従来技術を用いて図8(a)と図8(b)とに対して深度合成を行うと、範囲801の外にあたる部分は、図8(b)のボケが合成画像に使われてしまう。 Comparing FIG. 8 (c) and FIG. 8 (d), the contrast value shown in FIG. 8 (c) is higher than that in FIG. 8 (d) in the range 801 and FIG. 8 (d) is outside the range 801. It can be seen that the contrast value shown in c) is lower than that in FIG. 8 (d). When depth composition is performed on FIGS. 8 (a) and 8 (b) using the conventional technique described in the background, the blur of FIG. 8 (b) is used for the composite image in the portion outside the range 801. I will be broken.

図8(e)と図8(f)とのそれぞれは、図8(c)と図8(d)とにフィルタをかけた後のコントラスト値を示すグラフである。図8(e)と図8(f)とは、図8(c)と図8(d)と比べてグラフの形がさらに両側に広がるのがわかる。もともと、図8(c)に示す合焦画像、被写体のコントラスト値は、図8(d)に示すボケ画像よりも高く、それにフィルタをかけた後も、ボケ画像よりも広い範囲で高い。図8(e)と図8(f)とを比較すると、範囲802のうちでは、図8(e)に示すコントラスト値が図8(f)よりも高く、範囲802の外では、図8(e)に示すコントラスト値が図8(f)よりも低いことがわかる。後述する評価値の算出で深度合成を行うと、範囲802の外にあたる部分は、図8(b)のボケが合成画像に使われてしまう。ただし、範囲802は範囲801より広いので、ここで述べた算出された評価値に基づいて作成される合成画像のボケは、前述背景の従来技術で得られる合成画像のボケより少ない。同様に、さらにタップ数の多いフィルタを適用すると、さらにボケの少ない合成画像が得られる。本実施形態では、後述するように、このように異なるタップ数のフィルタをかけてさらにゲインをかけてコントラスト値を調整した結果を評価値として算出し、合成比率を算出する。 8 (e) and 8 (f) are graphs showing the contrast values after filtering the 8 (c) and 8 (d), respectively. It can be seen that the shapes of the graphs of FIGS. 8 (e) and 8 (f) are further expanded to both sides as compared with FIGS. 8 (c) and 8 (d). Originally, the contrast values of the in-focus image and the subject shown in FIG. 8 (c) are higher than those of the blurred image shown in FIG. 8 (d), and even after filtering the blurred image, they are higher in a wider range than the blurred image. Comparing FIG. 8 (e) and FIG. 8 (f), the contrast value shown in FIG. 8 (e) is higher in the range 802 than in FIG. 8 (f), and outside the range 802, FIG. It can be seen that the contrast value shown in e) is lower than that in FIG. 8 (f). When depth composition is performed in the calculation of the evaluation value described later, the blur of FIG. 8B is used in the composite image in the portion outside the range 802. However, since the range 802 is wider than the range 801 the blur of the composite image created based on the evaluation value calculated here is less than the blur of the composite image obtained by the prior art in the background described above. Similarly, if a filter with a larger number of taps is applied, a composite image with even less blur can be obtained. In the present embodiment, as will be described later, the result of adjusting the contrast value by applying a filter having a different number of taps and further applying a gain is calculated as an evaluation value, and the composition ratio is calculated.

このように、コントラスト値に平滑化のためのフィルタを適用することで、エッジ部近傍では、ボケ画像のコントラスト値よりも、ピントが合った画像のコントラスト値が高くなることが期待できる。後述する評価値の算出で、ピントが合った画像の部分の評価値が高く算出され、合成において、ボケ画像よりピントが合った画像が選ばれることが期待できる。 By applying the smoothing filter to the contrast value in this way, it can be expected that the contrast value of the focused image is higher than the contrast value of the blurred image in the vicinity of the edge portion. In the calculation of the evaluation value described later, the evaluation value of the part of the image that is in focus is calculated high, and it can be expected that the image that is in focus is selected from the blurred image in the composition.

ステップS604で、画像処理部107は、ステップS603でフィルタをかけて得られた結果に対して、ゲインGain[k]をかける。たとえば、図7では、画像処理部107は、フィルタ711(N[0])をかけた後の結果に対して、ゲインGain[0]をかけ、フィルタ712(N[1])をかけた後の結果に対して、ゲインGain[1]をかける。 In step S604, the image processing unit 107 applies a gain Gain [k] to the result obtained by filtering in step S603. For example, in FIG. 7, the image processing unit 107 applies a gain Gain [0] to the result after applying the filter 711 (N [0]), and then applies the filter 712 (N [1]). Gain [1] is applied to the result of.

ステップS605で、画像処理部107は、ステップS602でゲインをかけたコントラスト値を統合してm枚目の画像の評価値Em(x,y)を生成する。統合の方法は、ゲインをかけたコントラスト値の加算や加算平均などがあげられる。たとえば、画像処理部107は、図7に示したように、ゲインGain[0]をかけた後のコントラスト値721と、ゲインGain[0]をかけた後のコントラスト値722との加算値を、評価値Em(x,y)とする。または、画像処理部107は、ゲインGain[0]をかけた後のコントラスト値721と、ゲインGain[0]をかけた後のコントラスト値722との加算平均値を、評価値Em(x,y)とする。 In step S605, the image processing unit 107 integrates the contrast values gained in step S602 to generate the evaluation value Em (x, y) of the mth image. Examples of the integration method include addition of contrast values with gain and addition averaging. For example, as shown in FIG. 7, the image processing unit 107 adds a value of the contrast value 721 after the gain Gain [0] is applied and the contrast value 722 after the gain Gain [0] is applied. The evaluation value is Em (x, y). Alternatively, the image processing unit 107 sets the added average value of the contrast value 721 after the gain Gain [0] is applied and the contrast value 722 after the gain Gain [0] is applied as the evaluation value Em (x, y). ).

ステップS606で、制御部101は、すべての画像に対してステップS601乃至S603での処理を行ったかどうかについて判断し、すべての画像が処理済みならステップS605に進む。 In step S606, the control unit 101 determines whether or not the processing in steps S601 to S603 has been performed on all the images, and if all the images have been processed, the process proceeds to step S605.

ステップS607では、画像処理部107は、合成比率を算出する。 In step S607, the image processing unit 107 calculates the composition ratio.

具体的に、m枚目の画像のうち、同じ座標(x,y)に位置する画素のうち、最も評価値の高い画像に100%の合成比率を与える。なお、前述した通り、隣接画素間で急激な変化を生じないように、画像処理部107は、合成比率を適宜に調整してよい。 Specifically, 100% of the composite ratio is given to the image having the highest evaluation value among the pixels located at the same coordinates (x, y) in the mth image. As described above, the image processing unit 107 may appropriately adjust the composition ratio so that a sudden change does not occur between adjacent pixels.

もしくは、画像処理部107は、下記の(式6)に従い、合成比率を算出する。 Alternatively, the image processing unit 107 calculates the composition ratio according to the following (Equation 6).

ただし、(式6)では、Mは画像の枚数を示し、(x,y)は座標を示す。さらに、ステップS503で、(式6)の計算結果を用いて下記の(式7)に代入して合成画像を生成する。 However, in (Equation 6), M indicates the number of images, and (x, y) indicates the coordinates. Further, in step S503, the calculation result of (Equation 6) is used and substituted into the following (Equation 7) to generate a composite image.

ただし、(式7)では、Ik(x,y)は、k枚目の画像の座標(x,y)の画素値を示し、O(x,y)は合成画像の座標(x,y)の画素値を示す。 However, in (Equation 7), Ik (x, y) indicates the pixel value of the coordinates (x, y) of the kth image, and O (x, y) is the coordinates (x, y) of the composite image. Indicates the pixel value of.

また、(式6)の計算において、適宜に変形してもよい。たとえば、(式6)の分母の計算のとき、Em(x,y)の値が所定値以下のものは0とみなしてよい。また、(式6)の右側の計算結果が所定値以上になれば、Amを100%とみなしてもよい。 Further, in the calculation of (Equation 6), it may be appropriately modified. For example, in the calculation of the denominator of (Equation 6), if the value of Em (x, y) is less than or equal to a predetermined value, it may be regarded as 0. Further, if the calculation result on the right side of (Equation 6) becomes a predetermined value or more, Am may be regarded as 100%.

<ゲインの算出>
以下では、ステップS602ゲインGain[k]の算出について詳細に説明する。
<Gain calculation>
In the following, the calculation of step S602 gain Gain [k] will be described in detail.

まず、画像処理部107は、ステップS601で、複数の画像のコントラスト値から、遠近競合が生じたかどうかについて判定する。遠近競合の判定は従来技術を用いてよく、以下では、一例をあげて簡単に説明する。 First, in step S601, the image processing unit 107 determines from the contrast values of the plurality of images whether or not perspective competition has occurred. Conventional techniques may be used to determine perspective competition, which will be briefly described below with an example.

図9は、本実施形態における遠近競合の判定を説明するための図である。図9では、ピント位置の異なる複数の画像の対応する画素のコントラスト値を示している。横軸のピント位置の数字はピント位置とデジタルカメラ100との距離を示している。ピント位置が8のところで、ピント位置とデジタルカメラ100との距離が最も遠く(最無限遠側)、ピント位置が1のところで、ピント位置とデジタルカメラ100との距離が最も近い(最至近側)とする。 FIG. 9 is a diagram for explaining the determination of perspective competition in the present embodiment. FIG. 9 shows the contrast values of the corresponding pixels of a plurality of images having different focus positions. The number of the focus position on the horizontal axis indicates the distance between the focus position and the digital camera 100. When the focus position is 8, the distance between the focus position and the digital camera 100 is the farthest (farthest side), and when the focus position is 1, the distance between the focus position and the digital camera 100 is the shortest (closest side). And.

図9(a)では、ピント位置が2のところで、コントラスト値912が極大値になったことを示している。画像処理部107は、ピント位置が2のところで、被写体に合焦していると判定する。 In FIG. 9A, it is shown that the contrast value 912 has reached the maximum value when the focus position is 2. The image processing unit 107 determines that the subject is in focus when the focus position is 2.

図9(b)では、ピント位置が2と7のところのそれぞれで、コントラスト値922と927が極大値になったことを示している。画像処理部107は、前後2つの被写体に合焦し、遠近競合によるものと判定する。つまり、画像処理部107は、図9(b)のように、2つ以上の極大値が存在する場合、遠近競合が生じたと判定する。 In FIG. 9B, it is shown that the contrast values 922 and 927 have reached the maximum values at the focus positions 2 and 7, respectively. The image processing unit 107 focuses on the two front and rear subjects, and determines that the cause is perspective competition. That is, as shown in FIG. 9B, the image processing unit 107 determines that perspective competition has occurred when two or more maximum values exist.

図9(b)で示したような場合、コントラスト値927はコントラスト値922よりも高いので、仮に画像処理部107はコントラスト値927をもつ画素により高い合成比率を与えると、前述したような遠近競合の課題が生じてしまう。つまり、合成画像において2つの被写体が重なる領域では、遠いほうの被写体が近いほうの被写体に透過してしまう。 In the case shown in FIG. 9B, the contrast value 927 is higher than the contrast value 922. Therefore, if the image processing unit 107 gives a higher composition ratio to the pixel having the contrast value 927, the perspective competition as described above The problem arises. That is, in the region where two subjects overlap in the composite image, the farther subject is transmitted to the closer subject.

なお、図9(c)のように、ほかの極大値と比べて、両側の画素とのコントラスト値の差がきわめて小さい極大値932が存在する場合がある。画像処理部107は、こうした値は、ノイズなどによる影響の可能性が高いと判定する。つまり、画像処理部107は、ピント位置2のところに被写体に合焦していると判定しない。画像処理部107は、予め閾値を設けて、閾値を用いてノイズと極大値とを区別する。 As shown in FIG. 9C, there may be a maximum value of 932 in which the difference in contrast value between the pixels on both sides is extremely small as compared with other maximum values. The image processing unit 107 determines that such a value is highly likely to be affected by noise or the like. That is, the image processing unit 107 does not determine that the subject is in focus at the focus position 2. The image processing unit 107 sets a threshold value in advance and uses the threshold value to distinguish between noise and a maximum value.

ステップS601で、画像処理部107は、以上のような処理をすべての対応する画素に対して行うことで、遠近競合がどこに生じているかを判定する。 In step S601, the image processing unit 107 determines where the perspective conflict is occurring by performing the above processing on all the corresponding pixels.

次に、ステップS602で、画像処理部107は、遠近競合の度合いに基づいて、ゲインを算出する。ここで、遠近競合の度合いを考慮したうえでのゲインの算出が必要である。遠近競合が生じている領域では、単純にコントラストを周囲に広げると、ピント位置の異なる被写体のコントラストが混ざり、後述する評価値の算出を行って合成画像を作成すると、遠近競合がさらに進んでしてしまう可能性もある。この傾向は、遠近競合の度合いが強いほど深刻化する。そのため、画像処理部107は、遠近競合の度合いに基づいて、ゲインを遠近競合の領域以外の領域と異なる方法で算出する。 Next, in step S602, the image processing unit 107 calculates the gain based on the degree of perspective competition. Here, it is necessary to calculate the gain in consideration of the degree of perspective competition. In areas where perspective competition occurs, if the contrast is simply expanded to the surroundings, the contrasts of subjects with different focus positions will be mixed, and if the evaluation value described later is calculated to create a composite image, perspective competition will further advance. There is a possibility that it will end up. This tendency becomes more serious as the degree of perspective competition increases. Therefore, the image processing unit 107 calculates the gain based on the degree of perspective competition by a method different from that of the region other than the perspective competition region.

まず、画像処理部107は、遠近競合の度合いを算出する。一例としては、画像処理部107は、遠近競合が生じる2つの被写体に合焦しているときのコントラスト値の和を遠近競合の度合いとして算出してよい。一般的に、前後2つの被写体に合焦しているときのコントラスト値が高いほど、遠近競合が生じるとき2つの被写体が周囲よりもはっきりと見えるので、遠近競合の度合いが強い。つまり、図9(b)に示しているコントラスト値922と927の和を遠近競合の度合いとする。 First, the image processing unit 107 calculates the degree of perspective competition. As an example, the image processing unit 107 may calculate the sum of the contrast values when the two subjects in which perspective competition occurs are in focus as the degree of perspective competition. In general, the higher the contrast value when the two front and rear subjects are in focus, the stronger the degree of perspective competition is because the two subjects can be seen more clearly than the surroundings when perspective competition occurs. That is, the sum of the contrast values 922 and 927 shown in FIG. 9B is used as the degree of perspective competition.

図10は、本実施形態における遠近競合を説明するための図である。 FIG. 10 is a diagram for explaining perspective competition in the present embodiment.

図10(a)では、デジタルカメラ100が位置1011に存在している被写体1001を撮像する様子を示している。この場合では、位置1012には被写体が存在していない。 FIG. 10A shows a state in which the digital camera 100 images the subject 1001 existing at the position 1011. In this case, there is no subject at position 1012.

図10(b)では、デジタルカメラ100が位置1011に存在している被写体1001と位置1012に存在している被写体1002とを撮像する様子を示している。 FIG. 10B shows how the digital camera 100 images the subject 1001 existing at the position 1011 and the subject 1002 existing at the position 1012.

図10(c)は、図10(c)の場合で、デジタルカメラ100が位置1011と位置1012とのそれぞれにピントを合わせるときに撮像した画像を示している。デジタルカメラ100が位置1011にピントを合わせるとき(前ピンのとき)、被写体1001がはっきりに見え、デジタルカメラ100が位置1012にピントを合わせるとき(後ピンのとき)、被写体1001がボケる様子がわかる。 FIG. 10 (c) shows an image captured when the digital camera 100 focuses on each of the positions 1011 and 1012 in the case of FIG. 10 (c). When the digital camera 100 focuses on the position 1011 (when the front focus is on), the subject 1001 is clearly visible, and when the digital camera 100 focuses on the position 1012 (when the rear focus is on), the subject 1001 is out of focus. Understand.

図10(d)は、図10(b)の場合で、デジタルカメラ100が位置1011と位置1012とのそれぞれにピントを合わせるときに撮像した画像を示している。デジタルカメラ100が位置1011にピントを合わせるとき(前ピンのとき)、被写体1001がはっきりに見え、被写体1002がボケる。同様に、デジタルカメラ100が位置1011にピントを合わせるとき(前ピンのとき)、被写体1001がはっきりに見え、被写体1002がボケる。さらに、図10(d)では、遠近競合が生じている様子を示している。デジタルカメラ100が位置1011にピントが合わせているとき、被写体1001が被写体1002の手前側に位置するように見える。しかし、デジタルカメラ100が位置1012にピントが合わせているとき、被写体1001が被写体1002の奥側に位置するように見える。 FIG. 10D shows an image captured when the digital camera 100 focuses on the position 1011 and the position 1012 in the case of FIG. 10B. When the digital camera 100 focuses on the position 1011 (when the front focus is on), the subject 1001 is clearly visible and the subject 1002 is out of focus. Similarly, when the digital camera 100 focuses on the position 1011 (when the front focus is on), the subject 1001 is clearly visible and the subject 1002 is out of focus. Further, FIG. 10D shows a state in which perspective competition is occurring. When the digital camera 100 is in focus at the position 1011 the subject 1001 appears to be located in front of the subject 1002. However, when the digital camera 100 is in focus at the position 1012, the subject 1001 appears to be located behind the subject 1002.

なお、図10(c)および図10(d)におけるぼけている被写体の像のサイズは、誇張されて描かれている。 The size of the blurred subject image in FIGS. 10 (c) and 10 (d) is exaggerated.

図11は、本実施形態における遠近競合の有無とコントラスト値の変化との関係を説明するためのグラフである。図11(a)は、図10(c)に示す画像、つまり遠近競合が起きている場合に対応し、図11(b)は、図10(d)に示す画像、つまり遠近競合が起きている場合に対応する。図11(a)および図11(b)のグラフは、コントラスト値とx軸との関係を示している。x軸とは、図10(c)および図10(d)に示したx軸に対応し、原点0も互いに対応している。 FIG. 11 is a graph for explaining the relationship between the presence / absence of perspective competition and the change in contrast value in the present embodiment. FIG. 11 (a) corresponds to the image shown in FIG. 10 (c), that is, when perspective conflict occurs, and FIG. 11 (b) shows the image shown in FIG. 10 (d), that is, perspective conflict occurs. Correspond if there is. The graphs of FIGS. 11 (a) and 11 (b) show the relationship between the contrast value and the x-axis. The x-axis corresponds to the x-axis shown in FIGS. 10 (c) and 10 (d), and the origin 0 also corresponds to each other.

図11(a)は、曲線1101と1102とがフィルタをかける前の前ピンと後ピンとの場合のコントラスト値を示す。曲線1103と1104とがフィルタをかけた後の前ピンと後ピンとの場合のコントラスト値を示す。図11(a)から見れば、フィルタをかける前に、一部の領域において、曲線1101のコントラスト値が曲線1102に下回るが、フィルタをかけた後、曲線1103が完全に曲線1104の上にあると見える。つまり、フィルタをかけることによって、エッジ部の周辺にボケ領域が生じるという課題が解消される。 FIG. 11A shows the contrast values of the front and rear pins before the curves 1101 and 1102 are filtered. Curves 1103 and 1104 show the contrast values of the front and rear pins after filtering. As seen from FIG. 11A, the contrast value of curve 1101 falls below curve 1102 in some areas before filtering, but after filtering, curve 1103 is completely above curve 1104. It looks like. That is, by applying the filter, the problem that a blurred region is generated around the edge portion is solved.

図11(b)は、曲線1111と1112とがフィルタをかける前の前ピンと後ピンとの場合のコントラスト値を示す。曲線1113と1114とがフィルタをかけた後の前ピンと後ピンとの場合のコントラスト値を示す。図11(b)から見れば、フィルタをかける前に、領域1115において、曲線1111のコントラスト値が曲線1112に下回る。しかし、フィルタをかけた後は、領域1115において、曲線1114が曲線1113に下回ってしまうことがわかる。もともと、領域1115は被写体1001が写らないが、曲線1113と曲線1114との通りに合成を行うとき、被写体1001のボケ部分が領域1115に使われて、ボケが解消されない合成画像になってしまう。 FIG. 11B shows the contrast values of the front and rear pins before the curves 1111 and 1112 are filtered. Curves 1113 and 1114 show the contrast values for the front and rear pins after filtering. As seen from FIG. 11B, the contrast value of curve 1111 falls below curve 1112 in region 1115 before filtering. However, it can be seen that after filtering, the curve 1114 falls below the curve 1113 in the region 1115. Originally, the subject 1001 is not captured in the region 1115, but when compositing according to the curve 1113 and the curve 1114, the blurred portion of the subject 1001 is used for the region 1115, resulting in a composite image in which the blur is not eliminated.

以上に示しているように、遠近競合のせいで、フィルタをかけることによって、エッジ部の周辺にボケ領域が生じるということが解消されず、逆に悪化してしまう可能性が示されている。このため、遠近競合が生じる場合、通常と異なる方法でフィルタをかける必要がある。 As shown above, it has been shown that due to perspective competition, filtering does not eliminate the occurrence of a blurred region around the edge portion, but conversely worsens it. For this reason, when perspective contention occurs, it is necessary to filter in a different way than usual.

図12は、本実施形態におけるゲインと遠近競合の度合いとの関係を示すグラフである。図12(a)はk=0の場合を示し、図12(b)はk=1の場合を示す。遠近競合の度合いが強いほど、コントラスト値を広げると遠近競合が進んでしまう可能性があるので、ゲインを小さくすることで遠近競合の抑制を図る。 FIG. 12 is a graph showing the relationship between the gain and the degree of perspective competition in the present embodiment. FIG. 12A shows the case of k = 0, and FIG. 12B shows the case of k = 1. The stronger the degree of perspective competition, the more the perspective competition may progress when the contrast value is widened. Therefore, the perspective competition is suppressed by reducing the gain.

なお、タップ数が大きいフィルタほど、ピントが合った画像のフィルタをかけた後のコントラスト値がより広く、なだらかになるので、タップ数の大きいフィルタほど、ゲインを大きくする。つまり、ゲインGain[k]において、kが高いほど、図12におけるg_maxを高くする必要がある。 Note that the larger the number of taps, the wider the contrast value after filtering the in-focus image and the smoother the contrast value. Therefore, the larger the number of taps, the larger the gain. That is, in the gain Gain [k], the higher k, the higher g_max in FIG. 12 needs to be.

また、遠近競合が生じた領域において、画像処理部107は、ピント位置によって、ゲインを適宜に調整してよい。前述した通り、遠近競合の現象を緩和するために、コントラスト値に重みづけ係数をかけてから合成比率を決めることがある。同一位置の合焦している複数の画素のうち、遠いほうの画素を透過させないために、近いほうの画素の合成比率を適宜にあげてもよい。本実施形態においては、画像処理部107は、遠近競合の領域において、ピント位置の近い画素にかけた重みづけ係数をさらに高めることで、遠近競合を防ぐ効果がより一層上がる。 Further, in the region where perspective competition occurs, the image processing unit 107 may appropriately adjust the gain depending on the focus position. As described above, in order to alleviate the phenomenon of perspective competition, the contrast value may be multiplied by a weighting coefficient before the composition ratio is determined. Of the plurality of pixels in focus at the same position, the composition ratio of the closer pixel may be appropriately increased so that the farther pixel is not transmitted. In the present embodiment, the image processing unit 107 further increases the weighting coefficient applied to the pixels having close focus positions in the perspective competition region, so that the effect of preventing perspective competition is further enhanced.

以上のように、画像処理部107は、遠近競合を判定し、ゲインGain[k]を算出する。ここで算出したゲインGain[k]をステップS604に用いる。 As described above, the image processing unit 107 determines the perspective competition and calculates the gain Gain [k]. The gain Gain [k] calculated here is used in step S604.

第1の実施形態によれば、タップ数の異なるフィルタをかけた出力に対して、遠近競合を考慮したうえでゲインをかけて統合した評価値を用いて合成画像を生成することで、エッジ部のボケの程度の低減とともに、遠近競合の悪化を防げる。 According to the first embodiment, the edge portion is generated by generating a composite image using the evaluation values integrated by applying a gain to the output filtered with different tap numbers in consideration of perspective competition. It is possible to reduce the degree of blurring and prevent the deterioration of perspective competition.

(第2の実施形態)
第1の実施形態では、コントラストを周辺画素まで広げる処理をタップ数の異なるフィルタで実現したが、第2の実施形態では、多重解像度画像を用いてコントラストを周辺画素まで広げる。以下では、第2の実施形態について、第1の実施形態と異なる所を中心に説明する。なお、第1の実施形態と同様な所は省略する。
(Second Embodiment)
In the first embodiment, the process of expanding the contrast to the peripheral pixels is realized by filters having different taps, but in the second embodiment, the contrast is expanded to the peripheral pixels by using a multi-resolution image. Hereinafter, the second embodiment will be described focusing on the points different from those of the first embodiment. The same parts as in the first embodiment will be omitted.

第2の実施形態のフローは、第1の実施形態の図2乃至図5と同様である。しかし、第2の実施形態におけるステップS502での合成マップの生成は、第1の実施形態と異なる。 The flow of the second embodiment is the same as that of FIGS. 2 to 5 of the first embodiment. However, the generation of the composite map in step S502 in the second embodiment is different from that in the first embodiment.

図13は、第2の実施形態におけるステップS502での合成マップの生成について説明するためのフローチャートである。図14は、第2の実施形態におけるステップS502での合成マップの生成について説明するためのブロック図である。 FIG. 13 is a flowchart for explaining the generation of the composite map in step S502 in the second embodiment. FIG. 14 is a block diagram for explaining the generation of the composite map in step S502 in the second embodiment.

ステップS1301では、画像処理部107は、ステップS501で算出したコントラスト値に対して、縮小率が異なる縮小部1411(縮小率1/L[0])、1412で縮小処理(縮小率1/L[1])を行う。縮小部1411の出力は拡大部1421(拡大率L[0])、縮小部1412の出力は拡大部1422(拡大率L[1])で拡大処理を行う。L[1]はL[0]より数値が大きいことを示す。また、図14は2個の縮小部と2個の拡大部を例にしているが、その数に制約はないものとする。また、縮小部1411、拡大部1421をスルー出力(入力と出力が同じ信号)にする形態でも良いものとする。このように、逆数である縮小率と拡大率を用いることで、1つの縮小拡大処理を経て画像が元のサイズに戻れる。 In step S1301, the image processing unit 107 reduces the contrast value calculated in step S501 by reducing the reduction ratio 1411 (reduction ratio 1 / L [0]) and 1412 (reduction ratio 1 / L [0]). 1]) is performed. The output of the reduction unit 1411 is enlarged by the enlargement unit 1421 (enlargement ratio L [0]), and the output of the reduction unit 1412 is enlarged by the expansion unit 1422 (enlargement ratio L [1]). L [1] indicates that the numerical value is larger than L [0]. Further, although FIG. 14 shows an example of two reduction portions and two enlargement portions, it is assumed that the number of the reduction portions is not limited. Further, the reduction unit 1411 and the expansion unit 1421 may be set to through output (signals having the same input and output). In this way, by using the reciprocals of the reduction ratio and the enlargement ratio, the image can be returned to the original size through one reduction / enlargement process.

前述した並行する縮小拡大処理により、第1の実施形態と同様に、検出したコントラスト値を、その周辺領域に広げることができる。したがって、エッジ部のボケが発生している画素のコントラスト値よりも、ピントが合った画像のコントラスト値が高くなり、ピントが合った画像が出力しやすくなる。 By the parallel reduction / enlargement processing described above, the detected contrast value can be expanded to the peripheral region thereof, as in the first embodiment. Therefore, the contrast value of the in-focus image is higher than the contrast value of the pixel in which the edge portion is blurred, and the in-focus image can be easily output.

また、縮小や拡大の方法に関してはニアレストネイバー、バイリニア、バイキュービック等を用いることが可能だが、算出したコントラストを周辺画素に広げることができれば、これらの方法以外でも良い。 Nearest neighbor, bilinear, bicubic, etc. can be used for the reduction and enlargement methods, but other methods may be used as long as the calculated contrast can be expanded to the peripheral pixels.

ここで、第1の実施形態と同様に、遠近競合が生じている領域について、遠近競合の度合いが強いほど、ゲインを小さくする。これにより、縮小拡大の処理で遠近競合が悪化することを防ぐ。 Here, as in the first embodiment, the gain is reduced as the degree of perspective competition is stronger in the region where perspective competition is occurring. This prevents the perspective competition from getting worse in the reduction / enlargement process.

ステップS1305以降の処理(ゲインをかける処理から合成画像を生成する処理まで)は第1の実施形態と同様であるため省略する。 The processes after step S1305 (from the process of applying the gain to the process of generating the composite image) are the same as those of the first embodiment and are omitted.

第1の実施形態によれば、多重解像度画像を用いた処理を経て、遠近競合を考慮したうえでゲインをかけて統合した評価値を用いて合成画像を生成ことで、エッジ部のボケの程度の低減とともに、遠近競合の悪化を防げる。 According to the first embodiment, the degree of blurring of the edge portion is obtained by generating a composite image using the evaluation values integrated by applying gain after processing using the multi-resolution image and considering the perspective competition. And prevent the deterioration of perspective competition.

(その他の実施形態)
なお、上記実施形態においては、個人向けのデジタルカメラをもとに説明を行ったが、深度合成の機能を搭載していれば、携帯機器やスマートフォン、あるいは、サーバーに接続されたネットワークカメラなどに適用することも可能である。または、前述した処理の一部を、携帯機器やスマートフォン、あるいは、サーバーに接続されたネットワークカメラなどに行わせてもよい。
(Other embodiments)
In the above embodiment, the explanation was given based on a digital camera for individuals, but if it is equipped with a depth synthesis function, it can be used for mobile devices, smartphones, network cameras connected to servers, and the like. It is also possible to apply. Alternatively, a part of the above-mentioned processing may be performed on a mobile device, a smartphone, a network camera connected to a server, or the like.

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

100 デジタルカメラ
101 制御部
102 駆動部
103 光学系
104 撮像部
105 ROM
106 RAM
107 画像処理部
108 表示部
109 内蔵メモリ
110 操作部
100 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 (20)

複数の画像のコントラスト値を検出する検出手段と、
前記複数の画像の前記コントラスト値に基づいて、遠近競合の度合いの判定を行う判定手段と、
前記判定手段が前記判定を行った後の前記複数の画像の少なくとも一部の画像のそれぞれにおけるエッジ部のコントラスト値の変化を滑らかになるように、該画像のコントラスト値に対して第1の調整を行い、複数の調整の結果を生成する第1の調整手段と、
前記第1の調整手段が前記第1の調整を行った後のコントラスト値を有する前記画像のそれぞれにおいて、前記遠近競合の度合いがより強い位置に、より小さくなるようなゲインを算出し、前記ゲインを前記複数の調整の結果にかけてから統合した値を生成するように第2の調整を行う第2の調整手段であって、1つの前記画像の1つの前記位置に対して1つの前記統合した値を生成する第2の調整手段と、
前記複数の画像のそれぞれに対応する位置の前記統合した値に応じて、前記複数の画像の合成比率を設定する設定手段と、
前記合成比率に基づいて、前記複数の画像に対して合成を行い、合成画像を生成する生成手段と、を有する画像処理装置。
A detection means that detects the contrast values of multiple images,
A determination means for determining the degree of perspective competition based on the contrast values of the plurality of images, and
The first adjustment with respect to the contrast value of the image so that the determination means smoothes the change in the contrast value of the edge portion in each of at least a part of the images of the plurality of images after the determination is made. And the first adjustment means to generate the result of multiple adjustments,
In each of the images having the contrast value after the first adjustment means performs the first adjustment, a gain is calculated so that the degree of perspective competition becomes smaller at a position where the degree of perspective competition is stronger, and the gain is calculated. Is a second adjusting means for making a second adjustment so as to generate an integrated value after applying the results of the plurality of adjustments, and one said integrated value with respect to one said position of one said image. A second adjustment means to generate
A setting means for setting the composition ratio of the plurality of images according to the integrated value of the position corresponding to each of the plurality of images, and
An image processing apparatus comprising a generation means for generating a composite image by synthesizing the plurality of images based on the composite ratio.
前記第1の調整手段が前記第1の調整を行った後に前記生成手段が生成した合成画像は、前記第1の調整手段が前記第1の調整を行わずに前記生成手段が生成した合成画像よりもエッジ部におけるボケの程度が弱いことを特徴とする請求項1に記載の画像処理装置。 The composite image generated by the generation means after the first adjusting means performs the first adjustment is a composite image generated by the generation means without the first adjusting means performing the first adjustment. The image processing apparatus according to claim 1, wherein the degree of blurring at the edge portion is weaker than that of the image processing apparatus. 前記複数の画像は少なくとも一部の画角が重なることを特徴とする請求項1または2に記載の画像処理装置。 The image processing apparatus according to claim 1 or 2, wherein at least a part of the angles of view of the plurality of images overlap. 前記対応する位置は、前記生成手段が前記合成のために、前記複数の画像を画角が一致するように位置合わせした際に、重なる位置であることを特徴とする請求項3に記載の画像処理装置。 The image according to claim 3, wherein the corresponding position is an overlapping position when the generation means aligns the plurality of images so that the angles of view match for the purpose of compositing. Processing equipment. 前記判定手段は、前記複数の画像のそれぞれ対応する位置の前記コントラスト値を比較することによって、前記遠近競合の度合いを判定することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。 The determination means according to any one of claims 1 to 4, wherein the determination means determines the degree of perspective competition by comparing the contrast values at the corresponding positions of the plurality of images. Image processing device. 前記判定手段は、前記複数の画像のそれぞれ対応する位置の前記コントラスト値をピント位置の順番に並べたときに、前記コントラストの極大値が2つ以上であれば、該位置に遠近競合が生じたと判定することを特徴とする請求項5に記載の画像処理装置。 According to the determination means, when the contrast values at the corresponding positions of the plurality of images are arranged in the order of the focus position, if the maximum value of the contrast is two or more, perspective competition has occurred at the position. The image processing apparatus according to claim 5, wherein the determination is made. 前記極大値は該極大値の両側の前記コントラスト値との差が予め定められた閾値よりも大きいことを特徴とする請求項6に記載の画像処理装置。 The image processing apparatus according to claim 6, wherein the maximum value has a difference between the maximum value and the contrast value on both sides of the maximum value being larger than a predetermined threshold value. 前記判定手段が、前記極大値の前記コントラスト値と該極大値の両側の前記コントラスト値との差に基づいて、前記遠近競合の度合いについて判定することを特徴とする請求項7に記載の画像処理装置。 The image processing according to claim 7, wherein the determination means determines the degree of perspective competition based on the difference between the contrast value of the maximum value and the contrast values on both sides of the maximum value. apparatus. 前記第1の調整手段が前記第1の調整を行った後の被写体に合焦している画像の該被写体のエッジ部のボケの前記コントラスト値は、前記第1の調整を行った後の該被写体に合焦していない画像の該被写体のエッジ部のボケの対応する位置の前記コントラスト値よりも高いことを特徴とする請求項1乃至8のいずれか1項に記載の画像処理装置。 The contrast value of the blur of the edge portion of the subject in the image in which the first adjusting means is in focus on the subject after the first adjustment is the contrast value after the first adjustment is performed. The image processing apparatus according to any one of claims 1 to 8, wherein the image processing device according to any one of claims 1 to 8 is characterized in that the contrast value of the position corresponding to the blur of the edge portion of the subject is higher than the contrast value of the image out of focus on the subject. 前記設定手段は、前記複数の画像のそれぞれにおいて対応する位置のコントラスト値のうち、より高いコントラスト値の画像に対してより大きい合成比率を設定することを特徴とする請求項1乃至9のいずれか1項に記載の画像処理装置。 Any of claims 1 to 9, wherein the setting means sets a larger composition ratio for an image having a higher contrast value among the contrast values of the corresponding positions in each of the plurality of images. The image processing apparatus according to item 1. 前記第1の調整手段は、異なる参照範囲を持つ複数のフィルタを用いて前記コントラスト値に対して前記第1の調整を行うことを特徴とする請求項1乃至10のいずれか1項に記載の画像処理装置。 The first adjustment means according to any one of claims 1 to 10, wherein the first adjustment means makes the first adjustment with respect to the contrast value using a plurality of filters having different reference ranges. Image processing device. 前記第2の調整手段は、前記フィルタの参照範囲に応じて該フィルタをかけた後のコントラスト値にかける前記ゲインを算出することを特徴とする請求項11に記載の画像処理装置。 The image processing apparatus according to claim 11, wherein the second adjusting means calculates the gain applied to the contrast value after applying the filter according to the reference range of the filter. 前記第2の調整手段が第1の参照範囲を持つ前記フィルタをかけた後のコントラスト値にかける前記ゲインが、前記第2の調整手段が前記第1の参照範囲よりも狭い第2の参照範囲を持つ前記フィルタをかけた後のコントラスト値にかける前記ゲインよりも大きいことを特徴とする請求項12に記載の画像処理装置。 A second reference range in which the gain applied to the contrast value after the filter by the second adjusting means has a first reference range is narrower than that of the first reference range. The image processing apparatus according to claim 12, wherein the gain is larger than the gain applied to the contrast value after applying the filter. 前記第1の調整手段は、前記画像のコントラスト値に対して複数の並行する縮小拡大処理を行って前記コントラスト値を調整することを特徴とする請求項1乃至10のいずれか1項に記載の画像処理装置。 The first adjustment means according to any one of claims 1 to 10, wherein the first adjusting means adjusts the contrast value by performing a plurality of parallel reduction / enlargement processing on the contrast value of the image. Image processing device. 前記複数の並行する縮小拡大処理で用いられる縮小率と拡大率とは逆数であることを特徴とする請求項14に記載の画像処理装置。 The image processing apparatus according to claim 14, wherein the reduction ratio and the enlargement ratio used in the plurality of parallel reduction / enlargement processes are reciprocals. 前記第2の調整手段は、前記縮小拡大処理に用いられる拡大率に応じて前記縮小拡大処理を行った後の前記コントラスト値にかける前記ゲインを算出することを特徴とする請求項14または15に記載の画像処理装置。 14. The second adjusting means according to claim 14 or 15, wherein the second adjusting means calculates the gain applied to the contrast value after the reduction / enlargement processing is performed according to the enlargement ratio used for the reduction / enlargement processing. The image processing apparatus described. 前記第2の調整手段が第1の拡大率を有する拡大処理をしたコントラスト値を有する画像の前記コントラスト値にかけた前記ゲインは、前記第2の調整手段が前記第1の拡大率よりも小さい第2の拡大率を有する拡大処理をしたコントラスト値を有する画像の前記コントラスト値にかけた前記ゲインよりも大きいことを特徴とする請求項16に記載の画像処理装置。 The second adjusting means said gain the subjected to the contrast value of the image having a contrast value of the enlargement process having a first magnification, the second adjusting means is smaller than said first magnification rate the image processing apparatus according to claim 16, wherein greater than the gain applied to the contrast value of the image having a contrast value of the enlargement process with two magnification. 複数の画像を撮像する撮像手段と、
前記複数の画像のコントラスト値を検出する検出手段と、
前記複数の画像の前記コントラスト値に基づいて、遠近競合の度合いの判定を行う判定手段と、
前記判定手段が前記判定を行った後の前記複数の画像の少なくとも一部の画像のそれぞれにおけるエッジ部のコントラスト値の変化を滑らかになるように、該画像のコントラスト値に対して第1の調整を行い、複数の調整の結果を生成する第1の調整手段と、
前記第1の調整手段が前記第1の調整を行った後のコントラスト値を有する前記画像のそれぞれにおいて、前記遠近競合の度合いがより強い位置に、より小さくなるようなゲインを算出し、前記ゲインを前記複数の調整の結果にかけてから統合した値を生成するように第2の調整を行う第2の調整手段であって、1つの前記画像の1つの前記位置に対して1つの前記統合した値を生成する第2の調整手段と、
前記複数の画像のそれぞれに対応する位置の前記統合した値に応じて、前記複数の画像の合成比率を設定する設定手段と、
前記合成比率に基づいて、前記複数の画像に対して合成を行い、合成画像を生成する生成手段と、を有する撮像装置。
An imaging means that captures multiple images and
A detection means for detecting the contrast values of the plurality of images, and
A determination means for determining the degree of perspective competition based on the contrast values of the plurality of images, and
The first adjustment with respect to the contrast value of the image so that the determination means smoothes the change in the contrast value of the edge portion in each of at least a part of the images of the plurality of images after the determination is made. And the first adjustment means to generate the result of multiple adjustments,
In each of the images having the contrast value after the first adjustment means performs the first adjustment, a gain is calculated so that the degree of perspective competition becomes smaller at a position where the degree of perspective competition is stronger, and the gain is calculated. Is a second adjusting means for making a second adjustment so as to generate an integrated value after applying the results of the plurality of adjustments, and one said integrated value with respect to one said position of one said image. A second adjustment means to generate
A setting means for setting the composition ratio of the plurality of images according to the integrated value of the position corresponding to each of the plurality of images, and
An imaging device having a generation means for generating a composite image by synthesizing the plurality of images based on the composite ratio.
複数の画像のコントラスト値を検出する検出ステップと、
前記複数の画像の前記コントラスト値に基づいて、遠近競合の度合いの判定を行う判定ステップと、
前記判定ステップにおいて前記判定を行った後の前記複数の画像の少なくとも一部の画像のそれぞれにおけるエッジ部のコントラスト値の変化を滑らかになるように、該画像のコントラスト値に対して第1の調整を行い、複数の調整の結果を生成する第1の調整ステップと、
前記第1の調整ステップにおいて前記第1の調整を行った後のコントラスト値を有する前記画像のそれぞれにおいて、前記遠近競合の度合いがより強い位置に、より小さくなるようなゲインを算出し、前記ゲインを前記複数の調整の結果にかけてから統合した値を生成するように第2の調整を行う第2の調整ステップであって、1つの前記画像の1つの前記位置に対して1つの前記統合した値を生成する第2の調整ステップと、
前記複数の画像のそれぞれに対応する位置の前記統合した値に応じて、前記複数の画像の合成比率を設定する設定ステップと、
前記合成比率に基づいて、前記複数の画像に対して合成を行い、合成画像を生成する生成ステップと、を有する画像処理方法。
A detection step that detects the contrast values of multiple images,
A determination step for determining the degree of perspective competition based on the contrast values of the plurality of images, and
The first adjustment with respect to the contrast value of the image so that the change of the contrast value of the edge portion in each of at least a part of the images of the plurality of images after the determination is performed in the determination step is smooth. And the first adjustment step, which produces the results of multiple adjustments,
In each of the images having the contrast value after the first adjustment is performed in the first adjustment step, a gain is calculated so that the degree of perspective competition becomes smaller at a position where the degree of perspective competition is stronger, and the gain is calculated. Is a second adjustment step in which the second adjustment is performed so as to generate an integrated value after applying the results of the plurality of adjustments, and one said integrated value with respect to one said position of one said image. The second adjustment step to generate
A setting step of setting the composition ratio of the plurality of images according to the integrated value of the position corresponding to each of the plurality of images, and
An image processing method comprising a generation step of performing composition on a plurality of images based on the composition ratio to generate a composite image.
画像処理装置のコンピュータに動作させるコンピュータのプログラムであって、
複数の画像のコントラスト値を検出する検出ステップと、
前記複数の画像の前記コントラスト値に基づいて、遠近競合の度合いの判定を行う判定ステップと、
前記判定ステップにおいて前記判定を行った後の前記複数の画像の少なくとも一部の画像のそれぞれにおけるエッジ部のコントラスト値の変化を滑らかになるように、該画像のコントラスト値に対して第1の調整を行い、複数の調整の結果を生成する第1の調整ステップと、
前記第1の調整ステップにおいて前記第1の調整を行った後のコントラスト値を有する前記画像のそれぞれにおいて、前記遠近競合の度合いがより強い位置に、より小さくなるようなゲインを算出し、前記ゲインを前記複数の調整の結果にかけてから統合した値を生成するように第2の調整を行う第2の調整ステップであって、1つの前記画像の1つの前記位置に対して1つの前記統合した値を生成する第2の調整ステップと、
前記複数の画像のそれぞれに対応する位置の前記統合した値に応じて、前記複数の画像の合成比率を設定する設定ステップと、
前記合成比率に基づいて、前記複数の画像に対して合成を行い、合成画像を生成する生成ステップと、を行わせるコンピュータのプログラム。
A computer program that runs on the computer of an image processing device.
A detection step that detects the contrast values of multiple images,
A determination step for determining the degree of perspective competition based on the contrast values of the plurality of images, and
The first adjustment with respect to the contrast value of the image so that the change of the contrast value of the edge portion in each of at least a part of the images of the plurality of images after the determination is performed in the determination step is smooth. And the first adjustment step, which produces the results of multiple adjustments,
In each of the images having the contrast value after the first adjustment is performed in the first adjustment step, a gain is calculated so that the degree of perspective competition becomes smaller at a position where the degree of perspective competition is stronger, and the gain is calculated. Is a second adjustment step in which the second adjustment is performed so as to generate an integrated value after applying the results of the plurality of adjustments, and one said integrated value with respect to one said position of one said image. The second adjustment step to generate
A setting step of setting the composition ratio of the plurality of images according to the integrated value of the position corresponding to each of the plurality of images, and
A computer program that performs a generation step of synthesizing a plurality of images based on the composition ratio and generating a composite image.
JP2018242851A 2018-06-26 2018-12-26 Image processing equipment, imaging equipment, image processing methods and programs Active JP6818734B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018121365 2018-06-26
JP2018121365 2018-06-26

Publications (2)

Publication Number Publication Date
JP2020005243A JP2020005243A (en) 2020-01-09
JP6818734B2 true JP6818734B2 (en) 2021-01-20

Family

ID=69100734

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018242851A Active JP6818734B2 (en) 2018-06-26 2018-12-26 Image processing equipment, imaging equipment, image processing methods and programs

Country Status (1)

Country Link
JP (1) JP6818734B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4261743B2 (en) * 1999-07-09 2009-04-30 株式会社日立製作所 Charged particle beam equipment
CN101191719A (en) * 2006-12-01 2008-06-04 鸿富锦精密工业(深圳)有限公司 Image focal point synthetic system and method
JP6786311B2 (en) * 2016-08-31 2020-11-18 キヤノン株式会社 Image processing equipment, image processing methods, computer programs and storage media

Also Published As

Publication number Publication date
JP2020005243A (en) 2020-01-09

Similar Documents

Publication Publication Date Title
US11546518B2 (en) Dual aperture zoom camera with video support and switching / non-switching dynamic control
WO2021073331A1 (en) Zoom blurred image acquiring method and device based on terminal device
US8023000B2 (en) Image pickup apparatus, image processing apparatus, image pickup method, and image processing method
JP6436783B2 (en) Image processing apparatus, imaging apparatus, image processing method, program, and storage medium
JP6838994B2 (en) Imaging device, control method and program of imaging device
JP2005210217A (en) Stereoscopic camera
JP6786311B2 (en) Image processing equipment, image processing methods, computer programs and storage media
JP2018174502A (en) Imaging apparatus, image processing apparatus, control method of imaging apparatus, and program
JP6261205B2 (en) Image processing device
JP6818734B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP6961423B2 (en) Image processing equipment, imaging equipment, control methods for image processing equipment, programs and recording media
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
JP7458769B2 (en) Image processing device, imaging device, image processing method, program and recording medium
CN111698389A (en) Image processing apparatus, image capturing apparatus, image processing method, and storage 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
JP7409604B2 (en) Image processing device, imaging device, image processing method, program and recording medium
JP6637242B2 (en) Image processing apparatus, imaging apparatus, program, and image processing method
JP6833772B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP2024002631A (en) Image processing device, imaging apparatus, image processing method, computer program, and recording medium
JP2024036872A (en) Imaging device, imaging method, program and recording medium
JP2022077591A (en) Image processing apparatus, image processing method, imaging apparatus, program and recording medium
JP2021121067A (en) Image processing device, imaging apparatus, image processing method, program, and recording medium
JP2020136866A (en) Imaging apparatus, imaging method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191004

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200721

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200902

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200915

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201111

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201228

R151 Written notification of patent or utility model registration

Ref document number: 6818734

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151