JP2017040549A - Image processing device and error determination method - Google Patents

Image processing device and error determination method Download PDF

Info

Publication number
JP2017040549A
JP2017040549A JP2015162192A JP2015162192A JP2017040549A JP 2017040549 A JP2017040549 A JP 2017040549A JP 2015162192 A JP2015162192 A JP 2015162192A JP 2015162192 A JP2015162192 A JP 2015162192A JP 2017040549 A JP2017040549 A JP 2017040549A
Authority
JP
Japan
Prior art keywords
image
unit
camera
parameter
calibration
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
JP2015162192A
Other languages
Japanese (ja)
Other versions
JP2017040549A5 (en
JP6599685B2 (en
Inventor
幹生 瀬戸
Mikio Seto
幹生 瀬戸
徳井 圭
Kei Tokui
圭 徳井
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2015162192A priority Critical patent/JP6599685B2/en
Publication of JP2017040549A publication Critical patent/JP2017040549A/en
Publication of JP2017040549A5 publication Critical patent/JP2017040549A5/ja
Application granted granted Critical
Publication of JP6599685B2 publication Critical patent/JP6599685B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device which can detect the occurrence of an error in a value of a camera parameter regardless of whether or not an object in the known size is reflected on a photographed image.SOLUTION: An image processing device 100 includes: a deviation range calculation part 104 which calculates deviation ranges in the longitudinal direction and short side direction of two calibration images obtained by calibrating a left image and a right image on the basis of a camera parameter and a reference imaging distance; a deviation amount calculation part 105 which calculates a deviation amount in each direction of the two calibration images; and a determination part 106 which determines whether or not an error occurs in the camera parameter by comparing the deviation range with the deviation amount.SELECTED DRAWING: Figure 1

Description

本発明は、精度の高い三次元計測を可能にするための画像処理を行う画像処理装置、及び、そのような画像処理装置による、三次元計測のために参照されるパラメータの誤差を判定する方法に関する。   The present invention relates to an image processing apparatus that performs image processing for enabling highly accurate three-dimensional measurement, and a method for determining an error of a parameter referred to for three-dimensional measurement by such an image processing apparatus. About.

被写体の三次元位置を計測するシステムの一例として、2台のカメラを備えたステレオカメラシステムを用いた三次元計測システムがある。このような計測システムは、上記2台のカメラを通じて撮影された2枚の画像間の対応点を検出することで視差を算出し、三角測量の原理を利用して、上記2台のカメラが捉えた被写体の三次元位置を算出する。ピンホールカメラにモデル化された上記2台のカメラを平行配置したステレオカメラシステムの場合、被写体の三次元位置は、次の式(式1)によって算出することができる。   An example of a system that measures the three-dimensional position of a subject is a three-dimensional measurement system that uses a stereo camera system that includes two cameras. Such a measurement system calculates parallax by detecting corresponding points between the two images taken through the two cameras, and captures the two cameras using the principle of triangulation. The three-dimensional position of the subject is calculated. In the case of a stereo camera system in which the two cameras modeled as a pinhole camera are arranged in parallel, the three-dimensional position of the subject can be calculated by the following equation (Equation 1).

Figure 2017040549
Figure 2017040549

ここで、X、Y、及び、Zは、それぞれ、基準カメラ(2台のカメラのうちの一方のカメラ)が設置されている位置を原点とする世界座標系における被写体の位置のX座標値、Y座標値、及び、Z座標値を示している。また、x、yは基準カメラの撮像センサ上の投影座標、fは焦点距離、Bはカメラ間基線長、Dはカメラ間視差である。   Here, X, Y, and Z are the X coordinate values of the position of the subject in the world coordinate system with the position where the reference camera (one of the two cameras) is set as the origin, Y coordinate values and Z coordinate values are shown. Further, x and y are projection coordinates on the image sensor of the reference camera, f is a focal length, B is an inter-camera baseline length, and D is an inter-camera parallax.

しかしながら、実際には、X、Y、及び、Zの値は、「カメラ固定具への設置誤差、カメラ内部の撮像センサ取り付け位置のずれ、レンズ歪など」の影響による誤差のため、あまり正確な値にはならない。そのため、これらの影響を考慮して上記式の右辺の各パラメータを補正した後に、補正後の各パラメータを用いて上記式による演算を行うことで三次元計測を行うことが一般的である。   However, in reality, the values of X, Y, and Z are not very accurate because of errors due to the effects of “installation error on the camera fixture, displacement of the mounting position of the image sensor inside the camera, lens distortion, etc.” Not a value. Therefore, it is common to perform three-dimensional measurement by correcting each parameter on the right side of the above equation in consideration of these influences and then performing an operation according to the above equation using each parameter after correction.

上記のような誤差を考慮した場合、世界座標系における任意の点(Xw、Yw、Zw)と、その任意の点が投影される画像座標(u、v)の関係式は、例えば、次の式(式2)のようにモデル化することができる。   In consideration of the error as described above, a relational expression between an arbitrary point (Xw, Yw, Zw) in the world coordinate system and an image coordinate (u, v) on which the arbitrary point is projected is, for example, It can be modeled as an equation (Equation 2).

Figure 2017040549
Figure 2017040549

ここで、rij(i=1、2、3、j=1、2、3)は世界座標系とカメラ座標系との回転変換を示す回転パラメータであり、tx、ty、tzは世界座標系とカメラ座標系との並進パラメータである。これらのパラメータは外部パラメータと呼ばれる。 Here, r ij (i = 1, 2, 3, j = 1, 2, 3) is a rotation parameter indicating the rotation transformation between the world coordinate system and the camera coordinate system, and t x , t y , and t z are This is a translation parameter between the world coordinate system and the camera coordinate system. These parameters are called external parameters.

また、ki(i=1、2、3)およびpi(i=1、2)は、カメラのレンズ歪に関するパラメータであり、fx、fyは2台のカメラの焦点距離であり、cx、cyは2台のカメラの主点位置であり、これらのパラメータは内部パラメータと呼ばれる。ここで、主点とは、レンズの焦点からレンズに向かって焦点距離だけ移動した位置のことを指している。 K i (i = 1, 2, 3) and p i (i = 1, 2) are parameters relating to camera lens distortion, fx and fy are focal lengths of the two cameras, cx, cy is the principal point position of the two cameras, and these parameters are called internal parameters. Here, the principal point refers to a position moved from the focal point of the lens toward the lens by a focal length.

これらのパラメータは一般に未知であるが、既知の世界座標系の点(Xw、Yw、Zw)と画像上の投影点(u、v)との間の複数の対応関係を基に、非線形解法などを用いてこれらのパラメータを推定することができる。この推定手法の一例としては非特許文献1に開示されている方法がある。このように、カメラパラメータ(レンズ歪パラメータ、内部パラメータ、外部パラメータ)を推定する処理はキャリブレーションと呼ばれる。レンズ歪パラメータおよび内部パラメータによって、カメラの光学経路に関わる固有のずれ等の影響により生じる誤差を小さくすることで、画像をピンホールカメラモデルとして扱うことができるようになる。   Although these parameters are generally unknown, nonlinear solutions, etc. based on a plurality of correspondences between known world coordinate system points (Xw, Yw, Zw) and projected points (u, v) on the image Can be used to estimate these parameters. As an example of this estimation method, there is a method disclosed in Non-Patent Document 1. In this way, the process of estimating camera parameters (lens distortion parameters, internal parameters, external parameters) is called calibration. An image can be handled as a pinhole camera model by reducing an error caused by an influence such as an inherent shift related to the optical path of the camera by the lens distortion parameter and the internal parameter.

ステレオカメラにおいて、外部パラメータは、共通の世界座標系と各カメラ座標系との並進・回転の関係を示すパラメータであることから、それぞれ推定された外部パラメータに基づき、一方のカメラ座標系から他方のカメラ座標系への並進・回転パラメータが算出できる。カメラ間の並進・回転関係が既知となるため、光軸方向を平行化するように画像を校正することが可能となる。   In stereo cameras, the external parameters are parameters indicating the translational / rotational relationship between the common world coordinate system and each camera coordinate system. Therefore, based on the estimated external parameters, the external parameters are Translation / rotation parameters to the camera coordinate system can be calculated. Since the translational / rotational relationship between the cameras is known, it is possible to calibrate the image so that the optical axis direction is parallel.

以上のように2枚の画像を校正・平行化し、2枚の画像間の視差を算出することで、式1に基づいた三次元計測を行うことができる。また、以上のようなステレオカメラによる三次元計測は、校正・平行化した画像に基づいて行われるため、三次元計測の計測精度は、キャリブレーションによって推定されるカメラパラメータの推定精度により変化する。   As described above, the two images are calibrated and parallelized, and the parallax between the two images is calculated, so that the three-dimensional measurement based on Equation 1 can be performed. Further, since the three-dimensional measurement by the stereo camera as described above is performed based on the calibrated / parallelized image, the measurement accuracy of the three-dimensional measurement changes depending on the estimation accuracy of the camera parameter estimated by the calibration.

しかしながら、ステレオカメラによる三次元計測システムの実際の運用を考えた場合、カメラ固定具の経年劣化や振動等の影響を受けることによって、適切なカメラパラメータの値が、キャリブレーションを行った時点のカメラパラメータの値(もしくは、計測システムで利用している(補正後の)カメラパラメータの値)から変化してしまっている可能性がある。   However, when considering the actual operation of the stereo camera 3D measurement system, the camera parameters at the time of calibration are determined by the effects of aging and vibration of the camera fixture. There is a possibility that the value has changed from the parameter value (or the camera parameter value (after correction) used in the measurement system).

上記の影響を受けた後のある時点において、キャリブレーションを行った時点のカメラパラメータの値(もしくは、計測システムで利用している(補正後の)カメラパラメータの値)に基づいて三次元計測を行った場合、誤った三次元計測結果が算出されてしまうこととなる。そのため、カメラパラメータの値が適切な値ではなくなった(カメラパラメータの値に誤差が生じた)ことを検出し、カメラパラメータの値を正しい値に補正する機能が必要である。   Based on the camera parameter value at the time of calibration (or the camera parameter value (after correction) used in the measurement system) at a certain point after being affected by the above effects, If it is performed, an erroneous three-dimensional measurement result is calculated. For this reason, it is necessary to detect a camera parameter value that is no longer an appropriate value (an error has occurred in the camera parameter value) and correct the camera parameter value to a correct value.

このようなカメラパラメータの値の誤差を低減する技術が特許文献1に開示されている。   Patent Document 1 discloses a technique for reducing such an error in camera parameter values.

特許文献1に記載の校正装置は、まず、ステレオカメラの撮影画像(一方のカメラ画像)の中から、ナンバープレートのように予め大きさが既知である平面状の対象物を認識し、更にその対象物の特徴点座標を検出する。   First, the calibration device described in Patent Document 1 recognizes a planar object whose size is known in advance, such as a license plate, from a captured image (one camera image) of a stereo camera. The feature point coordinates of the object are detected.

続いて、一方のカメラ画像の前記特徴点座標が他方のカメラ画像に投影された投影点の座標位置と、他方のカメラ画像における、前記特徴点座標に対応する特徴点の座標位置と、を比較することによって、新たなカメラパラメータを推定する。   Subsequently, the coordinate position of the projection point at which the feature point coordinate of one camera image is projected onto the other camera image is compared with the coordinate position of the feature point corresponding to the feature point coordinate in the other camera image. Thus, a new camera parameter is estimated.

最後に、新たなカメラパラメータと元のカメラパラメータを比較することで、カメラパラメータを補正する。   Finally, the camera parameters are corrected by comparing the new camera parameters with the original camera parameters.

特開2014−74632号公報(2014年4月24日公開)JP 2014-74632 A (published April 24, 2014)

Z.Zhang、“A Flexible New Technique for Camera Calibration”、[online]、2009年11月5日、[2015年5月27日検索]、インターネット<http://research.microsoft.com/en-us/um/people/zhang/Papers/TR98-71.pdf>Z. Zhang, “A Flexible New Technology for Camera Calibration”, [online], November 5, 2009, [May 27, 2015 search], Internet <http://research.microsoft.com/en-us/um /people/zhang/Papers/TR98-71.pdf>

前述の通り、カメラパラメータの正確さは三次元計測において重要であり、キャリブレーション時に求めた現在のカメラパラメータ(もしくは、その後に補正された現在のカメラパラメータ)の値に振動等の影響による誤差が生じた場合には、正確な三次元計測を行うことができない。そのため、カメラパラメータの値に誤差が生じた場合には、速やかに誤差を低減することが必要である。   As described above, the accuracy of camera parameters is important in three-dimensional measurement, and errors due to the effects of vibration and other factors are present in the values of current camera parameters (or current camera parameters corrected thereafter) obtained during calibration. If it occurs, accurate three-dimensional measurement cannot be performed. Therefore, if an error occurs in the camera parameter value, it is necessary to quickly reduce the error.

しかしながら、特許文献1に記載の校正装置は、ステレオカメラの撮影画像にサイズが既知の対象物が映り込んでいない場合には、カメラパラメータの値の誤差を低減することができない。   However, the calibration device described in Patent Document 1 cannot reduce the error of the camera parameter value when an object having a known size does not appear in the captured image of the stereo camera.

そのため、例えば、特許文献1に記載の校正装置およびステレオカメラを含む計測システムを用いて、サイズが未知の対象物である「人物」の三次元位置を計測する場合、以下の2つの条件が重なったときには、「人物」の三次元位置を正確に計測することができない。
(条件1)「人物」の三次元位置を計測するまでにステレオカメラのカメラパラメータの値に誤差が生じた。
(条件2)ステレオカメラの撮影範囲内に、「人物」とともに他の対象物(具体的には、サイズが既知の対象物(例えば、ナンバープレート))が含まれていない。
Therefore, for example, when measuring the three-dimensional position of the “person” that is the object of unknown size using the measurement system including the calibration device and the stereo camera described in Patent Document 1, the following two conditions overlap. The three-dimensional position of the “person” cannot be measured accurately.
(Condition 1) An error occurred in the camera parameter value of the stereo camera before measuring the three-dimensional position of “person”.
(Condition 2) Other objects (specifically, objects with known sizes (for example, license plates)) are not included in the shooting range of the stereo camera together with “person”.

本発明は、以上の課題を鑑みてなされたものであり、その主な目的は、撮影画像にサイズが既知の対象物が映り込んでいるか否かに関わらず、カメラパラメータの値に誤差が生じたことを検知できる画像処理装置および誤差判定方法を実現することにある。   The present invention has been made in view of the above problems, and its main purpose is to generate an error in the value of the camera parameter regardless of whether or not an object having a known size is reflected in the captured image. It is to realize an image processing apparatus and an error determination method capable of detecting the above.

上記の課題を解決するために、本発明の一態様に係る画像処理装置は、少なくとも2つの視点画像を取得する画像取得部と、並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正部と、前記カメラパラメータに誤差が生じているか否かを判定する判定部とを備え、前記画像校正部は、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、前記判定部は、前記カメラパラメータに基づいて、前記2つの校正画像における、前記少なくとも一方の方向のずれ範囲を算出し、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出し、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定する。   In order to solve the above problems, an image processing apparatus according to an aspect of the present invention includes two image acquisition units that acquire at least two viewpoint images, and two camera parameters including a translation parameter and a rotation parameter. An image calibration unit that generates two calibration images from the viewpoint image, and a determination unit that determines whether or not an error has occurred in the camera parameter, wherein the image calibration unit has a longitudinal length according to the translation parameter. The translation error in at least one of the direction and the short direction is not calibrated, and the two calibration images are generated in which the rotation deviation according to the rotation parameter is calibrated. Based on this, a deviation range in the at least one direction in the two calibration images is calculated, and the one calibration image in the two calibration images is calculated. By calculating a deviation amount in the at least one direction of a corresponding point corresponding to the reference point in the other calibration image with respect to an arbitrary reference point, and comparing the deviation range and the deviation amount, It is determined whether an error has occurred.

上記の課題を解決するために、本発明の一態様に係る誤差判定方法は、画像処理装置による誤差判定方法であって、少なくとも2つの視点画像を取得する画像取得ステップと、並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正ステップと、前記カメラパラメータに誤差が生じているか否かを判定する判定ステップとを含み、前記画像校正ステップにて、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、前記判定ステップは、前記カメラパラメータに基づいて、前記2つの校正画像における、長手方向および短手方向の少なくとも一方の方向のずれ範囲を算出するステップと、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出するステップと、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定するステップとを含んでいる。   In order to solve the above problems, an error determination method according to an aspect of the present invention is an error determination method by an image processing apparatus, which includes an image acquisition step of acquiring at least two viewpoint images, a translation parameter, and a rotation parameter. An image calibration step for generating two calibration images from the two viewpoint images, and a determination step for determining whether or not an error has occurred in the camera parameters, In the step, the two calibration images in which the translational deviation in at least one of the longitudinal direction and the lateral direction according to the translation parameter is not calibrated, and the rotational deviation according to the rotational parameter is calibrated. Generating and determining, based on the camera parameters, in the longitudinal direction and the short side in the two calibration images. Calculating a deviation range in at least one direction of the direction, and an arbitrary reference point in one of the two calibration images, and a corresponding point corresponding to the reference point in the other calibration image, The method includes a step of calculating a shift amount in at least one direction and a step of determining whether or not an error has occurred in the camera parameter by comparing the shift range with the shift amount.

本発明の一態様に係る画像処理装置及び誤差判定方法は、撮影画像にサイズが既知の対象物が映り込んでいるか否かに関わらず、カメラパラメータの値に誤差が生じたことを検知できる、という効果を奏する。   The image processing apparatus and the error determination method according to one aspect of the present invention can detect that an error has occurred in the value of the camera parameter regardless of whether or not an object having a known size is reflected in the captured image. There is an effect.

第1の実施形態に係る画像処理装置の構成例を示す図である。It is a figure which shows the structural example of the image processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係る画像処理装置の処理フローを示す図である。It is a figure which shows the processing flow of the image processing apparatus which concerns on 1st Embodiment. 回転校正部が生成する生成画像の概念を示す図である。It is a figure which shows the concept of the production | generation image which a rotation calibration part produces | generates. カメラパラメータに基づく、ずれ範囲の概念を示す図である。It is a figure which shows the concept of the shift | offset | difference range based on a camera parameter. 第1の実施形態に係る画像処理装置の異なる構成例を示す図である。It is a figure which shows the example of a different structure of the image processing apparatus which concerns on 1st Embodiment. 第1の実施形態に係る画像撮像装置の一構成例を示す図である。It is a figure showing an example of 1 composition of an image pick-up device concerning a 1st embodiment. 第2の実施形態に係る画像処理装置の構成例を示す図である。It is a figure which shows the structural example of the image processing apparatus which concerns on 2nd Embodiment. 第2の実施形態に係る画像処理装置の処理フローを示す図である。It is a figure which shows the processing flow of the image processing apparatus which concerns on 2nd Embodiment. 情報提示部に提示される画像の一例を示す図である。It is a figure which shows an example of the image shown to an information presentation part. 第3の実施形態に係る三次元計測処理部の構成例を示す図である。It is a figure which shows the structural example of the three-dimensional measurement process part which concerns on 3rd Embodiment. 第3の実施形態に係る三次元計測処理部の処理フローを示す図である。It is a figure which shows the processing flow of the three-dimensional measurement process part which concerns on 3rd Embodiment. 第4の実施形態に係る車載システムの構成例を示す図である。It is a figure which shows the structural example of the vehicle-mounted system which concerns on 4th Embodiment. 第4の実施形態に係る車載システムの処理フローを示す図である。It is a figure which shows the processing flow of the vehicle-mounted system which concerns on 4th Embodiment. 第5の実施形態に係る三次元画像表示システムの構成例を示す図である。It is a figure which shows the structural example of the three-dimensional image display system which concerns on 5th Embodiment.

以下、本発明の各実施形態について、図面を参照して説明する。   Hereinafter, each embodiment of the present invention will be described with reference to the drawings.

(第1の実施形態)
本発明の一実施形態に係る画像処理装置の基本的な構成について説明する。図1は、本実施形態に係る画像処理装置の一構成例を示す図である。
(First embodiment)
A basic configuration of an image processing apparatus according to an embodiment of the present invention will be described. FIG. 1 is a diagram illustrating a configuration example of an image processing apparatus according to the present embodiment.

(画像処理装置100の構成)
図1に示すように、画像処理装置100は、画像取得部101、パラメータ取得部102、回転校正部103、ずれ範囲算出部104、及び、ずれ量算出部105、及び、判定部106を備えている。
(Configuration of the image processing apparatus 100)
As illustrated in FIG. 1, the image processing apparatus 100 includes an image acquisition unit 101, a parameter acquisition unit 102, a rotation calibration unit 103, a deviation range calculation unit 104, a deviation amount calculation unit 105, and a determination unit 106. Yes.

画像取得部101は、少なくとも2枚の視点画像を取得する。該少なくとも2枚の視点画像は、例えば、ステレオカメラシステムを構成する2台のカメラによって略同時に撮影された2枚の視点画像であってもよい。   The image acquisition unit 101 acquires at least two viewpoint images. The at least two viewpoint images may be, for example, two viewpoint images photographed substantially simultaneously by two cameras that constitute a stereo camera system.

パラメータ取得部102は、カメラパラメータ等(カメラパラメータ、及び、撮像距離に関するパラメータ)を取得する。   The parameter acquisition unit 102 acquires camera parameters and the like (camera parameters and parameters related to the imaging distance).

回転校正部103は、前記少なくとも2枚の画像をカメラパラメータに基づいて回転補正する。   The rotation calibration unit 103 corrects the rotation of the at least two images based on camera parameters.

ずれ範囲算出部104は、カメラパラメータに基づき、2枚の画像の並進ずれ範囲を算出する。   The shift range calculation unit 104 calculates the translation shift range of the two images based on the camera parameters.

ずれ量算出部105は、前記少なくとも2枚の画像間の対応点に基づき、並進ずれ量を算出するずれ量算出部105と、
判定部106は、前記ずれ範囲と前記ずれ量を比較することで、カメラパラメータのずれ判定(カメラパラメータに誤差が生じているか否かの判定)を行う。
The shift amount calculation unit 105 calculates a shift amount calculation unit 105 based on the corresponding points between the at least two images.
The determination unit 106 compares the shift range and the shift amount to perform camera parameter shift determination (determination as to whether an error has occurred in the camera parameter).

なお、前記並進ずれ範囲は、「前記カメラパラメータに基づく三次元測定を一定以上の精度で行うことが可能な前記並進ずれ量の範囲」を示している。   The translational deviation range indicates “the range of the translational deviation amount in which three-dimensional measurement based on the camera parameters can be performed with a certain degree of accuracy”.

画像処理装置100の各部の処理は、例えば、FPGA(Field Programmable Gate Array)やDSP(Disital Signal Processor)、GPU(Graphics Processing Unit)、ASIC(Application Specific Integrated Circuit)、などの電子回路によって実装されてもよい。もしくは、画像処理装置100は、CPU(Central Processing Unit)等のプロセッサがプログラムを実行することにより、上記各部の処理を行ってもよい。   The processing of each part of the image processing apparatus 100 is implemented by, for example, an FPGA (Field Programmable Gate Array), a DSP (Digital Signal Processor), a GPU (Graphics Processing Unit), an ASIC (Application Specific Integrated Circuit), or the like. Also good. Alternatively, the image processing apparatus 100 may perform the above-described processing by a processor such as a CPU (Central Processing Unit) executing a program.

(画像処理装置100の動作)
次に、画像処理装置100の動作について図2を参照しながら説明する。図2は、画像処理装置100の処理の流れを示す図である。
(Operation of the image processing apparatus 100)
Next, the operation of the image processing apparatus 100 will be described with reference to FIG. FIG. 2 is a diagram illustrating a processing flow of the image processing apparatus 100.

ステップS101において、画像取得部101は、複数(2つ以上)の異なる視点から撮影された複数の視点画像を含む多視点画像データを取得する。   In step S101, the image acquisition unit 101 acquires multi-viewpoint image data including a plurality of viewpoint images photographed from a plurality (two or more) different viewpoints.

画像取得部101が取得する多視点画像データとしては、例えば、以下のような多視点画像データが挙げられる。
・CMOS(Complementary Metal Oxide Semiconductor)やCCD(Charge Coupled Device)などの撮像素子と、レンズなどの光学部品と、から構成される1つの撮像装置が、平行移動台に乗った状態で平行移動しながら対象物を複数回撮影することによって得る複数の視点画像を含む多視点画像データ
・前記撮像装置を複数具備するように構成した多眼撮像システムが撮影した複数の視点画像を含む多視点画像データ
・1つの撮像素子に対して複数の光学経路を有するように構成されたレンズシステムを取り付けることで多視点画像を撮影できる多眼撮像システムにより撮影された複数の視点画像を含む多視点画像データ
・サイドバイサイドやフレームパッキングなどの多視点画像の保存フォーマットで保存された多視点画像データ
以降では、画像取得部101が取得する多視点画像データが、左右に並べて配置した2台のカメラを備えたステレオカメラシステムにより得られる視点画像データである例を挙げながら、画像処理装置100の動作を説明する。
Examples of the multi-view image data acquired by the image acquisition unit 101 include the following multi-view image data.
A single imaging device composed of an imaging element such as a CMOS (Complementary Metal Oxide Semiconductor) or CCD (Charge Coupled Device) and an optical component such as a lens is translated while being mounted on a translation table. Multi-viewpoint image data including a plurality of viewpoint images obtained by photographing a target object a plurality of times. Multi-viewpoint image data including a plurality of viewpoint images captured by a multi-view imaging system configured to include a plurality of the imaging devices. Multi-viewpoint image data including a plurality of viewpoint images photographed by a multi-view imaging system capable of photographing a multi-viewpoint image by attaching a lens system configured to have a plurality of optical paths to one image sensor side-by-side And multiple viewpoints such as frame packing Multi-viewpoint image data stored in an image storage format Hereinafter, multi-viewpoint image data acquired by the image acquisition unit 101 is viewpoint image data obtained by a stereo camera system including two cameras arranged side by side. The operation of the image processing apparatus 100 will be described with an example.

また、以降では、2台のカメラのうちの左カメラを基準カメラ、2台のカメラのうちの右カメラを参照カメラと呼び、左カメラによって撮影された視点画像のデータを基準画像データ、右カメラによって撮影された視点画像のデータを参照画像データと呼ぶ。また、2台のカメラが並んでいる左右方向を長手方向と呼び、2台のカメラの上下方向を短手方向と呼びながら、画像処理装置100の動作を説明する。   In the following, the left camera of the two cameras is referred to as the reference camera, the right camera of the two cameras is referred to as the reference camera, and the viewpoint image data captured by the left camera is referred to as the reference image data and the right camera. The data of the viewpoint image captured by the above is called reference image data. The operation of the image processing apparatus 100 will be described while referring to the left-right direction in which the two cameras are lined up as the longitudinal direction and the up-down direction of the two cameras as the short direction.

また、左右方向をX軸方向、上下方向をY軸方向、前後方向をZ軸方向として定義づけて説明を行う。ここで、本説明においては、世界座標系の原点および座標軸方向は、基準カメラにおける座標の原点および座標軸系と一致するものとして説明する。   The description will be made with the left-right direction defined as the X-axis direction, the up-down direction defined as the Y-axis direction, and the front-back direction defined as the Z-axis direction. Here, in this description, it is assumed that the origin and the coordinate axis direction of the world coordinate system coincide with the origin of the coordinate and the coordinate axis system of the reference camera.

なお、画像取得部101が取得する多視点画像データが、上下に並べて配置した2台のカメラを備えたステレオカメラシステムにより得られる視点画像データである場合における、画像処理装置100の動作については、当業者であれば、以降の説明文における「X軸方向」を「Y軸方向」と、「Y軸方向」を「X軸方向」と読み替えることによって、理解できるであろう。   Regarding the operation of the image processing apparatus 100 when the multi-viewpoint image data acquired by the image acquisition unit 101 is viewpoint image data obtained by a stereo camera system including two cameras arranged one above the other, A person skilled in the art will understand by replacing “X-axis direction” with “Y-axis direction” and “Y-axis direction” with “X-axis direction” in the following description.

また、画像取得部101が取得する多視点画像データが3枚以上の視点画像を含む多視点画像データである場合、画像処理装置10は、上記3枚以上の視点画像のうちの1つの視点画像のデータを基準画像データとして取扱い、上記3枚以上の視点画像のうちの残りの各視点画像のデータを参照画像データとして取り扱うことによって、以降で説明する動作と同様の動作を行うことが可能である。   When the multi-viewpoint image data acquired by the image acquisition unit 101 is multi-viewpoint image data including three or more viewpoint images, the image processing apparatus 10 selects one viewpoint image among the three or more viewpoint images. Can be performed as reference image data, and the remaining viewpoint image data among the three or more viewpoint images can be handled as reference image data, so that operations similar to those described below can be performed. is there.

画像取得部101が取得する基準画像データおよび参照画像データは、予めレンズ歪パラメータと内部パラメータが校正された多視点画像撮影システムにより撮影された校正済みの画像(校正画像)のデータであってもよいし、これらのパラメータが校正されていない多視点画像撮影システムにより撮影された校正前の画像のデータであってもよい。   The reference image data and reference image data acquired by the image acquisition unit 101 may be data of a calibrated image (calibration image) captured by a multi-view image capturing system in which lens distortion parameters and internal parameters are calibrated in advance. Alternatively, these parameters may be data of a pre-calibration image captured by a multi-viewpoint image capturing system that has not been calibrated.

後者の場合においては、画像取得部101または図示していない画像データ処理部が、パラメータ取得部102からレンズ歪パラメータと内部パラメータを受け取り、各パラメータに基づいて基準画像データおよび参照画像データに校正処理を施した後、校正後の各画像データを回転校正部103に送信するようにしても良い。   In the latter case, the image acquisition unit 101 or an image data processing unit (not shown) receives the lens distortion parameter and the internal parameter from the parameter acquisition unit 102, and calibrates the reference image data and the reference image data based on each parameter. Then, each calibrated image data may be transmitted to the rotation proofing unit 103.

なお、例えば、上記画像データ処理部は、レンズ歪パラメータと内部パラメータを校正した画像を利用した画像処理を行う場合においては、前者のような校正済みの画像データを読み込むようにすることで、少ない処理負荷で上記画像処理を行うことができる。   For example, when the image data processing unit performs image processing using an image in which the lens distortion parameter and the internal parameter are calibrated, the image data processing unit is reduced by reading the calibrated image data such as the former. The image processing can be performed with a processing load.

ステップS102において、パラメータ取得部102は、カメラパラメータおよび撮像距離に関するパラメータを読み込む。   In step S102, the parameter acquisition unit 102 reads camera parameters and parameters related to the imaging distance.

前記カメラパラメータは、例えば、カメラキャリブレーションによって算出したカメラパラメータ(レンズ歪パラメータ、内部パラメータ、外部パラメータ)、もしくは、計測システムで利用している(補正後の)カメラパラメータ、等である。   The camera parameters are, for example, camera parameters (lens distortion parameters, internal parameters, external parameters) calculated by camera calibration, camera parameters used in the measurement system (after correction), and the like.

前記撮像距離に関するパラメータは、例えば、焦点位置、被写界深度、画像中心の仮距離(仮に算出した距離)、カメラから被写体までの推定距離、前記カメラキャリブレーションを行った距離、等である。   The parameters relating to the imaging distance are, for example, a focal position, a depth of field, a provisional distance (tentatively calculated distance) of the image center, an estimated distance from the camera to the subject, a distance after performing the camera calibration, and the like.

ここで、画像中心の仮距離とは、〔背景技術〕に記載の三次元計測処理によって算出される、画像中心画素における被写体の距離(Z方向の距離)である。なお、画像中心画素は、画像の中心の1画素であっても良い。あるいは、上記仮距離は、画像中心領域における被写体の距離であってもよい。即ち、上記仮距離は、画像の中心と同じ位置を中心とする所定の領域(例えば、縦5画素x横5画素の画像中心領域)に関する計測結果の平均距離でも良い。   Here, the temporary distance at the center of the image is the distance of the subject (the distance in the Z direction) at the image center pixel, which is calculated by the three-dimensional measurement process described in [Background Art]. The image center pixel may be one pixel at the center of the image. Alternatively, the temporary distance may be the distance of the subject in the center area of the image. In other words, the provisional distance may be an average distance of measurement results regarding a predetermined area (for example, an image center area of 5 pixels vertically by 5 pixels horizontally) centered on the same position as the center of the image.

また、「前記カメラキャリブレーションを行った距離」は、例えば、前記カメラキャリブレーションにおいて、キャリブレーション用の参照ボードを設置した際のカメラから参照ボードまでの距離であってもよいし、カメラのピント距離であってもよい。   The “distance for which the camera calibration has been performed” may be, for example, a distance from the camera to the reference board when the calibration reference board is installed in the camera calibration, or the camera focus. It may be a distance.

なお、前記多視点画像データおよび前記カメラパラメータは、特定のフォーマットのファイルに含まれていてもよい。例えば、カメラパラメータは、多視点画像の画像ファイルのヘッダ情報として画像ファイル内に含まれていてもよい。画像処理装置100は、図示しないデコード部がこのフォーマットのファイルをデコードし、それぞれのデータを画像取得部101およびパラメータ取得部102が受け取るように構成することができる。   Note that the multi-viewpoint image data and the camera parameters may be included in a file in a specific format. For example, the camera parameter may be included in the image file as header information of the image file of the multi-viewpoint image. The image processing apparatus 100 can be configured such that a decoding unit (not shown) decodes a file of this format, and the image acquisition unit 101 and the parameter acquisition unit 102 receive the respective data.

ステップS103において、回転校正部103は、パラメータ取得部102からカメラパラメータを受け取り、このカメラパラメータに基づいて、画像取得部101から受け取った画像データを校正する。   In step S103, the rotation calibration unit 103 receives camera parameters from the parameter acquisition unit 102, and calibrates the image data received from the image acquisition unit 101 based on the camera parameters.

回転校正部103が受け取るカメラパラメータの詳細について説明する。カメラパラメータは、レンズ歪パラメータ、内部パラメータ、外部パラメータに分類することができる。更に、外部パラメータは、回転パラメータと並進パラメータとに分類することができる。回転校正部103は、カメラパラメータの内、外部パラメータ、特に、回転パラメータを受け取る。回転パラメータR、RY、RL、RRは、次の式(式3)によって示される。 Details of the camera parameters received by the rotation calibration unit 103 will be described. Camera parameters can be classified into lens distortion parameters, internal parameters, and external parameters. Furthermore, the external parameters can be classified into rotation parameters and translation parameters. The rotation calibration unit 103 receives external parameters, particularly rotation parameters, among the camera parameters. The rotation parameters R, R Y , R L , and R R are expressed by the following formula (Formula 3).

Figure 2017040549
Figure 2017040549

Rは、基準カメラのカメラ座標系における座標(基準カメラ座標)から参照カメラのカメラ座標系における座標(参照カメラ座標)への回転変換行列に相当する。RYは、基準カメラのカメラ座標系のXY平面と参照カメラのカメラ座標系のXY平面とを互いに平行にするための回転パラメータであって、参照カメラのカメラ座標系のXY平面をY軸方向にαラジアン回転させることを示す。RLおよびRRは、それぞれ基準画像データに対する回転パラメータ、参照画像データに対する回転パラメータである。回転校正前の座標データ(回転校正前の画像上のある位置を示す座標データ)と回転校正後の座標データ(回転校正後の画像上の同じ位置を示す座標データ)との関係を示す式(式4)を以下に示す。 R corresponds to a rotation transformation matrix from coordinates (reference camera coordinates) in the camera coordinate system of the reference camera to coordinates (reference camera coordinates) in the camera coordinate system of the reference camera. R Y is a rotation parameter for making the XY plane of the camera coordinate system of the reference camera parallel to the XY plane of the camera coordinate system of the reference camera, and the XY plane of the camera coordinate system of the reference camera is the Y-axis direction. Indicates that α radians are rotated. R L and R R are rotation parameters for the standard image data and rotation parameters for the reference image data, respectively. Expression indicating the relationship between coordinate data before rotation calibration (coordinate data indicating a position on the image before rotation calibration) and coordinate data after rotation calibration (coordinate data indicating the same position on the image after rotation calibration) ( Equation 4) is shown below.

Figure 2017040549
Figure 2017040549

(XL、YL、ZL)は、校正前の基準カメラ座標、(XL’、YL’、ZL’)は、校正後の基準カメラ座標、(XR、YR、ZR)は、校正前の参照カメラ座標、(XR’、YR’、ZR’)は、校正後の参照カメラ座標をそれぞれ示している。回転校正部103は、上記の式(式4)を用いて画像変換処理を実行することによって、回転校正した画像を得ることができる。 (X L , Y L , Z L ) is the reference camera coordinates before calibration, (X L ′, Y L ′, Z L ′) is the reference camera coordinates after calibration, (X R , Y R , Z R) ) Indicates reference camera coordinates before calibration, and (X R ′, Y R ′, Z R ′) indicate reference camera coordinates after calibration. The rotational calibration unit 103 can obtain a rotationally calibrated image by executing an image conversion process using the above formula (Formula 4).

なお、Y軸方向の回転ずれを無視できる場合、式3においてα=0となるため、基準カメラ座標値は、(XL’、YL’、ZL’)=(XL、YL、ZL)となり、行列計算を省略することができる。   When the rotational deviation in the Y-axis direction can be ignored, α = 0 in Equation 3, so that the reference camera coordinate values are (XL ′, YL ′, ZL ′) = (XL, YL, ZL), and the matrix Calculation can be omitted.

回転校正した画像の概念について、図3に基づいて説明する。   The concept of the rotationally calibrated image will be described with reference to FIG.

図3の(a)は、校正前の基準画像および参照画像の関係を示す一例である。図3の(b)は、従来行われている一般的な平行化処理後の基準画像と参照画像との関係を示す一例である。図3の(c)は、回転校正部103によって生成される基準画像と参照画像との関係を示す一例である。   FIG. 3A is an example showing the relationship between the standard image and the reference image before calibration. FIG. 3B is an example showing a relationship between a standard image after a general parallelization process that has been performed conventionally and a reference image. FIG. 3C is an example showing the relationship between the reference image generated by the rotation calibration unit 103 and the reference image.

一般的なステレオカメラを用いた計測システムにおいては、画像間のブロックマッチング処理における計算量削減を図るため、図3の(b)に示すように、基準画像と参照画像とに平行化処理を施す。平行化処理後においては、基準画像と参照画像との間の回転ずれおよび並進ずれが校正される。即ち、ステレオカメラシステムが左右に配置された2つのカメラを備えている場合、平行化処理後の2つの画像は、Y軸方向の回転ずれがない状態の2つのカメラであってX軸方向に基線長分(距離Bだけ)だけ離れている2つのカメラによって撮影された2つの画像に相当する。これにより、視差算出のためのブロックマッチング処理における探索方向はX軸方向に限定することができる。   In a measurement system using a general stereo camera, in order to reduce the amount of calculation in block matching processing between images, as shown in FIG. 3B, parallel processing is performed on the reference image and the reference image. . After the parallelization process, the rotational deviation and translational deviation between the standard image and the reference image are calibrated. That is, when the stereo camera system includes two cameras arranged on the left and right, the two images after the parallelization process are two cameras in a state where there is no rotational deviation in the Y-axis direction and in the X-axis direction. This corresponds to two images taken by two cameras that are separated by the length of the baseline (only distance B). Thereby, the search direction in the block matching process for parallax calculation can be limited to the X-axis direction.

一方、本実施形態においては、回転校正部103は、図3の(c)に示すように、回転パラメータのみを校正するので、回転校正部103が生成する2つの画像は、Y軸方向の回転ずれがない状態の2つのカメラであって、X軸方向にBxだけ離れ、Y軸方向にByだけ離れた2つのカメラによって撮影された2つの画像に相当する。即ち、回転校正部103は、回転パラメータに応じた回転ずれが校正され、並進パラメータに応じたずれ量(Bx、By)の並進ずれが校正されていない2つの校正画像を生成する。ここで、Bxは上記2つのカメラの長手方向の並進ずれ量(長基線長)を示し、Byは、上記2つのカメラの短手方向の並進ずれ量(短基線長)を示す。BxおよびByは、並進パラメータ(tx、ty、tz)に基づき、以下の式(式5)によって算出される。   On the other hand, in the present embodiment, the rotation calibration unit 103 calibrates only the rotation parameters as shown in FIG. 3C, so that the two images generated by the rotation calibration unit 103 are rotated in the Y-axis direction. This corresponds to two images taken by two cameras that are not displaced and separated by Bx in the X-axis direction and by By in the Y-axis direction. That is, the rotation calibration unit 103 generates two calibration images in which the rotational deviation according to the rotation parameter is calibrated and the translational deviation of the deviation amount (Bx, By) according to the translation parameter is not calibrated. Here, Bx represents the translational displacement amount (long baseline length) in the longitudinal direction of the two cameras, and By represents the translational displacement amount (short baseline length) in the lateral direction of the two cameras. Bx and By are calculated by the following formula (Formula 5) based on the translation parameters (tx, ty, tz).

Figure 2017040549
Figure 2017040549

ステップS104において、ずれ範囲算出部104は、パラメータ取得部102から、カメラパラメータと撮像距離に関するパラメータと、を受け取り、これらのパラメータを参照して、2つの画像における並進ずれ範囲を算出する。   In step S <b> 104, the deviation range calculation unit 104 receives the camera parameter and the parameter related to the imaging distance from the parameter acquisition unit 102, and calculates the translational deviation range in the two images with reference to these parameters.

ずれ範囲Sx1_near、Sx1_far、Sy1_near、Sy1_far、は、以下の式(式6)によって算出される。   The shift ranges Sx1_near, Sx1_far, Sy1_near, Sy1_far are calculated by the following formula (Formula 6).

Figure 2017040549
Figure 2017040549

ここで、fは内部パラメータとして算出される焦点距離、Lnearは基準撮影範囲の近点距離、Lfarは基準撮影範囲の遠点距離、Bx、Byは式5によって算出される並進ずれ量である。式6における各パラメータの関係は図4に示す通りである。基準カメラの座標中心107から参照カメラの座標中心108のX軸方向の距離がBx、同Y軸方向の距離がByとなる。基準撮影距離LnearおよびLfarは、基準カメラ座標から、それぞれ基準撮影距離近点109、基準撮影距離遠点110までのZ軸方向の距離であって、前記撮像距離に関するパラメータから設定される。以上のように、パラメータの相似関係を利用することで、ずれ範囲Sx1_near、Sx1_far、Sy1_near、Sy1_farは算出される。ずれ範囲は、X軸方向のずれ範囲と、Y軸方向のずれ範囲と、に分解される。Sx1_nearからSx1_farまでの範囲がX軸方向のずれ範囲、Sy1_nearからSy1_farまでの範囲がY軸方向のずれ範囲となる。 Here, f is a focal length calculated as an internal parameter, L near is a near point distance of the reference shooting range, L far is a far point distance of the reference shooting range, and Bx and By are translational deviation amounts calculated by Expression 5. is there. The relationship of each parameter in Formula 6 is as shown in FIG. The distance in the X-axis direction from the coordinate center 107 of the reference camera to the coordinate center 108 of the reference camera is Bx, and the distance in the Y-axis direction is By. The reference shooting distances L near and L far are distances in the Z-axis direction from the reference camera coordinates to the reference shooting distance near point 109 and the reference shooting distance far point 110, respectively, and are set from the parameters relating to the imaging distance. As described above, the deviation ranges Sx1_near, Sx1_far, Sy1_near, and Sy1_far are calculated by using the parameter similarity. The shift range is broken down into a shift range in the X-axis direction and a shift range in the Y-axis direction. The range from Sx1_near to Sx1_far is the shift range in the X-axis direction, and the range from Sy1_near to Sy1_far is the shift range in the Y-axis direction.

前述の通り、LnearよびLfarは、前記撮像距離に関するパラメータであって、例えば、被写界深度、画像中心の仮距離(仮に算出した距離)、カメラから被写体までの推定距離、前記カメラキャリブレーション距離の各パラメータが、近点に関するパラメータと遠点に関するパラメータとの2つのパラメータから構成されていてもよい。ずれ範囲算出部104は、前記撮像距離に関するパラメータとして、上記の全ての対について、当該対を成す2つのパラメータを読み込んでもよいし、上記のうちの任意の対について、当該対を成す2つのパラメータを読み込んでもよい。 As described above, L near and L far are parameters related to the imaging distance, and include, for example, the depth of field, the provisional distance of the image center (provisionally calculated distance), the estimated distance from the camera to the subject, and the camera calibration. Each parameter of the station distance may be composed of two parameters, a parameter related to the near point and a parameter related to the far point. The shift range calculation unit 104 may read two parameters forming the pair for all the above pairs as parameters relating to the imaging distance, or two parameters forming the pair for any of the above pairs. May be read.

以上の説明においては、近点に関するパラメータと遠点に関するパラメータとの2つのパラメータを読み込む構成について説明したが、例えば、ずれ範囲算出部104は、基準撮影距離L=Lnear=Lfarと見做して、前記撮像距離に関するパラメータ群の中からただ1つのパラメータを読み込むように構成されていてもよい。また、後述するずれ量算出部105によって算出されるずれ量Sx2を用いて、基準撮影距離L=Sxとすることもできる。このようにただ1つのパラメータを読み込む場合、ずれ範囲算出部104は、式6の代わりに以下の式(式7)を用いて、ずれ範囲の代わりに、ずれ距離を求めてもよい。 In the above description, a configuration has been described in which two parameters, a parameter relating to the near point and a parameter relating to the far point, are read. For example, the deviation range calculation unit 104 assumes that the reference shooting distance L = L near = L far. In this case, only one parameter may be read from the parameter group related to the imaging distance. Further, the reference photographing distance L = Sx can be set by using a deviation amount Sx2 calculated by a deviation amount calculation unit 105 described later. When only one parameter is read in this way, the deviation range calculation unit 104 may obtain the deviation distance instead of the deviation range by using the following equation (Equation 7) instead of Equation 6.

Figure 2017040549
Figure 2017040549

ここで、Sx1、Sy1は、ずれ距離である。   Here, Sx1 and Sy1 are deviation distances.

ステップS105において、ずれ量算出部105は、回転校正処理が施された基準画像データおよび参照画像データを受け取り、長手方向および短手方向の位置ずれの量を検出し、検出したずれ量を判定部106に送る。   In step S105, the deviation amount calculation unit 105 receives the standard image data and the reference image data subjected to the rotation calibration process, detects the amount of positional deviation in the longitudinal direction and the short side direction, and determines the detected deviation amount. 106.

ずれ量算出部105は、基準画像上の任意の基準点に対する、参照画像上の「当該基準点に対応する対応点」のX軸方向およびY軸方向のずれ量(Sx2,Sy2)を検出する。ここで、Sx2は画像上のX軸方向へのずれ量、Sy2は画像上のY軸方向へのずれ量を示す。すなわち、これらのずれ量は、上下方向の視差量および左右方向の視差量として検出される。ずれ量は、一般的なステレオ画像における視差算出手段と同様に、例えばブロックマッチングを利用した方法で算出される。ブロックマッチングでは、前記基準画像における基準点とその周辺画素からなるテンプレートを生成し、もう一方の参照画像上でマッチング位置の探索を行うことによって、それぞれの方向に対するずれを算出する。マッチングの評価には、例えば、SAD(Sum of Absolute Difference)やSSD(Sum of Squared Difference)、ZNCC(Zero−mean Normalized Cross−Correlation)などを利用してもよい。なお、ブロックマッチングにおいては2つの画像間のずれ量が算出される。そのため、前述の式2に基づいて、2つの画像間のずれ量(画像座標系におけるずれ量)をカメラ座標系におけるずれ量に変換する。   The deviation amount calculation unit 105 detects the deviation amounts (Sx2, Sy2) in the X-axis direction and the Y-axis direction of “corresponding points corresponding to the reference point” on the reference image with respect to an arbitrary reference point on the reference image. . Here, Sx2 indicates a shift amount in the X-axis direction on the image, and Sy2 indicates a shift amount in the Y-axis direction on the image. That is, these shift amounts are detected as a vertical parallax amount and a horizontal parallax amount. The shift amount is calculated by a method using block matching, for example, in the same manner as the parallax calculation means in a general stereo image. In block matching, a template composed of a reference point and its surrounding pixels in the reference image is generated, and a matching position is searched for on the other reference image, thereby calculating a deviation with respect to each direction. For the evaluation of matching, for example, SAD (Sum of Absolute Difference), SSD (Sum of Squared Difference), ZNCC (Zero-means Normalized Cross-Correlation), or the like may be used. In block matching, a shift amount between two images is calculated. Therefore, based on the above-described formula 2, the amount of deviation between the two images (the amount of deviation in the image coordinate system) is converted into the amount of deviation in the camera coordinate system.

ここで、基準点について説明する。任意の基準点は少なくとも1点以上が選択される。例えば、基準画像の中心領域に属し、かつ、基準画像上で予め決められた領域に属する範囲内の、エッジ強度が所定の閾値よりも大きい1以上の点、などが基準点として選択される。なお、エッジ強度は、例えば、Sobelフィルタ、Prewitフィルタ、DoG(Difference of Gaussian)の出力値等を利用して算出されてもよい。   Here, the reference point will be described. At least one or more arbitrary reference points are selected. For example, one or more points whose edge strength is greater than a predetermined threshold within a range belonging to the center region of the reference image and belonging to a predetermined region on the reference image are selected as the reference points. The edge strength may be calculated using, for example, an output value of a Sobel filter, a Prewit filter, a DoG (Difference of Gaussian), or the like.

任意の基準点の他の指定方法として、例えば、ステレオカメラシステムを備えた画像処理装置100を固定して使用する場合には、予め撮影された背景画像(背景の像を含み、被写体の像を含まない画像)と、基準画像(当該背景の像の一部と被写体の像とを含む画像)とから定まる特定の領域(2つの画像間の画素値の差分が0ではない領域)内における、エッジ強度が所定の閾値よりも大きい1以上の点を設定することもできる。この方法は、背景がエッジを検出できないような平面であるような画像上の基準点や、全体が被写体の像に覆われるような画像上の基準点を決める場合などに有用である。さらに、このような画像処理装置100を計測装置として使用する場合には、計測する点を基準点とすることができる。もしくは、画像処理装置100は、カメラパラメータの誤差を検出する動作をユーザ操作に従って実行する場合には、画像内の特定のマーカーパターン(市松模様や任意の色)を検出し、該マーカーパターンが存在する領域内の任意の点を基準点として利用してもよいし、ユーザによって指定された画像上の任意の点を、基準点として利用してもよい。   As another method for specifying an arbitrary reference point, for example, when the image processing apparatus 100 including a stereo camera system is used in a fixed manner, a background image (including a background image and an image of a subject) captured in advance is used. In a specific region (region where the difference in pixel values between the two images is not 0) determined from the reference image (an image including a part of the background image and the subject image) It is also possible to set one or more points whose edge strength is greater than a predetermined threshold. This method is useful for determining a reference point on an image whose background is a plane that cannot detect an edge, or a reference point on an image that is entirely covered with an image of a subject. Further, when such an image processing apparatus 100 is used as a measurement apparatus, a point to be measured can be used as a reference point. Alternatively, the image processing apparatus 100 detects a specific marker pattern (checkered pattern or arbitrary color) in the image when the operation of detecting the camera parameter error is performed according to the user operation, and the marker pattern exists. An arbitrary point in the area to be used may be used as the reference point, or an arbitrary point on the image designated by the user may be used as the reference point.

任意の基準点として複数点選択した場合は、ずれ量算出部105は、複数の基準点の各々について、当該基準点に対する、前述の「当該基準点に対応する対応点」のずれ量を算出してもよい。そして、ずれ量算出部105は、算出した複数のずれ量に基づいて、ずれ量の代表値を決定してもよい。例えば、ずれ量算出部105は、ずれ量の代表値として、前記複数のずれ量の平均値や中央値などの統計値を利用するようにしても良いし、前記複数のずれ量のうちの、最もエッジ強度の大きい基準点に対する、「当該基準点に対応する対応点」のずれ量を、ずれ量の代表値に決定してもよい。   When a plurality of arbitrary reference points are selected, the deviation amount calculation unit 105 calculates, for each of the plurality of reference points, the deviation amount of the “corresponding point corresponding to the reference point” with respect to the reference point. May be. Then, the deviation amount calculation unit 105 may determine a representative value of the deviation amount based on the calculated plural deviation amounts. For example, the deviation amount calculation unit 105 may use a statistical value such as an average value or a median value of the plurality of deviation amounts as a representative value of the deviation amount, and among the plurality of deviation amounts, The deviation amount of the “corresponding point corresponding to the reference point” with respect to the reference point having the highest edge strength may be determined as a representative value of the deviation amount.

ここで、画像処理装置100は、LnearおよびLfarを、カメラからZ軸方向にLnearおよびLfarだけ進んだ位置が画像撮像装置の被写界深度の範囲内に含まれるように、設定することが望ましい。エッジ強度に基づいて基準点を検出すると、基準撮影距離の範囲内の計測点を検出する確率が高まるからである。なお、例えば、全ての基準点におけるエッジ強度が所定の閾値を超えなかった場合、基準点が基準撮影距離の範囲内において検出できなかったと判定し、後段の判定処理を行わないようにしても良い。 Here, the image processing apparatus 100 sets L near and L far so that the positions advanced by L near and L far in the Z-axis direction from the camera are included in the range of the depth of field of the image pickup apparatus. It is desirable to do. This is because if the reference point is detected based on the edge strength, the probability of detecting a measurement point within the range of the reference shooting distance increases. For example, when the edge strengths at all the reference points do not exceed a predetermined threshold, it is determined that the reference points cannot be detected within the range of the reference shooting distance, and the subsequent determination process may not be performed. .

また、ステレオカメラシステムを用いた計測システムに画像処理装置100を利用する場合、LnearおよびLfarの値を、それぞれ、カメラから計測システムが想定する計測範囲の近点までの距離を示す値、および、カメラから該計測範囲の遠点までの距離を示す値とし、任意の計測点を基準点として利用するように画像処理装置100を構成することもできる。 Further, when the image processing apparatus 100 is used in a measurement system using a stereo camera system, the values of L near and L far are values indicating the distance from the camera to the near point of the measurement range assumed by the measurement system, The image processing apparatus 100 can also be configured to use a value indicating the distance from the camera to the far point of the measurement range and use any measurement point as a reference point.

撮影範囲が限られる場合(例えば、カメラからの距離が1〜5mの範囲しか画角内に収まらない場合)においては、Lnearの値を1mに設定するとともに、Lfarの値を5mに設定し(即ち、LnearおよびLfarに、それぞれ、カメラから撮影範囲の近点までの距離を示す値、および、カメラから撮影範囲の遠点までの距離を示す値を割り当て)、撮影された被写体上の任意の点を基準点として設定するように構成することもできる。 When the shooting range is limited (for example, when the distance from the camera is only within the range of 1 to 5 m), the L near value is set to 1 m and the L far value is set to 5 m. (Ie, a value indicating the distance from the camera to the near point of the shooting range and a value indicating the distance from the camera to the far point of the shooting range are assigned to L near and L far , respectively) An arbitrary upper point can be set as the reference point.

更には、工場などのライン検査システムに画像処理装置100を利用する場合、画像内のおける、部品などの動被写体の映り込む範囲が分かるため、LnearとLfarの設定値を限定できる。たとえば、検査システムをラインの400mm上方に設置し、ライン上を通過する部品のサイズが10mmである場合、Lnearを390mm、Lfarを400mmのように設定し、部品上の点を基準点として設定するように構成することもできる。 Furthermore, when the image processing apparatus 100 is used in a line inspection system such as a factory, since the range in which a moving subject such as a part is reflected in an image can be known, the set values of L near and L far can be limited. For example, if the inspection system is installed 400 mm above the line and the size of the part passing through the line is 10 mm, L near is set to 390 mm, L far is set to 400 mm, and the point on the part is used as the reference point. It can also be configured to set.

このように、LnearおよびLfarの値を対象物の大きさに応じた値とすることにより、算出されるずれ範囲が実際の対象物の大きさを元にした範囲となる。そのため、このような基準点の設定方法は、カメラパラメータの誤差を小さくすることができる好適な設定方法であると言える。 Thus, by setting the values of L near and L far according to the size of the object, the calculated deviation range becomes a range based on the actual size of the object. Therefore, it can be said that such a reference point setting method is a preferable setting method capable of reducing the error of the camera parameter.

以上の通り、ステップS103およびステップS104によって、カメラパラメータによって推定されるずれ範囲と、回転校正後の2つの撮影画像に関するずれ量と、が算出されることとなる。   As described above, in step S103 and step S104, the shift range estimated by the camera parameter and the shift amount related to the two captured images after the rotation calibration are calculated.

ステップS106において、判定部106は、ずれ範囲算出部104からずれ範囲を受け取るとともに、ずれ量算出部105からずれ量を受け取り、ずれ判定を行う。具体的には、判定部106は、以下の各式(式8および式9)に示す判定式に基づいて、ずれ判定を行う。   In step S <b> 106, the determination unit 106 receives the shift range from the shift range calculation unit 104, receives the shift amount from the shift amount calculation unit 105, and performs shift determination. Specifically, the determination unit 106 performs deviation determination based on the determination formulas shown in the following formulas (Formula 8 and Formula 9).

Figure 2017040549
Figure 2017040549

Figure 2017040549
Figure 2017040549

ここで、Sx1_near、Sx1_far、Sy1_near、及び、Sy1_farは、ステップS104において算出されたX軸方向およびY軸方向のずれ範囲を示す値であり、Sx2、及び、Sy2は、ステップS105において検出されたX軸方向およびY軸方向のずれ量を示す値であり、THx_far、THx_near、THy_far、THy_nearは、任意の閾値である。   Here, Sx1_near, Sx1_far, Sy1_near, and Sy1_far are values indicating the deviation ranges in the X-axis direction and the Y-axis direction calculated in step S104, and Sx2 and Sy2 are X detected in step S105. It is a value indicating the amount of deviation in the axial direction and the Y-axis direction, and THx_far, THx_near, THy_far, and THy_near are arbitrary threshold values.

すなわち、基準撮影距離範囲のずれ量(Sx1_near、Sx1_far、Sy1_near、Sy1_far)と任意の閾値(THx_far、THx_near、THy_far、THy_near)に基づいて、画像に基づくずれ量Sx2、Sy2の判定を行う。なお、任意の閾値(THx_far、THx_near、THy_far、THy_near)は、THx_farとTHx_nearとが異なり、且つ、THy_farとTHy_nearとが異なるように設定しても、THx_far=THx_near、THy_far=THy_nearとなるように設定しても良い。   That is, based on the deviation amounts (Sx1_near, Sx1_far, Sy1_near, Sy1_far) of the reference photographing distance range and arbitrary threshold values (THx_far, THx_near, THy_far, THy_near), the deviation amounts Sx2 and Sy2 based on the image are determined. The arbitrary threshold values (THx_far, THx_near, THy_far, THy_near) are set so that THx_far = THx_near, THy_far = THy_near even if THx_far and THx_near are set differently and THy_far and THy_near are set differently. You may do it.

上記の式8および式9の何れも成り立つ場合において、判定部106は、「カメラパラメータに誤差が生じていない」と判定する。一方、そうでない場合において、判定部106は、「カメラパラメータに誤差が生じている」と判定し、判定結果を示す値を出力する。なお、例えば、「カメラパラメータに誤差が生じていない」との判定結果を示す値はフラグ値0であり、「カメラパラメータがずれている」との判定結果を示す値はフラグ値1であってもよい。フラグ値は、例えば、他の処理部で処理を行うためのバイナリデータとして出力しても良い。   In the case where both of the above formulas 8 and 9 hold, the determination unit 106 determines that “the camera parameter has no error”. On the other hand, if not, the determination unit 106 determines that “an error has occurred in the camera parameters” and outputs a value indicating the determination result. For example, the value indicating the determination result that “the camera parameter has no error” is the flag value 0, and the value indicating the determination result that the “camera parameter is shifted” is the flag value 1. Also good. For example, the flag value may be output as binary data for processing by another processing unit.

あるいは、判定部106は、「カメラパラメータに誤差が生じていない」と判定した場合には電子回路(判定部106)の出力電圧のレベルがHighになり、「カメラパラメータに誤差が生じている」と判定した場合には電子回路(判定部106)の出力電圧のレベルがLowとなるように構成されていてもよい。   Alternatively, when the determination unit 106 determines that “an error has not occurred in the camera parameter”, the level of the output voltage of the electronic circuit (determination unit 106) becomes High, and “an error has occurred in the camera parameter”. May be configured so that the level of the output voltage of the electronic circuit (determination unit 106) becomes Low.

あるいは、ステップS106において、判定部106は、ずれ範囲算出部104から式7によって算出されるずれ距離を受け取った場合においては、以下の各式(式10および式11)に示す判定式に基づいて、ずれ判定を行ってもよい。   Alternatively, in step S106, when the determination unit 106 receives the shift distance calculated by the formula 7 from the shift range calculation unit 104, the determination unit 106 is based on the determination formulas shown in the following formulas (Formula 10 and Formula 11). The deviation determination may be performed.

Figure 2017040549
Figure 2017040549

Figure 2017040549
Figure 2017040549

ここで、Sx1及びSy1は、それぞれ、ステップS104において算出されたX軸方向およびY軸方向のずれ距離を示す値、Sx2及びSy2は、それぞれ、ステップS105において検出されたX軸方向およびY軸方向のずれ量を示す値である。また、THx_far、THx_near、THy_far、THy_nearは、任意の閾値である。すなわち、式7によって算出されたずれ距離(Sx1、Sy1)と任意の閾値(THx_far、THx_near、THy_far、THy_near)に基づいて、画像に基づくずれ量Sx2、Sy2の判定を行う。   Here, Sx1 and Sy1 are values indicating deviation distances in the X-axis direction and the Y-axis direction calculated in step S104, respectively, and Sx2 and Sy2 are X-axis direction and Y-axis direction detected in step S105, respectively. It is a value indicating the amount of deviation. Moreover, THx_far, THx_near, THy_far, and THy_near are arbitrary threshold values. That is, based on the shift distance (Sx1, Sy1) calculated by Expression 7 and an arbitrary threshold (THx_far, THx_near, THy_far, THy_near), the shift amounts Sx2, Sy2 based on the image are determined.

式10および式11の何れも成り立つ場合において、判定部106は、「カメラパラメータに誤差が生じていない」と判定する。一方、そうでない場合において、判定部106は、「カメラパラメータに誤差が生じている」と判定し、判定結果を示す値を出力する。なお、例えば、「カメラパラメータに誤差が生じていない」との判定結果を示す値はフラグ値0であり、「カメラパラメータがずれている」との判定結果を示す値はフラグ値1であってもよい。   When both Expression 10 and Expression 11 hold, the determination unit 106 determines that “the camera parameter has no error”. On the other hand, if not, the determination unit 106 determines that “an error has occurred in the camera parameters” and outputs a value indicating the determination result. For example, the value indicating the determination result that “the camera parameter has no error” is the flag value 0, and the value indicating the determination result that the “camera parameter is shifted” is the flag value 1. Also good.

ずれ範囲算出部104と、ずれ量算出部105と、判定部106とは、図1に示すように、それぞれ別個の処理部として画像処理装置100に設けられていてもよいが、図5に示すように、以上の3つの処理部を1つのずれ判定部111として構成することもできる。ずれ判定部111は、ずれ範囲算出部104と同様の処理によってずれ範囲を算出し、当該ずれ範囲についてずれ量算出部105と同様にブロックマッチングを行い、ブロックマッチングによって算出される類似度の最大値が所定の値を超えなかった場合において、パラメータがずれていると判定する。   As shown in FIG. 1, the deviation range calculation unit 104, the deviation amount calculation unit 105, and the determination unit 106 may be provided as separate processing units in the image processing apparatus 100, but are shown in FIG. As described above, the above three processing units can be configured as one deviation determination unit 111. The shift determination unit 111 calculates a shift range by the same processing as the shift range calculation unit 104, performs block matching for the shift range in the same manner as the shift amount calculation unit 105, and calculates the maximum similarity calculated by block matching. Is determined not to exceed a predetermined value, it is determined that the parameter is deviated.

以上の処理によって、画像処理装置100は、ずれ範囲算出部104およびずれ量算出部105のずれ算出結果や、判定部106のフラグ値を外部に出力することができる。   Through the above processing, the image processing apparatus 100 can output the deviation calculation results of the deviation range calculation unit 104 and the deviation amount calculation unit 105 and the flag value of the determination unit 106 to the outside.

また、図6に示すように、画像処理装置100は、画像撮像装置112の一部として構成することができる。   As shown in FIG. 6, the image processing apparatus 100 can be configured as a part of the image capturing apparatus 112.

画像撮像装置112は、図6に示すように、前記画像処理装置100と、少なくとも2つの画像を撮像する撮像部113と、カメラパラメータや画像処理結果などを保持するデータ保持部114と、前記画像処理結果などをユーザに提示する情報提示部115と、各ユニット間でやりとりされるデータが通過するデータバス116と、を備える。   As shown in FIG. 6, the image capturing device 112 includes the image processing device 100, an image capturing unit 113 that captures at least two images, a data storage unit 114 that stores camera parameters and image processing results, and the image. An information presentation unit 115 that presents processing results and the like to the user, and a data bus 116 through which data exchanged between the units passes.

撮像部113は、複数(2つ以上)の異なる視点から見た様子を示す複数の視野画像を撮像する撮像装置である。撮像部113は、例えば、CMOS(Complementary Metal Oxide Semiconductor)やCCD(Charge Coupled Device)などの撮像素子と、レンズなどの光学部品と、から構成される撮像装置であってもよい。   The imaging unit 113 is an imaging device that captures a plurality of field images showing a state seen from a plurality (two or more) of different viewpoints. The imaging unit 113 may be an imaging device including an imaging element such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) and an optical component such as a lens.

この場合、撮像部113は、平行移動台に乗った状態で平行移動しながら対象物を複数回撮影してもよい。   In this case, the imaging unit 113 may photograph the target object a plurality of times while translating in a state of being on the translation table.

あるいは、撮像部113は、前記撮像装置を複数具備するように構成した多眼撮像システムであってもよい。   Alternatively, the imaging unit 113 may be a multi-eye imaging system configured to include a plurality of the imaging devices.

あるいは、撮像部113は、1つの撮像素子に対して複数の光学経路を有するように構成されたレンズシステムを取り付けることで多視点画像を撮影できる多眼撮像システムであってもよい。   Alternatively, the imaging unit 113 may be a multi-view imaging system that can capture a multi-viewpoint image by attaching a lens system configured to have a plurality of optical paths with respect to one imaging device.

データ保持部114は、例えば、HDD(Hard Disk Drive)、SSD(SolidState Drive)、などの記憶装置によって構成される。   The data holding unit 114 is configured by a storage device such as an HDD (Hard Disk Drive) and an SSD (Solid State Drive).

データ保持部114は、画像処理装置100により読み込まれる、カメラパラメータ、撮像距離に関するパラメータ、画像処理装置100による画像処理の結果を示すデータ(フラグ値等)、撮像部113によって撮影された画像などのデータを保持する。   The data holding unit 114 is read by the image processing apparatus 100, such as camera parameters, parameters related to the imaging distance, data indicating the results of image processing by the image processing apparatus 100 (flag values, etc.), images taken by the imaging unit 113, and the like. Retain data.

情報提示部115は、例えば、LED(Light Emitting Diode)などの発光部であって、判定部106による判定結果に応じた発光制御を行う発光部である。情報提示部115は、例えば、判定部106がフラグ値0を出力した場合には発光せず、判定部106がフラグ値1を出力した場合には発光することにより、ユーザに判定結果を通知できる。あるいは、情報提示部115は、例えば、LCD(Liguid Crystal Display)やOLED(Organic Light Emitting Diode)などの表示部に、前記フラグ値に応じた、テキストや画像による警告メッセージを表示することもできる。また、情報提示部115は、例えば、スピーカであって、フラグ値が1の場合(カメラパラメータに誤差が生じている場合)に、警告音を出力することも可能である。   The information presentation unit 115 is a light emitting unit such as an LED (Light Emitting Diode), for example, and is a light emitting unit that performs light emission control according to the determination result by the determination unit 106. For example, the information presentation unit 115 can notify the user of the determination result by emitting no light when the determination unit 106 outputs the flag value 0 and emitting light when the determination unit 106 outputs the flag value 1. . Or the information presentation part 115 can also display the warning message by a text or an image according to the said flag value on display parts, such as LCD (Liquid Crystal Display) and OLED (Organic Light Emitting Diode), for example. In addition, the information presentation unit 115 can output a warning sound when the flag value is 1 (when an error occurs in the camera parameter), for example, a speaker.

データバス116は、例えば、PCI(Peripheral Component Interconnect)、SCSI(Small Computer System Interface)などのコンピュータ用のバスである。もしくは、各ユニットをイーサネット(登録商標)規格に基づいて接続するための電子線である。   The data bus 116 is a bus for a computer such as PCI (Peripheral Component Interconnect) and SCSI (Small Computer System Interface). Or it is an electron beam for connecting each unit based on Ethernet (trademark) specification.

以上のように構成された画像撮像装置112は、カメラパラメータに誤差が生じたことを検出し、ユーザに検出結果を提示することができる。なお、画像撮像装置112は、ずれ判定処理を必ずしも全ての撮影に対して実施する必要はなく、ユーザによって指定された場合にのみ、ずれ判定処理を実施するようにしても良い。   The image capturing apparatus 112 configured as described above can detect that an error has occurred in the camera parameter and can present the detection result to the user. Note that the image capturing apparatus 112 does not necessarily need to perform the shift determination process for all shootings, and may perform the shift determination process only when designated by the user.

また、本実施形態の誤差検出方法では、既知の対象物だけでなく任意の対象物の撮影時において誤差を検出すること、そして選択する基準点を最小限に抑えることができるという効果がある。   In addition, the error detection method of the present embodiment has an effect that an error can be detected at the time of photographing an arbitrary object as well as a known object, and a reference point to be selected can be minimized.

即ち、従来(特許文献1など)の既知の対象物間利用する方法では新たなカメラパラメータを推定するためには、カメラパラメータ推定における未知の変数が8点であるため、2つのカメラ画像間で共通する特徴点を少なくとも4点以上検出しておく必要がある。これに対し、本実施形態の方法では少なくとも1点の基準点を定めるだけで、カメラパラメータの誤差を検出することが可能である。更に、既知の対象物を検出するためには、2つの画像に対して物体認識の処理を施すことが必須となるため、計算量が増大していたが、本実施形態では1つの画像に対して物体認識の処理を施すだけでよく、計算量を抑えることができる。   That is, in the conventional method of using between known objects (eg, Patent Document 1), in order to estimate a new camera parameter, there are 8 unknown variables in the camera parameter estimation, so between two camera images. It is necessary to detect at least four or more common feature points. On the other hand, in the method of the present embodiment, it is possible to detect an error in the camera parameter only by determining at least one reference point. Furthermore, since it is indispensable to perform object recognition processing on two images in order to detect a known object, the amount of calculation has increased, but in this embodiment, one image is detected. Therefore, it is only necessary to perform object recognition processing, and the amount of calculation can be reduced.

(付記事項)
回転校正部103は、回転パラメータに応じた回転ずれが校正され、並進パラメータに応じた、長手方向及び短手方向のうちの一方の方向のずれ量の並進ずれが校正され、他方の方向のずれ量(BxまたはBy)が校正されていない2つの校正画像を生成してもよい。
(Additional notes)
The rotation calibration unit 103 calibrates the rotational deviation according to the rotation parameter, calibrates the translational deviation of the deviation amount in one of the longitudinal direction and the lateral direction according to the translation parameter, and the deviation in the other direction. Two calibration images in which the quantity (Bx or By) is not calibrated may be generated.

長手方向のずれ量(Bx)が校正されていない2つの校正画像が生成された場合、ずれ範囲算出部104は、式6を用いてずれ範囲Sx1_nearおよびSx1_farを算出し、判定部106は、式8の判定式に従って、ずれ判定を行ってもよい。   When two calibration images in which the displacement amount (Bx) in the longitudinal direction is not calibrated are generated, the displacement range calculation unit 104 calculates the displacement ranges Sx1_near and Sx1_far using Equation 6, and the determination unit 106 uses the equation The shift determination may be performed according to the determination formula of 8.

あるいは、短手方向のずれ量(By)が校正されていない2つの校正画像が生成された場合、ずれ範囲算出部104は、式6を用いてずれ範囲Sy1_nearおよびSy1_farを算出し、判定部106は、式9の判定式に従って、ずれ判定を行ってもよい。   Alternatively, when two proof images are generated in which the lateral shift amount (By) is not calibrated, the shift range calculation unit 104 calculates the shift ranges Sy1_near and Sy1_far using Equation 6, and the determination unit 106 May perform the deviation determination according to the determination formula of Formula 9.

(第2の実施形態)
第2の実施形態においては、ステレオカメラシステムによる三次元計測処理に、画像処理装置100を適用した例について説明する。なお、本実施形態の説明においては、既述の実施形態と共通する各部の詳細な説明は省略する。
(Second Embodiment)
In the second embodiment, an example in which the image processing apparatus 100 is applied to three-dimensional measurement processing by a stereo camera system will be described. In the description of the present embodiment, detailed description of each part common to the above-described embodiments is omitted.

図7は、本実施形態における画像処理装置100が三次元計測処理部200を備えた構成例である。   FIG. 7 is a configuration example in which the image processing apparatus 100 according to this embodiment includes a three-dimensional measurement processing unit 200.

三次元計測処理部200は、カメラパラメータを補正するカメラパラメータ補正部201と、取得した2つの視野画像を平行化する画像平行化部202と、平行化した2つの視野画像に基づき、視差を算出する視差算出部203と、算出した視差とカメラパラメータとから計測点の三次元座標を算出する三次元座標算出部204と、を備える。   The three-dimensional measurement processing unit 200 calculates the parallax based on the camera parameter correction unit 201 that corrects the camera parameters, the image parallelization unit 202 that parallelizes the acquired two field images, and the two parallel field images. A parallax calculation unit 203 that performs the calculation, and a three-dimensional coordinate calculation unit 204 that calculates the three-dimensional coordinates of the measurement point from the calculated parallax and the camera parameters.

カメラパラメータ補正部201と、画像平行化部202と、視差算出部203と、三次元座標算出部204と、は、例えば、FPGAやDSP、GPU、ASICなどの電子回路によって実装されてもよい。もしくは、三次元計測処理部200は、CPU(Central Processing Unit)等のプロセッサがプログラムを実行することにより、上記各部の処理を行ってもよい。   The camera parameter correction unit 201, the image parallelization unit 202, the parallax calculation unit 203, and the three-dimensional coordinate calculation unit 204 may be implemented by electronic circuits such as an FPGA, a DSP, a GPU, and an ASIC, for example. Alternatively, the three-dimensional measurement processing unit 200 may perform the processes of the above-described units when a processor such as a CPU (Central Processing Unit) executes a program.

(三次元計測処理部200の動作)
次に、三次元計測処理部200の動作について図8を参照しながら説明する。図8は、三次元計測処理部200の処理の流れを示す図である。
(Operation of the three-dimensional measurement processing unit 200)
Next, the operation of the three-dimensional measurement processing unit 200 will be described with reference to FIG. FIG. 8 is a diagram illustrating a processing flow of the three-dimensional measurement processing unit 200.

ステップS201において、カメラパラメータ補正部201は、判定部106からのフラグ値情報を受け取り、判定処理を行う。フラグ値が0の場合、すなわち、カメラパラメータに誤差が生じていない場合(S201:Yes)、ステップS202に進む。フラグ値が1の場合、すなわち、カメラパラメータに誤差が生じている場合(S201:No)、ステップS203に進む。   In step S201, the camera parameter correction unit 201 receives the flag value information from the determination unit 106 and performs a determination process. When the flag value is 0, that is, when there is no error in the camera parameter (S201: Yes), the process proceeds to step S202. If the flag value is 1, that is, if an error has occurred in the camera parameter (S201: No), the process proceeds to step S203.

ステップS202において、カメラパラメータ補正部201は、パラメータ取得部102が取得したカメラパラメータに誤差が生じていないと判断する。図7には示していないデータ保持部から、パラメータ取得部102が取得したカメラパラメータをそのまま読み込み、カメラパラメータを画像平行化部202に送る。   In step S202, the camera parameter correction unit 201 determines that there is no error in the camera parameters acquired by the parameter acquisition unit 102. The camera parameters acquired by the parameter acquisition unit 102 are read as they are from a data holding unit (not shown in FIG. 7), and the camera parameters are sent to the image parallelization unit 202.

ステップS203において、カメラパラメータ補正部201は、カメラパラメータに誤差が生じていると判断し、カメラパラメータを補正する処理を行い、補正したカメラパラメータを画像平行化部202に送る。カメラパラメータ補正部201は、以下の各式(式12および式13)に基づき、X軸方向の補正量とY軸方向の補正量を算出する。   In step S <b> 203, the camera parameter correction unit 201 determines that an error has occurred in the camera parameter, performs a process of correcting the camera parameter, and sends the corrected camera parameter to the image parallelization unit 202. The camera parameter correction unit 201 calculates a correction amount in the X-axis direction and a correction amount in the Y-axis direction based on the following formulas (Formula 12 and Formula 13).

Figure 2017040549
Figure 2017040549

Figure 2017040549
Figure 2017040549

ここで、CorXおよびCorYは、それぞれX軸方向のカメラパラメータ補正量、Y軸方向のカメラパラメータ補正量である。なお、その他の変数(前述の式8および式9でも用いられている変数)については既に説明済であるので、ここでは、その他の変数についての説明を省略する。   Here, CorX and CorY are a camera parameter correction amount in the X-axis direction and a camera parameter correction amount in the Y-axis direction, respectively. Since the other variables (variables used in the above-described equations 8 and 9) have already been described, the description of the other variables is omitted here.

カメラパラメータ補正部201は、データ保持部114から補正前のカメラパラメータを読み込み、パラメータの補正を行う。カメラパラメータ補正部201は、例えば、以下の式(式14)からわかるように、並進パラメータを補正する。   The camera parameter correction unit 201 reads the camera parameters before correction from the data holding unit 114 and corrects the parameters. The camera parameter correction unit 201 corrects the translation parameter as can be seen from the following equation (Equation 14), for example.

Figure 2017040549
Figure 2017040549

ここで、(tx’、ty’、tz’)は補正後の並進パラメータであり、(tx、ty、tx)は補正前の並進パラメータである。   Here, (tx ′, ty ′, tz ′) is a translation parameter after correction, and (tx, ty, tx) is a translation parameter before correction.

カメラパラメータ補正部201は、補正後のカメラパラメータと、補正量(補正前の並進パラメータのX成分値txからの補正量であるCorX、及び、補正前の並進パラメータのY成分値tyからの補正量であるCorY)をデータ保持部114に保存する。   The camera parameter correction unit 201 corrects the corrected camera parameter and the correction amount (CorX, which is the correction amount from the X component value tx of the translation parameter before correction, and the Y component value ty of the translation parameter before correction). (CorY) is stored in the data holding unit 114.

カメラパラメータ補正部201は、例えば、補正前のカメラパラメータを補正後のカメラパラメータで上書きしても良いし、補正後のカメラパラメータを、補正前のカメラパラメータとは別に保存するようにしても良い。カメラパラメータ補正部201は、カメラパラメータを上書き保存する場合、補正量(CorX、CorY)の累計量を保存することで、初期のカメラパラメータからの累積のずれ量を確認することができる。   For example, the camera parameter correction unit 201 may overwrite the camera parameter before correction with the camera parameter after correction, or may store the camera parameter after correction separately from the camera parameter before correction. . When the camera parameter correction unit 201 overwrites and saves the camera parameter, the camera parameter correction unit 201 can check the cumulative shift amount from the initial camera parameter by storing the cumulative amount of the correction amount (CorX, CorY).

また、カメラパラメータ補正部201は、補正回数を示す値をデータ保持部114に記憶しても良い。即ち、カメラパラメータ補正部201は、カメラパラメータが補正されるごとに補正回数を示す値をインクリメントすることにより、カメラパラメータが補正された回数を示す値を保持してもよい。   The camera parameter correction unit 201 may store a value indicating the number of corrections in the data holding unit 114. That is, the camera parameter correction unit 201 may hold a value indicating the number of times the camera parameter is corrected by incrementing a value indicating the number of corrections every time the camera parameter is corrected.

なお、カメラキャリブレーションが再度実施された場合(即ち、カメラパラメータが最新のパラメータに更新された場合)には、カメラパラメータ補正部201は、累積ずれ量を示す値、および、補正回数を示す値を0にリセットしてもよい。累積ずれ量を示す値や補正回数を示す値は、情報提示部115を介して、ユーザに提示されてもよい。これにより、ユーザは、提示された情報を通じて、再キャリブレーションの必要性の有無や、補正後のカメラパラメータによって算出された三次元計測結果の信頼性を判断できる。   When the camera calibration is performed again (that is, when the camera parameter is updated to the latest parameter), the camera parameter correction unit 201 has a value indicating the accumulated deviation amount and a value indicating the number of corrections. May be reset to zero. A value indicating the cumulative deviation amount or a value indicating the number of corrections may be presented to the user via the information presenting unit 115. Accordingly, the user can determine the necessity of recalibration and the reliability of the three-dimensional measurement result calculated based on the corrected camera parameter through the presented information.

ステップS204において、画像平行化部202は、画像取得部101から基準画像データおよび参照画像データを受け取るとともに、カメラパラメータ補正部201からカメラパラメータを受け取り、カメラパラメータと基準画像と参照画像とから、2枚の平行化画像を生成する。2枚の平行化画像とは、図3の(b)に示したような、互いに平行化された基準画像および参照画像からなる2枚の画像である。   In step S204, the image collimating unit 202 receives the standard image data and the reference image data from the image acquisition unit 101, receives the camera parameters from the camera parameter correction unit 201, and calculates 2 from the camera parameters, the standard image, and the reference image. A parallel image is generated. The two parallel images are two images composed of a standard image and a reference image that are parallel to each other as shown in FIG.

ステップS205において、視差算出部203は、三次元計測を行う計測点が設定する。視差算出部203は、例えば、基準画像における、参照画像に対応点が存在するような全ての画素からなる範囲(特定範囲)内の全ての点、上記特定範囲内のエッジとして検出される複数の点、上記基準画像における、上記基準画像内に被写体として映っているマーカーを指し示す点などを、計測点として自動的に設定してもよい。   In step S205, the parallax calculation unit 203 sets measurement points for performing three-dimensional measurement. The parallax calculation unit 203, for example, in the base image, all points within a range (specific range) made up of all pixels for which corresponding points exist in the reference image, and a plurality of edges detected as edges within the specific range. A point or a point indicating a marker appearing as a subject in the reference image in the reference image may be automatically set as a measurement point.

もしくは、三次元計測処理部200がユーザ指定部(図示せず)を備え、ユーザ指定部が、ユーザが指定した任意の点を計測点に設定してもよい。   Alternatively, the three-dimensional measurement processing unit 200 may include a user designation unit (not shown), and the user designation unit may set an arbitrary point designated by the user as a measurement point.

ステップS206において、視差算出部203は、上記選択された計測点の視差を算出する。視差は例えば、ブロックマッチングによって、算出される。   In step S206, the parallax calculation unit 203 calculates the parallax of the selected measurement point. The parallax is calculated by, for example, block matching.

ステップS207において、三次元座標算出部204は、各計測点の三次元座標を前述の式1に基づいて算出する。ここで算出される三次元座標は、カメラ座標系に基づく三次元座標である。ただし、三次元座標算出部204は、カメラ座標系から他の座標系への座標変換行列を用いることで、カメラ座標系に基づく三次元座標を、他の座標系の三次元計測値に変換することができる。   In step S <b> 207, the three-dimensional coordinate calculation unit 204 calculates the three-dimensional coordinates of each measurement point based on Equation 1 described above. The three-dimensional coordinates calculated here are three-dimensional coordinates based on the camera coordinate system. However, the three-dimensional coordinate calculation unit 204 converts a three-dimensional coordinate based on the camera coordinate system into a three-dimensional measurement value of another coordinate system by using a coordinate conversion matrix from the camera coordinate system to another coordinate system. be able to.

また、三次元座標算出部204は、他の計測結果と比較するために、計測した三次元計測値は、データ保持部114に保持してもよい。ユーザが、2つの計測点間の距離や対象物の体積を求めたり、対象物に関する現在の計測結果と、当該対象物に関する過去の計測結果とを比較したりすることができるからである。   In addition, the three-dimensional coordinate calculation unit 204 may hold the measured three-dimensional measurement value in the data holding unit 114 in order to compare with other measurement results. This is because the user can obtain the distance between the two measurement points and the volume of the target object, or can compare the current measurement result regarding the target object with the past measurement result regarding the target object.

以上の処理によって、三次元計測処理部200は、各計測点の三次元座標を得ることができる。三次元計測処理部200は、算出した三次元座標およびカメラパラメータの補正情報を、例えば、図9に示すように、情報提示部115に表示する。なお、この場合における情報提示部115は、LCD、OLEDなどのディスプレイ装置である。   Through the above processing, the three-dimensional measurement processing unit 200 can obtain the three-dimensional coordinates of each measurement point. The three-dimensional measurement processing unit 200 displays the calculated three-dimensional coordinates and camera parameter correction information on the information presenting unit 115 as shown in FIG. 9, for example. In this case, the information presentation unit 115 is a display device such as an LCD or an OLED.

情報提示部115に表示される画像205には、撮影画像領域206と、計測結果表示領域207と、カメラパラメータ警告領域208とが、含まれている。なお、図9の例は、三次元計測処理部200が、撮影画像領域206と、計測結果表示領域207と、カメラパラメータ警告領域208を、異なる位置に表示する例を示しているが、三次元計測処理部200は、撮影画像領域206に対して、計測結果表示領域207と、カメラパラメータ警告領域208とを重畳して表示するようにしても良い。   The image 205 displayed on the information presentation unit 115 includes a captured image area 206, a measurement result display area 207, and a camera parameter warning area 208. 9 shows an example in which the three-dimensional measurement processing unit 200 displays the captured image area 206, the measurement result display area 207, and the camera parameter warning area 208 at different positions. The measurement processing unit 200 may display the measurement result display area 207 and the camera parameter warning area 208 superimposed on the captured image area 206.

三次元計測処理部200は、撮影画像領域206に、任意の計測対象209が映っている画像を表示する。   The three-dimensional measurement processing unit 200 displays an image showing an arbitrary measurement target 209 in the captured image area 206.

三次元計測処理部200は、計測結果表示領域207に、任意の計測対象209の領域のうち計測点となった位置を示す三次元位置情報を表示する。例えば、三次元計測処理部200は、計測結果表示領域207に、カメラから任意の計測対象209までの距離を示す情報を表示する。   The three-dimensional measurement processing unit 200 displays three-dimensional position information indicating the position that is the measurement point in the area of the arbitrary measurement target 209 in the measurement result display area 207. For example, the three-dimensional measurement processing unit 200 displays information indicating the distance from the camera to an arbitrary measurement target 209 in the measurement result display area 207.

三次元計測処理部200は、カメラパラメータ警告領域208に、ステップS203においてデータ保持部114に保存した、補正回数や累積ずれ量等の情報を表示する。   The three-dimensional measurement processing unit 200 displays information such as the number of corrections and the accumulated deviation amount stored in the data holding unit 114 in step S203 in the camera parameter warning area 208.

三次元計測処理部200は、補正回数や累積ずれ量を示す数値ではなく、補正回数や累積ずれ量に応じた図形(警告マークなどの図形など)を表示してもよい。例えば、三次元計測処理部200は、補正回数及び/又は累積ずれ量が所定の閾値以上である場合、上記図形を点滅表示(強調表示)してもよい。これにより、ユーザへの注意喚起が成される。   The three-dimensional measurement processing unit 200 may display a figure (such as a warning mark) according to the number of corrections and the accumulated deviation amount, instead of a numerical value indicating the number of corrections and the accumulated deviation amount. For example, the three-dimensional measurement processing unit 200 may blink (highlight) the graphic when the number of corrections and / or the accumulated deviation amount is equal to or greater than a predetermined threshold. Thereby, the user is alerted.

なお、カメラパラメータ警告領域208は、補正回数が0の場合においては、カメラパラメータ警告領域208を表示しないようにしてもよい。   The camera parameter warning area 208 may not be displayed when the correction count is zero.

以上の構成によって、三次元計測処理部200は、カメラパラメータに誤差が生じている場合において、補正した(誤差が低減された)カメラパラメータを用いて計測した三次元計測結果を表示するとともに、カメラパラメータを補正した旨を示す情報をユーザに提示することができる。   With the above configuration, the three-dimensional measurement processing unit 200 displays the three-dimensional measurement result measured using the corrected camera parameter (the error is reduced) when an error occurs in the camera parameter, and the camera Information indicating that the parameter has been corrected can be presented to the user.

(第3の実施形態)
第1および第2の実施形態に係る画像処理装置100は、カメラパラメータに誤差が生じていないにも関わらずカメラパラメータのずれ判定処理を行うケースがあり、これらの画像処理装置100には、無駄な処理の量を削減する余地が残っている。
(Third embodiment)
In some cases, the image processing apparatus 100 according to the first and second embodiments performs a camera parameter deviation determination process even though no error has occurred in the camera parameter. There is still room to reduce the amount of processing.

第3の実施形態に係る画像処理装置100は、カメラパラメータのずれ判定処理を実行すべきタイミングを自動で判定して、そのようなタイミングにおいてずれ判定処理を行うようになっている。なお、本実施形態の説明においては、既述の実施形態と共通する各部の詳細な説明は省略する。   The image processing apparatus 100 according to the third embodiment automatically determines the timing for executing the camera parameter deviation determination process, and performs the deviation determination process at such timing. In the description of the present embodiment, detailed description of each part common to the above-described embodiments is omitted.

図10は、本実施形態に係る画像処理装置が備える三次元計測処理部300の一例である。なお、図10には示していないが、本実施形態に係る画像処理装置は、実施形態2に係る画像処理装置が備える各部を備えている。   FIG. 10 is an example of a three-dimensional measurement processing unit 300 included in the image processing apparatus according to the present embodiment. Although not shown in FIG. 10, the image processing apparatus according to the present embodiment includes each unit included in the image processing apparatus according to the second embodiment.

三次元計測処理部300は、第2の実施形態に係る三次元計測処理部200と同様に、カメラパラメータ補正部201と、画像平行化部202と、視差算出部203と、三次元座標算出部204と、を備えるとともに、新たに異常値判定部301を備えるように構成されている。   Similar to the three-dimensional measurement processing unit 200 according to the second embodiment, the three-dimensional measurement processing unit 300 includes a camera parameter correction unit 201, an image parallelization unit 202, a parallax calculation unit 203, and a three-dimensional coordinate calculation unit. 204, and an abnormal value determination unit 301 is newly provided.

(三次元計測処理部300の動作)
次に、三次元計測処理部300の動作について図11を参照しながら説明する。図11は、三次元計測処理部300の処理の流れを示す図である。
(Operation of the three-dimensional measurement processing unit 300)
Next, the operation of the three-dimensional measurement processing unit 300 will be described with reference to FIG. FIG. 11 is a diagram illustrating a processing flow of the three-dimensional measurement processing unit 300.

ステップS301において、三次元計測処理部300は、第2の実施形態と同様の工程(S201〜S207)を実行することによって、三次元座標を算出し、算出した三次元座標値を異常値判定部301に送る。   In step S301, the three-dimensional measurement processing unit 300 calculates the three-dimensional coordinates by executing the same steps (S201 to S207) as in the second embodiment, and uses the calculated three-dimensional coordinate values as the abnormal value determination unit. 301.

ステップS302において、異常値判定部301は、三次元座標算出部204から受け取った計測結果を示す値と、データ保持部114に記録されている過去の計測結果とを参照し、異常値判定を行う。異常値判定とは、三次元座標算出部204から受け取った計測結果を示す値(測定点の三次元座標値)が異常値であるか否かの判定を意味している。   In step S <b> 302, the abnormal value determination unit 301 refers to the value indicating the measurement result received from the three-dimensional coordinate calculation unit 204 and the past measurement result recorded in the data holding unit 114 and performs an abnormal value determination. . Abnormal value determination means determination of whether or not a value (three-dimensional coordinate value of a measurement point) indicating a measurement result received from the three-dimensional coordinate calculation unit 204 is an abnormal value.

または、予め形状の分かっている被写体を撮影する場合においては、上記被写体のCAD(Conputer Aided Design)データなどの正解データを受け取り、三次元座標算出部204から受け取った計測結果と正解データとを比較するように、異常値判定をおこなってもよい。   Alternatively, when photographing a subject whose shape is known in advance, correct data such as CAD (Computer Aided Design) data of the subject is received, and the measurement result received from the three-dimensional coordinate calculation unit 204 is compared with the correct data. As described above, the abnormal value determination may be performed.

例えば、本実施形態に係る画像処理装置が、工場のライン検査に用いられる場合であって、ラインを流れてくるパーツのサイズなどが既知である場合、異常値判定部301は、当該の既知のサイズと、計測結果が示すサイズと、の差分値を算出し、その差分値が閾値以上になる場合において、異常値判定フラグをONとしてもよい。あるいは、異常値判定部301は、パーツの既知の設置傾きと当該パーツの計測結果が示す設置傾きとの差分値を算出し、その差分値が閾値以上になる場合において、異常値判定フラグをONとするように構成してもよい。   For example, when the image processing apparatus according to the present embodiment is used for a line inspection in a factory, and the size of a part flowing through the line is known, the abnormal value determination unit 301 determines the known value. A difference value between the size and the size indicated by the measurement result is calculated, and when the difference value is equal to or greater than a threshold value, the abnormal value determination flag may be turned ON. Alternatively, the abnormal value determination unit 301 calculates a difference value between the known installation inclination of the part and the installation inclination indicated by the measurement result of the part, and turns on the abnormal value determination flag when the difference value is equal to or greater than a threshold value. You may comprise as follows.

一方、異常値判定部301は、計測結果を示す値が異常値でない場合(差分値が閾値を超えない場合)には、異常値フラグをOFFとしてもよい。   On the other hand, the abnormal value determination unit 301 may set the abnormal value flag to OFF when the value indicating the measurement result is not an abnormal value (when the difference value does not exceed the threshold value).

ステップS303において、異常値判定部301は、異常値判定フラグがONであるか否かを判定する。異常値判定部301は、異常値判定フラグがONであると判定した場合(S303:Yes)、ステップS304に進む。異常値判定部301は、異常値判定フラグがOFFであると判定した場合(S303:No)、S306に進む。なお、異常値判定部301は、異常値判定がONであると判定した場合、異常値判定回数を示す値として“1”をデータ保持部114に保持しておく。   In step S303, the abnormal value determination unit 301 determines whether or not the abnormal value determination flag is ON. If the abnormal value determination unit 301 determines that the abnormal value determination flag is ON (S303: Yes), the process proceeds to step S304. If the abnormal value determination unit 301 determines that the abnormal value determination flag is OFF (S303: No), the process proceeds to S306. When the abnormal value determination unit 301 determines that the abnormal value determination is ON, the abnormal value determination unit 301 stores “1” in the data holding unit 114 as a value indicating the number of abnormal value determinations.

ステップS304において、異常値判定部301は、異常値判定フラグがOFFであると判定するか、異常値判定フラグがONであるとの判定回数が所定の回数を超えるまで、判定異常値判定の繰り返し判定を行う。なお、異常値判定部301は、異常値判定フラグがONであると判定する度に、データ保持部114に記録されている、異常値判定回数を示す値をインクリメントする。   In step S304, the abnormal value determination unit 301 repeats the determination abnormal value determination until it determines that the abnormal value determination flag is OFF or the number of determinations that the abnormal value determination flag is ON exceeds a predetermined number. Make a decision. Each time the abnormal value determination unit 301 determines that the abnormal value determination flag is ON, the abnormal value determination unit 301 increments a value indicating the number of abnormal value determinations recorded in the data holding unit 114.

異常値判定部301は、上記判定回数が所定の回数を超えた場合(S304:Yes)においては、カメラパラメータの誤差が補正できないほどの大きさになっていると判断し、情報提示部115にエラーメッセージを出力する(ステップS307)。上記判定回数が所定の回数を超える前に異常値判定フラグがOFFであると判定した場合(S304:No)、ステップS305に進む。   When the number of determinations exceeds the predetermined number (S304: Yes), the abnormal value determination unit 301 determines that the camera parameter error is not large enough to be corrected, and informs the information presentation unit 115. An error message is output (step S307). If it is determined that the abnormal value determination flag is OFF before the determination number exceeds the predetermined number (S304: No), the process proceeds to step S305.

ステップS305において、画像処理装置100は、第1の実施形態と同様の工程(S102〜S105)を実行することによって、カメラパラメータのずれ判定処理を行う。   In step S305, the image processing apparatus 100 performs camera parameter deviation determination processing by executing the same steps (S102 to S105) as in the first embodiment.

以上のように、異常値判定部301は、計測結果の値として異常値が検出された場合にのみ、ずれ判定処理を行うことになる。   As described above, the abnormal value determination unit 301 performs the deviation determination process only when an abnormal value is detected as the value of the measurement result.

ステップS306において、第2の実施形態と同様に、計測結果を情報提示部115に表示する。   In step S306, the measurement result is displayed on the information presentation unit 115 as in the second embodiment.

以上で説明した本実施形態に係る画像処理装置は、カメラパラメータの誤差の判定を、計測結果を受けて実行するようになっている。そのため、本実施形態に係る画像処理装置は、実施形態1、2に係る画像処理装置と比べて、カメラパラメータに誤差が生じていないときの処理量が低減されていると言える。   The image processing apparatus according to the present embodiment described above performs determination of camera parameter error in response to a measurement result. Therefore, it can be said that the image processing apparatus according to the present embodiment has a reduced processing amount when no error occurs in the camera parameters, as compared with the image processing apparatuses according to the first and second embodiments.

(第4の実施形態)
第4の実施形態においては、画像処理装置100を車載システムに応用した一例について説明する。なお、本実施形態の説明においては、既述の実施形態と共通する各部の詳細な説明は省略する。
(Fourth embodiment)
In the fourth embodiment, an example in which the image processing apparatus 100 is applied to an in-vehicle system will be described. In the description of the present embodiment, detailed description of each part common to the above-described embodiments is omitted.

本実施形態に係る車載システム401は、図12に示すように、車両400の前方もしくは後方を撮影するためのステレオカメラ402と、各種制御処理を行う制御部403と、車両の制動を行う制動部404と、各種情報を提示できるマルチメディアユニット405と、を備える。なお、図12には示していないが、本実施形態に係る車載システム401は、実施形態2に係る画像処理装置が備える各部を備えている。   As shown in FIG. 12, the in-vehicle system 401 according to the present embodiment includes a stereo camera 402 for photographing the front or rear of the vehicle 400, a control unit 403 for performing various control processes, and a braking unit for braking the vehicle. 404 and a multimedia unit 405 capable of presenting various types of information. Although not shown in FIG. 12, the in-vehicle system 401 according to the present embodiment includes each unit included in the image processing apparatus according to the second embodiment.

本実施形態に係る車載システム401は、ステレオカメラ402が捉えた対象物(車両400の前方もしくは後方の他車両、人物、構造物等)と車両400との距離に基づいて、ブレーキ制御を行うシステム(衝突防止システム)である。車載システム401は、カメラパラメータの誤差に関する情報をユーザに提示するようになっている。   The in-vehicle system 401 according to the present embodiment performs a brake control based on a distance between an object (another vehicle in front or behind the vehicle 400, a person, a structure, or the like) captured by the stereo camera 402 and the vehicle 400. (Anti-collision system). The in-vehicle system 401 is configured to present information related to camera parameter errors to the user.

ステレオカメラ402は、実施形態1に係る画像処理装置100の各部の処理を実行するように構成されている。即ち、ステレオカメラ402は、上記各部の処理を実行するプログラムが組み込まれた組み込み機器である。   The stereo camera 402 is configured to execute processing of each unit of the image processing apparatus 100 according to the first embodiment. That is, the stereo camera 402 is an embedded device in which a program for executing the processing of each unit is incorporated.

制御部403は、FPGAやCPU等の各種処理装置によって構成され、車載システム401の全体のシステム制御を行う。   The control unit 403 includes various processing devices such as an FPGA and a CPU, and performs overall system control of the in-vehicle system 401.

制動部404は、例えば、油圧式ブレーキ装置であって、制御部403からの指示に応じて、車両速度を減少させるように制動動作を行う。   The braking unit 404 is, for example, a hydraulic brake device, and performs a braking operation so as to decrease the vehicle speed in response to an instruction from the control unit 403.

マルチメディアユニット405は、例えば、カーナビゲーションシステムなどであって、LCDやOLEDなどのディスプレイ装置と、スピーカシステムなどの音声提示装置を有する。   The multimedia unit 405 is, for example, a car navigation system, and includes a display device such as an LCD or OLED and a voice presentation device such as a speaker system.

(車載システム401の動作)
次に、車載システム401の動作について図13を参照しながら説明する。図13は、車載システム401の処理の流れを示す図である。
(Operation of in-vehicle system 401)
Next, the operation of the in-vehicle system 401 will be described with reference to FIG. FIG. 13 is a diagram showing a flow of processing of the in-vehicle system 401.

ステップS401において、ステレオカメラ402は、前述の実施形態2に係る画像処理装置100と同様の処理によって、計測点の三次元座標値とカメラパラメータのずれ判定に関する情報を算出する。なお、本実施形態においては、例えば、ステレオカメラ402によって撮影された基準画像における、第2の実施形態で説明した特定範囲内の複数のエッジ点(計測対象物と背景との境界に対応する点)を、計測点として利用する。また、ステレオカメラ402は、算出したエッジ上の各計測点の三次元座標値のうち、一部の計測点の三次元座標値(例えば、Smirnov−Grubbs検定などによって外れ値と判断された三次元座標値)を除く、残りの計測点の三次元座標値をデータ保持部114に保存する。また、ステレオカメラ402は、上記残りの計測点の各々について、当該計測点までの距離を示す距離データを、当該測定点のデータとして、データ保持部114に保存する。   In step S <b> 401, the stereo camera 402 calculates information related to the determination of the deviation between the three-dimensional coordinate value of the measurement point and the camera parameter by the same process as the image processing apparatus 100 according to the second embodiment. In the present embodiment, for example, a plurality of edge points (points corresponding to the boundary between the measurement object and the background) within the specific range described in the second embodiment in the reference image captured by the stereo camera 402. ) Is used as a measurement point. In addition, the stereo camera 402 has the three-dimensional coordinate values of some measurement points among the calculated three-dimensional coordinate values of each measurement point on the edge (for example, three-dimensional values determined as outliers by the Smirnov-Grubbs test or the like) The three-dimensional coordinate values of the remaining measurement points excluding the coordinate values are stored in the data holding unit 114. In addition, the stereo camera 402 stores, for each of the remaining measurement points, distance data indicating the distance to the measurement point in the data holding unit 114 as data of the measurement point.

ステップS402において、制御部403は、データ保持部114に保持されたカメラパラメータに基づくフラグ値が0であるか否かを判定する。制御部403は、フラグ値が1であると判定した場合(カメラパラメータに誤差が生じている場合、S402:Yes)にはステップS403に進み、フラグ値が0で有ると判定した場合(カメラパラメータがずれていない場合、S402:No)にはステップS404に進む。   In step S402, the control unit 403 determines whether or not the flag value based on the camera parameter held in the data holding unit 114 is zero. If the control unit 403 determines that the flag value is 1 (when an error occurs in the camera parameter, S402: Yes), the control unit 403 proceeds to step S403, and determines that the flag value is 0 (camera parameter). If not, the process proceeds to step S404 in S402: No).

ステップS403において、制御部403は、ステップS401において距離算出された計測点のデータのうちの、車両400に最も距離が近い計測点までの距離を示す距離データを参照し、当該距離と所定の距離閾値Aとの比較を行う。   In step S403, the control unit 403 refers to the distance data indicating the distance to the measurement point closest to the vehicle 400 among the data of the measurement points calculated in step S401, and the distance and the predetermined distance. Comparison with threshold A is performed.

制御部403は、最も距離が近い計測点までの距離が所定の距離閾値Aよりも小さい場合(S403:Yes)、ステップS406に進む。制御部403は、そうでない場合(S403:No)、ステップS405に進む。   When the distance to the closest measurement point is smaller than the predetermined distance threshold A (S403: Yes), the control unit 403 proceeds to step S406. If not (S403: No), the control unit 403 proceeds to step S405.

ステップS404において、制御部403は、ステップS401において距離算出された計測点のデータのうちの、車両400に最も距離が近い計測点までの距離を示す距離データを参照し、当該距離と、所定の距離閾値Bとの比較を行う。   In step S404, the control unit 403 refers to the distance data indicating the distance to the measurement point closest to the vehicle 400 among the data of the measurement points calculated in step S401. Comparison with the distance threshold B is performed.

制御部403は、最も距離が近い計測点までの距離が所定の距離閾値Bよりも小さい場合(S404:Yes)、ステップS406に進む。制御部403は、そうでない場合(S404:No)、ステップS405に進む。   When the distance to the closest measurement point is smaller than the predetermined distance threshold B (S404: Yes), the control unit 403 proceeds to step S406. If not (S404: No), the control unit 403 proceeds to step S405.

ステップS405において、制動部404は、ブレーキ制御を行わないことを決定する。   In step S405, the braking unit 404 determines not to perform brake control.

ステップS406において、制動部404は、制御部403からのブレーキ指示に従ってブレーキ制御を行う。   In step S <b> 406, the braking unit 404 performs brake control according to the brake instruction from the control unit 403.

ここで、ステップS403およびステップS404における距離閾値Aと距離閾値Bは、A≧Bの関係となるように設定される。カメラパラメータに誤差が生じた場合、計測点までの距離の測定値が実際の距離値よりも大きくなってしまう可能性があるため、上記のように、カメラパラメータに誤差が生じた場合に参照する距離閾値Aを、そうでない場合に参照する距離閾値Bよりも大きい値に設定する。   Here, the distance threshold A and the distance threshold B in step S403 and step S404 are set so as to satisfy the relationship A ≧ B. If an error occurs in the camera parameter, the measured value of the distance to the measurement point may be larger than the actual distance value, so refer to this when the error occurs in the camera parameter as described above. The distance threshold A is set to a value larger than the distance threshold B that is referred to otherwise.

なお、距離閾値Aと距離閾値Bとを等しい値に設定してもよい。この場合においては、制御部403は、カメラパラメータに誤差が生じていることが検出されたときは、カメラパラメータに誤差が生じていることが検出されていないときよりも、強い制動をかけるように、制動部404に指示してもよい。   The distance threshold A and the distance threshold B may be set to the same value. In this case, when it is detected that an error has occurred in the camera parameter, the control unit 403 applies stronger braking than when no error has been detected in the camera parameter. The braking unit 404 may be instructed.

また、制御部403は、カメラパラメータに誤差が生じた場合には、マルチメディアユニット405の表示装置に対して、カメラパラメータに誤差が生じたことを示す警告を提示してもよい。また、制御部403は、マルチメディアユニット405のスピーカシステムを介して、ユーザに音声で警告してもよい。あるいは、制御部403は、ステレオカメラ401の筺体につけられたLEDを点滅させることで、ユーザに警告を提示するように構成することもできる。   In addition, when an error occurs in the camera parameter, the control unit 403 may present a warning indicating that an error has occurred in the camera parameter to the display device of the multimedia unit 405. Further, the control unit 403 may warn the user by voice via the speaker system of the multimedia unit 405. Or the control part 403 can also be comprised so that a warning may be shown to a user by blinking LED attached to the housing of the stereo camera 401. FIG.

制御部403は、これらの警告を常時提示してもよいが、例えば、エンジン始動直後における、車載システム401への通電が開始された時点にのみ、これらの警告を提示してもよい。あるいは、車両400がオートマティックトランスミッション車両である場合、シフトレバーが「パーキング」を指し示す位置から他の位置に変更された時点などに、警告を提示してもよい。   The control unit 403 may present these warnings at all times, but may present these warnings only when, for example, energization of the in-vehicle system 401 is started immediately after the engine is started. Alternatively, when vehicle 400 is an automatic transmission vehicle, a warning may be presented when the shift lever is changed from a position indicating “parking” to another position.

なお、以上の説明において、画像処理装置100の各種処理をステレオカメラ402が実行するものとしたが、画像処理装置100の各種処理を制御部403が実行するようにしてもよい。   In the above description, the stereo camera 402 executes various processes of the image processing apparatus 100. However, the control unit 403 may execute various processes of the image processing apparatus 100.

(第5の実施形態)
第5の実施形態においては、三次元画像表示システムの一例について説明する。なお、本実施形態の説明においては、既述の実施形態と共通する各部の詳細な説明は省略する。
(Fifth embodiment)
In the fifth embodiment, an example of a three-dimensional image display system will be described. In the description of the present embodiment, detailed description of each part common to the above-described embodiments is omitted.

本実施形態に係る画像処理装置500の構成例を図14に示す。画像処理装置500は、第1の実施形態における画像処理装置100と同様に、画像取得部101と、パラメータ取得部102と、回転校正部103と、ずれ範囲算出部104と、ずれ量算出部105と、判定部106と、を備え、画像平行化部501と、表示画像生成部502と、を更に備える。また、画像処理装置500は、データバス116を介して、外部の表示装置(表示部503)と接続される。   A configuration example of the image processing apparatus 500 according to the present embodiment is shown in FIG. Similar to the image processing apparatus 100 in the first embodiment, the image processing apparatus 500 includes an image acquisition unit 101, a parameter acquisition unit 102, a rotation calibration unit 103, a deviation range calculation unit 104, and a deviation amount calculation unit 105. And a determination unit 106, and further includes an image parallelization unit 501 and a display image generation unit 502. The image processing apparatus 500 is connected to an external display device (display unit 503) via the data bus 116.

表示部503は、以下の(a)〜(c)に例示される表示装置である。
(a)アナグリフ、偏光メガネ、液晶シャッターメガネなどによって、三次元画像として表示できるメガネ式の三次元表示装置
(b)パララックスバリア方式やレンチキュラー方式などの裸眼式の三次元表示装置
(c)左右の目に異なる映像を提示することができるヘッドマウントディスプレイ装置
画像平行化部501は、画像取得部101から基準画像データおよび参照画像データを受け取るとともに、パラメータ取得部102からカメラパラメータを受け取る。画像平行化部501は、カメラパラメータと基準画像と参照画像とから、2枚の平行化画像を生成する。2枚の平行化画像とは、図3の(b)に示したような、互いに平行化された基準画像および参照画像からなる2枚の画像である。
The display unit 503 is a display device exemplified in the following (a) to (c).
(A) glasses-type three-dimensional display device capable of displaying as a three-dimensional image by anaglyph, polarized glasses, liquid crystal shutter glasses, etc. (b) autostereoscopic three-dimensional display devices such as parallax barrier method and lenticular method (c) left and right A head-mounted display device that can present different images to the eyes The image collimating unit 501 receives standard image data and reference image data from the image acquisition unit 101 and also receives camera parameters from the parameter acquisition unit 102. The image collimating unit 501 generates two parallelized images from the camera parameters, the standard image, and the reference image. The two parallel images are two images composed of a standard image and a reference image that are parallel to each other as shown in FIG.

表示画像生成部502は、画像平行化部501から2枚の平行化画像を受け取るとともに、判定部106からフラグ値を受け取り、2枚の平行化画像とフラグ値とを用いて、表示部503に表示するための三次元画像を生成する。   The display image generation unit 502 receives two parallel images from the image parallelization unit 501, receives a flag value from the determination unit 106, and uses the two parallelized images and the flag value to display on the display unit 503. Generate a three-dimensional image for display.

判定部106から受け取ったフラグ値が0の場合、すなわち、「カメラパラメータに誤差が生じていない」と判定された場合、表示画像生成部502は、平行化された基準画像データのデータと平行化された参照画像のデータとの組を、表示部503で表示するための三次元画像フォーマットのデータに変換し、変換後のデータを表示部503に送る。   When the flag value received from the determination unit 106 is 0, that is, when it is determined that “the camera parameter has no error”, the display image generation unit 502 performs parallelization with the parallelized reference image data data. The pair with the reference image data thus converted is converted into data in a three-dimensional image format for display on the display unit 503, and the converted data is sent to the display unit 503.

一方、判定部106から受け取ったフラグ値が1の場合、すなわち、「カメラパラメータに誤差が生じている」と判定された場合、表示画像生成部502は、平行化された基準画像のデータもしくは平行化された参照画像のデータのいずれかのデータを複製する。そして、表示画像生成部502は、同じ内容の2つの画像(基準画像又は参照画像)のデータの組を、表示部503で表示するための三次元画像フォーマットに変換し、変換後のデータを表示部503に送る。このため、表示部503に表示される画像は、実質的に二次元画像となる。   On the other hand, when the flag value received from the determination unit 106 is 1, that is, when it is determined that “an error has occurred in the camera parameter”, the display image generation unit 502 performs parallel reference image data or parallel Any one of the converted reference image data is copied. Then, the display image generation unit 502 converts a data set of two images (standard image or reference image) having the same content into a three-dimensional image format for display on the display unit 503, and displays the converted data. To part 503. For this reason, the image displayed on the display unit 503 is substantially a two-dimensional image.

以上の構成によって、本実施形態に係る三次元画像表示システムは、カメラパラメータに誤差が生じていない場合には三次元表示を行い、カメラパラメータに誤差が生じている場合には二次元表示を行うことができる。   With the above configuration, the 3D image display system according to the present embodiment performs 3D display when there is no error in the camera parameter, and performs 2D display when there is an error in the camera parameter. be able to.

<第1乃至第5の実施形態について>
上記の各実施形態において、添付図面に図示されている構成等については、あくまで一例であり、本発明は、これらに限定されるものではない。各実施形態の構成は、本発明の効果を発揮する範囲内で適宜変更することが可能である。その他、本発明の目的の範囲を逸脱しない限りにおいて各実施形態の構成を適宜変更して実施することが可能である。
<About the first to fifth embodiments>
In each of the above-described embodiments, the configuration and the like illustrated in the accompanying drawings are merely examples, and the present invention is not limited to these. The configuration of each embodiment can be appropriately changed within a range in which the effect of the present invention is exhibited. In addition, the configuration of each embodiment can be changed as appropriate without departing from the scope of the object of the present invention.

〔ソフトウェアによる実現例〕
画像処理装置100の制御ブロック(特に画像取得部101、パラメータ取得部102、回転校正部103、ずれ範囲算出部104、ずれ量算出部105、判定部106、情報提示部115、カメラパラメータ補正部201、視差算出部203、及び、三次元座標算出部204)は、集積回路(ICチップ)等に形成された論理回路(ハードウェア)によって実現してもよいし、CPU(Central Processing Unit)を用いてソフトウェアによって実現してもよい。
[Example of software implementation]
Control blocks of the image processing apparatus 100 (particularly, the image acquisition unit 101, parameter acquisition unit 102, rotation calibration unit 103, deviation range calculation unit 104, deviation amount calculation unit 105, determination unit 106, information presentation unit 115, camera parameter correction unit 201) , The parallax calculation unit 203 and the three-dimensional coordinate calculation unit 204) may be realized by a logic circuit (hardware) formed in an integrated circuit (IC chip) or the like, or using a CPU (Central Processing Unit). It may be realized by software.

後者の場合、画像処理装置100は、各機能を実現するソフトウェアであるプログラムの命令を実行するCPU、上記プログラムおよび各種データがコンピュータ(またはCPU)で読み取り可能に記録されたROM(Read Only Memory)または記憶装置(これらを「記録媒体」と称する)、上記プログラムを展開するRAM(Random Access Memory)などを備えている。そして、コンピュータ(またはCPU)が上記プログラムを上記記録媒体から読み取って実行することにより、本発明の目的が達成される。上記記録媒体としては、「一時的でない有形の媒体」、例えば、テープ、ディスク、カード、半導体メモリ、プログラマブルな論理回路などを用いることができる。また、上記プログラムは、該プログラムを伝送可能な任意の伝送媒体(通信ネットワークや放送波等)を介して上記コンピュータに供給されてもよい。なお、本発明は、上記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。   In the latter case, the image processing apparatus 100 includes a CPU that executes instructions of a program that is software that implements each function, and a ROM (Read Only Memory) in which the program and various data are recorded so as to be readable by a computer (or CPU). Alternatively, a storage device (these are referred to as “recording media”), a RAM (Random Access Memory) that expands the program, and the like are provided. And the objective of this invention is achieved when a computer (or CPU) reads the said program from the said recording medium and runs it. As the recording medium, a “non-temporary tangible medium” such as a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, or the like can be used. The program may be supplied to the computer via an arbitrary transmission medium (such as a communication network or a broadcast wave) that can transmit the program. The present invention can also be realized in the form of a data signal embedded in a carrier wave in which the program is embodied by electronic transmission.

〔まとめ〕
本発明の態様1に係る画像処理装置(画像処理装置100、画像撮像装置112)は、少なくとも2つの視点画像(基準画像、参照画像)を取得する画像取得部と、並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正部(回転校正部103)と、前記カメラパラメータに誤差が生じているか否かを判定する判定部(判定部106)とを備え、前記画像校正部は、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、前記判定部は、前記カメラパラメータに基づいて、前記2つの校正画像における、前記少なくとも一方の方向のずれ範囲を算出し、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出し、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定する。
[Summary]
An image processing apparatus (an image processing apparatus 100, an image capturing apparatus 112) according to aspect 1 of the present invention includes an image acquisition unit that acquires at least two viewpoint images (a reference image and a reference image), a translation parameter, and a rotation parameter. An image calibration unit (rotation calibration unit 103) that generates two calibration images from the two viewpoint images based on the included camera parameters, and a determination unit (determination unit) that determines whether an error has occurred in the camera parameters 106), and the image calibration unit is not calibrated for translational deviation in at least one of the longitudinal direction and the lateral direction according to the translation parameter, and the rotational deviation according to the rotational parameter is calibrated. The two calibration images are generated, and the determination unit determines whether the at least one of the two calibration images is based on the camera parameter. A deviation range in the direction is calculated, and a deviation amount in the at least one direction of a corresponding point corresponding to the reference point in the other calibration image with respect to an arbitrary reference point in one calibration image of the two calibration images Is calculated, and the deviation range and the deviation amount are compared to determine whether an error has occurred in the camera parameter.

上記の構成によれば、前記画像処理装置は、撮影画像(視点画像)にサイズが既知の対象物が映り込んでいるか否かに関わらず、カメラパラメータの値に誤差が生じたことを検知できる、という効果を奏する。   According to the above configuration, the image processing apparatus can detect that an error has occurred in the value of the camera parameter regardless of whether or not an object having a known size is reflected in the captured image (viewpoint image). , Has the effect.

本発明の態様2に係る画像処理装置(画像撮像装置112)は、前記態様1において、前記判定部による判定結果を示す情報を提示する情報提示部(情報提示部115)を備えていてもよい。   The image processing apparatus (image capturing apparatus 112) according to aspect 2 of the present invention may include an information presentation unit (information presentation unit 115) that presents information indicating a determination result by the determination unit in the aspect 1. .

上記の構成によれば、前記画像処理装置は、カメラパラメータの値に誤差が生じているか否かをユーザに認識させることができる、という更なる効果を奏する。   According to said structure, the said image processing apparatus has the further effect that a user can recognize whether the error has arisen in the value of the camera parameter.

本発明の態様3に係る画像処理装置(画像処理装置100)は、前記態様1または2において、前記カメラパラメータに誤差が生じていると前記判定部が判定した場合に、前記ずれ範囲と前記ずれ量に基づいて前記並進パラメータの補正量を算出するパラメータ更新処理部(カメラパラメータ補正部201)を備え、前記パラメータ更新処理部は、前記補正量の補正を前記並進パラメータに施すようになっていてもよい。   In the image processing apparatus (image processing apparatus 100) according to aspect 3 of the present invention, in the aspect 1 or 2, when the determination unit determines that an error has occurred in the camera parameter, the shift range and the shift A parameter update processing unit (camera parameter correction unit 201) that calculates a correction amount of the translation parameter based on the amount, and the parameter update processing unit performs correction of the correction amount on the translation parameter. Also good.

上記の構成によれば、前記画像処理装置は、カメラパラメータに誤差が生じている場合に、カメラパラメータの誤差を自動的に低減することができる、という更なる効果を奏する。   According to the above configuration, the image processing apparatus has an additional effect that the error of the camera parameter can be automatically reduced when an error occurs in the camera parameter.

本発明の態様4に係る画像処理装置(画像処理装置100)は、前記態様1から3のいずれかの態様において、前記2つの校正画像間の視差を算出する視差算出部(視差算出部203)と、前記視差算出部による算出結果に基づき、測定点の三次元座標値を算出する三次元座標値算出部(三次元座標算出部204)と、を更に備え、前記判定部は、前記三次元座標値が異常値であるか否かを判定し、前記三次元座標値が異常値であると判定した場合に、前記カメラパラメータに誤差が生じているか否かの判定を行ってもよい。   An image processing apparatus (image processing apparatus 100) according to an aspect 4 of the present invention, in any one of the aspects 1 to 3, has a parallax calculation unit (parallax calculation unit 203) that calculates the parallax between the two calibration images. And a three-dimensional coordinate value calculation unit (three-dimensional coordinate calculation unit 204) that calculates a three-dimensional coordinate value of a measurement point based on a calculation result by the parallax calculation unit, and the determination unit includes the three-dimensional coordinate value It may be determined whether the coordinate value is an abnormal value, and when it is determined that the three-dimensional coordinate value is an abnormal value, it may be determined whether an error has occurred in the camera parameter.

上記の構成によれば、前記画像処理装置が前記カメラパラメータに誤差が生じているか否かの判定を行うのは、前記三次元座標値が異常値であると前記画像処理装置が判定した場合である。   According to the above configuration, the image processing apparatus determines whether or not an error has occurred in the camera parameter when the image processing apparatus determines that the three-dimensional coordinate value is an abnormal value. is there.

即ち、前記画像処理装置は、前記カメラパラメータに誤差が生じている可能性が高い場合に、前記カメラパラメータに誤差が生じているか否かの判定を行う。   That is, the image processing apparatus determines whether an error has occurred in the camera parameter when there is a high possibility that an error has occurred in the camera parameter.

従って、前記画像処理装置には、前記カメラパラメータに誤差が生じているか否かを判定する処理(負荷のかかる処理)を無駄に実行しない、という更なる利点がある、と言える。   Therefore, it can be said that the image processing apparatus has a further advantage of not wastefully executing a process for determining whether an error has occurred in the camera parameter (a process requiring a load).

本発明の態様5に係る誤差判定方法は、画像処理装置による誤差判定方法であって、少なくとも2つの視点画像を取得する画像取得ステップと、並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正ステップと、前記カメラパラメータに誤差が生じているか否かを判定する判定ステップとを含み、前記画像校正ステップにて、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、前記判定ステップは、前記カメラパラメータに基づいて、前記2つの校正画像における、長手方向および短手方向の少なくとも一方の方向のずれ範囲を算出するステップと、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出するステップと、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定するステップとを含んでいる。   An error determination method according to aspect 5 of the present invention is an error determination method by an image processing device, based on an image acquisition step of acquiring at least two viewpoint images, and camera parameters including a translation parameter and a rotation parameter. An image calibration step for generating two calibration images from the two viewpoint images, and a determination step for determining whether or not an error has occurred in the camera parameter, and in the image calibration step, according to the translation parameter Further, the translational deviation in at least one of the longitudinal direction and the lateral direction is not calibrated, and the two calibration images in which the rotational deviation according to the rotational parameter is calibrated are generated. Based on the camera parameters, in the two calibration images, at least one of the longitudinal direction and the lateral direction And a deviation amount in at least one direction of a corresponding point corresponding to the reference point in the other calibration image with respect to an arbitrary reference point in one of the two calibration images. And a step of determining whether or not an error has occurred in the camera parameter by comparing the shift range and the shift amount.

上記の構成によれば、上記態様5に係る誤差判定方法は、上記態様1に係る画像処理装置と同様の作用効果を奏する。   According to said structure, the error determination method which concerns on the said aspect 5 has an effect similar to the image processing apparatus which concerns on the said aspect 1. FIG.

100 画像処理装置
101 画像取得部
103 回転校正部(画像校正部)
106 判定部
112 画像撮像装置(画像処理装置)
115 情報提示部
200 三次元計測処理部
201 カメラパラメータ補正部(パラメータ更新処理部)
203 視差算出部
204 三次元座標算出部(三次元座標値算出部)
DESCRIPTION OF SYMBOLS 100 Image processing apparatus 101 Image acquisition part 103 Rotation calibration part (image calibration part)
106 Determination Unit 112 Image Imaging Device (Image Processing Device)
115 Information Presentation Unit 200 Three-dimensional Measurement Processing Unit 201 Camera Parameter Correction Unit (Parameter Update Processing Unit)
203 parallax calculation unit 204 three-dimensional coordinate calculation unit (three-dimensional coordinate value calculation unit)

Claims (5)

少なくとも2つの視点画像を取得する画像取得部と、
並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正部と、
前記カメラパラメータに誤差が生じているか否かを判定する判定部とを備え、
前記画像校正部は、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、
前記判定部は、前記カメラパラメータに基づいて、前記2つの校正画像における、前記少なくとも一方の方向のずれ範囲を算出し、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出し、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定する、ことを特徴とする画像処理装置。
An image acquisition unit for acquiring at least two viewpoint images;
An image calibration unit that generates two calibration images from the two viewpoint images based on camera parameters including a translation parameter and a rotation parameter;
A determination unit that determines whether an error has occurred in the camera parameter,
The image calibration unit is not calibrated for translational deviation in at least one of the longitudinal direction and the lateral direction according to the translation parameter, and the two calibrations are calibrated for rotational deviation according to the rotational parameter. Generate an image,
The determination unit calculates a shift range in the at least one direction in the two calibration images based on the camera parameter, and with respect to an arbitrary reference point in one calibration image of the two calibration images, Whether or not there is an error in the camera parameter by calculating a deviation amount of the corresponding point corresponding to the reference point in the other calibration image in the at least one direction and comparing the deviation range with the deviation amount. An image processing apparatus characterized by determining whether or not.
前記判定部による判定結果を示す情報を提示する情報提示部を備えている、ことを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising an information presentation unit that presents information indicating a determination result by the determination unit. 前記カメラパラメータに誤差が生じていると前記判定部が判定した場合に、前記ずれ範囲と前記ずれ量に基づいて前記並進パラメータの補正量を算出するパラメータ更新処理部を備え、
前記パラメータ更新処理部は、前記補正量の補正を前記並進パラメータに施すようになっている、ことを特徴とする請求項1または2に記載の画像処理装置。
A parameter update processing unit that calculates a correction amount of the translation parameter based on the shift range and the shift amount when the determination unit determines that an error has occurred in the camera parameter;
The image processing apparatus according to claim 1, wherein the parameter update processing unit is configured to perform correction of the correction amount on the translation parameter.
前記2つの校正画像間の視差を算出する視差算出部と、
前記視差算出部による算出結果に基づき、測定点の三次元座標値を算出する三次元座標値算出部と、を更に備え、
前記判定部は、前記三次元座標値が異常値であるか否かを判定し、前記三次元座標値が異常値であると判定した場合に、前記カメラパラメータに誤差が生じているか否かの判定を行う、ことを特徴とする請求項1から3のいずれか一項に記載の画像処理装置。
A parallax calculator that calculates parallax between the two calibration images;
A three-dimensional coordinate value calculation unit that calculates a three-dimensional coordinate value of a measurement point based on a calculation result by the parallax calculation unit;
The determination unit determines whether or not the three-dimensional coordinate value is an abnormal value, and when determining that the three-dimensional coordinate value is an abnormal value, whether or not an error has occurred in the camera parameter. The image processing apparatus according to claim 1, wherein the determination is performed.
画像処理装置による誤差判定方法であって、
少なくとも2つの視点画像を取得する画像取得ステップと、
並進パラメータと回転パラメータとを含むカメラパラメータに基づいて、2つの前記視点画像から2つの校正画像を生成する画像校正ステップと、
前記カメラパラメータに誤差が生じているか否かを判定する判定ステップとを含み、
前記画像校正ステップにて、前記並進パラメータに応じた、長手方向および短手方向の少なくとも一方の方向の並進ずれが校正されておらず、前記回転パラメータに応じた回転ずれが校正された前記2つの校正画像を生成し、
前記判定ステップは、前記カメラパラメータに基づいて、前記2つの校正画像における、長手方向および短手方向の少なくとも一方の方向のずれ範囲を算出するステップと、前記2つの校正画像のうちの一方の校正画像における任意の基準点に対する、他方の校正画像における前記基準点に対応する対応点の、前記少なくとも一方の方向のずれ量を算出するステップと、前記ずれ範囲と前記ずれ量を比較することで、前記カメラパラメータに誤差が生じているか否かを判定するステップとを含んでいる、ことを特徴とする誤差判定方法。
An error determination method by an image processing apparatus,
An image acquisition step of acquiring at least two viewpoint images;
An image calibration step for generating two calibration images from the two viewpoint images based on camera parameters including a translation parameter and a rotation parameter;
Determining whether or not an error has occurred in the camera parameter,
In the image calibration step, the translational deviation in at least one of the longitudinal direction and the lateral direction according to the translation parameter is not calibrated, and the rotational deviation according to the rotational parameter is calibrated. Produce a calibration image,
The determining step calculates a deviation range in at least one of a longitudinal direction and a short direction in the two calibration images based on the camera parameters, and calibration of one of the two calibration images. Calculating a deviation amount in the at least one direction of a corresponding point corresponding to the reference point in the other calibration image with respect to an arbitrary reference point in the image, and comparing the deviation range and the deviation amount, And determining whether an error has occurred in the camera parameter.
JP2015162192A 2015-08-19 2015-08-19 Image processing apparatus and error determination method Active JP6599685B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015162192A JP6599685B2 (en) 2015-08-19 2015-08-19 Image processing apparatus and error determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015162192A JP6599685B2 (en) 2015-08-19 2015-08-19 Image processing apparatus and error determination method

Publications (3)

Publication Number Publication Date
JP2017040549A true JP2017040549A (en) 2017-02-23
JP2017040549A5 JP2017040549A5 (en) 2018-09-13
JP6599685B2 JP6599685B2 (en) 2019-10-30

Family

ID=58202761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015162192A Active JP6599685B2 (en) 2015-08-19 2015-08-19 Image processing apparatus and error determination method

Country Status (1)

Country Link
JP (1) JP6599685B2 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018229812A1 (en) * 2017-06-12 2018-12-20 株式会社日立製作所 Three-dimensional measurement device and method
WO2018235256A1 (en) * 2017-06-23 2018-12-27 株式会社日立製作所 Stereo measurement device and system
CN109146977A (en) * 2017-06-16 2019-01-04 中兴通讯股份有限公司 Image translation error correcting method, mobile terminal and computer readable storage medium
JP2019016308A (en) * 2017-07-10 2019-01-31 株式会社Zmp Object detection device and method
WO2019239775A1 (en) * 2018-06-15 2019-12-19 日立オートモティブシステムズ株式会社 Vehicle object sensing device
JP2020190411A (en) * 2019-05-17 2020-11-26 キヤノン株式会社 Imaging device, image processing device, image processing method, calibration method of imaging device, robot device, manufacturing method of articles using robot device, control program and recording medium
WO2021029206A1 (en) * 2019-08-14 2021-02-18 日立オートモティブシステムズ株式会社 Image processing device
JP2022510237A (en) * 2019-01-18 2022-01-26 エヌイーシー ラボラトリーズ アメリカ インク Camera self-calibration network
CN114693770A (en) * 2020-12-31 2022-07-01 北京小米移动软件有限公司 Calibration method and device
DE112021006059T5 (en) 2021-04-20 2023-12-07 Fanuc Corporation robot

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09153148A (en) * 1995-11-30 1997-06-10 Oki Electric Ind Co Ltd Correcting condition detector for stereoscopic picture
US20020167726A1 (en) * 2001-03-08 2002-11-14 Rod Barman Method and apparatus for multi-nodal, three-dimensional imaging
JP2010271950A (en) * 2009-05-21 2010-12-02 Canon Inc Information processing apparatus and method of calibration process
JP2011180022A (en) * 2010-03-02 2011-09-15 Suzuki Motor Corp Method and device of diagnosing stereo camera
JP2012173032A (en) * 2011-02-18 2012-09-10 Ricoh Co Ltd Image processing device, method, program and recording medium
JP2014006243A (en) * 2012-05-28 2014-01-16 Ricoh Co Ltd Abnormality diagnostic device, abnormality diagnostic method, imaging apparatus, moving body control system and moving body

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09153148A (en) * 1995-11-30 1997-06-10 Oki Electric Ind Co Ltd Correcting condition detector for stereoscopic picture
US20020167726A1 (en) * 2001-03-08 2002-11-14 Rod Barman Method and apparatus for multi-nodal, three-dimensional imaging
JP2010271950A (en) * 2009-05-21 2010-12-02 Canon Inc Information processing apparatus and method of calibration process
JP2011180022A (en) * 2010-03-02 2011-09-15 Suzuki Motor Corp Method and device of diagnosing stereo camera
JP2012173032A (en) * 2011-02-18 2012-09-10 Ricoh Co Ltd Image processing device, method, program and recording medium
JP2014006243A (en) * 2012-05-28 2014-01-16 Ricoh Co Ltd Abnormality diagnostic device, abnormality diagnostic method, imaging apparatus, moving body control system and moving body

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2018229812A1 (en) * 2017-06-12 2020-02-27 株式会社日立製作所 Three-dimensional measuring device and method
WO2018229812A1 (en) * 2017-06-12 2018-12-20 株式会社日立製作所 Three-dimensional measurement device and method
CN109146977A (en) * 2017-06-16 2019-01-04 中兴通讯股份有限公司 Image translation error correcting method, mobile terminal and computer readable storage medium
WO2018235256A1 (en) * 2017-06-23 2018-12-27 株式会社日立製作所 Stereo measurement device and system
JPWO2018235256A1 (en) * 2017-06-23 2020-05-21 株式会社日立製作所 Stereo measuring device and system
JP2019016308A (en) * 2017-07-10 2019-01-31 株式会社Zmp Object detection device and method
JP7152884B2 (en) 2018-06-15 2022-10-13 日立Astemo株式会社 Vehicle object detection device
JP2019219180A (en) * 2018-06-15 2019-12-26 日立オートモティブシステムズ株式会社 Object detection device for vehicle
WO2019239775A1 (en) * 2018-06-15 2019-12-19 日立オートモティブシステムズ株式会社 Vehicle object sensing device
US11914028B2 (en) 2018-06-15 2024-02-27 Hitachi Astemo, Ltd. Object detection device for vehicle
JP2022510237A (en) * 2019-01-18 2022-01-26 エヌイーシー ラボラトリーズ アメリカ インク Camera self-calibration network
JP2020190411A (en) * 2019-05-17 2020-11-26 キヤノン株式会社 Imaging device, image processing device, image processing method, calibration method of imaging device, robot device, manufacturing method of articles using robot device, control program and recording medium
US11637948B2 (en) 2019-05-17 2023-04-25 Canon Kabushiki Kaisha Image capturing apparatus, image processing apparatus, image processing method, image capturing apparatus calibration method, robot apparatus, method for manufacturing article using robot apparatus, and recording medium
US12058468B2 (en) 2019-05-17 2024-08-06 Canon Kabushiki Kaisha Image capturing apparatus, image processing apparatus, image processing method, image capturing apparatus calibration method, robot apparatus, method for manufacturing article using robot apparatus, and recording medium
WO2021029206A1 (en) * 2019-08-14 2021-02-18 日立オートモティブシステムズ株式会社 Image processing device
CN114693770A (en) * 2020-12-31 2022-07-01 北京小米移动软件有限公司 Calibration method and device
DE112021006059T5 (en) 2021-04-20 2023-12-07 Fanuc Corporation robot

Also Published As

Publication number Publication date
JP6599685B2 (en) 2019-10-30

Similar Documents

Publication Publication Date Title
JP6599685B2 (en) Image processing apparatus and error determination method
JP6167525B2 (en) Distance measuring device and vehicle
EP3114430B1 (en) Calibration method, calibration device, and computer program product
JP4814669B2 (en) 3D coordinate acquisition device
JP7018566B2 (en) Image pickup device, image processing method and program
US10659762B2 (en) Stereo camera
JP5293131B2 (en) Compound eye distance measuring device for vehicle and compound eye distance measuring method
KR20150101749A (en) Device for estimating three-dimensional shape of object and method thereof
JP2014092461A (en) Image processor and image processing method, image processing system, and program
JP2009529824A (en) CMOS stereo camera for 3D image acquisition
JP5299296B2 (en) Vehicle periphery image display device and vehicle periphery image display method
WO2011125937A1 (en) Calibration data selection device, method of selection, selection program, and three dimensional position measuring device
JP2007256029A (en) Stereo image processing device
JP2014074632A (en) Calibration apparatus of in-vehicle stereo camera and calibration method
CN111882655A (en) Method, apparatus, system, computer device and storage medium for three-dimensional reconstruction
JP2021051347A (en) Distance image generation apparatus and distance image generation method
JP6040782B2 (en) Image processing apparatus and program
JP2009092551A (en) Method, apparatus and system for measuring obstacle
WO2017187935A1 (en) Information processing apparatus, information processing method, and program
CN110121023B (en) Image processing method, electronic device and non-transitory computer readable storage medium
US20230260159A1 (en) Information processing apparatus, information processing method, and non-transitory computer readable medium
JP7132501B2 (en) ranging camera
JP6305232B2 (en) Information processing apparatus, imaging apparatus, imaging system, information processing method, and program.
WO2015182771A1 (en) Image capturing device, image processing device, image processing method, and computer program
JP6680335B2 (en) Stereo camera, vehicle, calculation method and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180803

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180803

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190521

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190528

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190726

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191003

R150 Certificate of patent or registration of utility model

Ref document number: 6599685

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150