JP2020021126A - Image processing device and control method thereof, distance detection device, imaging device, program - Google Patents

Image processing device and control method thereof, distance detection device, imaging device, program Download PDF

Info

Publication number
JP2020021126A
JP2020021126A JP2018142350A JP2018142350A JP2020021126A JP 2020021126 A JP2020021126 A JP 2020021126A JP 2018142350 A JP2018142350 A JP 2018142350A JP 2018142350 A JP2018142350 A JP 2018142350A JP 2020021126 A JP2020021126 A JP 2020021126A
Authority
JP
Japan
Prior art keywords
reference image
shape
image area
image
deformation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018142350A
Other languages
Japanese (ja)
Other versions
JP7195801B2 (en
Inventor
伸 田中
Shin Tanaka
伸 田中
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 JP2018142350A priority Critical patent/JP7195801B2/en
Publication of JP2020021126A publication Critical patent/JP2020021126A/en
Application granted granted Critical
Publication of JP7195801B2 publication Critical patent/JP7195801B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Focusing (AREA)
  • Stereoscopic And Panoramic Photography (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

To reduce an error of a correlation value, and acquire the parallax amount with higher accuracy.SOLUTION: A distance detection device 101 acquires a plurality of image data having viewpoints made different from each other by an imaging unit. An arithmetic processing unit 105 sets a standard image region on an image of first image data as a standard image, among the plurality of acquired image data, and sets a reference image region on the image of second image data as a reference image. The arithmetic processing unit 105 performs correlation calculation between the standard image region and the reference image region, and calculates a parallax amount from correlation value groups obtained by changing the reference image region. The arithmetic processing unit 105 determines a shape of the standard image region so that a luminance change value of an adjoining pixel at a boundary part in a parallax direction of the standard image region is less than a predetermined threshold, and performs the correlation calculation between the reference image regions having the shape corresponding to the shape of the standard image region.SELECTED DRAWING: Figure 1

Description

本発明は、撮像された画像を用いて視差量を算出する画像処理技術に関する。   The present invention relates to an image processing technique for calculating a parallax amount using a captured image.

撮影画像から距離情報を算出する方法には、異なる視点で取得した複数の画像間の相関値から視差量を求めて距離情報を取得する方法がある。具体的には、組をなす画像のうち、片方の画像において着目画素を含む部分領域の画像信号を基準画像領域の信号として抜き出し、他方の画像における部分領域の画像信号を参照画像信号として抜き出す処理が行われる。参照画像信号の抜き出し位置を変え、各位置における相関値が計算される。各位置における相関値のうちで最も相関が高くなる位置を求めることで、着目画素における視差量を算出することができる。また最も相関が高くなる位置と、その位置に隣接する参照画像の位置との間で画素値の相関値を用いて、より高分解能な視差量を推定するサブピクセル推定法が行われる。この場合、撮影画像の画素値が大きく変化する領域は被写体の形状等に依存し、当該領域と基準画像領域の端部とが重なる条件で視差量を算出すると誤差が発生する。特許文献1にはブロックマッチング処理において、対象物の形状と基準画像領域の形状とが重ならないように基準画像領域の形状を選択することで誤差を低減する方法が開示されている。   As a method of calculating distance information from a captured image, there is a method of obtaining distance information by obtaining a parallax amount from a correlation value between a plurality of images obtained from different viewpoints. Specifically, a process of extracting an image signal of a partial region including a pixel of interest in one image as a signal of a reference image region and extracting an image signal of a partial region in the other image as a reference image signal from among the images forming the set Is performed. The extraction position of the reference image signal is changed, and the correlation value at each position is calculated. By obtaining the position having the highest correlation among the correlation values at each position, the amount of parallax at the pixel of interest can be calculated. In addition, a sub-pixel estimation method for estimating a higher-resolution parallax amount using a correlation value of a pixel value between a position having the highest correlation and a position of a reference image adjacent to the position is performed. In this case, an area where the pixel value of the captured image greatly changes depends on the shape of the subject and the like, and an error occurs if the amount of parallax is calculated under the condition that the area and the end of the reference image area overlap. Patent Literature 1 discloses a method of reducing an error in a block matching process by selecting a shape of a reference image area so that the shape of an object and the shape of the reference image area do not overlap.

特許第5782766号公報Japanese Patent No. 5782766

対象物の形状と基準画像領域の形状が一致しないように基準画像領域の形状を選択する場合、例えば縦線のような被写体に対し、円形状となるように基準画像領域の形状を選択しても誤差は残存する。対象物の形状と基準画像領域の形状とが一致しないとしても、基準画像領域の視差探索方向の境界部に輝度変化が残存する場合、サブピクセル推定法にて高相関値の位置と隣接する参照画像位置における相関値に誤差が発生する可能性がある。
本発明は、相関値の誤差を低減して、より高精度な視差量を取得することができる画像処理装置の提供を目的とする。
When selecting the shape of the reference image area so that the shape of the target object does not match the shape of the reference image area, for example, for a subject such as a vertical line, select the shape of the reference image area so as to be circular. The error still remains. Even if the shape of the target object does not match the shape of the reference image area, if a luminance change remains at the boundary in the parallax search direction of the reference image area, a reference adjacent to the position of the high correlation value by the sub-pixel estimation method An error may occur in the correlation value at the image position.
SUMMARY An advantage of some aspects of the invention is to provide an image processing apparatus that can reduce a correlation value error and obtain a more accurate amount of parallax.

本発明の実施形態の画像処理装置は、視点の異なる複数の画像データの画像処理を行う画像処理装置であって、前記複数の画像データを取得する取得手段と、前記取得手段によって取得された前記複数の画像データのうち、基準画像である第1の画像データの画像に基準画像領域を設定し、参照画像である第2の画像データの画像に参照画像領域を設定して、前記基準画像領域と前記参照画像領域との相関演算によって前記複数の画像データの視差量を算出する演算処理手段と、を備える。前記演算処理手段は、前記基準画像領域の視差方向の境界部における隣接画素の輝度変化値が閾値未満となる形状を有する前記基準画像領域を決定し、決定された前記基準画像領域と、当該基準画像領域の形状に対応する形状を有する前記参照画像領域との間で前記相関演算を行う。   An image processing apparatus according to an embodiment of the present invention is an image processing apparatus that performs image processing on a plurality of image data having different viewpoints, wherein the obtaining unit obtains the plurality of image data, and the obtaining unit obtains the plurality of image data. Setting a reference image area in the image of the first image data as the reference image and setting a reference image area in the image of the second image data as the reference image among the plurality of image data; Calculation processing means for calculating a parallax amount of the plurality of image data by performing a correlation calculation between the image data and the reference image area. The arithmetic processing unit determines the reference image region having a shape in which a luminance change value of an adjacent pixel at a boundary portion in the parallax direction of the reference image region is smaller than a threshold, and the determined reference image region and the reference The correlation operation is performed with the reference image area having a shape corresponding to the shape of the image area.

本発明の画像処理装置によれば、相関値の誤差を低減して、より高精度な視差量を取得することができる。   ADVANTAGE OF THE INVENTION According to the image processing apparatus of this invention, the error of a correlation value can be reduced and a more highly accurate parallax amount can be acquired.

第1実施形態に係る距離検出装置の一例を示す模式図である。FIG. 2 is a schematic diagram illustrating an example of a distance detection device according to the first embodiment. 第1実施形態に係る撮像装置の構成例を説明する模式図である。FIG. 2 is a schematic diagram illustrating a configuration example of an imaging device according to the first embodiment. 第1実施形態に係る距離検出方法を説明する図である。FIG. 5 is a diagram illustrating a distance detection method according to the first embodiment. 第1実施形態に係る基準画像領域の形状の決定方法の説明図である。FIG. 5 is an explanatory diagram of a method for determining a shape of a reference image area according to the first embodiment. 第1実施形態に係る距離検出結果の一例を示す図である。FIG. 6 is a diagram illustrating an example of a distance detection result according to the first embodiment. 第2実施形態に係る基準画像領域の形状の決定方法の説明図である。FIG. 14 is an explanatory diagram of a method for determining a shape of a reference image area according to the second embodiment.

本発明の各実施形態について、添付図面を用いて詳細に説明する。以下の実施形態では、本発明の画像処理装置を適用した装置例として、撮像部によって視点の異なる複数の画像データを取得して、視差量または視差量に対応する距離情報等を算出する装置を説明する。   Each embodiment of the present invention will be described in detail with reference to the accompanying drawings. In the following embodiments, as an example of an apparatus to which the image processing apparatus of the present invention is applied, an apparatus that acquires a plurality of image data having different viewpoints by an imaging unit and calculates a parallax amount or distance information corresponding to the parallax amount is described. explain.

[第1実施形態]
図1は本実施形態の距離検出装置101の概要を示す。撮像部を含む距離検出装置101は、被写体102の撮影を行う。距離検出装置101は、結像光学系103、撮像素子104、演算処理部105、メモリ部106を備える。
[First Embodiment]
FIG. 1 shows an outline of a distance detection device 101 of the present embodiment. A distance detection device 101 including an imaging unit captures an image of a subject 102. The distance detection device 101 includes an imaging optical system 103, an image sensor 104, an arithmetic processing unit 105, and a memory unit 106.

結像光学系103は、被写体からの光を結像し、被写体の像を撮像素子104の撮像面に形成する撮像光学系である。結像光学系103は図示しない複数のレンズ群および絞りを備え、撮像素子104から所定距離の位置に射出瞳を有する。なお、図1に結像光学系103の光軸110を示し、互いに直交する3軸であるX軸、Y軸、Z軸を定義する。本明細書中では光軸110がZ軸と平行であって、Z軸に対して直交するX軸とY軸は互いに垂直であり、且つ光軸と垂直な軸であるものとする。   The imaging optical system 103 is an imaging optical system that forms light from a subject and forms an image of the subject on an imaging surface of the imaging element 104. The imaging optical system 103 includes a plurality of lens groups and a stop (not shown), and has an exit pupil at a position at a predetermined distance from the image sensor 104. Note that FIG. 1 shows the optical axis 110 of the imaging optical system 103, and defines three orthogonal X-axis, Y-axis, and Z-axis. In this specification, the optical axis 110 is parallel to the Z axis, and the X axis and the Y axis orthogonal to the Z axis are perpendicular to each other, and are perpendicular to the optical axis.

撮像素子104には複数の画素部が配置される。図2を参照して具体的に説明する。図2(A)は、各画素部の構成を模式的に示す断面図である。画素部はマイクロレンズ201、カラーフィルタ202、光電変換部203Aおよび203Bを有する。撮像素子104は画素部ごとのカラーフィルタ202によって検出する波長帯域に応じたR(赤),G(緑),B(青)の分光特性が与えられており、図示しない配色パターンでカラーフィルタ群が配置されている。本明細書中では便宜上、各画素部がXY平面に配置されているとして説明する。基板204には、検出する波長帯域に感度を有する光電変換部203Aおよび203Bが形成されている。光電変換部203Aおよび203Bはフォトダイオードを用いて形成されている。また、各画素部は図示しない配線を備えている。   A plurality of pixel units are arranged in the image sensor 104. A specific description will be given with reference to FIG. FIG. 2A is a cross-sectional view schematically illustrating a configuration of each pixel portion. The pixel portion has a micro lens 201, a color filter 202, and photoelectric conversion units 203A and 203B. The image sensor 104 is provided with spectral characteristics of R (red), G (green), and B (blue) according to the wavelength band detected by the color filter 202 for each pixel unit. Is arranged. In this specification, for convenience, each pixel portion is described as being arranged on an XY plane. On the substrate 204, photoelectric conversion units 203A and 203B having sensitivity in a wavelength band to be detected are formed. The photoelectric conversion units 203A and 203B are formed using photodiodes. In addition, each pixel portion includes a wiring (not shown).

図2(B)は、光軸110と撮像素子104との交点(中心像高)から、結像光学系103の射出瞳を見た図である。光電変換部203Aには、第1の瞳部分領域210を主に通過した第1の光束が入射する。光電変換部203Bには、第2の瞳部分領域220を主に通過した第2の光束が入射する。第1の瞳部分領域210と第2の瞳部分領域220は、射出瞳における異なる領域である。光電変換部203Aおよび203Bは、入射された光束をそれぞれ光電変換することで、A画像とB画像を生成する。光電変換部203Aおよび203Bによって取得されたA画像とB画像の各信号は演算処理部105に伝送される。演算処理部105は測距演算処理を実行し、距離検出装置101から被写体102までの距離値を算出する。算出された距離値のデータはメモリ部106に記憶される。また、A画像の信号とB画像の信号を加算した画像信号は、被写体102の撮像画像信号として利用することができる。   FIG. 2B is a view of the exit pupil of the imaging optical system 103 from the intersection (center image height) between the optical axis 110 and the image sensor 104. The first light flux mainly passing through the first pupil partial region 210 enters the photoelectric conversion unit 203A. The second light flux mainly passing through the second pupil partial region 220 enters the photoelectric conversion unit 203B. The first pupil partial region 210 and the second pupil partial region 220 are different regions in the exit pupil. The photoelectric conversion units 203A and 203B generate an A image and a B image by photoelectrically converting the incident light flux, respectively. The signals of the A image and the B image acquired by the photoelectric conversion units 203A and 203B are transmitted to the arithmetic processing unit 105. The calculation processing unit 105 executes a distance measurement calculation process, and calculates a distance value from the distance detection device 101 to the subject 102. The data of the calculated distance value is stored in the memory unit 106. An image signal obtained by adding the signal of the A image and the signal of the B image can be used as a captured image signal of the subject 102.

図2(B)にて、第1の瞳部分領域210の重心位置(第1の重心位置)を点211で示し、第2の瞳部分領域220の重心位置(第2の重心位置)を点221で示す。軸200は、点211と点221を通ってX軸方向に延在する軸である。   In FIG. 2B, the position of the center of gravity of the first pupil partial region 210 (the position of the first center of gravity) is indicated by a point 211, and the position of the center of gravity of the second pupil partial region 220 (the position of the second center of gravity) is indicated by a point. 221. The axis 200 is an axis extending in the X-axis direction through the points 211 and 221.

本実施形態においては、点211で示す第1の重心位置は、射出瞳の中心から軸200に沿って偏心(移動)している。一方、点221で示す第2の重心位置は、軸200に沿って、第1の重心位置とは逆の方向に偏心(移動)している。第1の重心位置を示す点211と第2の重心位置を示す点221とを結ぶ方向を、瞳分割方向と呼ぶ。また、点211と点221との距離、つまり重心間距離が基線長222となる。A画像とB画像は、デフォーカスによって瞳分割方向と同じ方向(本実施形態ではX軸方向)に位置が変化する。A画像とB画像との間の相対的な位置変化量、すなわちA画像とB画像との視差量は、デフォーカス量に応じた量となる。よって、A画像とB画像との視差量を後述の方法により取得し、既知の変換方法によって視差量をデフォーカス量または距離に変換することができる。   In the present embodiment, the position of the first center of gravity indicated by the point 211 is eccentric (moved) along the axis 200 from the center of the exit pupil. On the other hand, the second center of gravity position indicated by the point 221 is eccentric (moved) along the axis 200 in a direction opposite to the first center of gravity position. The direction connecting the point 211 indicating the first position of the center of gravity and the point 221 indicating the position of the second center of gravity is called a pupil division direction. The distance between the point 211 and the point 221, that is, the distance between the centers of gravity is the base line length 222. The positions of the A image and the B image change in the same direction as the pupil division direction (X-axis direction in the present embodiment) due to defocus. The relative position change amount between the A image and the B image, that is, the parallax amount between the A image and the B image is an amount corresponding to the defocus amount. Therefore, the amount of parallax between the A image and the B image can be acquired by a method described later, and the amount of parallax can be converted into a defocus amount or a distance by a known conversion method.

図3を参照して、本実施形態の測距演算について説明する。図3(A)は処理の流れを説明するフローチャートであり、以下の処理は距離検出装置101の制御部が備えるCPU(中央演算処理装置)が所定のプログラムを実行することで実現される。   With reference to FIG. 3, the distance measurement calculation according to the present embodiment will be described. FIG. 3A is a flowchart illustrating the flow of the processing. The following processing is realized by a CPU (Central Processing Unit) included in the control unit of the distance detection device 101 executing a predetermined program.

図3(A)のS301に示す「画像取得」では、被写体を撮影して画像信号を保存する処理が行われる。撮影された画像は、視差を有するA画像とB画像からなる画像の組として取得されて、各画像データはメモリ部106に記憶される。   In “image acquisition” shown in S301 of FIG. 3A, a process of photographing a subject and saving an image signal is performed. The captured image is acquired as a set of an image including an A image and a B image having parallax, and each image data is stored in the memory unit 106.

次のS302からS305に示す測距演算処理は演算処理部105によって行われる。図3(B)を参照して、各ステップにて設定される基準画像領域および参照画像領域の位置関係を説明する。図3(B)は、A画像310AとB画像310Bを模式的に表した図である。Z軸を図3の紙面に垂直な軸とする。X軸は左右方向の軸であって、Y軸は上下方向の軸である。   The distance measurement calculation processing shown in S302 to S305 is performed by the calculation processing unit 105. The positional relationship between the reference image area and the reference image area set in each step will be described with reference to FIG. FIG. 3B is a diagram schematically illustrating the A image 310A and the B image 310B. The Z axis is an axis perpendicular to the plane of FIG. The X axis is a horizontal axis, and the Y axis is a vertical axis.

図3(A)のS302に示す「基準画像領域形状算出」では、基準画像領域の形状を決定する処理が実行される。図3(B)のA画像310Aにおいて画素320は、距離算出を行う対象であり、以下では着目画素と呼ぶ。着目画素320とその近傍画素を含む部分領域を抜き出す処理が行われ、初期形状の画像領域311が得られる。以下では画像領域311を初期基準画像領域と呼ぶ。本明細書ではA画像310A上に着目画素を設定する例を説明する。つまりA画像310Aを基準画像とし、B画像310Bを参照画像としているが、B画像310B上に着目画素を設定してA画像310Aを参照画像としても構わない。S302の処理の詳細については図4を用いて後述する。   In “calculation of reference image region shape” shown in S302 of FIG. 3A, a process of determining the shape of the reference image region is executed. The pixel 320 in the A image 310A of FIG. 3B is a target for which distance calculation is performed, and is hereinafter referred to as a target pixel. A process of extracting a partial region including the target pixel 320 and its neighboring pixels is performed, and an image region 311 having an initial shape is obtained. Hereinafter, the image area 311 is referred to as an initial reference image area. In this specification, an example in which a target pixel is set on the A image 310A will be described. That is, although the A image 310A is used as a reference image and the B image 310B is used as a reference image, a pixel of interest may be set on the B image 310B and the A image 310A may be used as a reference image. Details of the process of S302 will be described later with reference to FIG.

S303に示す「相関演算」では、A画像310AとB画像310Bとの間で相関値を算出する処理が実行される。A画像の着目画素におけるS302で決定された形状の基準画像領域が取得される。次にB画像上で基準画像領域と同形状の領域を抜き出す処理が行われて、参照画像領域313が取得される。図3(B)では説明の便宜上、参照画像領域313が四角形として表示されているが、実際にはS302で決定された形状と同形状の画像領域である。B画像上で参照画像領域を抜き出す位置を、瞳分割方向と同じX軸方向に沿って移動させ、各移動量における参照画像領域と基準画像領域との相関値を算出する処理が行われる。これにより、各移動量に対する相関値のデータ列からなる相関値が得られる。参照画像領域を移動させて相関演算を行う方向を視差算出方向と呼ぶ。視差算出方向を瞳分割方向と同じ方向に設定することにより、A画像とB画像に係る被写体距離に応じて生じる視差量を正しく算出できる。相関値の算出には、SAD(Sum of Absolute Difference)やSSD(Sum of Squared Difference)等の一般的な算出方法を用いることができる。   In the “correlation calculation” shown in S303, a process of calculating a correlation value between the A image 310A and the B image 310B is executed. A reference image area of the shape of the target pixel of the A image determined in S302 is acquired. Next, a process of extracting an area having the same shape as the reference image area on the B image is performed, and a reference image area 313 is obtained. In FIG. 3B, the reference image area 313 is displayed as a square for convenience of explanation, but is actually an image area having the same shape as the shape determined in S302. A process of moving the position where the reference image region is extracted on the B image along the X-axis direction that is the same as the pupil division direction, and calculating a correlation value between the reference image region and the reference image region at each movement amount is performed. As a result, a correlation value composed of a data sequence of correlation values for each movement amount is obtained. The direction in which the reference image area is moved to perform the correlation operation is called a parallax calculation direction. By setting the parallax calculation direction to the same direction as the pupil division direction, it is possible to correctly calculate the amount of parallax generated according to the subject distance of the A image and the B image. For the calculation of the correlation value, a general calculation method such as SAD (Sum of Absolute Difference) or SSD (Sum of Squared Difference) can be used.

S304に示す「視差量算出」では、S303で求めた相関値より視差量を算出する処理が実行される。視差量については、既存の方法を用いて算出することができる。例えば、相関値の中で最も高い相関が得られる移動量とその近傍の移動量に対応する相関値のデータ列を抽出する処理が行われる。既知の内挿方法により、最も相関が高くなる移動量をサブピクセル精度で推定することにより、視差量を算出できる。既知の内挿方法とは、例えば相関値の算出にSADを用いた場合の等角直線フィッティング法であり、またSSDを用いた場合のパラボラフィッティング法である。相関値の算出方法に応じて様々な内挿方法が使用されるが、いかなる内挿方法を用いてサブピクセル精度で視差量を算出してもよい。   In the “parallax amount calculation” shown in S304, a process of calculating the parallax amount from the correlation value obtained in S303 is executed. The amount of parallax can be calculated using an existing method. For example, a process of extracting a data sequence of the correlation value corresponding to the movement amount that provides the highest correlation among the correlation values and the movement amount in the vicinity thereof is performed. The parallax amount can be calculated by estimating the movement amount having the highest correlation with sub-pixel accuracy using a known interpolation method. The known interpolation method is, for example, a conformal straight line fitting method when SAD is used for calculating a correlation value, and a parabolic fitting method when SSD is used. Various interpolation methods are used depending on the method of calculating the correlation value, but the parallax amount may be calculated with sub-pixel accuracy using any interpolation method.

S305に示す「距離値算出」では、S304で算出された視差量をデフォーカス量または被写体距離に変換する処理が実行される。視差量からデフォーカス量への換算は、基線長を用いた幾何学的関係を利用して行うことができる。また、デフォーカス量から被写体距離への変換については、結像光学系103の結像関係を用いて行えばよい。あるいは視差量に所定の変換係数を乗算することでデフォーカス量または被写体距離に変換してもよい。このような方法により、着目画素における距離値を算出することができる。   In the “distance value calculation” shown in S305, a process of converting the parallax amount calculated in S304 into a defocus amount or a subject distance is performed. The conversion from the parallax amount to the defocus amount can be performed by using a geometric relationship using the base line length. The conversion from the defocus amount to the subject distance may be performed using the imaging relationship of the imaging optical system 103. Alternatively, it may be converted into a defocus amount or a subject distance by multiplying the parallax amount by a predetermined conversion coefficient. With such a method, the distance value at the pixel of interest can be calculated.

距離値に対応する分布データ群としては、距離マップの他に像ずれ量マップやデフォーカスマップ等がある。視点の異なる複数の画像データは互いに視差を有し、視差量に対応する像ずれ量またはデフォーカス量を取得することができる。例えば、撮像装置への適用において、制御部はデフォーカス量を用いて撮像光学系の焦点調節の制御を行う。つまり、視点の異なる複数の画像間の相対的な位置ずれ量に基づき、撮像面位相差方式のオートフォーカス制御が行われる。あるいは撮像装置内の画像処理部は、取得された複数の画像データを用いて距離マップ、像ずれ量マップ、デフォーカスマップ等のデータを生成する。これらのデータは撮像画像における奥行き方向の深度情報であり、例えば被写体領域の認識処理、視点変更処理、ボケ補正処理等で使用可能である。また撮像装置内の画像処理部は、取得された視点の異なる複数の画像データを用いて3次元表示(立体視表示)用の画像を生成し、表示部や記録部に出力する。   The distribution data group corresponding to the distance value includes an image shift amount map, a defocus map, and the like in addition to the distance map. A plurality of image data having different viewpoints have a parallax, and an image shift amount or a defocus amount corresponding to the parallax amount can be acquired. For example, in application to an imaging apparatus, the control unit controls the focus adjustment of the imaging optical system using the defocus amount. That is, autofocus control based on the imaging surface phase difference method is performed based on the relative positional shift amount between a plurality of images having different viewpoints. Alternatively, the image processing unit in the imaging device generates data such as a distance map, an image shift amount map, and a defocus map by using the acquired plurality of image data. These data are depth information in the depth direction of the captured image, and can be used in, for example, a subject area recognition process, a viewpoint change process, a blur correction process, and the like. In addition, the image processing unit in the imaging device generates an image for three-dimensional display (stereoscopic display) using the acquired plurality of pieces of image data having different viewpoints, and outputs the image to the display unit and the recording unit.

次に図4を参照して、図3のS302に示す「基準画像領域形状算出」の処理例について説明する。図4(A)はS302の処理の一例を示すフローチャートである。図4(B)は「基準画像領域形状算出」処理を説明するための画像例を示す。図中では画素値が閾値以上の画素を白色で表示し、画素値が閾値未満の画素を黒色で表示しており、白色の画素が高輝度画素を表し、黒色の画素が低輝度画素を表す。図4(B)の紙面に垂直な軸をZ軸とし、Z軸と直交する左右方向の軸をX軸(左側を正方向と定義)とし、Z軸と直交する上下方向の軸をY軸(上側を正方向と定義)とする。   Next, with reference to FIG. 4, a description will be given of a processing example of “reference image area shape calculation” shown in S302 of FIG. FIG. 4A is a flowchart illustrating an example of the process of S302. FIG. 4B shows an example of an image for explaining the “reference image region shape calculation” process. In the figure, pixels whose pixel values are greater than or equal to the threshold are displayed in white, pixels whose pixel values are less than the threshold are displayed in black, white pixels represent high luminance pixels, and black pixels represent low luminance pixels . The axis perpendicular to the plane of FIG. 4B is the Z axis, the horizontal axis orthogonal to the Z axis is the X axis (the left side is defined as the positive direction), and the vertical axis orthogonal to the Z axis is the Y axis. (The upper side is defined as the positive direction).

図4(B)において上側に示す図は、着目画素付近の部分画像を表している。灰色で示す太線枠内の領域は、初期基準画像領域(5×5画素領域)を示す。本実施形態では初期基準画像領域に関し、図3(B)の初期形状(画像領域311の形状)を四角形として説明するが、任意の形状を初期形状として選択可能である。   The upper diagram in FIG. 4B shows a partial image near the pixel of interest. The area inside the bold frame shown in gray indicates the initial reference image area (5 × 5 pixel area). In the present embodiment, regarding the initial reference image area, the initial shape (the shape of the image area 311) in FIG. 3B will be described as a square, but any shape can be selected as the initial shape.

図4(A)のS400では、基準画像領域における視差探索方向の初期形状の境界部が取得されて、境界部の近傍画素に対して順番に処理が実行される。視差探索方向とは、本実施形態では瞳分割方向と同じで、X軸方向のことである。初期形状とは初期基準画像領域の形状である。図4(B)の上側の図では、灰色で示す太線枠Lの左側の境界部に、それぞれに矢印が記載されている。太線枠Lの右側にも同様に境界部が存在する場合もある。   In step S400 of FIG. 4A, the boundary of the initial shape in the parallax search direction in the reference image area is obtained, and the process is sequentially performed on pixels near the boundary. In the present embodiment, the parallax search direction is the same as the pupil division direction, and is the X-axis direction. The initial shape is the shape of the initial reference image area. In the upper part of FIG. 4B, arrows are described at the left boundary of the thick line frame L shown in gray. Similarly, there may be a boundary portion on the right side of the thick line frame L.

S401の「輝度変化計算」処理では、初期形状の境界部において隣接画素の輝度変化を計算する処理が実行される。図4(B)の上側の図で矢印の端点となっている画素が対象画素である。S402の「輝度変化閾値処理」では、S401で算出した輝度変化値が閾値と比較される。対象画素での輝度変化値が閾値以上である場合、S403の処理に進み、輝度変化値が閾値未満である場合にはS404の処理に進む。具体的には、図4(B)の上側の図において上から2行目では、初期形状の境界部の隣接画素はいずれも低輝度画素であり、輝度変化値が閾値未満であるので、S404の処理に移行する。一方、図4(B)の上側の図において上から3行目では、初期形状の境界部の隣接画素が低輝度画素と高輝度画素である。この場合、輝度変化値が閾値以上であるので、S403の処理に進む。   In the “brightness change calculation” process of S401, a process of calculating a brightness change of an adjacent pixel at the boundary of the initial shape is performed. The pixel indicated by the end point of the arrow in the upper diagram of FIG. 4B is the target pixel. In the “brightness change threshold process” of S402, the brightness change value calculated in S401 is compared with a threshold. If the luminance change value of the target pixel is equal to or larger than the threshold, the process proceeds to S403. If the luminance change value is smaller than the threshold, the process proceeds to S404. More specifically, in the second row from the top in the upper diagram of FIG. 4B, the neighboring pixels at the boundary of the initial shape are all low-luminance pixels, and the luminance change value is less than the threshold value. Move to the processing of. On the other hand, in the third row from the top in the upper part of FIG. 4B, adjacent pixels at the boundary of the initial shape are low-luminance pixels and high-luminance pixels. In this case, since the luminance change value is equal to or larger than the threshold, the process proceeds to S403.

S403の「形状変形処理」において、基準画像領域の形状を初期形状から変形する処理が実行される。つまり境界部を視差探索方向に移動させる処理が行われる。そしてS401に移行して、移動後の境界部での輝度変化計算が行われる。次にS402にて輝度変化閾値処理が行われる。閾値未満となる境界部が見つかるまで、境界部を視差探索方向に移動させる処理が繰り返し実行される。図4(B)に示す例で具体的に説明する。   In the “shape deformation process” of S403, a process of deforming the shape of the reference image area from the initial shape is performed. That is, a process of moving the boundary in the parallax search direction is performed. Then, the flow shifts to S401, where a luminance change calculation at the boundary after the movement is performed. Next, a luminance change threshold process is performed in S402. Until a boundary portion smaller than the threshold value is found, the process of moving the boundary portion in the parallax search direction is repeatedly executed. This will be specifically described with reference to an example shown in FIG.

図4(B)の上側の図では、上から3行目(初期形状内では2行目)において輝度変化値が閾値以上である。つまり、境界に隣接する2つの画素のうち、左側の画素が黒色の低輝度画素であり、右側の画素は白色の高輝度画素である。この場合、図4(B)の下側の図にて太線枠LLで示すように、3行目(初期形状内では2行目)において、境界を1画素分だけ−X方向(右方向)に移動させる処理が行われる。これにより、境界の左右の画素がいずれも、高輝度画素となり、輝度変化値が閾値未満となる。その他の境界部についても同様の処理が行われ、いずれの境界部でも輝度変化値が閾値未満となったことがS402で判定された場合にS404の処理に進む。   In the upper part of FIG. 4B, the luminance change value is equal to or larger than the threshold value in the third row from the top (the second row in the initial shape). That is, of the two pixels adjacent to the boundary, the left pixel is a black low-luminance pixel, and the right pixel is a white high-luminance pixel. In this case, as shown by the thick line frame LL in the lower diagram of FIG. 4B, in the third row (the second row in the initial shape), the boundary is shifted by one pixel in the −X direction (right direction). Is performed. As a result, both the left and right pixels on the boundary become high-luminance pixels, and the luminance change value is less than the threshold. Similar processing is performed on the other boundary portions. When it is determined in S402 that the luminance change value is less than the threshold value in any of the boundary portions, the process proceeds to S404.

S404の「形状決定処理」において境界が決定される。すべての視差探索方向の境界において形状を決定する処理が行われることで、基準画像領域の形状が決定される。例えば、図4(B)の上側の図において、上から2行目と4〜6行目(初期形状内では1行目と3〜5行目)や、右側の境界部では輝度変化値が閾値未満であるので、初期形状に対する変形処理が行われず、変更なしで境界が決定される。この場合、図4(B)の下側の図において、太線枠LLでは上から2行目と4〜6行目に該当する部分の形状が変化していない。   The boundary is determined in the “shape determination processing” of S404. The shape of the reference image area is determined by performing the process of determining the shape at the boundaries in all the parallax search directions. For example, in the upper diagram of FIG. 4B, the second row and the fourth to sixth rows from the top (the first row and the third to fifth rows in the initial shape) and the brightness change value at the right boundary portion are different. Since it is less than the threshold value, no deformation process is performed on the initial shape, and the boundary is determined without any change. In this case, in the lower diagram of FIG. 4B, the shape of the portion corresponding to the second row and the fourth to sixth rows from the top in the thick line frame LL does not change.

S405では初期形状のすべての境界部に係る処理が終了したかどうかが判断される。処理が終了した場合、それまでのS401からS404の処理によって、図3(B)の初期形状の画像領域311に対して、基準画像領域312の形状が決定される。また、未終了の場合にはS400に戻って次の境界部の処理を続行する。   In S405, it is determined whether or not the processing for all the boundaries of the initial shape has been completed. When the processing is completed, the shape of the reference image area 312 is determined with respect to the image area 311 having the initial shape in FIG. If the processing has not been completed, the process returns to step S400 to continue the processing of the next boundary portion.

S402で使用する輝度変化値に対する閾値は、どのように決定しても構わない。閾値を小さくする程、精度が良くなるが、S403の形状変形処理が行われても輝度変化値が閾値未満とならないことが多くなる。その結果、計算量が増加する可能性がある。その場合には、形状変形処理を行う毎に閾値を大きくする設定処理が実行される。これまでに計算した輝度変化値と、変更された閾値とを比較する処理が行われて、輝度変化値が閾値未満である場合にはその時点で形状が決定される。それにより形状の変形量を抑えることができ、誤差の低減と計算量の増加とのバランスをとることができる。変更後の閾値と比較される輝度変化値はそれまでに計算された値の最小値でよい。または形状の変形量そのものに制限を加える方法を採用してもよい。S403の形状変形処理を行って、輝度変化値を計算する処理が所定の閾値回数で実行されても、輝度変化値が閾値未満とならない場合には形状変形処理が打ち切られ、計算量の増加が抑えられる。その場合には計算された輝度変化値のうちで、最小の輝度変化値となる形状変形量を選択する処理が行われる。つまり、最小の輝度変化値となる形状が基準画像領域の形状として決定される。計算量が上限を超えないように制限された上で、複数の形状変形量から最適な形状変形量を決定することができる。   The threshold value for the luminance change value used in S402 may be determined in any manner. The accuracy is improved as the threshold value is reduced, but the luminance change value often does not become less than the threshold value even if the shape deformation processing in S403 is performed. As a result, the amount of calculation may increase. In that case, a setting process for increasing the threshold value is performed each time the shape deformation process is performed. A process of comparing the calculated luminance change value with the changed threshold value is performed. If the luminance change value is less than the threshold value, the shape is determined at that time. As a result, the amount of shape deformation can be suppressed, and a balance between a reduction in error and an increase in the amount of calculation can be achieved. The luminance change value to be compared with the changed threshold value may be the minimum value of the values calculated so far. Alternatively, a method of limiting the amount of deformation of the shape itself may be adopted. Even if the process of calculating the brightness change value by performing the shape deformation process of S403 is executed at a predetermined threshold number of times, if the brightness change value does not become less than the threshold value, the shape deformation process is terminated, and the amount of calculation is increased. Can be suppressed. In that case, a process of selecting a shape deformation amount that has a minimum brightness change value from among the calculated brightness change values is performed. That is, the shape having the minimum luminance change value is determined as the shape of the reference image area. After the calculation amount is limited so as not to exceed the upper limit, the optimum shape deformation amount can be determined from a plurality of shape deformation amounts.

図4(B)では形状変形処理の例として、X軸方向のマイナス側に境界を変更する場合を説明したが、X軸方向のプラス側に境界を変形させてもよく、プラス側およびマイナス側の両方の側に変形させてもよい。変形順に関しても特定の順序に限定されない。   In FIG. 4B, as an example of the shape deformation processing, the case where the boundary is changed to the minus side in the X-axis direction has been described. However, the boundary may be changed to the plus side in the X-axis direction. May be deformed to both sides. The order of transformation is not limited to a particular order.

また基準画像領域のサイズ(つまり画素数)に関しては、サイズが小さくなると画素信号のノイズ耐性が低くなり、誤差が大きくなって計算量が増加する可能性がある。初期基準画像領域はノイズと計算量のバランスをとって設定することが望ましい。形状変形処理が行われたとしても、形状変形処理後の基準画像領域のサイズが変形前後で同等となるように変形を行うことが望ましい。同等とは、初期基準画像領域のサイズと形状変形処理後の基準画像領域のサイズとが等しいか、または両者のサイズ差が閾値未満であることをいう。そのためには、X軸方向のプラス側に変形する場合の境界部とマイナス側に変形する場合の境界部とを同数とするか、または同数に近くなるように設定する処理が行われる。例えば、行ごとに交互にプラス側への形状変形とマイナス側への形状変形を行う方法がある。あるいは、初期基準画像領域の左側の境界と右側の境界とで形状変形の方向を異なる側の方向に設定する方法がある。これは初期基準画像領域の左側の境界でその外側(または内側)への形状変形を行い、右側の境界でその内側(または外側)への形状変形を行う方法である。その他、初期基準画像領域のサイズを形状変形後の基準画像領域のサイズと同等とする、どのような方法を用いて構わない。   Regarding the size of the reference image area (that is, the number of pixels), the smaller the size, the lower the noise resistance of the pixel signal, the larger the error, and the more the calculation amount. It is desirable that the initial reference image area be set with a balance between noise and calculation amount. Even if the shape deformation processing is performed, it is desirable to perform the deformation so that the size of the reference image area after the shape deformation processing becomes equal before and after the deformation. Equal means that the size of the initial reference image area is equal to the size of the reference image area after the shape deformation processing, or that the size difference between the two is less than the threshold. For this purpose, a process is performed in which the number of boundaries when deforming to the plus side in the X-axis direction and the number of boundaries when deforming to the minus side are the same or set to be close to the same number. For example, there is a method in which shape deformation to the positive side and shape deformation to the negative side are alternately performed for each row. Alternatively, there is a method in which the direction of shape deformation is set to different directions at the left boundary and the right boundary of the initial reference image area. In this method, the shape is deformed outward (or inward) at the left boundary of the initial reference image area, and the shape is deformed inward (or outside) at the right boundary. In addition, any method may be used to make the size of the initial reference image area equal to the size of the reference image area after shape deformation.

また図3(A)に示すS302の「基準画像領域形状算出」内のループ処理中で前回の処理までの形状変形量に合わせて、形状の変形方向を変更してもよい。ループ処理中とは、S400からS405までの処理にてS405で未処理の判断が行われて処理が継続していることである。初期形状の新たな境界部を処理する場合、前回の処理までに行われた形状変形処理(S403)による形状変形量の総計値が算出される。例えば、ループ処理ごとに形状変形量の加算値を計算する処理が行われる。算出された加算値が正値である場合にはマイナス側への形状変形処理が行われ、また算出された加算値が負値である場合には、プラス側への形状変形処理が行われる。この処理によって、初期基準画像領域のサイズ(画素数)と変形後の基準画像領域のサイズとの差がゼロに近づくように、形状変形処理を行うことができる。また初期基準画像領域のサイズを、ノイズの観点から最小となるサイズに設定し、常にサイズが大きくなる方向へと形状変形処理を行う方法でもよい。これとは逆に初期基準画像領域のサイズを、計算量が許容できる最大のサイズに設定し、常にサイズが小さくなる方向へと形状変形処理を行う方法でもよい。   Further, the shape deformation direction may be changed in accordance with the shape deformation amount up to the previous process in the loop process in the “reference image region shape calculation” of S302 shown in FIG. The loop process is being executed in S405 in S400 to S405, and the process is continued. When processing a new boundary portion of the initial shape, the total value of the shape deformation amount by the shape deformation process (S403) performed up to the previous process is calculated. For example, a process of calculating an added value of the shape deformation amount is performed for each loop process. If the calculated addition value is a positive value, the shape deformation processing to the minus side is performed. If the calculated addition value is a negative value, the shape deformation processing to the plus side is performed. By this processing, the shape deformation processing can be performed so that the difference between the size (the number of pixels) of the initial reference image area and the size of the deformed reference image area approaches zero. Alternatively, a method may be used in which the size of the initial reference image area is set to a minimum size from the viewpoint of noise, and the shape deformation processing is always performed in a direction to increase the size. Conversely, a method may be used in which the size of the initial reference image area is set to the maximum size that allows the amount of calculation, and the shape deformation processing is always performed in a direction in which the size decreases.

本実施形態では、視差探索方向の基準画像領域の境界部における輝度変化値に応じて基準画像領域の形状変形処理を行うことによって、被写体の輝度分布と基準画像領域の位置とに関係して発生する相関値の誤差を低減し、より高精度な測距を実現できる。   In the present embodiment, by performing the shape deformation processing of the reference image area according to the brightness change value at the boundary of the reference image area in the parallax search direction, it is generated in relation to the brightness distribution of the subject and the position of the reference image area. Therefore, the error of the correlation value can be reduced, and more accurate ranging can be realized.

ここで誤差の発生原理と、本実施形態により誤差が改善されることを説明する。まず図5(A)、(B)、(C)を参照して、基準画像領域の形状を変更しない場合(初期基準形状のまま使用する場合)に誤差が発生する理由を説明する。以降の説明では前提として、A画像とB画像とが同じ濃淡を有する画像であって、視差が無いものとする。   Here, the principle of generation of an error and the fact that the error is reduced by the present embodiment will be described. First, with reference to FIGS. 5A, 5B, and 5C, a description will be given of the reason why an error occurs when the shape of the reference image area is not changed (when the initial reference shape is used). In the following description, it is assumed that the A image and the B image are images having the same shading and have no parallax.

図5(A)は、A画像501において基準画像領域502と基準画像領域503との位置関係を示す図である。A画像501は左右方向にて明暗が変化する縦ストライプ形状のパターン画像である。以下ではA画像501にて明暗が切り替わる境界部504および505を、画像エッジと呼ぶ。基準画像領域502内には、画像エッジである境界部504および505が存在する。一方、基準画像領域503内には、画像エッジである境界部505が存在し、基準画像領域503の右端が境界部504と重なっている。   FIG. 5A is a diagram illustrating a positional relationship between the reference image area 502 and the reference image area 503 in the A image 501. The A image 501 is a pattern image of a vertical stripe shape in which the brightness changes in the left-right direction. In the following, the boundary portions 504 and 505 at which light and dark are switched in the A image 501 are referred to as image edges. In the reference image area 502, there are boundaries 504 and 505, which are image edges. On the other hand, a boundary portion 505 that is an image edge exists in the reference image region 503, and the right end of the reference image region 503 overlaps the boundary portion 504.

図5(B)は、参照画像領域を移動させて基準画像領域502との相関演算を行うことで算出される各相関値を例示する。横軸は参照画像領域の移動量を表し、縦軸は相関値を表す。ここでは相関値が低いほど、画像間の相関が高いことを意味する。相関値C0,Cp,Cmはそれぞれ参照画像領域の位置を0,+1画素,−1画素に相当する量だけ移動させたときの相関値である。移動量がゼロである場合に参照画像と基準画像は一致し、相関値C0は低い値となる。参照画像領域を+1画素または−1画素に相当する量だけ移動させた場合、画像エッジである境界部504と505では基準画像領域と参照画像領域との間に差が発生し、相関値Cp,Cmはいずれも増加する。このときの相関値CpとCmは同じ値となる。この相関値を内挿して相関曲線510を求め、最も高い相関となる移動量(視差量)を算出することにより、符号511に示す視差量、すなわち正しい値(視差量0)が求まる。   FIG. 5B illustrates each correlation value calculated by moving the reference image area and performing a correlation operation with the reference image area 502. The horizontal axis represents the movement amount of the reference image area, and the vertical axis represents the correlation value. Here, the lower the correlation value, the higher the correlation between images. The correlation values C0, Cp, and Cm are correlation values when the position of the reference image area is moved by an amount corresponding to 0, +1 pixel, and -1 pixel, respectively. When the movement amount is zero, the reference image and the reference image match, and the correlation value C0 becomes a low value. When the reference image area is moved by an amount corresponding to +1 pixel or −1 pixel, a difference occurs between the reference image area and the reference image area at the boundary portions 504 and 505, which are image edges, and the correlation values Cp, Cm both increase. At this time, the correlation values Cp and Cm have the same value. By calculating the correlation curve 510 by interpolating the correlation value and calculating the movement amount (parallax amount) having the highest correlation, the parallax amount indicated by reference numeral 511, that is, the correct value (parallax amount 0) is obtained.

図5(C)は、参照画像領域を移動させて基準画像領域503との相関演算を行うことで算出される各相関値を例示する。横軸および縦軸の設定は図5(B)と同じである。図5(C)の場合、画像エッジである境界部504と基準画像領域503の右端が重なっている。移動量がゼロであるときに参照画像と基準画像は一致し、相関値C0は低い値となる。移動量が+1画素に相当する量であるときには、基準画像領域502の場合と同様に相関値Cpが増加する。他方、移動量が−1画素に相当する量であるときには、画像エッジである境界部505のみで基準画像と参照画像との差が発生する。そのため、−1画素に対応する相関値Cmの増加については微増となる。相関値は移動量のプラス側とマイナス側で非対称となるので、各相関値を内挿して求まる視差量(符号512参照)は正しい値(視差量0)とは異なる値となり、その結果、誤差が発生する。   FIG. 5C illustrates each correlation value calculated by moving the reference image area and performing a correlation operation with the reference image area 503. The setting of the horizontal axis and the vertical axis is the same as in FIG. In the case of FIG. 5C, the boundary 504, which is an image edge, and the right end of the reference image area 503 overlap. When the movement amount is zero, the reference image and the reference image match, and the correlation value C0 is low. When the movement amount is an amount corresponding to +1 pixel, the correlation value Cp increases as in the case of the reference image area 502. On the other hand, when the movement amount is an amount corresponding to −1 pixel, a difference between the reference image and the reference image occurs only at the boundary portion 505 which is an image edge. Therefore, the increase in the correlation value Cm corresponding to −1 pixel is slightly increased. Since the correlation value is asymmetric on the plus side and the minus side of the movement amount, the amount of parallax (see reference numeral 512) obtained by interpolating each correlation value is different from the correct value (parallax amount 0). Occurs.

次に本実施形態により、前記誤差が低減される理由を説明する。本実施形態では基準画像領域503のように画像エッジと基準画像領域の右端とが重なる場合、基準画像領域の形状変形処理が行われる。画像エッジと基準画像領域の右端とが重ならないように、基準画像領域の形状が変化する。図5(D)を参照して具体的に説明する。   Next, the reason why the error is reduced by the present embodiment will be described. In the present embodiment, when the image edge and the right end of the reference image area overlap, as in the case of the reference image area 503, the shape deformation processing of the reference image area is performed. The shape of the reference image area changes so that the image edge and the right end of the reference image area do not overlap. This will be specifically described with reference to FIG.

図5(D)に示す基準画像領域506は、基準画像領域503に対応する形状変形処理後の領域である。基準画像領域503の右端部が変形されて、基準画像領域506は画像エッジと重ならない形状になる。そのため、図5(B)と同様に移動量が+1画素と−1画素に対応する量である場合の相関値CpとCmが同じ値となる。よって、正しい値(視差量0)を求めることができる。より詳細には、基準画像領域の形状が変化することで、基準画像領域の視差方向の境界で大きな輝度変化が発生しないように形状が設定される。例えば基準画像領域の形状を菱形や円形にした場合でも画像エッジと重ならなくなるが、境界の一部分では視差方向の境界で大きな輝度変化が発生する部分が残存し、それが誤差を発生させる要因となる。そこで、本実施形態では、視差方向の各境界で大きな輝度変化が発生しないように基準画像領域の形状変形処理を実行することにより、前記誤差をより低減することができる。例えば、撮像画像の画素値が大きく変化する領域と基準画像領域の左右方向の端部(境界部)とが重なる場合に発生する視差量の算出誤差を低減できる。   A reference image area 506 shown in FIG. 5D is an area after the shape deformation processing corresponding to the reference image area 503. The right end of the reference image area 503 is deformed, so that the reference image area 506 has a shape that does not overlap the image edge. Therefore, as in FIG. 5B, the correlation values Cp and Cm when the movement amount is an amount corresponding to +1 pixel and −1 pixel have the same value. Therefore, a correct value (parallax amount 0) can be obtained. More specifically, the shape is set so that a change in the shape of the reference image region does not cause a large change in luminance at the boundary in the parallax direction of the reference image region. For example, even if the shape of the reference image area is rhombic or circular, it does not overlap with the image edge, but a part of the boundary where a large luminance change occurs at the boundary in the parallax direction remains, which is a factor that causes an error. Become. Therefore, in the present embodiment, the error can be further reduced by executing the shape deformation processing of the reference image area so that a large luminance change does not occur at each boundary in the parallax direction. For example, it is possible to reduce the calculation error of the amount of parallax that occurs when an area in which the pixel value of the captured image greatly changes and an end (boundary) in the left-right direction of the reference image area overlaps.

本実施形態によれば、撮影画像を用いた距離計測において、相関値の誤差を低減して、より高精度な距離情報を取得することができる。   According to the present embodiment, in distance measurement using a captured image, errors in correlation values can be reduced and more accurate distance information can be obtained.

[第2実施形態]
次に本発明の第2実施形態を説明する。本実施形態では第1実施形態との相違点を主に説明し、第1実施形態と同様の事項については説明を省略する。このような説明の省略の仕方は後述の実施形態でも同じである。
[Second embodiment]
Next, a second embodiment of the present invention will be described. In the present embodiment, differences from the first embodiment will be mainly described, and description of the same items as those in the first embodiment will be omitted. The manner of omitting such description is the same in the embodiments described later.

図3(A)のS302に示す「基準画像領域形状算出」では、隣接画素の差分値(輝度変化値)により、基準画像領域の形状を決定する処理が実行される。着目画素として多くの画素を計算する必要がある場合、隣接画素の輝度変化値の計算として何度も同じ計算が行われる可能性がある。そこで本実施形態では、事前に隣接画素の輝度変化値の計算を行うことで計算量を削減し、効率良く基準画像領域の形状算出を行う例を説明する。   In “reference image region shape calculation” shown in S302 of FIG. 3A, a process of determining the shape of the reference image region based on a difference value (brightness change value) between adjacent pixels is performed. When many pixels need to be calculated as the target pixel, the same calculation may be performed many times as the calculation of the luminance change value of the adjacent pixel. Therefore, in the present embodiment, an example will be described in which the calculation amount is reduced by calculating the luminance change values of adjacent pixels in advance, and the shape of the reference image area is efficiently calculated.

図6は、本実施形態におけるS302の「基準画像領域形状算出」を説明するフローチャートである。S610の処理は、A画像上での隣接画素の輝度変化値を計算する処理である。この計算処理は、S302の処理が行われる前に事前に実行される。S610での計算結果のデータは、例えばメモリ部106に記憶される。S610ではA画像上の隣接画素の輝度変化値、つまり着目画素とその周辺画素とで複数回の輝度変化値を計算する可能性がある画素領域の全域に亘って計算処理が実行される。隣接画素の輝度変化値は、例えば隣接画素値同士の差分の絶対値として算出される。   FIG. 6 is a flowchart illustrating “reference image region shape calculation” of S302 in the present embodiment. The process of S610 is a process of calculating a luminance change value of an adjacent pixel on the A image. This calculation process is executed in advance before the process of S302 is performed. The data of the calculation result in S610 is stored in, for example, the memory unit 106. In S610, the calculation process is executed over the entire pixel area where the brightness change value of the adjacent pixel on the A image, that is, the brightness change value of the target pixel and its surrounding pixels may be calculated a plurality of times. The luminance change value of an adjacent pixel is calculated, for example, as an absolute value of a difference between adjacent pixel values.

S302においては、図4(A)と同様に、視差探索方向における初期基準画像の形状の境界に沿って繰り返し計算が行われる。S400に続くS601の「最小値探索処理」では、S610で事前に計算されている隣接画素の輝度変化値についての最小値を探索する処理が行われる。初期基準画像の形状の境界から許容できる形状変更範囲に対応した隣接画素の輝度変化値を抽出する処理が実行される。抽出された隣接画素の輝度変化値の最小値が探索される。   In S302, as in FIG. 4A, the calculation is repeatedly performed along the boundary of the shape of the initial reference image in the disparity search direction. In the “minimum value search processing” of S601 following S400, processing of searching for the minimum value of the luminance change value of the adjacent pixel calculated in advance in S610 is performed. A process of extracting a luminance change value of an adjacent pixel corresponding to an allowable shape change range from the boundary of the shape of the initial reference image is executed. The minimum value of the luminance change values of the extracted adjacent pixels is searched.

S602の「基準画像領域形状決定処理」では、S601で探索された輝度変化値の最小値である画素位置に対応したA画像上の位置を境界として設定することにより、基準画像領域の形状が決定される。   In the “reference image region shape determination processing” of S602, the position of the reference image region is determined by setting a position on the A image corresponding to the pixel position that is the minimum luminance change value searched for in S601 as a boundary. Is done.

複数の着目画素間で基準画像領域のサイズをおよそ一定にするために、前述した初期基準画像の形状の境界から許容できる形状変更範囲をループ処理ごとに変更してもよい。例えば行ごとに形状変更範囲を変更する方法や、右側の境界と左側の境界とで形状変更範囲を変更する方法がある。   In order to make the size of the reference image area approximately constant among a plurality of target pixels, the shape change range allowable from the boundary of the shape of the initial reference image described above may be changed for each loop process. For example, there is a method of changing the shape change range for each row, and a method of changing the shape change range between the right boundary and the left boundary.

またS601を最小値の探索ではなく閾値処理とし、輝度変化値が閾値未満となる画素位置を探索してもよい。これにより隣接画素の輝度変化値が閾値未満となる画素位置候補からS602において基準画像領域の形状を決定することができる。例えば、初期基準画像領域の形状に最も近い位置を選択することで初期基準画像領域の形状により近い基準画像領域の形状を決定することができる。また複数の着目画素間で基準画像領域のサイズがおよそ一定となるように、基準画像領域の各境界位置で既に変形済みの形状変形量に従って画素位置を選択することでサイズを調整することができる。   Alternatively, S601 may be set as threshold processing instead of searching for the minimum value, and a pixel position where the luminance change value is less than the threshold may be searched. Thereby, the shape of the reference image area can be determined in S602 from the pixel position candidates where the luminance change value of the adjacent pixel is less than the threshold value. For example, by selecting a position closest to the shape of the initial reference image area, the shape of the reference image area closer to the shape of the initial reference image area can be determined. Further, the size can be adjusted by selecting a pixel position according to the already deformed shape deformation amount at each boundary position of the reference image region so that the size of the reference image region is approximately constant among the plurality of target pixels. .

またS610で事前に計算されている隣接画素の輝度変化値に基づいて、S302の「基準画像領域形状算出」を行う位置をあらかじめ決定してもよい。隣接画素の輝度変化値の情報により、各着目画素で輝度変化値が閾値以上である画素位置をあらかじめ判別することができる。輝度変化値が閾値以上である画素位置を抽出し、その画素位置で初期基準画像領域の形状の視差方向の境界が重なる着目画素を抽出する処理が実行され、その着目画素のみでS302の処理が実行される。当該着目画像以外ではS302の処理を行わず、S303へ移行する。これにより、計算量を削減することができる。   Further, the position at which the “reference image region shape calculation” of S302 is performed may be determined in advance based on the luminance change value of the adjacent pixel calculated in advance in S610. From the information on the luminance change value of the adjacent pixel, it is possible to determine in advance the pixel position where the luminance change value is equal to or larger than the threshold value in each target pixel. A process of extracting a pixel position where the luminance change value is equal to or greater than the threshold value and extracting a target pixel at which the boundary of the shape of the initial reference image region in the parallax direction overlaps is executed, and the process of S302 is performed using only the target pixel. Be executed. The process shifts to S303 without performing the process of S302 except for the image of interest. As a result, the amount of calculation can be reduced.

本実施形態によれば、初期基準画像領域に対する形状変形処理において、より効率的に基準画像領域の形状を算出することができる。   According to the present embodiment, it is possible to more efficiently calculate the shape of the reference image area in the shape deformation processing on the initial reference image area.

[第3実施形態]
次に本発明の第3実施形態を説明する。本実施形態では、各マイクロレンズに対する複数の光電変換部を有する瞳分割型撮像素子ではなく、ステレオカメラを使用する。視点の異なる複数の画像データを取得可能な撮像装置は、2つ以上の複数の撮像光学系とそれらに対応する撮像素子によって実現できる。この場合、基線長の設計自由度が向上し、測距分解能が向上する。
[Third embodiment]
Next, a third embodiment of the present invention will be described. In the present embodiment, a stereo camera is used instead of a pupil division type image sensor having a plurality of photoelectric conversion units for each microlens. An imaging device capable of acquiring a plurality of image data with different viewpoints can be realized by two or more imaging optical systems and their corresponding imaging devices. In this case, the design flexibility of the base line length is improved, and the distance measurement resolution is improved.

本実施形態では、例えば撮像装置と投影装置とを別の装置として距離検出装置が構成される。被写体に所定のパターンの光を照射する投影装置と組み合わせることで、より高精度な測距を行うことができる。例えば、図5(A),(D)に示すような縦線チャートを被写体に投影することで、被写体にテクスチャがない領域でも測距が可能となる。ただし、前述したように誤差が生じやすいシーンとなるので、前述した基準画像領域の形状変形処理を実行することにより、誤差を低減できる。制御装置としては撮像装置内に備えられたCPUを用いて構成することが装置の小型化の観点から好適である。   In the present embodiment, for example, a distance detection device is configured by using the imaging device and the projection device as separate devices. By combining with a projection device that irradiates a subject with light of a predetermined pattern, more accurate distance measurement can be performed. For example, by projecting a vertical line chart as shown in FIGS. 5A and 5D onto a subject, distance measurement can be performed even in a region where the subject has no texture. However, since the scene is likely to have an error as described above, the error can be reduced by executing the shape deformation processing of the reference image area described above. It is preferable that the control device is configured using a CPU provided in the imaging device from the viewpoint of miniaturization of the device.

本実施形態は、撮像装置から被写体までの距離を算出する以外に、視差量を検出する視差量検出装置に適用することができる。この場合、図3において、S305の「距離値算出」を省略可能である。視差量検出装置では、検出された視差量に基づいて、合焦位置近傍の被写体の画像領域を撮像された画像から切り出す処理等が行われる。視差量検出装置は、前記実施形態の距離検出装置101において視差量を距離に変換せずにそのまま出力する構成であり、その他の構成は距離検出装置101と同じである。   The present embodiment can be applied to a parallax amount detection device that detects a parallax amount in addition to calculating a distance from an imaging device to a subject. In this case, in FIG. 3, “calculation of distance value” in S305 can be omitted. In the parallax amount detection device, based on the detected parallax amount, a process of cutting out an image area of a subject near the in-focus position from a captured image is performed. The parallax amount detection apparatus is configured to output the parallax amount as it is without converting the parallax amount into a distance in the distance detection apparatus 101 of the above embodiment, and the other configuration is the same as the distance detection apparatus 101.

デジタルカメラにおいては、検出された視差量に基づいて結像光学系103や撮像素子104に対するフィードバック制御が行われ、例えば、より高精度な自動焦点調節を実現できる。この場合、撮像光学系の制御部および撮像素子の制御部、またはそのいずれか一方の制御部は、任意の画角における補正距離に応じた移動量を計算する。例えば制御部は、視差量に対応する像ずれ量またはデフォーカス量を算出し、撮像光学系内のフォーカスユニットを駆動する駆動部を制御して焦点調節を行う。あるいは制御部は視差量に対応する像ずれ量またはデフォーカス量を算出し、撮像素子の駆動部を制御することで撮像素子を移動させて焦点調節を行う。より高精度な視差量を得ることができるので、被写体に対して1回のフィードバック制御で、より正確な焦点合わせが可能となる。また視差量に対応する距離情報(深度情報)を用いて、より高精度な被写界情報を取得できるので、不図示のストロボを用いて、最適なストロボ撮影を行うこともできる。   In the digital camera, feedback control is performed on the imaging optical system 103 and the image sensor 104 based on the detected amount of parallax, and for example, more accurate automatic focus adjustment can be realized. In this case, the control unit of the image pickup optical system and the control unit of the image pickup device, or any one of the control units, calculate the movement amount according to the correction distance at an arbitrary angle of view. For example, the control unit calculates an image shift amount or a defocus amount corresponding to the parallax amount, and controls a driving unit that drives a focus unit in the imaging optical system to perform focus adjustment. Alternatively, the control unit calculates an image shift amount or a defocus amount corresponding to the parallax amount, and controls the driving unit of the image sensor to move the image sensor to perform focus adjustment. Since a more accurate amount of parallax can be obtained, more accurate focusing can be performed with a single feedback control on the subject. Further, since more accurate field information can be obtained using the distance information (depth information) corresponding to the parallax amount, it is possible to perform optimal flash photography using a strobe (not shown).

この他、本実施形態の装置は、自律的に行動計画を作成可能なロボットや自動車、ドローン等に搭載され、外部環境を認識するための情報取得手段として活用することができる。取得された距離情報を用いて、外部環境認識部で外部環境認識データに変換する処理が実行される。この場合のシステムは撮像装置と、撮像画像データを処理する外部環境認識部と、行動計画作成部と、アクチュエータ制御部を備える。行動計画作成部は、外部環境認識部が出力する外部環境認識データを取得し、当該データと事前に与えてある目的に応じて行動計画を作成する。アクチュエータ制御部は、行動計画作成部により作成された行動計画にしたがってアクチュエータを制御する。アクチュエータは原動機や電気モータや車輪の駆動部、脚機構部等である。ロボットや移動装置の自律移動を実現する上で、本実施形態に係る撮像装置は、誤差が低減された距離情報を取得できるので、外部環境をより安定して認識できるという効果を奏する。   In addition, the device of the present embodiment is mounted on a robot, a car, a drone, or the like capable of autonomously creating an action plan, and can be used as information acquisition means for recognizing an external environment. Using the acquired distance information, the external environment recognizing unit performs a process of converting the distance information into external environment recognition data. The system in this case includes an imaging device, an external environment recognition unit that processes the captured image data, an action plan creation unit, and an actuator control unit. The action plan creation unit acquires the external environment recognition data output from the external environment recognition unit, and creates an action plan according to the data and a given purpose in advance. The actuator control unit controls the actuator according to the action plan created by the action plan creation unit. The actuator is a prime mover, an electric motor, a driving unit of a wheel, a leg mechanism, or the like. In realizing autonomous movement of a robot or a moving device, the imaging device according to the present embodiment can acquire distance information with reduced errors, and thus has an effect of being able to more stably recognize an external environment.

本実施形態によれば、距離検出装置または視差量検出装置を利用する各種システムへの適用において、より高速で高精度な距離検出または視差量検出が可能である。   According to the present embodiment, faster and more accurate distance detection or parallax amount detection is possible in application to various systems using the distance detection device or the parallax amount detection device.

[その他の実施形態]
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other Embodiments]
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 距離検出装置
103 結像光学系
104 撮像素子
105 演算処理部

Reference Signs List 101 distance detection device 103 imaging optical system 104 imaging device 105 arithmetic processing unit

Claims (24)

視点の異なる複数の画像データの画像処理を行う画像処理装置であって、
前記複数の画像データを取得する取得手段と、
前記取得手段によって取得された前記複数の画像データのうち、基準画像である第1の画像データの画像に基準画像領域を設定し、参照画像である第2の画像データの画像に参照画像領域を設定して、前記基準画像領域と前記参照画像領域との相関演算によって前記複数の画像データの視差量を算出する演算処理手段と、を備え、
前記演算処理手段は、前記基準画像領域の視差方向の境界部における隣接画素の輝度変化値が閾値未満となる形状を有する前記基準画像領域を決定し、決定された前記基準画像領域と、当該基準画像領域の形状に対応する形状を有する前記参照画像領域との間で前記相関演算を行う
ことを特徴とする画像処理装置。
An image processing apparatus that performs image processing on a plurality of image data having different viewpoints,
Acquisition means for acquiring the plurality of image data;
A reference image area is set in the image of the first image data that is the reference image, and a reference image area is set in the image of the second image data that is the reference image, of the plurality of pieces of image data acquired by the acquisition unit. Setting, calculating processing means for calculating the amount of parallax of the plurality of image data by a correlation operation between the reference image area and the reference image area,
The arithmetic processing unit determines the reference image region having a shape in which a luminance change value of an adjacent pixel at a boundary portion in the parallax direction of the reference image region is smaller than a threshold, and the determined reference image region and the reference An image processing apparatus, wherein the correlation operation is performed with the reference image area having a shape corresponding to the shape of the image area.
前記演算処理手段は、
前記基準画像領域の初期形状を設定する設定手段と、
前記初期形状である基準画像領域の視差方向の境界部における隣接画素の輝度変化値を算出する算出手段と、
前記算出手段により算出される前記輝度変化値が前記閾値以上である場合、前記初期形状である基準画像領域の境界の位置を変更することにより当該基準画像領域の形状を変形する変形手段と、を備える
ことを特徴とする請求項1に記載の画像処理装置。
The arithmetic processing means,
Setting means for setting an initial shape of the reference image area,
Calculation means for calculating a luminance change value of an adjacent pixel at a boundary portion in the parallax direction of the reference image region that is the initial shape,
When the brightness change value calculated by the calculation unit is equal to or more than the threshold, a deformation unit that changes the shape of the reference image region by changing the position of the boundary of the reference image region that is the initial shape, The image processing apparatus according to claim 1, comprising:
前記算出手段は、前記変形手段によって変形された前記基準画像領域の視差方向の境界部における隣接画素の輝度変化値を算出し、
前記演算処理手段は、前記算出手段により算出された前記輝度変化値が前記閾値未満である場合、前記変形手段により変形された前記基準画像領域の境界の位置を決定する
ことを特徴とする請求項2に記載の画像処理装置。
The calculating means calculates a luminance change value of an adjacent pixel at a boundary in the parallax direction of the reference image area deformed by the deforming means,
The arithmetic processing unit, when the luminance change value calculated by the calculation unit is less than the threshold, determines a position of a boundary of the reference image area deformed by the deformation unit. 3. The image processing device according to 2.
前記変形手段は、前記基準画像領域の形状を変形する際の変形量を制限し、前記算出手段によって算出される前記輝度変化値が前記閾値未満とならない場合には前記基準画像領域の形状の変形処理を止める
ことを特徴とする請求項3に記載の画像処理装置。
The deformation unit limits the amount of deformation when deforming the shape of the reference image region, and when the luminance change value calculated by the calculation unit does not fall below the threshold, the shape of the reference image region is deformed. The image processing apparatus according to claim 3, wherein the processing is stopped.
前記変形手段は、前記算出手段によって算出される前記輝度変化値が前記閾値未満とならない場合、前記算出手段によって算出された前記輝度変化値のうちで、最小の輝度変化値となる形状を前記基準画像領域の形状として決定する
ことを特徴とする請求項4に記載の画像処理装置。
When the brightness change value calculated by the calculation means does not become less than the threshold value, the deformation means determines a shape having a minimum brightness change value among the brightness change values calculated by the calculation means as the reference. The image processing apparatus according to claim 4, wherein the image processing apparatus determines the shape of the image area.
前記演算処理手段は、前記変形手段によって前記基準画像領域の形状の変形処理を行う毎に前記閾値を大きく設定する
ことを特徴とする請求項2乃至5のいずれか1項に記載の画像処理装置。
The image processing apparatus according to claim 2, wherein the arithmetic processing unit sets the threshold value to be large each time the deformation unit performs a deformation process on the shape of the reference image area. .
前記初期形状である基準画像領域のサイズと、前記変形手段による変形処理後の基準画像領域のサイズとが等しいか、または前記初期形状である基準画像領域のサイズと、前記変形手段による変形処理後の基準画像領域のサイズとのサイズ差が閾値未満である
ことを特徴とする請求項2乃至6のいずれか1項に記載の画像処理装置。
The size of the reference image area that is the initial shape is equal to the size of the reference image area after the deformation processing by the deformation unit, or the size of the reference image area that is the initial shape and the size of the reference image area after the deformation processing by the deformation unit. The image processing apparatus according to any one of claims 2 to 6, wherein a size difference from the size of the reference image area is smaller than a threshold value.
前記変形手段は、前記基準画像領域の形状を変形する方向を行ごとに変更する
ことを特徴とする請求項2乃至7のいずれか1項に記載の画像処理装置。
The image processing apparatus according to claim 2, wherein the deforming unit changes a direction in which a shape of the reference image area is deformed for each row.
前記変形手段は、前記基準画像領域の形状を変形する方向を、視差方向の第1の境界と第2の境界とで異なる側の方向に設定する
ことを特徴とする請求項2乃至7のいずれか1項に記載の画像処理装置。
The said deformation | transformation means sets the direction which deform | transforms the shape of the said reference | standard image area to the direction of a different side by the 1st boundary of a parallax direction, and the 2nd boundary. The image processing apparatus according to claim 1.
前記変形手段は、前記基準画像領域の形状を変形する方向を、既に行った変形処理による変形量の総計値にしたがって変更する
ことを特徴とする請求項2乃至7のいずれか1項に記載の画像処理装置。
The said deformation | transformation means changes the direction which deform | transforms the shape of the said reference image area according to the total value of the deformation amount by the already-performed deformation | transformation processing. The Claims any one of Claims 2 thru | or 7 characterized by the above-mentioned. Image processing device.
前記変形手段は、前記初期形状である基準画像領域のサイズに比べて、変形処理ごとに変更される前記基準画像領域のサイズを常に大きくするかまたは小さくする
ことを特徴とする請求項2乃至6のいずれか1項に記載の画像処理装置。
The said deformation | transformation means always makes the size of the said reference image area changed for every deformation process larger or smaller than the size of the reference | standard image area which is the said initial shape. The image processing device according to any one of claims 1 to 4.
前記変形手段は、前記算出手段によって事前に算出された前記隣接画素の輝度変化値を用いて前記基準画像領域の形状を変形する処理を行う
ことを特徴とする請求項2に記載の画像処理装置。
The image processing apparatus according to claim 2, wherein the deforming unit performs a process of deforming a shape of the reference image area using a luminance change value of the adjacent pixel calculated in advance by the calculating unit. .
前記変形手段は、前記算出手段によって事前に算出された前記隣接画素の輝度変化値についての最小値を探索し、探索された前記輝度変化値の最小値である画素位置に対応した前記基準画像領域の位置を境界として設定する
ことを特徴とする請求項12に記載の画像処理装置。
The deformation unit searches for a minimum value of the luminance change value of the adjacent pixel calculated in advance by the calculation unit, and the reference image area corresponding to a pixel position that is the minimum value of the searched luminance change value. The image processing apparatus according to claim 12, wherein the position is set as a boundary.
前記変形手段は、前記算出手段によって事前に算出された前記隣接画素の輝度変化値が閾値未満となる画素位置により前記基準画像領域の形状を決定する
ことを特徴とする請求項12に記載の画像処理装置。
The image according to claim 12, wherein the deforming unit determines the shape of the reference image area based on a pixel position where a luminance change value of the adjacent pixel calculated in advance by the calculating unit is smaller than a threshold. Processing equipment.
前記変形手段は、前記隣接画素の輝度変化値が前記閾値未満である画素位置のうち、前記初期形状である基準画像領域の形状により近い画素位置を選択して前記基準画像領域の形状を決定する
ことを特徴とする請求項14に記載の画像処理装置。
The deformation unit determines a shape of the reference image region by selecting a pixel position closer to the shape of the reference image region, which is the initial shape, from among the pixel positions where the luminance change value of the adjacent pixel is less than the threshold value. The image processing apparatus according to claim 14, wherein:
前記変形手段は、前記隣接画素の輝度変化値が前記閾値未満である画素位置のうち、前記基準画像領域の境界位置で変形済みの変形量にしたがって前記画素位置を選択して前記基準画像領域のサイズを調整し、前記基準画像領域の形状を決定する
ことを特徴とする請求項14に記載の画像処理装置。
The deformation unit selects the pixel position according to the deformation amount that has been deformed at the boundary position of the reference image region among the pixel positions where the luminance change value of the adjacent pixel is less than the threshold, and The image processing apparatus according to claim 14, wherein a size is adjusted to determine a shape of the reference image area.
前記算出手段によって事前に算出された前記隣接画素の輝度変化値により、前記基準画像領域の形状の変形処理を行うかどうかを判断する判断手段を備え、
前記変形手段は、前記判断手段により前記基準画像領域の形状の変形処理を行うと判断された場合、前記輝度変化値が閾値以上である画素位置を選択して前記基準画像領域の形状を決定する
ことを特徴とする請求項12に記載の画像処理装置。
With a luminance change value of the adjacent pixel calculated in advance by the calculation unit, a determination unit that determines whether to perform a deformation process of the shape of the reference image region,
When the determination unit determines that the shape of the reference image area is to be deformed by the determination unit, the deformation unit selects a pixel position where the luminance change value is equal to or greater than a threshold to determine the shape of the reference image area. The image processing apparatus according to claim 12, wherein:
前記判断手段は、前記初期形状である基準画像領域の境界部にて前記隣接画素の輝度変化値が閾値未満である場合に前記基準画像領域の形状の変形処理を行わないと判断する
ことを特徴とする請求項17に記載の画像処理装置。
The determining unit determines that the deformation processing of the shape of the reference image region is not performed when the luminance change value of the adjacent pixel is less than a threshold value at the boundary of the reference image region that is the initial shape. The image processing apparatus according to claim 17, wherein
請求項1乃至18のいずれか1項に記載の画像処理装置と、
撮像手段と、を備え、
前記演算処理手段は、前記参照画像領域を変更して前記基準画像領域と前記参照画像領域との相関演算により算出された複数の相関値から前記視差量に対応する距離情報を算出する
ことを特徴とする距離検出装置。
An image processing apparatus according to any one of claims 1 to 18,
Imaging means,
The arithmetic processing means calculates distance information corresponding to the amount of parallax from a plurality of correlation values calculated by performing a correlation operation between the reference image region and the reference image region by changing the reference image region. Distance detecting device.
前記撮像手段は、複数のマイクロレンズと、各マイクロレンズに対応する複数の光電変換部を備え、
前記取得手段は、前記撮像手段から視点の異なる複数の画像データを取得する
ことを特徴とする請求項19に記載の距離検出装置。
The imaging unit includes a plurality of microlenses, and a plurality of photoelectric conversion units corresponding to each microlens,
20. The distance detecting apparatus according to claim 19, wherein the acquisition unit acquires a plurality of image data having different viewpoints from the imaging unit.
請求項1乃至18のいずれか1項に記載の画像処理装置と、
撮像手段と、
前記視差量に対応するデフォーカス量を算出して撮像光学系の焦点調節の制御を行う制御手段と、を備える
ことを特徴とする撮像装置。
An image processing apparatus according to any one of claims 1 to 18,
Imaging means;
Control means for calculating a defocus amount corresponding to the parallax amount and controlling focus adjustment of the imaging optical system.
前記撮像手段は、複数のマイクロレンズと、各マイクロレンズに対応する複数の光電変換部を備え、
前記取得手段は、前記撮像手段から視点の異なる複数の画像データを取得する
ことを特徴とする請求項21に記載の撮像装置。
The imaging unit includes a plurality of microlenses, and a plurality of photoelectric conversion units corresponding to each microlens,
22. The imaging apparatus according to claim 21, wherein the acquisition unit acquires a plurality of pieces of image data having different viewpoints from the imaging unit.
視点の異なる複数の画像データの画像処理を行う画像処理装置にて実行される制御方法であって、
前記複数の画像データを取得する取得工程と、
取得された前記複数の画像データのうち、基準画像である第1の画像データの画像に基準画像領域を設定し、参照画像である第2の画像データの画像に参照画像領域を設定する設定工程と、
前記基準画像領域と前記参照画像領域との相関演算によって前記複数の画像データの視差量を算出する算出工程と、を有し、
前記設定工程では、前記基準画像領域の視差方向の境界部における隣接画素の輝度変化値が閾値未満となる形状を有する前記基準画像領域を決定する処理が行われ、前記算出工程では、決定された前記基準画像領域と、当該基準画像領域の形状に対応する形状を有する前記参照画像領域との間で前記相関演算が行われる
ことを特徴とする画像処理装置の制御方法。
A control method executed by an image processing apparatus that performs image processing of a plurality of image data having different viewpoints,
An obtaining step of obtaining the plurality of image data,
A setting step of setting a reference image area in the image of the first image data as the reference image and setting a reference image area in the image of the second image data as the reference image among the plurality of acquired image data sets When,
A calculating step of calculating a parallax amount of the plurality of image data by a correlation operation between the reference image area and the reference image area,
In the setting step, a process of determining the reference image region having a shape in which a luminance change value of an adjacent pixel in a boundary portion of the reference image region in the parallax direction is smaller than a threshold value is performed. The control method of an image processing device, wherein the correlation operation is performed between the reference image region and the reference image region having a shape corresponding to the shape of the reference image region.
請求項23に記載の制御方法の各工程をコンピュータに実行させる
ことを特徴とするプログラム。



A program for causing a computer to execute each step of the control method according to claim 23.



JP2018142350A 2018-07-30 2018-07-30 Image processing device and its control method, distance detection device, imaging device, program Active JP7195801B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018142350A JP7195801B2 (en) 2018-07-30 2018-07-30 Image processing device and its control method, distance detection device, imaging device, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018142350A JP7195801B2 (en) 2018-07-30 2018-07-30 Image processing device and its control method, distance detection device, imaging device, program

Publications (2)

Publication Number Publication Date
JP2020021126A true JP2020021126A (en) 2020-02-06
JP7195801B2 JP7195801B2 (en) 2022-12-26

Family

ID=69589824

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018142350A Active JP7195801B2 (en) 2018-07-30 2018-07-30 Image processing device and its control method, distance detection device, imaging device, program

Country Status (1)

Country Link
JP (1) JP7195801B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021245972A1 (en) * 2020-06-05 2021-12-09 日立Astemo株式会社 Computation device and parallax calculation method
WO2022024793A1 (en) * 2020-07-28 2022-02-03 京セラ株式会社 Image processing device, stereo camera device, moving object, parallax calculation method, and image processing method
GB2608496A (en) * 2021-05-07 2023-01-04 Canon Kk Image processing apparatus and method, and image capturing apparatus and control method thereof, program, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010165248A (en) * 2009-01-16 2010-07-29 Casio Computer Co Ltd Image processor, image collation method, and program
JP2011103040A (en) * 2009-11-10 2011-05-26 Mitsubishi Electric Corp Following device
JP2011165117A (en) * 2010-02-15 2011-08-25 Nec System Technologies Ltd Apparatus, method and program for processing image
WO2013038863A1 (en) * 2011-09-13 2013-03-21 富士フイルム株式会社 Monocular stereoscopic imaging device, imaging method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010165248A (en) * 2009-01-16 2010-07-29 Casio Computer Co Ltd Image processor, image collation method, and program
JP2011103040A (en) * 2009-11-10 2011-05-26 Mitsubishi Electric Corp Following device
JP2011165117A (en) * 2010-02-15 2011-08-25 Nec System Technologies Ltd Apparatus, method and program for processing image
WO2013038863A1 (en) * 2011-09-13 2013-03-21 富士フイルム株式会社 Monocular stereoscopic imaging device, imaging method, and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
浜村 倫行 ほか: "ステレオ画像の視差検出と符合化への応用", 情報処理学会研究報告 99−CVIM−115, vol. 99, no. 29, JPN6022032843, 18 March 1999 (1999-03-18), JP, pages 65 - 72, ISSN: 0004844899 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021245972A1 (en) * 2020-06-05 2021-12-09 日立Astemo株式会社 Computation device and parallax calculation method
DE112021001906T5 (en) 2020-06-05 2023-01-26 Hitachi Astemo, Ltd. COMPUTING DEVICE AND PARALLAX CALCULATION METHOD
WO2022024793A1 (en) * 2020-07-28 2022-02-03 京セラ株式会社 Image processing device, stereo camera device, moving object, parallax calculation method, and image processing method
GB2608496A (en) * 2021-05-07 2023-01-04 Canon Kk Image processing apparatus and method, and image capturing apparatus and control method thereof, program, and storage medium
GB2608496B (en) * 2021-05-07 2024-04-24 Canon Kk Image processing apparatus and method, and image capturing apparatus and control method thereof, program, and storage medium

Also Published As

Publication number Publication date
JP7195801B2 (en) 2022-12-26

Similar Documents

Publication Publication Date Title
US10832429B2 (en) Device and method for obtaining distance information from views
TWI521255B (en) Automatic focusing method, and automatic focusing device, image capturing device using the same
JP4852591B2 (en) Stereoscopic image processing apparatus, method, recording medium, and stereoscopic imaging apparatus
JP5776771B2 (en) Corresponding point search device and distance measurement device
WO2021054140A1 (en) Image processing device, image processing method, imaging device, and program
JP7378219B2 (en) Imaging device, image processing device, control method, and program
JP2020021126A (en) Image processing device and control method thereof, distance detection device, imaging device, program
JP2017138199A (en) Image processing device, imaging device, and image processing method
JP2019168479A (en) Controller, imaging device, method for control, program, and, and storage medium
WO2019216229A1 (en) Data processing device, data processing method, and program
US20210065404A1 (en) Image processing apparatus, image processing method, and program
JP5925109B2 (en) Image processing apparatus, control method thereof, and control program
US20130076868A1 (en) Stereoscopic imaging apparatus, face detection apparatus and methods of controlling operation of same
JP6648916B2 (en) Imaging device
KR101839357B1 (en) Imaging apparatus and imaging method
JP7341033B2 (en) Parallax detection device, imaging device, parallax detection method, and program
JP6257201B2 (en) FOCUS DETECTION DEVICE, ITS CONTROL METHOD, CONTROL PROGRAM, AND IMAGING DEVICE
JP6900228B2 (en) Imaging device, imaging system, imaging device control method, and program
JP7346021B2 (en) Image processing device, image processing method, imaging device, program and recording medium
JP6608238B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP7200002B2 (en) Image processing device, imaging device, image processing method, program, and storage medium
JP2017083817A (en) Deviation amount acquisition device, imaging apparatus, and deviation amount acquisition method
JP2017073681A (en) Imaging device and imaging processing program
JP2016090975A (en) Distance detector, imaging apparatus, distance detection method, and program
JP6066765B2 (en) Imaging device, control method thereof, and control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210727

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220705

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220809

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220926

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221214

R151 Written notification of patent or utility model registration

Ref document number: 7195801

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151