JP6639155B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6639155B2
JP6639155B2 JP2015169355A JP2015169355A JP6639155B2 JP 6639155 B2 JP6639155 B2 JP 6639155B2 JP 2015169355 A JP2015169355 A JP 2015169355A JP 2015169355 A JP2015169355 A JP 2015169355A JP 6639155 B2 JP6639155 B2 JP 6639155B2
Authority
JP
Japan
Prior art keywords
size
distance
evaluation frame
images
evaluation
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
JP2015169355A
Other languages
Japanese (ja)
Other versions
JP2017044983A (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
Priority to JP2015169355A priority Critical patent/JP6639155B2/en
Publication of JP2017044983A publication Critical patent/JP2017044983A/en
Application granted granted Critical
Publication of JP6639155B2 publication Critical patent/JP6639155B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置及び画像処理方法に関する。   The present invention relates to an image processing device and an image processing method.

撮像された複数の画像を用いて、被写体までの距離情報を取得することが提案されている。具体的には、複数の画像間における視差やぼけの相関量を算出し、算出した相関量に基づいて被写体までの距離情報を取得する。   It has been proposed to acquire distance information to a subject by using a plurality of captured images. Specifically, a correlation amount between parallax and blur between a plurality of images is calculated, and distance information to the subject is acquired based on the calculated correlation amount.

特許文献1には、Depth from Defocus(DFD)法を用いた距離算出が開示されている。引用文献1では、撮影パラメータを異ならせて撮影されたぼけが異なる複数の画像を用い、当該複数の画像間におけるぼけの相関量を算出し、算出したぼけの相関量に基づいて被写体まで距離情報を取得する。特許文献2では、色情報に基づいて画像を各セグメントに分割し、同一のセグメント内では同じ視差になると仮定し、セグメントの範囲内において相関量を算出することによって距離情報を取得することが開示されている。   Patent Literature 1 discloses distance calculation using a depth from defocus (DFD) method. In the cited document 1, a plurality of images having different blurs photographed with different photographing parameters are used, a correlation amount of the blur between the plurality of images is calculated, and distance information to the subject is calculated based on the calculated correlation amount of the blur. To get. Patent Literature 2 discloses that an image is divided into segments based on color information, and that parallax is assumed to be the same within the same segment, and distance information is obtained by calculating a correlation amount within the range of the segment. Have been.

特開2013−253964号JP 2013-253964 A 特開2006−012166号JP-A-2006-012166

しかしながら、従来の技術では、距離情報を必ずしも良好に取得し得なかった。   However, according to the conventional technology, it has not always been possible to acquire distance information satisfactorily.

本発明の目的は、距離情報を良好に取得し得る画像処理装置及び画像処理方法を提供することにある。   An object of the present invention is to provide an image processing apparatus and an image processing method that can acquire distance information well.

本発明の一観点によれば、撮像手段によって撮像された複数の画像を入力するための画像入力手段と、前記画像を撮像した際における撮像情報を取得する撮像情報取得手段と、前記撮像情報に含まれる合焦距離に基づいて評価枠のサイズを決定し、前記評価枠における前記複数の画像間の相関量を算出し、前記複数の画像間の前記相関量に基づいて距離情報を算出する距離情報算出手段とを有することを特徴とする画像処理装置が提供される。

According to one aspect of the present invention, an image input unit for inputting a plurality of images captured by an imaging unit, an imaging information acquisition unit for acquiring imaging information when the image is captured, and A distance for determining the size of the evaluation frame based on the included focusing distance, calculating a correlation amount between the plurality of images in the evaluation frame, and calculating distance information based on the correlation amount between the plurality of images. An image processing apparatus having information calculation means is provided.

本発明によれば、画像を撮像した際における撮像条件等を示す情報である撮像情報に基づいて評価枠のサイズを決定するため、評価枠のサイズを適切に設定することができる。適切なサイズの評価枠を用いるため、相関量を良好に取得することができ、ひいては距離情報を良好に取得することができる。   According to the present invention, the size of the evaluation frame can be appropriately set because the size of the evaluation frame is determined based on the imaging information that is information indicating the imaging conditions when the image is captured. Since the evaluation frame having an appropriate size is used, the correlation amount can be obtained well, and the distance information can be obtained well.

第1実施形態による画像処理装置の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of the image processing apparatus according to the first embodiment. 第1実施形態による画像処理装置の動作を示すフローチャートである。5 is a flowchart illustrating an operation of the image processing apparatus according to the first embodiment. 各撮像情報と評価枠のサイズとの関係を示すグラフである。5 is a graph showing the relationship between each piece of imaging information and the size of an evaluation frame. レンズの焦点距離に応じた評価枠のサイズの設定の例を示す図である。FIG. 5 is a diagram illustrating an example of setting of an evaluation frame size according to a focal length of a lens. DFD方式を用いる場合における相関量の算出処理を説明するための図である。FIG. 9 is a diagram for describing a calculation process of a correlation amount when the DFD method is used. ステレオ方式を用いる場合における相関量の算出処理を説明するための図である。FIG. 9 is a diagram for explaining a calculation process of a correlation amount when a stereo method is used. ステレオ方式を用いる場合における相関量の算出処理を説明するための図である。FIG. 9 is a diagram for explaining a calculation process of a correlation amount when a stereo method is used. 第2実施形態による画像処理装置の構成を示すブロック図である。It is a block diagram showing the composition of the image processing device by a 2nd embodiment. 第2実施形態による画像処理装置における動作を示すフローチャートである。9 is a flowchart illustrating an operation in the image processing apparatus according to the second embodiment. 評価枠のサイズを示す図である。It is a figure showing the size of an evaluation frame. 第2実施形態による画像処理装置において用いられる評価枠のサイズを説明するための図である。FIG. 14 is a diagram for explaining the size of an evaluation frame used in the image processing device according to the second embodiment.

[第1実施形態]
第1実施形態による画像処理装置及び画像処理方法について図1から図6を用いて説明する。
[First Embodiment]
An image processing apparatus and an image processing method according to the first embodiment will be described with reference to FIGS.

複数の画像間における相関量に基づいて被写体までの奥行き方向の距離(被写体距離)あるいはそれに対応する情報を算出する際、相関演算処理の対象となる画像上(画面上)の範囲の相違によって、距離情報の算出結果が異なる。相関演算処理の対象となる範囲が広い場合には、多くのテクスチャを含むことができるため、算出される距離情報は安定する傾向がある。しかし、相関演算処理の対象となる範囲が広い場合には、撮像装置からの距離が互いに異なっている複数の被写体が当該範囲内に含まれやすくなるため、遠い被写体と近い被写体とが混在する遠近競合領域が増加する傾向がある。一方、相関演算処理の対象となる範囲が狭い場合には、遠近競合領域は少なくなるが、当該範囲内に含まれるテクスチャも少なくなるため、算出される距離情報が不安定になる傾向がある。このように、相関演算処理の対象となる範囲を単に設定した場合には、距離情報を必ずしも良好に取得し得ない。   When calculating the distance in the depth direction to the subject (subject distance) or information corresponding to the subject based on the amount of correlation between a plurality of images, the difference in the range on the image (on the screen) that is the target of the correlation calculation processing may cause The calculation result of the distance information is different. When the range to be subjected to the correlation operation processing is wide, many textures can be included, and thus the calculated distance information tends to be stable. However, when the range to be subjected to the correlation calculation processing is wide, a plurality of subjects whose distances from the imaging device are different from each other are likely to be included in the range. The competition area tends to increase. On the other hand, when the range to be subjected to the correlation calculation process is narrow, the distance conflict region is reduced, but the texture included in the range is also reduced, so that the calculated distance information tends to be unstable. As described above, when the range to be subjected to the correlation calculation processing is simply set, the distance information cannot always be obtained satisfactorily.

本実施形態による画像処理装置は、複数の画像間における相関量を算出するための評価枠のサイズを、撮像時の撮像情報に基づいて決定し、これにより、距離情報を良好に得ることを可能とするものである。   The image processing apparatus according to the present embodiment determines the size of the evaluation frame for calculating the amount of correlation between a plurality of images based on the imaging information at the time of imaging, thereby making it possible to obtain good distance information. It is assumed that.

まず、本実施形態による画像処理装置の構成について図1を用いて説明する。図1は、本実施形態による画像処理装置の構成を示すブロック図である。   First, the configuration of the image processing apparatus according to the present embodiment will be described with reference to FIG. FIG. 1 is a block diagram illustrating the configuration of the image processing apparatus according to the present embodiment.

画像入力部101は、複数の撮像画像を本実施形態による画像処理装置に入力するためのものである。画像入力部101を介して入力される画像は、後述する距離情報算出部103の評価枠選択部104に入力される。画像入力部101は、撮像素子であってもよいし、画像信号の入力端子であってもよい。   The image input unit 101 is for inputting a plurality of captured images to the image processing device according to the present embodiment. The image input via the image input unit 101 is input to an evaluation frame selection unit 104 of the distance information calculation unit 103 described later. The image input unit 101 may be an image sensor or an image signal input terminal.

撮像情報取得部102は、撮像画像を取得した際における撮像条件等を示す情報である撮像情報(カメラ情報)、即ち、撮像時における撮像情報を取得する。撮像情報取得部102によって取得される撮像情報は、距離情報算出部103の評価枠選択部104に入力される。   The imaging information acquisition unit 102 acquires imaging information (camera information) that is information indicating imaging conditions and the like at the time of acquiring a captured image, that is, imaging information at the time of imaging. The imaging information acquired by the imaging information acquisition unit 102 is input to the evaluation frame selection unit 104 of the distance information calculation unit 103.

距離情報算出部103は、距離情報を算出するためのものであり、評価枠選択部104と相関量算出部105と距離情報生成部106とを備えている。   The distance information calculation unit 103 is for calculating distance information, and includes an evaluation frame selection unit 104, a correlation amount calculation unit 105, and a distance information generation unit 106.

評価枠選択部104は、撮像情報取得部102によって取得された撮像情報に基づいて、相関演算の対象となる範囲、即ち、評価枠のサイズを決定する。   The evaluation frame selection unit 104 determines a range to be subjected to a correlation operation, that is, a size of the evaluation frame, based on the imaging information acquired by the imaging information acquisition unit 102.

相関量算出部105は、評価枠選択部104によって決定されたサイズの評価枠において、複数の画像間の相関量を算出する。   The correlation amount calculation unit 105 calculates a correlation amount between a plurality of images in an evaluation frame of the size determined by the evaluation frame selection unit 104.

距離情報生成部106は、相関量算出部105によって算出された相関量に基づいて、撮像装置から各被写体までの奥行き方向の距離あるいは奥行き方向の距離に対応する情報である距離情報(被写体距離情報)を算出する。奥行き方向の距離に対応する情報とは、例えば相関量算出部105によって算出される相関量に基づく像ずれ量、あるいは相関量に基づくデフォーカス量などである。距離情報生成部106は、算出した距離情報を、距離情報出力部107を介して出力する。   Based on the correlation amount calculated by the correlation amount calculation unit 105, the distance information generation unit 106 generates a distance in the depth direction from the imaging device to each subject, or distance information (object distance information) corresponding to the distance in the depth direction. ) Is calculated. The information corresponding to the distance in the depth direction is, for example, an image shift amount based on the correlation amount calculated by the correlation amount calculation unit 105 or a defocus amount based on the correlation amount. The distance information generation unit 106 outputs the calculated distance information via the distance information output unit 107.

次に、本実施形態による画像処理装置の動作について図2を用いて説明する。図2は、本実施形態による画像処理装置の動作を示すフローチャートである。なお、本実施形態による画像処理装置の全体の動作は、例えば制御手段であるCPU(図示せず)によって司られる。   Next, the operation of the image processing apparatus according to the present embodiment will be described with reference to FIG. FIG. 2 is a flowchart illustrating the operation of the image processing apparatus according to the present embodiment. Note that the overall operation of the image processing apparatus according to the present embodiment is controlled by, for example, a CPU (not shown) as control means.

ステップS201では、距離情報を取得するために必要となる複数の画像が、画像入力部101を介して、距離情報算出部103に入力される。より具体的には、画像入力部101を介して入力された複数の画像が、距離情報算出部103の評価枠選択部104に入力される。上述したように、画像入力部101は、撮像素子であってもよいし、画像信号の入力端子であってもよい。画像入力部101が撮像素子である場合には、撮像素子を用いて取得された複数の画像が距離情報算出部103に入力される。画像入力部101が画像入力端子である場合には、画像入力端子を介して入力された複数の画像が距離情報算出部103に入力される。   In step S201, a plurality of images necessary for acquiring distance information are input to the distance information calculation unit 103 via the image input unit 101. More specifically, a plurality of images input via the image input unit 101 are input to the evaluation frame selection unit 104 of the distance information calculation unit 103. As described above, the image input unit 101 may be an image sensor or an image signal input terminal. When the image input unit 101 is an image sensor, a plurality of images acquired using the image sensor are input to the distance information calculator 103. When the image input unit 101 is an image input terminal, a plurality of images input via the image input terminal are input to the distance information calculation unit 103.

ステップS202では、複数の画像の各々が撮像された際における撮像情報が撮像情報取得部102によって取得され、撮像情報取得部102によって取得された撮像情報が距離情報算出部103に入力される。より具体的には、撮像情報取得部102によって取得された撮像情報が、距離情報算出部103の評価枠選択部104に入力される。撮像情報取得部104によって取得される撮像情報としては、レンズの焦点距離、合焦距離、レンズの絞り、被写体の大きさ、手ぶれ量、歪み情報、ISO感度等が挙げられる。   In step S202, imaging information obtained when each of the plurality of images is captured is acquired by the imaging information acquisition unit 102, and the imaging information acquired by the imaging information acquisition unit 102 is input to the distance information calculation unit 103. More specifically, the imaging information acquired by the imaging information acquisition unit 102 is input to the evaluation frame selection unit 104 of the distance information calculation unit 103. Examples of the imaging information acquired by the imaging information acquisition unit 104 include a focal length of a lens, a focusing distance, an aperture of a lens, a size of a subject, a camera shake amount, distortion information, ISO sensitivity, and the like.

ステップS203では、画像入力部101を介して入力された複数の画像と、撮像情報取得部102によって取得された撮像情報とに基づいて、複数の画像間の相関量を算出する際に用いられる評価枠のサイズが評価枠選択部104によって決定される。複数の画像間における相関量は、例えば、焦点位置の異なる複数の画像間におけるぼけの変化量である。   In step S203, an evaluation used when calculating a correlation amount between a plurality of images based on the plurality of images input through the image input unit 101 and the imaging information acquired by the imaging information acquiring unit 102. The size of the frame is determined by the evaluation frame selection unit 104. The correlation amount between a plurality of images is, for example, a change amount of blur between a plurality of images having different focus positions.

複数の画像間の相関量を算出する際に用いられる評価枠のサイズは、後述するように、撮像情報毎に算出された評価枠のサイズを総合的に判断することによって決定される。撮像情報毎に算出される評価枠のサイズについて以下に説明する。   As described later, the size of the evaluation frame used when calculating the correlation amount between a plurality of images is determined by comprehensively determining the size of the evaluation frame calculated for each piece of imaging information. The size of the evaluation frame calculated for each piece of imaging information will be described below.

図3は、各撮像情報と評価枠のサイズとの関係を示すグラフである。図3(a)は、レンズの焦点距離と評価枠のサイズとの関係を示しており、図3(b)は、合焦距離と評価枠のサイズとの関係を示している。図3(c)は、レンズの絞りと評価枠のサイズとの関係を示しており、図3(d)は、被写体の大きさと評価枠のサイズとの関係を示している。図3(e)は、手ぶれ量と評価枠のサイズとの関係を示しており、図3(f)は、歪み情報と評価枠のサイズとの関係、より具体的には、像高位置と評価枠のサイズとの関係を示している。図3(g)は、ISO感度と評価枠のサイズの下限との関係を示している。図3(a)から図3(f)の各々における縦軸は評価枠のサイズを示しており、図3(g)における縦軸は評価枠のサイズの下限を示している。   FIG. 3 is a graph showing the relationship between each piece of imaging information and the size of the evaluation frame. FIG. 3A shows the relationship between the focal length of the lens and the size of the evaluation frame, and FIG. 3B shows the relationship between the focusing distance and the size of the evaluation frame. FIG. 3C shows the relationship between the aperture of the lens and the size of the evaluation frame, and FIG. 3D shows the relationship between the size of the subject and the size of the evaluation frame. FIG. 3E shows the relationship between the amount of camera shake and the size of the evaluation frame. FIG. 3F shows the relationship between the distortion information and the size of the evaluation frame, more specifically, the relationship between the image height position and the image height position. The relationship with the size of the evaluation frame is shown. FIG. 3G shows the relationship between the ISO sensitivity and the lower limit of the size of the evaluation frame. The vertical axis in each of FIGS. 3A to 3F indicates the size of the evaluation frame, and the vertical axis in FIG. 3G indicates the lower limit of the size of the evaluation frame.

まず、レンズの焦点距離に基づいた評価枠のサイズの決定について説明する。図4は、レンズの焦点距離に基づいた評価枠のサイズの決定の例を示す図である。図4(a)及び図4(b)は、レンズの焦点距離が短い場合の撮像画像を示しており、図4(c)及び図4(d)は、レンズの焦点距離が長い場合の撮像画像を示している。評価枠は図4の各図において太線を用いて示されている。   First, the determination of the size of the evaluation frame based on the focal length of the lens will be described. FIG. 4 is a diagram illustrating an example of determining the size of the evaluation frame based on the focal length of the lens. FIGS. 4A and 4B show captured images when the focal length of the lens is short, and FIGS. 4C and 4D show images captured when the focal length of the lens is long. An image is shown. The evaluation frame is shown using a thick line in each drawing of FIG.

図4(a)に示すように、レンズの焦点距離が短い場合には、撮像画像中に多くの被写体が写り込むため、撮像装置からの距離が互いに異なっている多くの被写体が評価枠内に含まれる傾向がある。このため、レンズの焦点距離が短い場合には、図4(b)に示すように、評価枠のサイズを小さ目に設定し、評価枠内に位置し得る被写体の数を少なくすることによって、遠近競合を生じにくくさせ、正確な距離情報が得られるようにする。   As shown in FIG. 4A, when the focal length of the lens is short, many subjects appear in the captured image, so that many subjects at different distances from the imaging device are included in the evaluation frame. Tends to be included. Therefore, when the focal length of the lens is short, as shown in FIG. 4B, the size of the evaluation frame is set to be small, and the number of subjects that can be located in the evaluation frame is reduced, so that the distance Conflict is unlikely to occur, and accurate distance information is obtained.

一方、図4(c)に示すように、レンズの焦点距離が長い場合には、撮像画像中に写り込む被写体の数が少なくなり、評価枠内に含まれる被写体の数も少なくなる傾向がある。このため、レンズの焦点距離が長い場合には、図4(d)に示すように、評価枠のサイズを大き目に設定することによって、安定した距離情報、即ち、ばらつきの小さい距離情報が得られるようにする。   On the other hand, as shown in FIG. 4C, when the focal length of the lens is long, the number of subjects appearing in the captured image decreases, and the number of subjects included in the evaluation frame tends to decrease. . For this reason, when the focal length of the lens is long, as shown in FIG. 4D, by setting the size of the evaluation frame to be large, stable distance information, that is, distance information with small variation can be obtained. To do.

例えば、図3(a)に示すような関係を満たすように、評価枠のサイズがレンズの焦点距離に応じて決定される。即ち、レンズの焦点距離が長くなるに伴って評価枠のサイズが大きくなるように、評価枠のサイズが決定される。評価枠のサイズには、下限と上限とが設定される。評価枠のサイズが小さすぎる場合には、評価枠内に含まれるテクスチャが少なくなりすぎ、安定した距離情報を得ることが困難となるためである。また、評価枠のサイズが大きすぎる場合には、評価枠内に含まれるテクスチャが多くなりすぎ、相関量を算出する際における計算量の増大を招くためである。このような理由により、評価枠のサイズには、下限と上限とが設定される。そして、下限と上限との間の範囲内において、レンズの焦点距離に応じて、評価枠のサイズが決定される。   For example, the size of the evaluation frame is determined according to the focal length of the lens so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined such that the size of the evaluation frame increases as the focal length of the lens increases. For the size of the evaluation frame, a lower limit and an upper limit are set. If the size of the evaluation frame is too small, the texture included in the evaluation frame is too small, and it is difficult to obtain stable distance information. Further, if the size of the evaluation frame is too large, the number of textures included in the evaluation frame becomes too large, which causes an increase in the amount of calculation when calculating the correlation amount. For these reasons, a lower limit and an upper limit are set for the size of the evaluation frame. Then, within the range between the lower limit and the upper limit, the size of the evaluation frame is determined according to the focal length of the lens.

次に、合焦距離に基づいた評価枠のサイズの決定について図3(b)を用いて説明する。合焦距離が近い場合、即ち、被写体までの距離が近い場合には、撮影される被写体の大きさが大きくなり、撮像画像中に写りこむ被写体の数は少なくなる傾向がある。このため、合焦距離が近い場合には、評価枠のサイズを大き目に設定することによって、距離情報のばらつきを低減する。一方、合焦距離が遠い場合には、撮影される被写体の大きさが小さくなり、撮像画像中に含まれる被写体の数が多くなる傾向がある。このため、合焦距離が遠い場合には、評価枠のサイズを小さ目に設定し、評価枠内に位置する被写体の数を少なくすることによって、距離情報の精度を向上させる。例えば、図3(b)に示すような関係を満たすように、評価枠のサイズが合焦距離に応じて決定される。即ち、合焦距離が長くなるに伴って評価枠のサイズが小さくなるように、評価枠のサイズが決定される。   Next, determination of the size of the evaluation frame based on the focusing distance will be described with reference to FIG. When the focusing distance is short, that is, when the distance to the subject is short, the size of the subject to be shot tends to increase, and the number of subjects appearing in the captured image tends to decrease. For this reason, when the focusing distance is short, the variation of the distance information is reduced by setting the size of the evaluation frame to be large. On the other hand, when the focusing distance is long, the size of the subject to be photographed tends to be small, and the number of subjects included in the captured image tends to increase. Therefore, when the focusing distance is long, the accuracy of the distance information is improved by setting the size of the evaluation frame to a small size and reducing the number of subjects located in the evaluation frame. For example, the size of the evaluation frame is determined according to the focusing distance so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined such that the size of the evaluation frame decreases as the focusing distance increases.

次に、F値に基づいた評価枠のサイズの決定について図3(c)を用いて説明する。レンズの絞りが開放側である場合、即ち、レンズのF値が小さい場合には、背景がぼけるため、被写体として認識可能なものが背景において少なくなる傾向がある。このため、レンズのF値が小さい場合には、評価枠のサイズを大き目に設定することによって、距離情報のばらつきを低減する。一方、レンズの絞りが絞り側である場合、即ち、F値が大きい場合には、背景のぼけが小さくなるため、異なる距離にある被写体として認識可能なものが背景において多く含まれやすくなる。このため、F値が大きい場合には、評価枠のサイズを小さ目に設定することによって、評価枠内に位置する被写体を少なくし、距離情報の精度を向上させる。例えば、図3(c)に示すような関係を満たすように、評価枠のサイズがF値に応じて決定される。即ち、F値が大きくなるに伴って評価枠のサイズが小さくなるように、評価枠のサイズが決定される。   Next, determination of the size of the evaluation frame based on the F value will be described with reference to FIG. When the aperture of the lens is on the open side, that is, when the F-number of the lens is small, the background is blurred, and there is a tendency that the number of objects that can be recognized as subjects is reduced in the background. For this reason, when the F-number of the lens is small, the size of the evaluation frame is set to be large, thereby reducing the variation in the distance information. On the other hand, when the aperture of the lens is on the aperture side, that is, when the F-number is large, blurring of the background is small, so that many objects recognizable as subjects at different distances are likely to be included in the background. For this reason, when the F value is large, the size of the evaluation frame is set to a small value, thereby reducing the number of subjects located in the evaluation frame and improving the accuracy of the distance information. For example, the size of the evaluation frame is determined according to the F value so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined such that the size of the evaluation frame decreases as the F-number increases.

次に、被写体の大きさに基づいた評価枠の設定について図3(d)を用いて説明する。被写体の大きさに関する情報を得る際には、例えば、認識情報を用いることができる。具体的には、認識情報として人が認識された場合には、人が認識された範囲に基づいて被写体の大きさが決定される。被写体の大きさが大きい場合には、撮像画像中に写りこむ被写体は少なくなる傾向がある。このため、被写体の大きさが大きい場合には、評価枠のサイズを大き目に設定することによって、距離情報のばらつきを低減する。一方、被写体の大きさが小さい場合には、多くの被写体が撮像画像中に含まれやすい。このため、被写体の大きさが小さい場合には、評価枠のサイズを小さ目に設定することによって、評価枠内に位置する被写体を少なくし、距離情報の精度を向上させる。例えば、図3(d)に示すような関係を満たすように、評価枠のサイズが被写体の大きさに応じて決定される。即ち、被写体が大きくなるに伴って評価枠のサイズが大きくなるように、評価枠のサイズが決定される。   Next, the setting of the evaluation frame based on the size of the subject will be described with reference to FIG. When obtaining information on the size of the subject, for example, recognition information can be used. Specifically, when a person is recognized as the recognition information, the size of the subject is determined based on the range in which the person is recognized. When the size of the subject is large, the number of subjects appearing in the captured image tends to be small. For this reason, when the size of the subject is large, the size of the evaluation frame is set to be large, thereby reducing the variation in the distance information. On the other hand, when the size of the subject is small, many subjects are likely to be included in the captured image. For this reason, when the size of the subject is small, the size of the evaluation frame is set to be small, so that the number of subjects located in the evaluation frame is reduced, and the accuracy of the distance information is improved. For example, the size of the evaluation frame is determined according to the size of the subject so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined such that the size of the evaluation frame increases as the size of the subject increases.

次に、手ぶれ量に基づいた評価枠の設定について図3(e)を用いて説明する。手ぶれ量に関する情報を得る際には、例えば、ジャイロセンサの値を用いることができる。手ぶれ量が大きいにもかかわらず、評価枠のサイズが小さい場合には、位置ずれの影響のため、正しい対応関係が見つけられなくなり、精度の高い相関量を算出し得ない。このため、手ぶれ量が大きい場合には、評価枠のサイズを大き目に設定することによって、手ぶれの影響を緩和させる。一方、手ぶれ量が小さい場合には、評価枠のサイズが小さくても、正しい対応関係を検出することができる。このため、手ぶれ量が小さい場合には、評価枠のサイズを小さ目に設定することによって、評価枠内に位置する被写体を少なくし、距離情報の精度を向上させる。例えば、図3(e)に示すような関係を満たすように、評価枠のサイズが手ぶれ量に応じて決定される。即ち、手ぶれ量が大きくなるに伴って評価枠のサイズが大きくなるように、評価枠のサイズが決定される。   Next, setting of an evaluation frame based on the camera shake amount will be described with reference to FIG. When obtaining information on the camera shake amount, for example, a value of a gyro sensor can be used. If the size of the evaluation frame is small even though the camera shake amount is large, a correct correspondence cannot be found due to the influence of the positional shift, and a highly accurate correlation amount cannot be calculated. For this reason, when the camera shake amount is large, the influence of the camera shake is reduced by setting the size of the evaluation frame to a large value. On the other hand, when the camera shake amount is small, a correct correspondence can be detected even if the size of the evaluation frame is small. For this reason, when the camera shake amount is small, the size of the evaluation frame is set to a small value, thereby reducing the number of subjects located in the evaluation frame and improving the accuracy of the distance information. For example, the size of the evaluation frame is determined according to the amount of camera shake so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined so that the size of the evaluation frame increases as the camera shake amount increases.

次に、歪み情報に基づいた評価枠の設定について図3(f)を用いて説明する。撮像画像は収差の影響を受けているため、像高位置によって歪みの大きさが異なっている。このため、像高位置に応じて評価枠のサイズを変更することが好ましい。例えば、樽型歪みが発生した場合には、像高位置が高い箇所においては、像高位置が低い箇所よりも大きく被写体が写りこむ。このため、像高位置が高い場合には、評価枠のサイズを大き目に設定することによって、評価枠内にテクスチャが多く含まれるようにし、精度の高い相関量が得られるようにする。一方、像高位置が低い箇所においては、評価枠のサイズを小さ目に設定することによって、距離情報の精度を向上させる。例えば、図3(f)に示すような関係を満たすように、評価枠のサイズが像高位置に応じて決定される。即ち、像高位置が高くなるに伴って評価枠のサイズが大きくなるように、評価枠のサイズが決定される。   Next, setting of an evaluation frame based on distortion information will be described with reference to FIG. Since the captured image is affected by the aberration, the magnitude of the distortion differs depending on the image height position. Therefore, it is preferable to change the size of the evaluation frame according to the image height position. For example, when barrel distortion occurs, a subject appears larger in a place where the image height position is high than in a place where the image height position is low. Therefore, when the image height position is high, the size of the evaluation frame is set to be large, so that many textures are included in the evaluation frame, and a highly accurate correlation amount is obtained. On the other hand, at a position where the image height position is low, the accuracy of the distance information is improved by setting the size of the evaluation frame to a small value. For example, the size of the evaluation frame is determined according to the image height position so as to satisfy the relationship shown in FIG. That is, the size of the evaluation frame is determined such that the size of the evaluation frame increases as the image height position increases.

次に、ISO感度に基づいた評価枠の設定について図3(g)を用いて説明する。高感度で撮影した場合には、撮像画像にノイズが多く含まれるため、評価枠のサイズが小さいと、ノイズの影響により正しい相関量を算出し得ない。このため、高感度で撮影した場合には、評価枠のサイズを大き目に設定することによって、相関量の精度を向上させる。一方、低感度で撮影した場合には、撮像画像にノイズがあまり含まれていないため、評価枠のサイズを小さ目に設定しても、精度の高い相関量を取得し得る。例えば、図3(g)に示すような関係を満たすように、評価枠のサイズがISO感度に応じて決定される。即ち、ISO感度が高くなるに伴って評価枠のサイズの下限が大きくなるようにする。高感度で撮影した場合における評価枠のサイズの下限mは、低感度で撮影した場合における評価枠のサイズの下限nよりも大きい。   Next, setting of an evaluation frame based on ISO sensitivity will be described with reference to FIG. When the image is captured with high sensitivity, a large amount of noise is included in the captured image. Therefore, if the size of the evaluation frame is small, a correct correlation amount cannot be calculated due to the influence of noise. For this reason, when shooting with high sensitivity, the accuracy of the correlation amount is improved by setting the size of the evaluation frame to be large. On the other hand, when the image is captured with low sensitivity, the captured image does not include much noise. Therefore, even if the size of the evaluation frame is set to a small value, a highly accurate correlation amount can be obtained. For example, the size of the evaluation frame is determined according to the ISO sensitivity so as to satisfy the relationship shown in FIG. That is, the lower limit of the size of the evaluation frame increases as the ISO sensitivity increases. The lower limit m of the size of the evaluation frame when shooting with high sensitivity is larger than the lower limit n of the size of the evaluation frame when shooting with low sensitivity.

こうして、撮像情報毎に評価枠のサイズが算出される。そして、撮像情報毎に算出された評価枠のサイズを用い、これらを総合的に判断することによって、相関量を算出する際に用いられる評価枠のサイズが算出される。具体的には、例えば、下記のような式(1)を用いて加重加算を行うことによって、相関量を算出する際に用いられる評価枠のサイズSoutが決定される。なお、式(1)において、αは、撮像情報毎の重みを示しており、Sは、撮像情報毎に算出された評価枠のサイズを示している。

Figure 0006639155
Thus, the size of the evaluation frame is calculated for each piece of imaging information. Then, the size of the evaluation frame used for calculating the correlation amount is calculated by comprehensively determining these using the size of the evaluation frame calculated for each piece of imaging information. Specifically, for example, by performing weighted addition using the following equation (1), the size S out of the evaluation frame used when calculating the correlation amount is determined. In the equation (1), the alpha n, which indicates the weight of each imaging information, S n indicates the size of the evaluation frame calculated for each imaging information.
Figure 0006639155

具体例として、例えば、レンズの焦点距離が長く、レンズの絞りが開放側である場合について説明する。レンズの焦点距離が長い場合には、撮像画像中に写り込む被写体の数が少なくなる傾向にある。また、レンズの絞りが開放側である場合には、背景がぼけるため、被写体として認識可能なものが背景において少なくなる傾向がある。このため、レンズの焦点距離が長く、絞りが開放側である場合には、評価枠のサイズは大き目に設定される。評価枠のサイズを大き目に設定した場合であっても、異なる距離に位置している認識可能な被写体が評価枠内に含まれにくいため、精度の高い距離情報を得ることができる。   As a specific example, for example, a case where the focal length of the lens is long and the aperture of the lens is on the open side will be described. When the focal length of the lens is long, the number of subjects appearing in the captured image tends to decrease. Also, when the aperture of the lens is on the open side, the background is blurred, and there is a tendency that the number of objects that can be recognized as subjects is reduced in the background. Therefore, when the focal length of the lens is long and the aperture is on the open side, the size of the evaluation frame is set to be large. Even when the size of the evaluation frame is set to be large, recognizable subjects located at different distances are hardly included in the evaluation frame, so that highly accurate distance information can be obtained.

また、具体例として、レンズの焦点距離が長く、レンズの絞りが絞り側である場合について説明する。レンズの焦点距離が長い場合には、撮像画像中に写り込む被写体の数が少なくなる傾向がある。また、レンズの絞りが絞り側である場合には、被写体として認識可能なものが背景において多くなる傾向がある。このため、レンズの焦点距離が長い場合であっても、レンズの絞りが絞り側である場合には、レンズの絞りが開放側である場合と比較して、評価枠のサイズを小さ目に設定される。これにより、良好な相関量を得ることが可能となり、精度の高い距離情報を得ることができる。   As a specific example, a case where the focal length of the lens is long and the aperture of the lens is on the aperture side will be described. When the focal length of the lens is long, the number of subjects appearing in the captured image tends to decrease. Also, when the aperture of the lens is on the aperture side, the number of objects that can be recognized as subjects tends to increase in the background. For this reason, even when the focal length of the lens is long, the size of the evaluation frame is set to be smaller when the aperture of the lens is on the aperture side than when the aperture of the lens is on the open side. You. As a result, a good correlation amount can be obtained, and highly accurate distance information can be obtained.

ステップS204では、複数の画像間における相関量が相関量算出部105によって算出される。複数の画像間における相関量を算出する際には、ステップS203において決定されたサイズSoutの評価枠が用いられる。特許文献1に記載されているようなDFD方式を用いて相関量の算出を行う場合には、焦点位置の異なる複数の画像が用いられ、これら複数の画像間におけるぼけの変化量を相関量として算出する。 In step S204, the correlation amount between the plurality of images is calculated by the correlation amount calculation unit 105. When calculating the correlation amount between a plurality of images, the evaluation frame of the size S out determined in step S203 is used. When calculating a correlation amount using the DFD method as described in Patent Literature 1, a plurality of images having different focal positions are used, and a change amount of blur between the plurality of images is set as a correlation amount. calculate.

DFD方式を用いた相関量の算出処理について図5を用いて説明する。図5は、DFD方式を用いる場合における相関量の算出処理を説明するための図である。図5(a)は、被写体にフォーカスした状態で取得されたフォーカス画像(基準画像)におけるエッジ強度の特性501と、フォーカス状態に対して焦点位置を変更した状態で取得された撮像画像におけるエッジ強度の特性502とを示している。横軸はデフォーカス量を示しており、縦軸はエッジ強度を示している。これらの2つのエッジ強度の特性501,502を用いて、複数の画像間におけるぼけの相関量を算出することができる。図5(b)は、複数の画像間におけるぼけの相関量の特性を示すグラフである。図5(b)においては、複数の画像間におけるぼけの相関量の特性503が太い実線を用いて示されている。   The calculation process of the correlation amount using the DFD method will be described with reference to FIG. FIG. 5 is a diagram for explaining a calculation process of a correlation amount when the DFD method is used. FIG. 5A shows a characteristic 501 of an edge strength in a focus image (reference image) obtained in a state where a subject is focused, and an edge strength in a captured image obtained in a state where a focus position is changed with respect to a focus state. The characteristic 502 of FIG. The horizontal axis indicates the defocus amount, and the vertical axis indicates the edge intensity. By using these two edge strength characteristics 501 and 502, the correlation amount of blur between a plurality of images can be calculated. FIG. 5B is a graph showing the characteristics of the amount of blur correlation between a plurality of images. In FIG. 5B, a characteristic 503 of the amount of blur correlation between a plurality of images is shown using a thick solid line.

ステップS205では、ステップS204において算出された相関量に基づいて、距離情報が距離情報生成部106によって生成される。具体的には、ステップS204において算出された相関量の特性503に基づいて、像面でのデフォーカス量を算出することによって、距離情報を生成する。このような手法によって算出されたデフォーカス量は、像面上における距離である。像面上における距離をレンズの公式を用いて物面距離に変換することによって、被写体までの距離情報を取得することも可能である。   In step S205, distance information is generated by the distance information generation unit 106 based on the correlation amount calculated in step S204. Specifically, distance information is generated by calculating a defocus amount on the image plane based on the correlation amount characteristic 503 calculated in step S204. The defocus amount calculated by such a method is a distance on the image plane. By converting the distance on the image plane into the object plane distance using the formula of the lens, it is also possible to obtain distance information to the subject.

なお、本実施形態では、DFD方式を用いる場合を例に説明したが、例えば、これに限定されるものではなく、例えば、ステレオ方式を用いるようにしてもよい。   In the present embodiment, the case where the DFD system is used has been described as an example. However, the present invention is not limited to this. For example, a stereo system may be used.

ステレオ方式を用いる場合について、以下に説明する。
ステレオ方式を用いる場合には、ステップS201において、視差のある複数の画像が画像入力部101を介して入力される。図6は、ステレオ方式を用いる場合における相関量の算出処理を説明するための図である。図6(a)は基準画像を示しており、図6(b)は撮像位置が基準画像とは異なっている画像を示している。撮影位置が互いに異なっているため、これら複数の画像には視差が生じている。
The case where the stereo system is used will be described below.
When the stereo method is used, a plurality of images having parallax are input via the image input unit 101 in step S201. FIG. 6 is a diagram for explaining a calculation process of a correlation amount when the stereo method is used. FIG. 6A shows a reference image, and FIG. 6B shows an image whose imaging position is different from the reference image. Since the photographing positions are different from each other, parallax occurs in these multiple images.

ステップS202とステップS203については、DFD方式を用いる場合と同様であるため、説明を省略する。   Steps S202 and S203 are the same as in the case where the DFD method is used, and thus description thereof is omitted.

ステップS204では、ステップ203において決定されたサイズSoutの評価枠を用いて、複数の画像間における相関量が相関量算出部105によって算出される。複数の画像間における相関量は、視差量を求めるために算出される画像間における差分値である。ステレオ方式を用いる場合には、複数の画像間における相関量は、例えば、以下のようにして算出される。基準画像においては、評価枠602が図6(a)のように設定される。一方、撮影位置が基準画像とは異なっている画像においては、評価枠612を矢印方向に徐々にずらす。評価枠612を徐々にずらしながら、撮像位置が基準画像とは異なっている画像と基準画像との相関量を算出する。 In Step S204, the correlation amount between the plurality of images is calculated by the correlation amount calculation unit 105 using the evaluation frame of the size S out determined in Step 203. The correlation amount between a plurality of images is a difference value between images calculated for obtaining a parallax amount. When the stereo method is used, the correlation amount between a plurality of images is calculated, for example, as follows. In the reference image, the evaluation frame 602 is set as shown in FIG. On the other hand, in an image whose shooting position is different from the reference image, the evaluation frame 612 is gradually shifted in the direction of the arrow. While gradually shifting the evaluation frame 612, the correlation amount between the image whose imaging position is different from the reference image and the reference image is calculated.

図7は、ステレオ方式を用いる場合における相関量の算出処理を説明するための図である。図7(a)は1枚目の画像を示しており、図7(b)は、1枚目の画像における評価枠内のデータを示している。図7(c)は2枚目の画像を示しており、図7(d)は2枚目の画像における評価枠内のデータを示している。なお、評価枠は、図7において、太い実線を用いて示されている。図7(b)に示すような評価枠内のデータ値と図7(d)に示すような評価枠内のデータ値との差分絶対値の積算値、即ち、SAD(Sum of Absolute Difference)が算出される。具体的には、以下のような式(2)を用いて、差分絶対値の積算値RSADが相関量として算出される。なお、f(i,j)は、図7(a)に示す1枚目の画像の評価枠内の各座標(i,j)における画素値であり、g(i,j)は、図7(c)に示す2枚目の評価枠内の各座標(i,j)における画素値である。

Figure 0006639155
FIG. 7 is a diagram for explaining a calculation process of the correlation amount when the stereo method is used. FIG. 7A shows the first image, and FIG. 7B shows data in the evaluation frame of the first image. FIG. 7C shows the second image, and FIG. 7D shows data in the evaluation frame of the second image. Note that the evaluation frame is shown using a thick solid line in FIG. The integrated value of the absolute value of the difference between the data value in the evaluation frame as shown in FIG. 7B and the data value in the evaluation frame as shown in FIG. 7D, that is, the SAD (Sum of Absolute Difference) is Is calculated. Specifically, the integrated value R SAD of the absolute difference value is calculated as the correlation amount using the following equation (2). Note that f (i, j) is a pixel value at each coordinate (i, j) in the evaluation frame of the first image shown in FIG. 7A, and g (i, j) is It is a pixel value at each coordinate (i, j) in the second evaluation frame shown in (c).
Figure 0006639155

なお、ここでは、差分絶対値の積算値であるSADを用いて相関量を算出する場合を例に説明したが、これに限定されるものではない。得られる相関量によって最も相関の高い点(ずらし量、像ずれ量)が判定できるものであれば、他の方法によって相関量を算出するようにしてもよい。   Here, the case where the correlation amount is calculated using the SAD that is the integrated value of the absolute difference values has been described as an example, but the present invention is not limited to this. If the point having the highest correlation (shift amount, image shift amount) can be determined from the obtained correlation amount, the correlation amount may be calculated by another method.

ステップS205では、ステップS204において算出された相関量に基づいて、距離情報生成部106によって距離情報が算出される。ステップS204において算出される相関量は、例えば、図6(c)に示すような特性を示す。図6(c)の横軸は評価枠のずらし量であり、縦軸は相関量である。算出される相関量が最も高くなる点を相関が最も高い点として、そのときのずらし量を、複数の画像間における視差量(像ずれ量)とする。当該視差量に対し、撮像素子の画素ピッチとレンズに応じて決定される変換係数とを用いて、像面でのデフォーカス量を算出することによって、距離情報を生成する。なお本実施形態では、距離情報としてデフォーカス量を生成しているが、前述したように、像ずれ量や、撮影光学系の状態に基づいてデフォーカス量から1対1に換算される被写体距離を距離情報としてもよい。   In step S205, the distance information is calculated by the distance information generating unit 106 based on the correlation amount calculated in step S204. The correlation amount calculated in step S204 has, for example, a characteristic as shown in FIG. The horizontal axis of FIG. 6C is the shift amount of the evaluation frame, and the vertical axis is the correlation amount. The point at which the calculated correlation amount is the highest is defined as the point at which the correlation is the highest, and the shift amount at that time is defined as the parallax amount (image shift amount) between a plurality of images. The distance information is generated by calculating the defocus amount on the image plane using the pixel pitch of the image sensor and the conversion coefficient determined according to the lens for the parallax amount. In this embodiment, the defocus amount is generated as the distance information. However, as described above, the subject distance converted from the defocus amount to one-to-one based on the image shift amount and the state of the imaging optical system, as described above. May be used as the distance information.

このように、本実施形態によれば、撮像時の撮像情報に基づいて評価枠のサイズを決定するため、評価枠のサイズを適切に設定することができる。適切なサイズの評価枠を用いるため、相関量を良好に取得することができ、ひいては距離情報を良好に取得することができる。   As described above, according to the present embodiment, since the size of the evaluation frame is determined based on the imaging information at the time of imaging, the size of the evaluation frame can be appropriately set. Since the evaluation frame having an appropriate size is used, the correlation amount can be obtained well, and the distance information can be obtained well.

[第2実施形態]
第2実施形態による画像処理装置及び画像処理方法を図8乃至図11を用いて説明する。図1乃至図7に示す第1実施形態による画像処理装置と同一の構成要素には、同一の符号を付して説明を省略または簡潔にする。
本実施形態による画像処理装置は、サイズが異なる複数の評価枠を相関量の算出の際に用いるものである。
[Second embodiment]
An image processing apparatus and an image processing method according to the second embodiment will be described with reference to FIGS. The same components as those of the image processing apparatus according to the first embodiment shown in FIGS. 1 to 7 are denoted by the same reference numerals, and description thereof will be omitted or simplified.
The image processing apparatus according to the present embodiment uses a plurality of evaluation frames having different sizes when calculating the correlation amount.

本実施形態による画像処理装置の構成について図8を用いて説明する。図8は、本実施形態による画像処理装置の構成を示すブロック図である。
本実施形態による画像処理装置の各構成要素801〜807は、図1を用いて上述した第1実施形態による画像処理装置の各構成要素101〜107と同様である。本実施形態による画像処理装置は、相関量算出部805による処理と距離情報生成部806による処理とが、サイズが異なる複数の評価枠を用いて繰り返し行われる点が、第1実施形態による画像処理装置と相違している。
The configuration of the image processing apparatus according to the present embodiment will be described with reference to FIG. FIG. 8 is a block diagram illustrating the configuration of the image processing apparatus according to the present embodiment.
The components 801 to 807 of the image processing apparatus according to the present embodiment are the same as the components 101 to 107 of the image processing apparatus according to the first embodiment described above with reference to FIG. The image processing apparatus according to the first embodiment is different from the image processing apparatus according to the first embodiment in that the processing by the correlation amount calculation unit 805 and the processing by the distance information generation unit 806 are repeatedly performed using a plurality of evaluation frames having different sizes. It is different from the device.

本実施形態による画像処理装置の動作について図9を用いて説明する。図9は、本実施形態による画像処理装置の動作を示すフローチャートである。   The operation of the image processing apparatus according to the present embodiment will be described with reference to FIG. FIG. 9 is a flowchart illustrating the operation of the image processing apparatus according to the present embodiment.

まず、ステップS901からステップS902は、図2を用いて上述したステップS201からステップS202と同様であるため、説明を省略する。   First, steps S901 to S902 are the same as steps S201 to S202 described above with reference to FIG.

ステップS903では、サイズの異なる複数種の評価枠、即ち、サイズの異なるP種類の評価枠が、以下のようにして決定される。即ち、まず、評価枠のサイズは、第1実施形態と同様に、撮像情報毎にそれぞれ算出される。そして、撮像情報毎にそれぞれ算出された評価枠のサイズが、所定の基準に基づいて分類される。図10は、撮像情報毎に算出された評価枠のサイズを示す図である。図10には、分類後の代表値が示されている。図10においては、L×L、M×M、N×N(L<M<N)の3種類に分類された場合が例として示されている。なお、A<L<M<Nである。   In step S903, a plurality of types of evaluation frames having different sizes, that is, P types of evaluation frames having different sizes are determined as follows. That is, first, the size of the evaluation frame is calculated for each piece of imaging information as in the first embodiment. Then, the size of the evaluation frame calculated for each piece of imaging information is classified based on a predetermined criterion. FIG. 10 is a diagram illustrating the size of the evaluation frame calculated for each piece of imaging information. FIG. 10 shows representative values after classification. FIG. 10 shows, as an example, a case where the data is classified into three types of L × L, M × M, and N × N (L <M <N). Note that A <L <M <N.

ステップS903において決定されたP種類のサイズの評価枠を順次用いて、相関量算出処理(ステップS904)と距離情報生成処理(ステップS905)とが繰り返し行われる。即ち、本実施形態では、異なるサイズの評価枠を順次用いて、階層的な処理が行われる。図11は、本実施形態において用いられる評価枠のサイズを説明するための図である。図11(a)は、1回目の相関演算処理の際に用いられる評価枠1102のサイズを示している。1回目の相関演算処理(ステップS904)においては、例えばL×Lのサイズの評価枠1102が用いられる。そして、1回目の相関演算処理において算出された相関量に基づいて、距離情報が生成される(ステップS905)。そして、生成された距離情報に対して距離情報のばらつきを算出し、距離情報がばらついている領域に対して2回目の相関演算処理が行われる。図11(b)は、2回目の相関演算処理の際に用いられる評価枠1112のサイズを示している。2回目の相関演算処理(ステップS904)においては、例えばM×Mのサイズの評価枠1112が用いられる。そして、2回目の相関演算処理において算出された相関量に基づいて、距離情報が生成される(ステップS905)。そして、生成された距離情報に対して距離情報のばらつきを算出し、距離情報がばらついている領域に対して3回目の相関演算処理が行われる。図11(c)は、3回目の相関演算処理の際に用いられる評価枠1122のサイズを示している。3回目の相関演算処理(ステップS904)においては、例えばN×Nのサイズの評価枠1122が用いられる。そして、3回目の相関演算処理において算出された相関量に基づいて、距離情報が生成される(ステップS905)。   The correlation amount calculation processing (step S904) and the distance information generation processing (step S905) are repeatedly performed using the evaluation frames of the P types determined in step S903. That is, in the present embodiment, hierarchical processing is performed by sequentially using evaluation frames of different sizes. FIG. 11 is a diagram for explaining the size of the evaluation frame used in the present embodiment. FIG. 11A shows the size of the evaluation frame 1102 used in the first correlation calculation process. In the first correlation calculation process (step S904), for example, an L × L size evaluation frame 1102 is used. Then, distance information is generated based on the correlation amount calculated in the first correlation calculation process (step S905). Then, a variation of the distance information is calculated for the generated distance information, and a second correlation calculation process is performed on the area where the distance information varies. FIG. 11B shows the size of the evaluation frame 1112 used in the second correlation calculation process. In the second correlation calculation process (step S904), for example, an evaluation frame 1112 having a size of M × M is used. Then, distance information is generated based on the correlation amount calculated in the second correlation calculation process (step S905). Then, the variation of the distance information is calculated for the generated distance information, and the third correlation calculation process is performed on the region where the distance information varies. FIG. 11C shows the size of the evaluation frame 1122 used in the third correlation calculation process. In the third correlation calculation process (step S904), for example, an evaluation frame 1122 having a size of N × N is used. Then, distance information is generated based on the correlation amount calculated in the third correlation calculation process (step S905).

ところで、ステップ906では、相関量演算処理及び距離情報生成処理がP回行われたか否かが判定される。相関量演算処理及び距離情報生成処理がP回行われていない場合には(ステップS906においてNO)、ステップS904及びステップS905が繰り返される。一方、相関量演算処理及び距離情報生成処理がP回行われた場合には(ステップS906においてYES)、距離情報の算出処理が完了する。   Meanwhile, in step 906, it is determined whether the correlation amount calculation processing and the distance information generation processing have been performed P times. If the correlation amount calculation processing and the distance information generation processing have not been performed P times (NO in step S906), steps S904 and S905 are repeated. On the other hand, when the correlation amount calculation processing and the distance information generation processing have been performed P times (YES in step S906), the calculation processing of the distance information is completed.

このように、本実施形態では、サイズの異なる複数種の評価枠を順次用いて相関量が算出され、算出された相関量に基づいて距離情報が生成される。従って、本実施形態によれば、距離情報をより良好に取得することが可能となる。   As described above, in the present embodiment, the correlation amount is sequentially calculated using the plurality of types of evaluation frames having different sizes, and the distance information is generated based on the calculated correlation amount. Therefore, according to the present embodiment, it is possible to acquire distance information more favorably.

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

101…画像入力部
102…撮像情報取得部
103…距離情報算出部
104…評価枠選択部
105…相関量算出部
106…距離情報生成部
107…距離情報出力部
101 image input unit 102 imaging information acquisition unit 103 distance information calculation unit 104 evaluation frame selection unit 105 correlation amount calculation unit 106 distance information generation unit 107 distance information output unit

Claims (14)

撮像手段によって撮像された複数の画像を入力するための画像入力手段と、
前記画像を撮像した際における撮像情報を取得する撮像情報取得手段と、
前記撮像情報に含まれる合焦距離に基づいて評価枠のサイズを決定し、前記評価枠における前記複数の画像間の相関量を算出し、前記複数の画像間の前記相関量に基づいて被写体までの奥行き方向の距離に対応する距離情報を算出する距離情報算出手段と
を有することを特徴とする画像処理装置。
Image input means for inputting a plurality of images taken by the imaging means,
Imaging information acquisition means for acquiring imaging information when the image is captured,
Determine the size of the evaluation frame based on the focusing distance included in the imaging information, calculate the amount of correlation between the plurality of images in the evaluation frame, to the subject based on the amount of correlation between the plurality of images And a distance information calculating means for calculating distance information corresponding to the distance in the depth direction of the image processing apparatus.
前記評価枠のサイズは、複数の前記撮像情報の各々に応じて決定された複数の前記評価枠のサイズを加重加算することによって決定される
ことを特徴とする請求項1に記載する画像処理装置。
The image processing apparatus according to claim 1, wherein the size of the evaluation frame is determined by weighted addition of the sizes of the plurality of evaluation frames determined according to each of the plurality of pieces of imaging information. .
前記撮像情報は、レンズの焦点距離をさらに含み、
前記距離情報算出手段は、前記レンズの焦点距離が第1の距離である場合、前記第1の距離より短い第2の距離である場合よりも前記評価枠のサイズが大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes a focal length of the lens,
The distance information calculating unit may be configured to determine the size of the evaluation frame such that the size of the evaluation frame is larger when the focal length of the lens is a first distance than when the focal length of the lens is a second distance shorter than the first distance. The image processing apparatus according to claim 1, wherein a size of the frame is determined.
前記距離情報算出手段は、前記合焦距離が第1の距離である場合、前記第1の距離より遠い第2の距離である場合よりも前記評価枠のサイズが大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
It said distance information calculating unit, when the focusing distance is a first distance, the evaluation frame sizes size Kunar so than when the a first distant second distance than the distance, the evaluation The image processing apparatus according to claim 1, wherein a size of the frame is determined.
前記撮像情報は、前記被写体の大きさをさらに含み、
前記距離情報算出手段は、前記被写体の大きさが第1の大きさである場合、前記第1の大きさより小さい第2の大きさである場合よりも前記評価枠のサイズが大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes a size of the subject,
The distance information calculation means is configured such that when the size of the subject is a first size, the size of the evaluation frame is larger than when the size of the subject is a second size smaller than the first size. The image processing device according to claim 1, wherein a size of the evaluation frame is determined.
前記撮像情報は、レンズのF値をさらに含み、
前記距離情報算出手段は、前記レンズのF値が第1の値である場合、前記第1の値より小さい第2の値である場合よりも前記評価枠のサイズが小さくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes an F value of the lens,
The distance information calculation means may be configured to determine the size of the evaluation frame so that the F-number of the lens is smaller than the first value when the F-number of the lens is a first value. The image processing apparatus according to claim 1, wherein a size of the frame is determined.
前記撮像情報は、ISO感度をさらに含み、
前記距離情報算出手段は、前記ISO感度が第1の感度である場合、前記第1の感度より低い第2の感度である場合よりも前記評価枠のサイズの下限が大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes an ISO sensitivity,
The distance information calculating unit may be configured to perform the evaluation so that a lower limit of the size of the evaluation frame is larger when the ISO sensitivity is the first sensitivity than when the ISO sensitivity is the second sensitivity lower than the first sensitivity. The image processing apparatus according to claim 1, wherein a size of the frame is determined.
前記撮像情報は、手ぶれ量をさらに含み、
前記距離情報算出手段は、前記手ぶれ量が第1の値である場合、前記第1の値より小さい第2の値である場合よりも前記評価枠のサイズが大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes a camera shake amount,
The distance information calculating means may determine that the size of the evaluation frame is larger when the camera shake amount is a first value than when the shake amount is a second value smaller than the first value. The image processing apparatus according to claim 1, wherein the size is determined.
前記撮像情報は、像高位置をさらに含み、
前記距離情報算出手段は、前記像高位置が第1の位置である場合、前記第1の位置より低い第2の位置である場合よりも前記評価枠のサイズが大きくなるように、前記評価枠のサイズを決定する
ことを特徴とする請求項1に記載の画像処理装置。
The imaging information further includes an image height position,
The distance information calculating unit may be configured to determine that the size of the evaluation frame is larger when the image height position is the first position than when the image height position is the second position lower than the first position. The image processing device according to claim 1, wherein the size of the image processing device is determined.
前記複数の画像間における前記相関量は、焦点位置が異なる前記複数の画像間におけるぼけの相関量である
ことを特徴とする請求項1から9のいずれか1項に記載の画像処理装置。
The image processing apparatus according to any one of claims 1 to 9, wherein the correlation amount between the plurality of images is a blur correlation amount between the plurality of images having different focus positions.
前記複数の画像間における前記相関量は、撮像位置が異なる前記複数の画像間における視差の相関量である
ことを特徴とする請求項1から9のいずれか1項に記載の画像処理装置。
The image processing device according to any one of claims 1 to 9, wherein the correlation amount between the plurality of images is a parallax correlation amount between the plurality of images having different imaging positions.
前記距離情報算出手段は、前記サイズが異なる複数の前記評価枠を複数の前記撮像情報の各々に応じて決定し、前記サイズが異なる前記複数の評価枠における前記複数の画像間の前記相関量を算出し、前記複数の画像間の前記相関量に基づいて前記距離情報を算出する
ことを特徴とする請求項1から11のいずれか1項に記載の画像処理装置。
The distance information calculating unit determines the plurality of evaluation frames having different sizes in accordance with each of a plurality of pieces of imaging information, and calculates the correlation amount between the plurality of images in the plurality of evaluation frames having different sizes. The image processing device according to claim 1, wherein the distance information is calculated based on the correlation amount between the plurality of images.
撮像手段によって撮像された複数の画像が入力されるステップと、
前記画像を撮像した際における撮像情報を取得するステップと、
前記撮像情報に含まれる合焦距離に基づいて評価枠のサイズを決定するステップと、
前記評価枠における前記複数の画像間の相関量を算出するステップと、
前記複数の画像間の前記相関量に基づいて被写体までの奥行き方向の距離に対応する距離情報を算出するステップと
を有する
ことを特徴とする画像処理方法。
Inputting a plurality of images taken by the imaging means;
Acquiring imaging information at the time of capturing the image,
Determining the size of the evaluation frame based on the focusing distance included in the imaging information;
Calculating a correlation amount between the plurality of images in the evaluation frame,
Calculating distance information corresponding to the distance in the depth direction to the subject based on the correlation amount between the plurality of images.
コンピュータに、
撮像手段によって撮像された複数の画像が入力されるステップと、
前記画像を撮像した際における撮像情報を取得するステップと、
前記撮像情報に含まれる合焦距離に基づいて評価枠のサイズを決定するステップと、
前記評価枠における前記複数の画像間の相関量を算出するステップと、
前記複数の画像間の前記相関量に基づいて被写体までの奥行き方向の距離に対応する距離情報を算出するステップと
を実行させるためのプログラム。
On the computer,
Inputting a plurality of images taken by the imaging means;
Acquiring imaging information at the time of capturing the image,
Determining the size of the evaluation frame based on the focusing distance included in the imaging information;
Calculating a correlation amount between the plurality of images in the evaluation frame,
Calculating distance information corresponding to a distance in the depth direction to the subject based on the correlation amount between the plurality of images.
JP2015169355A 2015-08-28 2015-08-28 Image processing apparatus and image processing method Active JP6639155B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015169355A JP6639155B2 (en) 2015-08-28 2015-08-28 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015169355A JP6639155B2 (en) 2015-08-28 2015-08-28 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2017044983A JP2017044983A (en) 2017-03-02
JP6639155B2 true JP6639155B2 (en) 2020-02-05

Family

ID=58210087

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015169355A Active JP6639155B2 (en) 2015-08-28 2015-08-28 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP6639155B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018143704A (en) * 2017-03-09 2018-09-20 株式会社サンセイアールアンドディ Game machine

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3646124B2 (en) * 2001-10-01 2005-05-11 コニカミノルタフォトイメージング株式会社 Autofocus device
JP2005316271A (en) * 2004-04-30 2005-11-10 Nikon Corp Autofocus camera
JP4708967B2 (en) * 2005-11-11 2011-06-22 キヤノン株式会社 Imaging apparatus and imaging method
JP5907595B2 (en) * 2011-09-27 2016-04-26 キヤノン株式会社 Imaging device
JP6202927B2 (en) * 2012-08-31 2017-09-27 キヤノン株式会社 Distance detection device, imaging device, program, recording medium, and distance detection method
JP6137840B2 (en) * 2013-01-18 2017-05-31 オリンパス株式会社 Camera system
JP6040422B2 (en) * 2013-03-26 2016-12-07 パナソニックIpマネジメント株式会社 Imaging device

Also Published As

Publication number Publication date
JP2017044983A (en) 2017-03-02

Similar Documents

Publication Publication Date Title
US10997696B2 (en) Image processing method, apparatus and device
JP6245885B2 (en) Imaging apparatus and control method thereof
CN109255810B (en) Image processing apparatus and image processing method
JP5868183B2 (en) Imaging apparatus and imaging method
JP6271990B2 (en) Image processing apparatus and image processing method
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
JP6157249B2 (en) Imaging apparatus, distance information acquisition method, and program
TWI393980B (en) The method of calculating the depth of field and its method and the method of calculating the blurred state of the image
JP2015035658A (en) Image processing apparatus, image processing method, and imaging apparatus
JP6319972B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2007199633A (en) Focusing detector
JP6071257B2 (en) Image processing apparatus, control method therefor, and program
JP2014138290A (en) Imaging device and imaging method
JP6544978B2 (en) Image output apparatus, control method therefor, imaging apparatus, program
US9538074B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US10204400B2 (en) Image processing apparatus, imaging apparatus, image processing method, and recording medium
JP6395429B2 (en) Image processing apparatus, control method thereof, and storage medium
JP6639155B2 (en) Image processing apparatus and image processing method
JP6305232B2 (en) Information processing apparatus, imaging apparatus, imaging system, information processing method, and program.
EP3194886A1 (en) Positional shift amount calculation apparatus and imaging apparatus
JP5484129B2 (en) Imaging device
JP6486453B2 (en) Image processing apparatus, image processing method, and program
JP6570406B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6381212B2 (en) Imaging apparatus and control method thereof
JP2018129825A (en) Information processing apparatus and method, information processing system, and program

Legal Events

Date Code Title Description
RD05 Notification of revocation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7425

Effective date: 20171214

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20180126

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180710

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190222

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190328

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190524

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191029

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191108

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191224

R151 Written notification of patent or utility model registration

Ref document number: 6639155

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151