Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7621828B2 - IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD - Google Patents
[go: Go Back, main page]

JP7621828B2 - IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD - Google Patents

IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD Download PDF

Info

Publication number
JP7621828B2
JP7621828B2 JP2021024654A JP2021024654A JP7621828B2 JP 7621828 B2 JP7621828 B2 JP 7621828B2 JP 2021024654 A JP2021024654 A JP 2021024654A JP 2021024654 A JP2021024654 A JP 2021024654A JP 7621828 B2 JP7621828 B2 JP 7621828B2
Authority
JP
Japan
Prior art keywords
image
pixels
dissimilarity
search area
reference image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2021024654A
Other languages
Japanese (ja)
Other versions
JP2022126527A (en
Inventor
弘理 外舘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyocera Corp
Original Assignee
Kyocera 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 Kyocera Corp filed Critical Kyocera Corp
Priority to JP2021024654A priority Critical patent/JP7621828B2/en
Publication of JP2022126527A publication Critical patent/JP2022126527A/en
Application granted granted Critical
Publication of JP7621828B2 publication Critical patent/JP7621828B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Image Analysis (AREA)

Description

本発明は、画像処理装置、ステレオカメラ装置、移動体及び画像処理方法に関するものである。 The present invention relates to an image processing device, a stereo camera device, a moving object, and an image processing method.

ステレオカメラが撮像するステレオ画像それぞれにおいて、同じ物体の位置の違い(視差)に基づいて、実空間における当該物体の位置を算出することが知られている。視差の算出方法として、例えば、ブロックマッチング方式が用いられている。ブロックマッチングでは、ブロック内に背景が含まれる場合、異なる距離の物体が含まれやすくなるため、ブロックマッチングの一致度が低下する。そのため、視差の算出精度が低下し得る。また、屋外環境においては、ビル等の人工物特有の鉛直方向のエッジ情報及び水平方向のエッジ情報が多く含まれることがあり、これらのエッジ情報が、ブロックマッチングの一致度に大きな影響を与え得る。一致度に大きな影響を与えることにより、視差の算出精度が低下し得る。 It is known that the position of an object in real space is calculated based on the difference in the position (parallax) of the same object in each stereo image captured by a stereo camera. For example, a block matching method is used as a method of calculating parallax. In block matching, if a background is included in a block, objects at different distances are likely to be included, and the degree of match of the block matching decreases. This can reduce the accuracy of the parallax calculation. Furthermore, in an outdoor environment, there may be a lot of vertical edge information and horizontal edge information specific to man-made objects such as buildings, and this edge information can have a significant impact on the degree of match of the block matching. This significant impact on the degree of match can reduce the accuracy of the parallax calculation.

そこで、ステレオペアにおける一次的な視差を算出し、当該一次的な視差に基づいてマッチングウィンドウのウィンドウサイズの拡大又は縮小を行うことが提案されている(特許文献1参照)。 Therefore, it has been proposed to calculate the primary disparity in a stereo pair and expand or reduce the window size of the matching window based on the primary disparity (see Patent Document 1).

特開2014-174930号公報JP 2014-174930 A

ブロックマッチングにおいて、ブロックに含まれる画素が属する物体の距離に応じてブロックの大きさを変更できれば、ブロックマッチングの一致度を高められると考えられる。しかし、一次的な視差の精度が低ければ、ブロックの大きさを変更させても、視差の算出精度を向上させることは困難である。また、鉛直方向及び水平方向のエッジ情報を含む画像に対してはブロックの大きさを変更したとしても、視差の算出精度を向上させることは困難である。 In block matching, if the size of a block could be changed depending on the distance of the object to which the pixels contained in the block belong, it is thought that the degree of agreement in block matching could be improved. However, if the accuracy of the primary disparity is low, it is difficult to improve the accuracy of the disparity calculation even if the block size is changed. Furthermore, for images that contain edge information in the vertical and horizontal directions, it is difficult to improve the accuracy of the disparity calculation even if the block size is changed.

従って、上記のような従来技術の問題点に鑑みてなされた本開示の目的は、視差の算出精度を向上させる画像処理装置、ステレオカメラ装置、移動体、及び画像処理方法を提供することにある。 Therefore, in consideration of the problems with the conventional technology described above, the objective of the present disclosure is to provide an image processing device, a stereo camera device, a moving object, and an image processing method that improve the accuracy of calculating disparity.

上述した諸課題を解決すべく、第1の観点による画像処理装置は、
ステレオカメラが撮像した基準画像及び参照画像を取得する取得部と、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する制御部と、を備え、
前記制御部は、
前記基準画像内の各画素が被写体別にグループ分けされるように、クラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出する。
In order to solve the above-mentioned problems, an image processing apparatus according to a first aspect comprises:
An acquisition unit that acquires a standard image and a reference image captured by a stereo camera;
a control unit that calculates a disparity of a subject image within the search area based on a first degree of difference between a search area including a reference point in the base image and a comparison area that is displaced in pixel units along a baseline length direction of the stereo camera in the reference image,
The control unit is
clustering the pixels in the reference image so that the pixels are grouped by object;
In the search region, pixels that belong to the same subject as the subject to which the reference point belongs are weighted differently from pixels that belong to subjects other than the same subject, to calculate the first dissimilarity.

また、第2の観点によるステレオカメラ装置は、
基準画像及び参照画像を撮像するステレオカメラと、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する画像処理装置とを備え、
前記画像処理装置は、
前記基準画像内で、各画素を被写体別にクラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出する。
Moreover, a stereo camera device according to a second aspect of the present invention comprises:
A stereo camera that captures a standard image and a reference image;
an image processing device that calculates a disparity of a subject image within the search area based on a first degree of difference between a search area including a reference point in the standard image and a comparison area that is displaced in pixel units along a baseline length direction of the stereo camera in the reference image;
The image processing device includes:
In the reference image, pixels are clustered by subject;
In the search region, pixels that belong to the same subject as the subject to which the reference point belongs are weighted differently from pixels that belong to subjects other than the same subject, to calculate the first dissimilarity.

また、第3の観点による移動体は、
基準画像及び参照画像を撮像するステレオカメラと、前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する画像処理装置とを有する、ステレオカメラ装置を備え、
前記ステレオカメラ装置は、
前記基準画像内で、各画素を被写体別にクラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出する。
A moving body according to a third aspect of the present invention comprises:
a stereo camera device including a stereo camera for capturing a standard image and a reference image; and an image processing device for calculating a parallax of a subject image in a search area based on a first degree of difference between a search area including a standard point in the standard image and a comparison area displaced in pixel units along a base line length direction of the stereo camera in the reference image;
The stereo camera device includes:
In the reference image, pixels are clustered by subject;
In the search region, pixels that belong to the same subject as the subject to which the reference point belongs are weighted differently from pixels that belong to subjects other than the same subject, to calculate the first dissimilarity.

また、第4の観点による画像処理方法は、
ステレオカメラに基準画像及び参照画像を撮像させるステップと、
前記基準画像内で、各画素を被写体別にクラスタリングを行うステップと、
前記基準画像内の基準点を含む探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けになるように、各画素の重み付けを決定するステップと、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との複数の第1の相違度と、前記各画素の重付けとに基づいて前記探索領域内の被写体像の視差を算出するステップと、を備える。
Further, an image processing method according to a fourth aspect comprises:
A step of capturing a standard image and a reference image by a stereo camera;
clustering pixels in the reference image by object;
determining a weighting for each pixel in a search area including a reference point in the reference image such that pixels belonging to the same subject as the subject to which the reference point belongs are weighted differently from pixels belonging to subjects other than the same subject;
The method includes a step of calculating a disparity of a subject image within the search area based on a plurality of first disparities between a search area including a reference point in the base image and a comparison area in the reference image which is displaced on a pixel-by-pixel basis along a baseline length direction of the stereo camera, and a weighting of each pixel.

上記のように構成された本開示に係る画像処理装置、ステレオカメラ装置、移動体及び画像処理方法によれば、視差の算出精度が向上する。 The image processing device, stereo camera device, moving body, and image processing method according to the present disclosure configured as described above improve the accuracy of calculating disparity.

本実施形態に係る画像処理装置を含むステレオカメラ装置の概略構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a stereo camera device including an image processing device according to an embodiment of the present invention. 図1のステレオカメラの移動体における位置を概念的に例示する側面図である。2 is a side view conceptually illustrating the position of the stereo camera of FIG. 1 on the moving body. 図1のステレオカメラの移動体における位置を概念的に例示する正面図である。2 is a front view conceptually illustrating the position of the stereo camera of FIG. 1 on the moving body. 図1の制御部が実行する第1の位置算出処理を説明するためのフローチャートである。4 is a flowchart for explaining a first position calculation process executed by a control unit in FIG. 1 . 図1の制御部が実行する第2の位置算出処理を説明するためのフローチャートである。10 is a flowchart for explaining a second position calculation process executed by the control unit in FIG. 1 . 図1の制御部が実行する第3の位置算出処理を説明するためのフローチャートである。10 is a flowchart for explaining a third position calculation process executed by the control unit in FIG. 1 . 視差の算出精度の説明のために例示した探索領域の画素の集合を示す図である。FIG. 11 is a diagram showing a set of pixels in a search region illustrated as an example for explaining the accuracy of disparity calculation. 図7で例示した探索領域に対応する範囲で切出した参照画像の画素の集合を示す図である。8 is a diagram showing a set of pixels of a reference image cut out in a range corresponding to the search region exemplified in FIG. 7 . 図8の参照画像に対して指定される第1の比較領域、第2の比較領域、及び第3の比較領域の範囲を示す図である。9 is a diagram showing the ranges of a first comparison region, a second comparison region, and a third comparison region specified for the reference image of FIG. 8 .

以下、本開示を適用した画像処理装置の実施形態について、図面を参照して説明する。 Below, an embodiment of an image processing device to which the present disclosure is applied will be described with reference to the drawings.

図1に示すように、本開示を適用した画像処理装置10を含むステレオカメラ装置11は、ステレオカメラ12及び画像処理装置10を含む。図2に示すように、ステレオカメラ装置11は、撮像したステレオ画像に基づいて、ステレオ画像に含まれる被写体像に相当する被写体の、移動体13を基準にしたワールド座標系における位置を算出してよい。図1に示すように、ステレオカメラ装置11は、被写体のワールド座標系の位置を外部装置14に通知してよい。外部装置14は、オートクルーズコントロールなどの走行支援装置、自動ブレーキ装置などの運転支援装置、被写体までの距離を報知する報知装置、ならびに警告を発する警告装置を含んでよい。 As shown in FIG. 1, a stereo camera device 11 including an image processing device 10 to which the present disclosure is applied includes a stereo camera 12 and the image processing device 10. As shown in FIG. 2, the stereo camera device 11 may calculate the position of a subject corresponding to the subject image included in a stereo image in a world coordinate system based on a moving body 13, based on a captured stereo image. As shown in FIG. 1, the stereo camera device 11 may notify an external device 14 of the position of the subject in the world coordinate system. The external device 14 may include a driving support device such as an auto cruise control, a driving support device such as an automatic braking device, a notification device that notifies the distance to the subject, and a warning device that issues a warning.

移動体13は、例えば車両、船舶、航空機などを含んでよい。車両は、例えば、自動車、産業車両、鉄道車両、生活車両、滑走路を走行する固定翼機などを含んでよい。自動車は、例えば、乗用車、トラック、バス、二輪車、トロリーバスなどを含んでよい。産業車両は、例えば、農業、建設向けの産業車両などを含んでよい。産業車両は、例えば、フォークリフト、ゴルフカートなどを含んでよい。農業向けの産業車両は、例えば、トラクター、耕耘機、移植機、バインダー、コンバイン、芝刈り機などを含んでよい。建設向けの産業車両は、例えば、ブルドーザー、スクレーバー、ショベルカー、クレーン車、ダンプカー、ロードローラなどを含んでよい。車両は、人力で走行するものを含んでよい。車両の分類は、上述した例に限られない。例えば、自動車は、道路を走行可能な産業車両を含んでよい。複数の分類に同じ車両が含まれてよい。船舶は、例えば、マリンジェット、ボート、タンカーを含んでよい。航空機は、例えば、固定翼機、回転翼機などを含んでよい。 The moving body 13 may include, for example, vehicles, ships, aircraft, etc. The vehicles may include, for example, automobiles, industrial vehicles, railroad vehicles, residential vehicles, fixed-wing aircraft running on runways, etc. The automobiles may include, for example, passenger cars, trucks, buses, motorcycles, trolley buses, etc. The industrial vehicles may include, for example, industrial vehicles for agriculture and construction. The industrial vehicles may include, for example, forklifts, golf carts, etc. The agricultural industrial vehicles may include, for example, tractors, cultivators, transplanters, binders, combines, lawnmowers, etc. The construction industrial vehicles may include, for example, bulldozers, scrapers, excavators, cranes, dump trucks, road rollers, etc. The vehicles may include those that run by human power. The classification of vehicles is not limited to the above examples. For example, automobiles may include industrial vehicles that can run on roads. The same vehicle may be included in multiple classifications. The ships may include, for example, marine jets, boats, and tankers. Aircraft may include, for example, fixed-wing aircraft, rotorcraft, etc.

ステレオカメラ12及び画像処理装置10は、有線又は無線通信により通信可能であってよい。ステレオカメラ12及び画像処理装置10とは、ネットワークを介して通信してよい。ネットワークは、例えば、有線又は無線のLAN(Local Area Network)、CAN(Controller Area Network)などを含んでよい。ステレオカメラ12及び画像処理装置10は、同一の筺体内に収納され一体的に構成されてよい。ステレオカメラ12及び画像処理装置10は、移動体13内に位置し、移動体13内のECU(Electronic Control Unit)と通信可能に構成されてよい。 The stereo camera 12 and the image processing device 10 may be capable of communicating with each other via wired or wireless communication. The stereo camera 12 and the image processing device 10 may communicate with each other via a network. The network may include, for example, a wired or wireless LAN (Local Area Network), CAN (Controller Area Network), etc. The stereo camera 12 and the image processing device 10 may be housed in the same housing and configured as an integrated unit. The stereo camera 12 and the image processing device 10 may be located in a moving object 13 and configured to be capable of communicating with an ECU (Electronic Control Unit) in the moving object 13.

図2に示すように、ステレオカメラ装置11は、例えば、移動体13に搭載されてよい。ステレオカメラ12は、例えば、移動体13の前方を撮像するように設置されてよい。ステレオカメラ12は、例えば、後述する、ステレオカメラ12に含まれる複数のカメラの少なくとも1つの光軸OXは、移動体13の前後方向に略平行となるように配置される。 As shown in FIG. 2, the stereo camera device 11 may be mounted on, for example, a moving body 13. The stereo camera 12 may be installed, for example, so as to capture an image in front of the moving body 13. The stereo camera 12 is arranged, for example, so that the optical axis OX of at least one of the multiple cameras included in the stereo camera 12, which will be described later, is approximately parallel to the front-rear direction of the moving body 13.

ステレオカメラ12は、移動体13の多様な場所に搭載されてよい。ステレオカメラ12は、例えば、移動体13の内部に搭載され、ウインドシールドを介して移動体13の外部を撮像する。ステレオカメラ12は、ルームミラーの前方又はダッシュボード上に配置されてよい。ステレオカメラ12は、移動体13のフロントバンパー、フェンダーグリル、サイドフェンダー、ライトモジュール及びボンネットのいずれかに固定されていてよい。 The stereo camera 12 may be mounted in various locations on the moving body 13. For example, the stereo camera 12 is mounted inside the moving body 13 and captures an image of the outside of the moving body 13 through the windshield. The stereo camera 12 may be disposed in front of the rearview mirror or on the dashboard. The stereo camera 12 may be fixed to any of the front bumper, fender grille, side fender, light module, and bonnet of the moving body 13.

ステレオカメラ12は、互いに視差を有する複数のカメラを含んでよい。図1に示すように、ステレオカメラ12は、例えば、第1のカメラ15及び第2のカメラ16を含んでよい。ステレオカメラ12は、複数のカメラを協働させて、複数の方向から対象を撮像してよい。ステレオカメラ12は、単一の筐体に複数のカメラを含んでよい。ステレオカメラ12は互いに独立し、且つ互いに離れて位置する2台以上のカメラを含んでよい。ステレオカメラ12は、互いに独立した複数のカメラに限られない。本開示では、例えば、離れた2箇所に入射される光を1つの受光素子に導く光学機構を有するカメラがステレオカメラ12として採用され得る。 The stereo camera 12 may include multiple cameras having parallax with respect to each other. As shown in FIG. 1, the stereo camera 12 may include, for example, a first camera 15 and a second camera 16. The stereo camera 12 may capture an image of an object from multiple directions by using multiple cameras in cooperation with each other. The stereo camera 12 may include multiple cameras in a single housing. The stereo camera 12 may include two or more cameras that are independent of each other and located apart from each other. The stereo camera 12 is not limited to multiple cameras that are independent of each other. In the present disclosure, for example, a camera having an optical mechanism that guides light incident at two separate points to one light receiving element may be adopted as the stereo camera 12.

ステレオカメラ12において、第1のカメラ15及び第2のカメラ16は、それぞれの光軸OXが互いに同じ被写体を撮像可能な方向を向くように、位置してよい。第1のカメラ15及び第2のカメラ16は、撮像した画像に少なくとも同じ被写体像が含まれるように、光軸OX及び位置が定められてよい。第1のカメラ15及び第2のカメラ16の光軸OXは、例えば、互いに平行である。光軸OXが平行とは、厳密な平行に限定されず、組立てのずれ、取付けのずれ、及びこれらの経時によるずれを許容してよい。第1のカメラ15及び第2のカメラ16の光軸OXは、平行に限定されず、互いに異なる方向を向いてよい。 In the stereo camera 12, the first camera 15 and the second camera 16 may be positioned so that their optical axes OX face in directions that allow them to capture the same subject. The optical axes OX and positions of the first camera 15 and the second camera 16 may be determined so that the captured images include at least the same subject image. The optical axes OX of the first camera 15 and the second camera 16 are, for example, parallel to each other. The optical axes OX being parallel is not limited to being strictly parallel, and may allow for misalignment in assembly, misalignment in installation, and misalignment over time. The optical axes OX of the first camera 15 and the second camera 16 are not limited to being parallel, and may face in different directions.

第1のカメラ15及び第2のカメラ16は、光軸OXに交わる方向において離れて位置してよい。図3に示すように、第1のカメラ15及び第2のカメラ16は、移動体13への取り付けにおいて定められている姿勢において、左右方向に沿って位置してよい。第1のカメラ15及び第2のカメラ16の位置の違いにより、各カメラで撮像した2つの画像において、互いに対応する被写体の位置は、異なる。第1のカメラ15が生成する基準画像、及び第2のカメラ16が生成する参照画像は、異なる視点から撮像したステレオ画像である。第1のカメラ15及び第2のカメラ16は、所定のフレームレート(例えば30fps)で被写体を撮像してよい。 The first camera 15 and the second camera 16 may be positioned apart in a direction intersecting the optical axis OX. As shown in FIG. 3, the first camera 15 and the second camera 16 may be positioned along the left-right direction in a posture determined when they are attached to the moving body 13. Due to differences in the positions of the first camera 15 and the second camera 16, the positions of the objects corresponding to each other in the two images captured by each camera are different. The base image generated by the first camera 15 and the reference image generated by the second camera 16 are stereo images captured from different viewpoints. The first camera 15 and the second camera 16 may capture the object at a predetermined frame rate (e.g., 30 fps).

第1のカメラ15及び第2のカメラ16は、それぞれ光軸OXを規定する光学系と撮像素子とを備えてよい。第1のカメラ15及び第2のカメラ16はそれぞれ異なる光軸OXを有してよい。光学系は、レンズ又はミラーを含み、被写体像を撮像素子の受光面に結像させてよい。撮像素子は、例えば、CCDイメージセンサ(Charge-Coupled Device Image Sensor)、又はCMOSイメージセンサ(Complementary MOS Image Sensor)である。第1のカメラ15及び第2のカメラ16それぞれの撮像素子は、それぞれのカメラの光軸OXに垂直な同一面内に存在してよい。第1のカメラ15及び第2のカメラ16それぞれの撮像素子は、行列状に配置される複数の画素を有してよい。第1のカメラ15及び第2のカメラ16の撮像素子において、画素の並ぶ行方向がステレオカメラ12の基線長方向に平行であってよい。基線長方向は、第1のカメラ15の撮像素子の受光面への光軸OXの交点と、第2のカメラ16の撮像素子の受光面への光軸OXの交点とを通る直線の方向である。第1のカメラ15及び第2のカメラ16は、撮像素子に結像された画像を信号として生成する。第1のカメラ15及び第2のカメラ16は、撮像した画像に、歪み補正、明度調整、コントラスト調整、ガンマ補正などの任意の画像処理を施してよい。 The first camera 15 and the second camera 16 may each include an optical system that defines an optical axis OX and an imaging element. The first camera 15 and the second camera 16 may each have a different optical axis OX. The optical system may include a lens or a mirror, and may form an image of a subject on the light receiving surface of the imaging element. The imaging element may be, for example, a CCD image sensor (Charge-Coupled Device Image Sensor) or a CMOS image sensor (Complementary MOS Image Sensor). The imaging elements of the first camera 15 and the second camera 16 may be present in the same plane perpendicular to the optical axis OX of each camera. The imaging elements of the first camera 15 and the second camera 16 may have a plurality of pixels arranged in a matrix. In the imaging elements of the first camera 15 and the second camera 16, the row direction in which pixels are arranged may be parallel to the base length direction of the stereo camera 12. The base length direction is the direction of a straight line passing through the intersection of the optical axis OX to the light receiving surface of the imaging element of the first camera 15 and the intersection of the optical axis OX to the light receiving surface of the imaging element of the second camera 16. The first camera 15 and the second camera 16 generate the image formed on the imaging element as a signal. The first camera 15 and the second camera 16 may perform any image processing such as distortion correction, brightness adjustment, contrast adjustment, and gamma correction on the captured image.

図1に示すように、画像処理装置10は、取得部17、出力部18、メモリ19及び制御部20を備える。画像処理装置10は、移動体13内において任意の位置に配置されてよい。画像処理装置10は、例えば、移動体13のダッシュボード内に配置される。 As shown in FIG. 1, the image processing device 10 includes an acquisition unit 17, an output unit 18, a memory 19, and a control unit 20. The image processing device 10 may be disposed at any position within the mobile object 13. The image processing device 10 is disposed, for example, within the dashboard of the mobile object 13.

取得部17は、ステレオカメラ12及び外部機器から情報を取得する、画像処理装置10の入力インタフェースである。取得部17には、物理コネクタ、及び無線通信機が採用されてよい。物理コネクタは、電気信号による伝送に対応した電気コネクタ、光信号による伝送に対応した光コネクタ及び電磁波による伝送に対応した電磁コネクタが含まれてよい。電気コネクタには、IEC60603に準拠するコネクタ、USB規格に準拠するコネクタ、RCA端子に対応するコネクタ、EIAJ CP-1211Aに規定されるS端子に対応するコネクタ、EIAJ RC-5237に規定されるD端子に対応するコネクタ、HDMI(登録商標)規格に準拠するコネクタ及びBNCを含む同軸ケーブルに対応するコネクタが含まれてよい。光コネクタは、IEC 61754に準拠する種々のコネクタを含んでよい。無線通信機は、Bluetooth(登録商標)、及びIEEE802.11を含む各規格に準拠する無線通信機を含んでよい。無線通信機は、少なくとも1つのアンテナを含んでよい。 The acquisition unit 17 is an input interface of the image processing device 10 that acquires information from the stereo camera 12 and external devices. The acquisition unit 17 may employ a physical connector and a wireless communication device. The physical connector may include an electrical connector compatible with transmission by electrical signals, an optical connector compatible with transmission by optical signals, and an electromagnetic connector compatible with transmission by electromagnetic waves. The electrical connector may include a connector conforming to IEC 60603, a connector conforming to the USB standard, a connector compatible with an RCA terminal, a connector compatible with an S terminal defined in EIAJ CP-1211A, a connector compatible with a D terminal defined in EIAJ RC-5237, a connector conforming to the HDMI (registered trademark) standard, and a connector compatible with a coaxial cable including BNC. The optical connector may include various connectors conforming to IEC 61754. The wireless communication device may include a wireless communication device conforming to each standard including Bluetooth (registered trademark) and IEEE 802.11. The wireless communication device may include at least one antenna.

取得部17は、ステレオカメラ12が撮像により生成した基準画像及び参照画像を信号として取得する。取得部17は取得した基準画像及び参照画像を、制御部20に引き渡す。取得部17は、ステレオカメラ12の撮像信号の伝送方式に対応してよい。取得部17は、ネットワークを介してステレオカメラ12の出力インタフェースに接続されてよい。 The acquisition unit 17 acquires the standard image and the reference image generated by the stereo camera 12 through imaging as signals. The acquisition unit 17 passes the acquired standard image and reference image to the control unit 20. The acquisition unit 17 may be compatible with a transmission method for the imaging signal of the stereo camera 12. The acquisition unit 17 may be connected to the output interface of the stereo camera 12 via a network.

出力部18は、画像処理装置10が算出する被写体のワールド座標系における位置を、移動体13内の他の装置又は他の移動体、路側機などの移動体13外の外部装置14に出力し得る、画像処理装置10の出力インタフェースである。出力部18は、取得部17と同様に、有線及び無線の通信に対応した種々のインタフェースを含んでよい。出力部18は、例えば、CANのインタフェースを有し、移動体13内の他の装置と通信を行う。 The output unit 18 is an output interface of the image processing device 10 that can output the position of the subject in the world coordinate system calculated by the image processing device 10 to other devices within the mobile body 13 or to external devices 14 outside the mobile body 13, such as other mobile bodies or roadside units. The output unit 18 may include various interfaces compatible with wired and wireless communication, similar to the acquisition unit 17. The output unit 18 has, for example, a CAN interface and communicates with other devices within the mobile body 13.

メモリ19は、例えば、RAM(Random Access Memory)及びROM(Read Only Memory)など、任意の記憶デバイスを含んでよい。メモリ19は、制御部20を機能させる多様なプログラム、及び制御部20が用いる多様な情報を記憶してよい。 The memory 19 may include any storage device, such as a RAM (Random Access Memory) and a ROM (Read Only Memory). The memory 19 may store various programs that cause the control unit 20 to function, and various information used by the control unit 20.

制御部20は、1以上のプロセッサ及びメモリを含んでよい。プロセッサは、特定のプログラムを読み込ませて特定の機能を実行する汎用のプロセッサ、及び特定の処理に特化した専用のプロセッサを含んでよい。専用のプロセッサは、特定用途向けIC(ASIC;Application Specific Integrated Circuit)を含んでよい。プロセッサは、プログラマブルロジックデバイス(PLD;Programmable Logic Device)を含んでよい。PLDは、FPGA(Field-Programmable Gate Array)を含んでよい。制御部20は、1つまたは複数のプロセッサが協働するSoC(System-on-a-Chip)、及びSiP(System In a Package)のいずれかであってもよい。 The control unit 20 may include one or more processors and memories. The processor may include a general-purpose processor that loads a specific program to execute a specific function, and a dedicated processor specialized for a specific process. The dedicated processor may include an application specific integrated circuit (ASIC). The processor may include a programmable logic device (PLD). The PLD may include a field-programmable gate array (FPGA). The control unit 20 may be either a system-on-a-chip (SoC) in which one or more processors work together, or a system in a package (SIP).

制御部20は、基準画像内の各画素が被写体別にグループ分けされるように、クラスタリングを行う。制御部20は、多様な方法によりクラスタリングを行ってよい。制御部20は、少なくとも1つの方法により、クラスタリングを行ってよい。制御部20は、複数の方法を組合わせて、クラスタリングを行ってよい。 The control unit 20 performs clustering so that each pixel in the reference image is grouped by subject. The control unit 20 may perform clustering using various methods. The control unit 20 may perform clustering using at least one method. The control unit 20 may perform clustering using a combination of multiple methods.

例えば、制御部20は、以下に説明する、オプティカルフローに基づいて、クラスタリングを行ってよい。オプティカルフローに基づくクラスタリングを行うために、制御部20は、基準画像を連続して取得してよい。基準画像を連続して取得とは、任意のフレームレートで、撮像時点が異なる2フレーム以上の基準画像を取得することを意味する。撮像時点が異なる2フレーム以上の基準画像は、撮像時点が連続するフレームの基準画像であってよい。 For example, the control unit 20 may perform clustering based on optical flow, which will be described below. To perform clustering based on optical flow, the control unit 20 may continuously acquire reference images. Continuously acquiring reference images means acquiring reference images of two or more frames captured at different times at an arbitrary frame rate. The reference images of two or more frames captured at different times may be reference images of frames captured at consecutive times.

制御部20は、例えば、Lucas-Kanade法等の任意の方法により、基準画像の各画素におけるオプティカルフローを算出する。制御部20は、算出した各画素のオプティカルフローの中で、オプティカルフロー、即ち連続する基準画像間での動きベクトルが同じ画素であって、互いに近接する画素を同一の被写体に属する画素とみなしてよい。制御部20は、各画素を任意の被写体に属するとみなすことにより、被写体別にグループ分けしてよい。 The control unit 20 calculates the optical flow for each pixel of the reference image using any method, such as the Lucas-Kanade method. The control unit 20 may consider pixels that have the same optical flow, i.e., the same motion vector between successive reference images, and are close to each other, as belonging to the same subject, among the calculated optical flows for each pixel, as belonging to the same subject. The control unit 20 may group the pixels by subject by considering each pixel as belonging to any subject.

また、例えば、制御部20は、以下に説明する、オクルージョン領域に基づいて、クラスタリングを行ってよい。オクルージョン領域とは、近距離の被写体の周辺における遠距離の背景等の被写体領域のように、基準画像及び参照画像の一方に撮像され、他方には撮像されない領域である。 For example, the control unit 20 may perform clustering based on occlusion regions, which will be described below. An occlusion region is a region that is captured in one of the base image and the reference image and not captured in the other, such as a subject region such as a distant background around a close subject.

制御部20は、基準画像から参照画像への視差、及び参照画像から基準画像への視差の比較によりオクルージョン領域を決定してよい。制御部20は、ブロックマッチングにより、基準画像の各画素からの参照画像の各画素への第1の視差を算出してよい。また、制御部20は、ブロックマッチングにより、参照画像の各画素からの基準画像の各画素への第2の視差を算出してよい。 The control unit 20 may determine the occlusion region by comparing the parallax from the standard image to the reference image and the parallax from the reference image to the standard image. The control unit 20 may calculate a first parallax from each pixel of the standard image to each pixel of the reference image by block matching. The control unit 20 may also calculate a second parallax from each pixel of the reference image to each pixel of the standard image by block matching.

制御部20は、第1の視差及び第2の視差の比較に基づいて、相違性を算出してよい。相違性は、第1の視差及び極性を反転させた第2の視差の合計の絶対値であってよい。オクルージョン領域においては、第1の視差は、極性を反転させた第2の視差に相違する可能性が高い。そこで、制御部20は、相違性が閾値以上である画素を、オクルージョン領域内の画素とみなしてよい。 The control unit 20 may calculate the dissimilarity based on a comparison of the first dissimilarity and the second dissimilarity. The dissimilarity may be the absolute value of the sum of the first dissimilarity and the second dissimilarity with the polarity reversed. In an occlusion region, the first dissimilarity is likely to differ from the second dissimilarity with the polarity reversed. Therefore, the control unit 20 may consider a pixel whose dissimilarity is equal to or greater than a threshold value to be a pixel in an occlusion region.

制御部20は、基準画像内で、オクルージョン領域内とみなし、且つ互いに隣接する画素により形成される輪郭を認識してよい。制御部20は、認識した輪郭に基づいて、基準画像を複数の領域に区分けしてよい。制御部20は、基準画像の各画素をいずれの領域内に含まれるかに基づいて、被写体別にグループ分けしてよい。 The control unit 20 may recognize contours formed by pixels that are considered to be within an occlusion region and are adjacent to each other in the reference image. The control unit 20 may divide the reference image into a plurality of regions based on the recognized contours. The control unit 20 may group each pixel of the reference image by subject based on which region it is included in.

制御部20は、以下に説明するように、少なくとも第1フィッティング関数を作成してよい。制御部20は、基準画像内の任意の領域を探索領域に指定する。制御部20は、例えば、任意の1画素を注目画素として、当該注目画素を含む所定の大きさの領域を探索領域に指定する。探索領域は、例えば、注目画素を中心としたm行n列(m、nは自然数)の大きさの領域であってよい。本願明細書において、注目画素に対応する基準画像内の点を基準点と呼ぶ。 The control unit 20 may create at least a first fitting function as described below. The control unit 20 designates an arbitrary region in the reference image as a search region. For example, the control unit 20 designates an arbitrary pixel as a pixel of interest and designates an area of a predetermined size including the pixel of interest as the search region. The search region may be, for example, an area of m rows and n columns (m and n are natural numbers) centered on the pixel of interest. In this specification, a point in the reference image that corresponds to the pixel of interest is called a reference point.

制御部20は、参照画像内で、探索領域の位置から基線長方向に沿って画素単位で変位させた領域を比較領域に指定する。制御部20は、基線長方向に沿った両方向に1画素ずつ変位させて複数の比較領域を指定する。 The control unit 20 designates, as a comparison region, a region in the reference image that is displaced in pixel units from the position of the search region along the baseline length direction. The control unit 20 designates multiple comparison regions by displacing one pixel at a time in both directions along the baseline length direction.

制御部20は、探索領域及び比較領域に含まれる部分画像同士の第1の相違度を算出する。制御部20は、第1の相違度の算出において、以下に説明するように、クラスタリングに基づく重付けを施す。制御部20は、探索領域内で基準点が属する被写体、言換えると、注目画素が属する被写体を判別する。制御部20は、探索領域内で、注目画素が属する被写体と同一の被写体に属する画素を判別する。制御部20は、注目画素と同一の被写体に属する画素に、当該被写体以外の被写体に属する画素と異なる重付けを施す。例えば、制御部20は、注目画素と同一の被写体に属する画素に、当該被写体以外の被写体に属する画素よりも大きな重付けを施す。より具体的に説明すると、制御部20は、注目画素と同じ被写体に属する画素の画素値と、比較領域内で当該画素と同じ位置に位置する画素の画素値との差分に、他の画素よりも大きく重付けた係数を乗じてよい。係数は、例えば、注目画素と同一の被写体に属する画素に対して2であり、注目画素の被写体とは異なる被写体に属する画素に対して1である。 The control unit 20 calculates a first dissimilarity between the partial images included in the search area and the comparison area. In calculating the first dissimilarity, the control unit 20 performs weighting based on clustering, as described below. The control unit 20 determines the subject to which the reference point belongs in the search area, in other words, the subject to which the pixel of interest belongs. The control unit 20 determines pixels in the search area that belong to the same subject as the subject to which the pixel of interest belongs. The control unit 20 performs weighting on pixels that belong to the same subject as the pixel of interest differently from pixels that belong to subjects other than the subject. For example, the control unit 20 performs weighting on pixels that belong to the same subject as the pixel of interest more heavily than pixels that belong to subjects other than the subject. More specifically, the control unit 20 may multiply the difference between the pixel value of a pixel that belongs to the same subject as the pixel of interest and the pixel value of a pixel located at the same position as the pixel of interest in the comparison area by a coefficient that is weighted more heavily than other pixels. For example, the coefficient is 2 for pixels that belong to the same subject as the pixel of interest, and 1 for pixels that belong to a different subject than the pixel of interest.

制御部20は、上述の係数を乗じた、探索領域及び比較領域内の同じ位置の画素の画素値の差分を用いて、第1の相違度を算出する。第1の相違度は、例えば、SAD(Sum of Absolute Difference)、SSD(Sum of Squared Difference)等の部分画像を構成する画素の画素値の相違に応じて変化する指数である。制御部20は、変位させた位置別の複数の第1の相違度を算出する。 The control unit 20 calculates the first dissimilarity using the difference between the pixel values of pixels at the same position in the search area and the comparison area multiplied by the above-mentioned coefficient. The first dissimilarity is an index that changes depending on the difference in pixel values of pixels that make up the partial image, such as SAD (Sum of Absolute Difference) or SSD (Sum of Squared Difference). The control unit 20 calculates multiple first dissimilarity values for each displaced position.

一般的に、相違度が極値である比較領域は、第1の相違度を算出した比較領域の中で最も探索領域に類似している。本実施形態において、第1の相違度の極値は、SAD及びSSDのように探索領域と比較領域との相違が大きくなるほど相違度が増加する構成においては、極小値である。 In general, the comparison area in which the dissimilarity is an extreme value is the most similar to the search area among the comparison areas for which the first dissimilarity is calculated. In this embodiment, the extreme value of the first dissimilarity is a minimum value in a configuration in which the dissimilarity increases as the difference between the search area and the comparison area increases, such as SAD and SSD.

制御部20は、複数の比較領域それぞれに対して算出した第1の相違度に基づいて、第1フィッティング関数を作成してよい。第1フィッティング関数は、探索領域に対して比較領域を基線長方向に移動させた移動量に対する第1の相違度の関係を示す関数である。第1フィッティング関数は、前述の移動量に対応する相違度を通るように、等角直線フィッティング又はパラボラフィッティング等を行うことにより作成されてよい。 The control unit 20 may create a first fitting function based on the first dissimilarity calculated for each of the multiple comparison regions. The first fitting function is a function that indicates the relationship of the first dissimilarity to the amount of movement of the comparison region in the baseline length direction relative to the search region. The first fitting function may be created by performing equiangular linear fitting or parabolic fitting, etc., so that the first fitting function passes through the dissimilarity corresponding to the amount of movement.

制御部20は、以下に説明するように、更に第2フィッティング関数を作成してよい。制御部20は、基準画像及び参照画像の一方を基線長方向に0.5画素変位させてよい。0.5画素変位させるとは、例えば、画像を構成する画素を変位方向に沿って互いに隣接する画素値を平均することにより画素補間を行い、0.5画素変位させた位置の画素値を算出することを意味する。基準画像及び参照画像の一方の変位は、画像全体でなく、視差を算出する探索領域及び比較領域の周辺であってもよい。変位方向は-0.5画素としたマイナス方向であってよい。 The control unit 20 may further create a second fitting function, as described below. The control unit 20 may displace one of the base image and the reference image by 0.5 pixels in the baseline length direction. Displacing by 0.5 pixels means, for example, performing pixel interpolation by averaging the pixel values of pixels that make up the image adjacent to each other along the displacement direction, and calculating the pixel value at the position displaced by 0.5 pixels. The displacement of one of the base image and the reference image may not be the entire image, but may be the periphery of the search area and comparison area where the parallax is calculated. The displacement direction may be a negative direction of -0.5 pixels.

制御部20は、基準画像及び参照画像の一方を基線長方向に0.5画素変位させた状態で、第1フィッティング関数の作成時の画像全体の中の同じ位置で同じ大きさの領域を探索領域に指定してよい。 The control unit 20 may designate as the search area an area of the same size and at the same position within the entire image when the first fitting function was created, with one of the base image and the reference image displaced by 0.5 pixels in the baseline length direction.

制御部20は、基準画像及び参照画像の一方を基線長方向に0.5画素変位させた状態で、参照画像内で、探索領域の位置から基線長方向に沿って画素単位で変位させた領域を比較領域に指定してよい。制御部20は、基線長方向に沿った両方向に1画素ずつ変位させて複数の比較領域を指定してよい。 The control unit 20 may designate, as a comparison region, a region in the reference image that has been displaced pixel by pixel from the position of the search region along the baseline length direction, with one of the base image and the reference image displaced by 0.5 pixels in the baseline length direction. The control unit 20 may designate multiple comparison regions by displacing one pixel at a time in both directions along the baseline length direction.

制御部20は、基準画像及び参照画像の一方を基線長方向に0.5画素変位させた状態で、探索領域及び比較領域に含まれる部分画像同士の第2の相違度を算出してよい。制御部20は、第2の相違度の算出において、第1の相違度の算出と類似して、クラスタリングに基づく重付けを施してよい。 The control unit 20 may calculate a second dissimilarity between the partial images included in the search area and the comparison area with one of the standard image and the reference image displaced by 0.5 pixels in the baseline length direction. In calculating the second dissimilarity, the control unit 20 may apply weighting based on clustering, similar to the calculation of the first dissimilarity.

制御部20は、基準画像を0.5画素変位させる構成において、0.5画素変位させた基準画像に対してクラスタリングを行うことにより、0.5画素変位させた基準画像の各画素を被写体別にグループ分けしてよい。または、制御部20は、第1の相違度の算出に用いた基準画像のクラスタリングを0.5画素変位させることにより、0.5画素変位させた基準画像の各画素を被写体別にグループ分けしてよい。制御部20は、参照画像を0.5画素変位させる構成においては、第1の相違度の算出に用いたクラスタリングをそのまま、第2の相違度の算出に適用してよい。 In a configuration in which the reference image is displaced by 0.5 pixels, the control unit 20 may perform clustering on the reference image displaced by 0.5 pixels, thereby grouping each pixel of the reference image displaced by 0.5 pixels by subject. Alternatively, the control unit 20 may group each pixel of the reference image displaced by 0.5 pixels by displacing the clustering of the reference image used to calculate the first dissimilarity by 0.5 pixels. In a configuration in which the reference image is displaced by 0.5 pixels, the control unit 20 may apply the clustering used to calculate the first dissimilarity directly to the calculation of the second dissimilarity.

制御部20は、第2の相違度の算出において、探索領域内で、注目画素が属する被写体と同一の被写体に属する画素を判別してよい。制御部20は、注目画素と同一の被写体に属する画素に、当該被写体以外の被写体に属する画素と異なる重付けを施してよい。例えば、制御部20は、注目画素と同一の被写体に属する画素に、当該被写体以外の被写体に属する画素よりも大きな重付けを施してよい。 In calculating the second dissimilarity, the control unit 20 may determine pixels within the search area that belong to the same subject as the subject to which the pixel of interest belongs. The control unit 20 may weight pixels that belong to the same subject as the pixel of interest differently from pixels that belong to subjects other than the pixel of interest. For example, the control unit 20 may weight pixels that belong to the same subject as the pixel of interest more heavily than pixels that belong to subjects other than the pixel of interest.

制御部20は、第1の相違度の算出と類似して、重付けに応じた係数を乗じた探索領域及び比較領域内の同じ位置の画素の画素値の差分を用いて、第2の相違度を算出してよい。第2の相違度は、SAD(Sum of Absolute Difference)、SSD(Sum of Squared Difference)等の部分画像を構成する画素の画素値の相違に応じて変化する指数として、第1の相違度の算出に用いられた算出式とを同じ算出式が適用された指数である。制御部20は、変位させた位置別の複数の第2の相違度を算出してよい。 The control unit 20 may calculate the second dissimilarity using the difference between the pixel values of pixels at the same positions in the search area and the comparison area multiplied by a coefficient according to the weighting, similar to the calculation of the first dissimilarity. The second dissimilarity is an index that changes according to the difference in pixel values of pixels constituting a partial image, such as SAD (Sum of Absolute Difference) or SSD (Sum of Squared Difference), and is calculated using the same calculation formula as that used to calculate the first dissimilarity. The control unit 20 may calculate multiple second dissimilarity values for different displaced positions.

制御部20は、基準画像及び参照画像の一方を基線長方向に0.5画素変位させた状態で、複数の比較領域それぞれに対して算出した第2の相違度に基づいて、第2フィッティング関数を作成してよい。第2フィッティング関数は、探索領域に対して比較領域を基線長方向に移動させた移動量に対する相違度の関係を示す関数であってよい。制御部20は、等角直線フィッティング又はパラボラフィッティング等の方法の中で第1フィッティング関数の算出に採用した方法と同じ方法で、第2フィッティング関数を作成してよい。 The control unit 20 may create a second fitting function based on the second dissimilarity calculated for each of the multiple comparison regions while one of the standard image and the reference image is displaced by 0.5 pixels in the baseline length direction. The second fitting function may be a function that indicates the relationship of the dissimilarity to the amount of movement of the comparison region in the baseline length direction relative to the search region. The control unit 20 may create the second fitting function using the same method as that used to calculate the first fitting function, such as equiangular linear fitting or parabolic fitting.

制御部20は、第1の相違度に基づいて、探索領域内の被写体像の視差を算出する。より具体的には、制御部20は、第1の相違度により作成される第1フィッティング関数に基づいて、視差を算出する。制御部20は、第1フッティング関数の第1の相違度が最小となる移動量を、視差として算出してよい。 The control unit 20 calculates the disparity of the subject image in the search area based on the first disparity. More specifically, the control unit 20 calculates the disparity based on a first fitting function created from the first disparity. The control unit 20 may calculate, as the disparity, the amount of movement that minimizes the first disparity of the first fitting function.

制御部20は、第2フィッティング関数を更に作成した構成においては、第2の相違度にも基づいて視差を算出してよい。より具体的には、制御部20は、第2の相違度により作成される第2フィッティング関数に基づいて、視差を算出してよい。より詳細には、制御部20は、第1フィッティング関数及び第2フィッティング関数の、同じ移動量における第1の相違度及び第2の相違度を合計又は平均化したフィッティング関数において第1の相違度及び第2の相違度の合計値又は平均値が最小となる移動量を、視差として算出してよい。 In a configuration in which a second fitting function is further created, the control unit 20 may calculate the disparity based on the second disparity as well. More specifically, the control unit 20 may calculate the disparity based on the second fitting function created from the second disparity. More specifically, the control unit 20 may calculate, as the disparity, the movement amount at which the sum or average value of the first disparity and the second disparity is minimum in a fitting function obtained by summing or averaging the first disparity and the second disparity at the same movement amount of the first fitting function and the second fitting function.

制御部20は、算出した視差、外部標定要素、及び内部標定要素に基づいて、探索領域内の被写体像に対応する被写体のワールド座標系における位置を算出してよい。制御部20は、算出した被写体のワールド座標系の位置を外部装置14に出力するように、出力部18を制御してよい。制御部20は、基準画像の一部または基準画像のすべてを順次比較領域に指定して、画素毎に被写体の位置を算出してよい。 The control unit 20 may calculate the position in the world coordinate system of the subject corresponding to the subject image in the search area based on the calculated parallax, exterior orientation parameters, and interior orientation parameters. The control unit 20 may control the output unit 18 to output the calculated position in the world coordinate system of the subject to the external device 14. The control unit 20 may sequentially designate a part of the reference image or the entire reference image as a comparison area and calculate the position of the subject for each pixel.

次に、本実施形態において制御部20が実行する、第1の位置算出処理について、図4のフローチャートを用いて説明する。第1の位置算出処理では、第2の相違度の算出のために、基準画像を0.5画素変位させ、変位させた基準画像に対してクラスタリングが行われる。第1の位置算出処理は、ステレオカメラ12から1フレームの基準画像及び参照画像を取得するたびに開始する。 Next, the first position calculation process executed by the control unit 20 in this embodiment will be described with reference to the flowchart in FIG. 4. In the first position calculation process, the reference image is displaced by 0.5 pixels to calculate the second dissimilarity, and clustering is performed on the displaced reference image. The first position calculation process starts every time one frame of the reference image and the reference image is acquired from the stereo camera 12.

ステップS100において、制御部20は、基準画像を0.5画素の移動量で変位させる。変位後、プロセスはステップS101に進む。 In step S100, the control unit 20 displaces the reference image by a movement amount of 0.5 pixels. After the displacement, the process proceeds to step S101.

ステップS101では、制御部20は、基準画像及びステップS100において0.5画素変位させた基準画像に、クラスタリングを行う。オプティカルフローに基づくクラスタリングを行う構成においては、直前のフレームの基準画像を、第1の位置算出処理の開始時に取得したフレームの基準画像とともに用いてオプティカルフローを算出する。オクルージョン領域に基づくクラスタリングを行う構成においては、第1の位置算出処理の開始時に取得したフレームの基準画像を用いてオクルージョン領域を算出してよい。クラスタリング後、プロセスはステップS102に進む。 In step S101, the control unit 20 performs clustering on the reference image and the reference image displaced by 0.5 pixels in step S100. In a configuration in which clustering based on optical flow is performed, the reference image of the immediately preceding frame is used together with the reference image of the frame acquired at the start of the first position calculation process to calculate the optical flow. In a configuration in which clustering based on occlusion regions is performed, the occlusion regions may be calculated using the reference image of the frame acquired at the start of the first position calculation process. After clustering, the process proceeds to step S102.

ステップS102では、制御部20は、基準画像及びステップS100において0.5画素変位させた基準画像に対して指定すべき領域の中で、未指定である領域の中から探索領域を指定する。指定後、プロセスはステップS103に進む。 In step S102, the control unit 20 designates a search area from among undesignated areas among the areas to be designated for the reference image and the reference image displaced by 0.5 pixels in step S100. After designation, the process proceeds to step S103.

ステップS103では、制御部20は、探索領域における注目画素が、ステップS101においてクラスタリングしたいずれの被写体に属するかを判別する。さらに、制御部20は、探索領域の各画素が注目画素と同じ被写体に属するか否かに基づいて、各画素の重付けを決定する。決定後、プロセスはステップS104に進む。 In step S103, the control unit 20 determines to which of the objects clustered in step S101 the pixel of interest in the search area belongs. Furthermore, the control unit 20 determines the weighting of each pixel in the search area based on whether or not the pixel belongs to the same object as the pixel of interest. After the determination, the process proceeds to step S104.

ステップS104では、制御部20は、ステップS102において指定した探索領域に対して、複数の比較領域を指定する。さらに、制御部20は、ステップS102において指定した探索領域、複数の比較領域、及びステップS103において決定した重付けに基づいて、第1の相違度及び第2の相違度を算出する。算出後、プロセスはステップS105に進む。 In step S104, the control unit 20 specifies multiple comparison areas for the search area specified in step S102. Furthermore, the control unit 20 calculates a first dissimilarity and a second dissimilarity based on the search area specified in step S102, the multiple comparison areas, and the weighting determined in step S103. After the calculation, the process proceeds to step S105.

ステップS105では、制御部20は、ステップS104において算出した第1の相違度に基づいて、第1フィッティング関数を作成する。さらに、制御部20は、ステップS104において算出した第2の相違度に基づいて、第2フィッティング関数を作成する。作成後、プロセスはステップS106に進む。 In step S105, the control unit 20 creates a first fitting function based on the first dissimilarity calculated in step S104. Furthermore, the control unit 20 creates a second fitting function based on the second dissimilarity calculated in step S104. After the second fitting function is created, the process proceeds to step S106.

ステップS106では、制御部20は、ステップS105において作成した第1フィッティング関数及び第2フィッティング関数に基づいて、視差を算出する。視差の算出後、プロセスはステップS107に進む。 In step S106, the control unit 20 calculates the disparity based on the first fitting function and the second fitting function created in step S105. After calculating the disparity, the process proceeds to step S107.

ステップS107では、制御部20は、ステップS106において算出した視差、外部標定要素、及び内部標定要素に基づいて、ステップS102において指定した探索領域に含まれる被写体像に対応する被写体の位置を算出する。算出後、プロセスはステップS108に進む。 In step S107, the control unit 20 calculates the position of the subject corresponding to the subject image included in the search area specified in step S102 based on the parallax, exterior orientation parameters, and interior orientation parameters calculated in step S106. After the calculation, the process proceeds to step S108.

ステップS108では、制御部20は、ステップS107において算出した位置を外部装置14に出力するように出力部18を制御する。出力後、プロセスはステップS109に進む。 In step S108, the control unit 20 controls the output unit 18 to output the position calculated in step S107 to the external device 14. After the output, the process proceeds to step S109.

ステップS109では、制御部20は、基準画像及びステップS100において0.5画素変位させた基準画像に対して指定すべき領域のすべてが探索領域として指定されたか否かを判別する。一部が指定されていない場合、プロセスはステップS102に戻る。すべての指定すべき領域が指定済みである場合、第1の位置算出処理は終了する。 In step S109, the control unit 20 determines whether all of the areas to be specified in the reference image and the reference image displaced by 0.5 pixels in step S100 have been specified as search areas. If some areas have not been specified, the process returns to step S102. If all of the areas to be specified have been specified, the first position calculation process ends.

次に、本実施形態において制御部20が実行する、第2の位置算出処理について、図5のフローチャートを用いて説明する。第2の位置算出処理では、第2の相違度の算出のために、基準画像を0.5画素変位させ、元の基準画像に対して行ったクラスタリングによる各画素の被写体別のグループ分けを0.5画素の移動量で基準画素と同じ方向に変位させることにより、0.5画素変位させた基準画像に対するクラスタリングの結果が得られる。第1の位置算出処理は、ステレオカメラ12から1フレームの基準画像及び参照画像を取得するたびに開始する。 Next, the second position calculation process executed by the control unit 20 in this embodiment will be described with reference to the flowchart in FIG. 5. In the second position calculation process, in order to calculate the second dissimilarity, the reference image is displaced by 0.5 pixels, and the grouping of each pixel by subject performed by clustering on the original reference image is displaced by 0.5 pixels in the same direction as the reference pixel, thereby obtaining the clustering result for the reference image displaced by 0.5 pixels. The first position calculation process is started each time one frame of the reference image and the reference image are acquired from the stereo camera 12.

ステップS200において、制御部20は、基準画像を0.5画素の移動量で変位させる。変位後、プロセスはステップS201に進む。 In step S200, the control unit 20 displaces the reference image by a movement amount of 0.5 pixels. After the displacement, the process proceeds to step S201.

ステップS201では、制御部20は、基準画像に、クラスタリングを行う。オプティカルフローに基づくクラスタリングを行う構成においては、直前のフレームの基準画像を、第1の位置算出処理の開始時に取得したフレームの基準画像とともに用いてオプティカルフローを算出する。オクルージョン領域に基づくクラスタリングを行う構成においては、第1の位置算出処理の開始時に取得したフレームの基準画像を用いてオクルージョン領域を算出してよい。クラスタリング後、プロセスはステップS202に進む。 In step S201, the control unit 20 performs clustering on the reference image. In a configuration in which clustering based on optical flow is performed, the reference image of the immediately preceding frame is used together with the reference image of the frame acquired at the start of the first position calculation process to calculate the optical flow. In a configuration in which clustering based on occlusion regions is performed, the occlusion regions may be calculated using the reference image of the frame acquired at the start of the first position calculation process. After clustering, the process proceeds to step S202.

ステップS202では、制御部20は、ステップS201で行ったクラスタリングによる各画素の被写体別のグループ分けを0.5画素の移動量で基準画素と同じ方向に変位させる。変位後、プロセスはステップS203に進む。 In step S202, the control unit 20 displaces the grouping of each pixel by subject, which was performed by the clustering in step S201, in the same direction as the reference pixel by a movement amount of 0.5 pixels. After the displacement, the process proceeds to step S203.

ステップS203では、制御部20は、基準画像及びステップS100において0.5画素変位させた基準画像に対して指定すべき領域の中で、未指定である領域の中から探索領域を指定する。指定後、プロセスはステップS204に進む。 In step S203, the control unit 20 specifies a search area from among unspecified areas among the areas to be specified for the reference image and the reference image displaced by 0.5 pixels in step S100. After the search area is specified, the process proceeds to step S204.

ステップS204では、制御部20は、基準画像の探索領域における注目画素が、ステップS201においてクラスタリングしたいずれの被写体に属するかを判別する。また、制御部20は、0.5画素変位させた基準画像の探索領域における注目画素が、ステップS202において0.5画素変位させたいずれの被写体別に属するかを判別する。さらに、制御部20は、探索領域の各画素が注目画素と同じ被写体に属するか否かに基づいて、各画素の重付けを決定する。決定後、プロセスはステップS205に進む。 In step S204, the control unit 20 determines to which of the objects clustered in step S201 the pixel of interest in the search area of the reference image belongs. The control unit 20 also determines to which of the objects clustered in step S202 the pixel of interest in the search area of the reference image displaced by 0.5 pixels belongs. Furthermore, the control unit 20 determines the weighting of each pixel in the search area based on whether or not the pixel of interest belongs to the same object as the pixel of interest. After the determination, the process proceeds to step S205.

ステップS205からS210では、制御部20は、第1の位置算出処理におけるステップS104からS109に類似した処理を行う。ステップS210において、すべての指定すべき領域が指定済みである場合、第2の位置算出処理は終了する。 In steps S205 to S210, the control unit 20 performs processing similar to steps S104 to S109 in the first position calculation process. In step S210, if all areas to be specified have been specified, the second position calculation process ends.

次に、本実施形態において制御部20が実行する、第3の位置算出処理について、図6のフローチャートを用いて説明する。第3の位置算出処理では、第2の相違度の算出のために、参照画像を0.5画素変位させる。第3の位置算出処理は、ステレオカメラ12から1フレームの基準画像及び参照画像を取得するたびに開始する。 Next, the third position calculation process executed by the control unit 20 in this embodiment will be described with reference to the flowchart in FIG. 6. In the third position calculation process, the reference image is displaced by 0.5 pixels to calculate the second dissimilarity. The third position calculation process starts every time one frame of the base image and the reference image is acquired from the stereo camera 12.

ステップS300において、制御部20は、参照画像を0.5画素の移動量で変位させる。変位後、プロセスはステップS302に進む。 In step S300, the control unit 20 displaces the reference image by a movement amount of 0.5 pixels. After the displacement, the process proceeds to step S302.

ステップS301では、制御部20は、基準画像に、クラスタリングを行う。オプティカルフローに基づくクラスタリングを行う構成においては、直前のフレームの基準画像を、第1の位置算出処理の開始時に取得したフレームの基準画像とともに用いてオプティカルフローを算出する。オクルージョン領域に基づくクラスタリングを行う構成においては、第1の位置算出処理の開始時に取得したフレームの基準画像を用いてオクルージョン領域を算出してよい。クラスタリング後、プロセスはステップS302に進む。 In step S301, the control unit 20 performs clustering on the reference image. In a configuration in which clustering based on optical flow is performed, the reference image of the immediately preceding frame is used together with the reference image of the frame acquired at the start of the first position calculation process to calculate the optical flow. In a configuration in which clustering based on occlusion regions is performed, the occlusion regions may be calculated using the reference image of the frame acquired at the start of the first position calculation process. After clustering, the process proceeds to step S302.

ステップS302では、制御部20は、基準画像に対して指定すべき領域の中で、未指定である領域の中から探索領域を指定する。指定後、プロセスはステップS303に進む。 In step S302, the control unit 20 specifies a search area from among the areas to be specified for the reference image that are not specified. After specification, the process proceeds to step S303.

ステップS303では、制御部20は、探索領域における注目画素が、ステップS301においてクラスタリングしたいずれの被写体に属するかを判別する。さらに、制御部20は、探索領域の各画素が注目画素と同じ被写体に属するか否かに基づいて、各画素の重付けを決定する。決定後、プロセスはステップS304に進む。 In step S303, the control unit 20 determines to which of the objects clustered in step S301 the pixel of interest in the search area belongs. Furthermore, the control unit 20 determines the weighting of each pixel in the search area based on whether or not the pixel belongs to the same object as the pixel of interest. After the determination, the process proceeds to step S304.

ステップS304では、制御部20は、ステップS302において指定した探索領域に対して、参照画像中で、複数の比較領域を指定する。また、制御部20は、当該探索領域に対して、ステップS300において0.5画素変位させた参照画像中で、複数の比較領域を指定する。さらに、制御部20は、ステップS302において指定した探索領域、複数の比較領域、及びステップS303において決定した重付けに基づいて、第1の相違度及び第2の相違度を算出する。算出後、プロセスはステップS305に進む。 In step S304, the control unit 20 specifies multiple comparison regions in the reference image for the search region specified in step S302. The control unit 20 also specifies multiple comparison regions in the reference image displaced by 0.5 pixels in step S300 for the search region. Furthermore, the control unit 20 calculates a first dissimilarity and a second dissimilarity based on the search region specified in step S302, the multiple comparison regions, and the weighting determined in step S303. After the calculation, the process proceeds to step S305.

ステップS305からS309では、制御部20は、第1の位置算出処理におけるステップS105からS109に類似した処理を行う。ステップS309において、すべての指定すべき領域が指定済みである場合、第3の位置算出処理は終了する。 In steps S305 to S309, the control unit 20 performs processing similar to steps S105 to S109 in the first position calculation process. If, in step S309, all areas to be specified have been specified, the third position calculation process ends.

以上のような構成の本実施形態の画像処理装置10は、基準画像内の基準点を含む探索領域と参照画像内で基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて探索領域内の被写体像の視差を算出する制御部20を有し、制御部20は、基準画像内の各画素が被写体別にグループ分けされるようにクラスタリングを行い、探索領域において基準点が属する被写体と同一の被写体に属する画素に対して、当該被写体以外の被写体に属する画素よりも大きな重付けを施して、第1の相違度を算出する。撮像した画像中には、観測対象の種類の被写体とともに、当該被写体の背景となる被写体の像が含まれることが一般的である。背景には距離の異なる複数の被写体が含まれることがあるため、ブロックマッチングによる視差の算出精度が低下する。特に、屋外の自然環境においてはビル等の鉛直方向及び水平方向のエッジ情報が画像に多く含まれるので、ブロックマッチングを用いた視差算出において、エッジ情報の強い影響により視差の算出精度がさらに低下する。このような事象に対して、上述の構成の画像処理装置10は、以下に具体例を用いて説明するように、注目画素と同じ被写体に属する画素に大きな重付けが施されるので、正確な視差以外の視差におけるフィッティング関数を大きく増大させる。したがって、画像処理装置10は、正確な視差に対するフィッティング関数の値が、正確でない視差に対するフィッティング関数の値よりも小さくなる可能性を高める。それゆえ、画像処理装置10は、視差の算出精度を向上させる。 The image processing device 10 of the present embodiment configured as described above has a control unit 20 that calculates the parallax of the subject image in the search area based on the first dissimilarity between the search area including the reference point in the reference image and the comparison area displaced in pixel units along the baseline length direction in the reference image. The control unit 20 performs clustering so that each pixel in the reference image is grouped by subject, and calculates the first dissimilarity by weighting pixels belonging to the same subject as the subject to which the reference point belongs in the search area more heavily than pixels belonging to subjects other than the subject. In general, the captured image contains an image of a subject that is the background of the subject, along with the type of subject to be observed. Since the background may contain multiple subjects at different distances, the accuracy of the calculation of the parallax by block matching decreases. In particular, in outdoor natural environments, the image contains a lot of vertical and horizontal edge information of buildings, etc., so the accuracy of the calculation of the parallax using block matching further decreases due to the strong influence of the edge information. In response to such an event, the image processing device 10 configured as described above heavily weights pixels belonging to the same subject as the pixel of interest, as will be described below using a specific example, and therefore greatly increases the fitting function for parallax other than the accurate parallax. Therefore, the image processing device 10 increases the likelihood that the value of the fitting function for the accurate parallax will be smaller than the value of the fitting function for the inaccurate parallax. Therefore, the image processing device 10 improves the accuracy of calculating the parallax.

視差の算出精度の説明のために、図7に示すように、5行5列の探索領域SRが例示される。図示の探索領域SRでは、中央の注目画素FPがステレオカメラ12から近距離に位置する被写体Aに属する。また、探索領域SRでは、注目画素FPから右側1列且つ下側2列の、注目画素FPを含めた6個の画素が、当該被写体Aに属する。当該被写体Aに属する画素の輝度は、50である。探索領域SRにおける左端の1列に並ぶ5画素は中距離の被写体Bに属する。当該被写体Bに属する画素の輝度は、100である。探索領域SRにおいて、被写体A及び被写体Bに属する画素以外の全画素は、遠距離の被写体Cに属する。当該被写体Cに属する画素の輝度は、200である。 To explain the accuracy of calculating the parallax, a search area SR with 5 rows and 5 columns is illustrated as shown in FIG. 7. In the illustrated search area SR, the pixel of interest FP in the center belongs to subject A located at a short distance from the stereo camera 12. In addition, in the search area SR, six pixels including the pixel of interest FP, which are one column to the right and two columns below the pixel of interest FP, belong to the subject A. The luminance of the pixels belonging to the subject A is 50. The five pixels lined up in the leftmost column in the search area SR belong to subject B at a medium distance. The luminance of the pixels belonging to the subject B is 100. In the search area SR, all pixels other than those belonging to subjects A and B belong to subject C at a long distance. The luminance of the pixels belonging to the subject C is 200.

また、図8に示すように、図7の探索領域SRに対応する、5行7列に切出した参照画像RIが例示される。図示の参照画像RIには、左端2列及び右端1列に並ぶ合計15画素は中距離の被写体Bに属する。また、参照画像RIには、右端から2、3列目の下端から1から3行目に並ぶ合計6画素は近距離の被写体Aに属する。参照画像RIにおいて、被写体A及び被写体Bに属する画素以外の全画素は、遠距離の被写体Cに属する。 As shown in FIG. 8, a reference image RI cut out into 5 rows and 7 columns corresponding to the search region SR in FIG. 7 is exemplified. In the illustrated reference image RI, a total of 15 pixels arranged in the two leftmost columns and the one rightmost column belong to subject B at a medium distance. In addition, in the reference image RI, a total of 6 pixels arranged in the first to third rows from the bottom of the second and third columns from the right end belong to subject A at a close distance. In the reference image RI, all pixels other than those belonging to subjects A and B belong to subject C at a long distance.

図9に示すように、参照画像RIにおいて、左端の1列目を含む5行5列の画素の領域が、第1の比較領域CR1に定められる。参照画像RIにおいて、左端の2列目を含む5行5列の画素の領域が、第2の比較領域CR2に定められる。参照画像RIにおいて、左端の3列目を含む5行5列の画素の領域が、第3の比較領域CR3に定められる。図示の参照画像RIに対しては、第3の比較領域CR3が正確な視差に相当する領域である。 As shown in FIG. 9, in the reference image RI, a region of 5 rows and 5 columns of pixels including the first column from the left end is defined as a first comparison region CR1. In the reference image RI, a region of 5 rows and 5 columns of pixels including the second column from the left end is defined as a second comparison region CR2. In the reference image RI, a region of 5 rows and 5 columns of pixels including the third column from the left end is defined as a third comparison region CR3. For the reference image RI shown in the figure, the third comparison region CR3 is the region that corresponds to the accurate parallax.

図7に例示した探索領域SR、並びに図9に例示した第1の比較領域CR1、第2の比較領域CR2、及びに第3の比較領域CR3対して、以下のように第1の相違度が算出される。第1の相違度は、重付けを施さない構成及び本実施形態のように重付けを施す構成で別々に算出される。本例示において、第1の相違度は、SADにより算出される。重付け係数は、注目画素FPと同じ被写体に属する画素に対して2、当該被写体と異なる被写体に属する画素に対して1とする。 For the search area SR illustrated in FIG. 7, and the first comparison area CR1, second comparison area CR2, and third comparison area CR3 illustrated in FIG. 9, the first dissimilarity is calculated as follows. The first dissimilarity is calculated separately for a configuration in which no weighting is applied and a configuration in which weighting is applied as in this embodiment. In this example, the first dissimilarity is calculated by SAD. The weighting coefficient is 2 for pixels that belong to the same subject as the pixel of interest FP, and 1 for pixels that belong to a different subject from the subject.

重付けを施さない構成で、第1の相違度は、第1の比較領域CR1に対して、1850である。重付けを施さない構成で、第1の相違度は、第2の比較領域CR2に対して、900である。重付けを施さない構成で、第1の相違度は、第3の比較領域CR3に対して、1000である。したがって、重付けを施さない構成では、第1の相違度は、第2の比較領域CR2において極小となる。 In a configuration without weighting, the first dissimilarity is 1850 for the first comparison region CR1. In a configuration without weighting, the first dissimilarity is 900 for the second comparison region CR2. In a configuration without weighting, the first dissimilarity is 1000 for the third comparison region CR3. Thus, in a configuration without weighting, the first dissimilarity is minimal in the second comparison region CR2.

重付けを施す構成で、第1の相違度は、第1の比較領域CR1に対して、2750である。重付けを施す構成で、第1の相違度は、第2の比較領域CR2に対して、1350である。重付けを施す構成で、第1の相違度は、第3の比較領域CR3に対して、1000である。したがって、重付けを施す構成では、第1の相違度は、第3の比較領域CR3において極小となる。 In the weighted configuration, the first dissimilarity is 2750 for the first comparison region CR1. In the weighted configuration, the first dissimilarity is 1350 for the second comparison region CR2. In the weighted configuration, the first dissimilarity is 1000 for the third comparison region CR3. Thus, in the weighted configuration, the first dissimilarity is minimal in the third comparison region CR3.

また、本実施形態の画像処理装置10は、オプティカルフローに基づいてクラスタリングを行う。オプティカルフローが同じである画素は、同じ被写体像を表示している可能性が高い。それゆえ、上述の構成を有する画像処理装置10は、被写体に対応する被写体像のクラスタリングの正確性を向上させる。 In addition, the image processing device 10 of this embodiment performs clustering based on optical flow. Pixels with the same optical flow are likely to display the same subject image. Therefore, the image processing device 10 having the above-mentioned configuration improves the accuracy of clustering subject images corresponding to subjects.

また、本実施形態の画像処理装置10は、基準画像の各画素からの参照画像の各画素への視差と、当該参照画像の各画素からの基準画像の各画素への視差との比較による相違性を算出し、当該相違性が閾値以上である画素が構成する輪郭で区分けすることによりクラスタリングを行う。このような構成により、画像処理装置10は、静止している被写体であっても、当該被写体に対応する被写体像のクラスタリングの正確性を向上させる。 The image processing device 10 of this embodiment also calculates disparity by comparing the parallax from each pixel of the base image to each pixel of the reference image with the parallax from each pixel of the reference image to each pixel of the base image, and performs clustering by dividing the pixels whose disparity is equal to or greater than a threshold into contours. With this configuration, the image processing device 10 improves the accuracy of clustering of subject images corresponding to the subject, even if the subject is stationary.

また、本実施形態の画像処理装置10は、複数の方法を組合わせてクラスタリングを行う。このような構成により、画像処理装置10は、実際には異なる被写体を、画像において、より正確にグループ分けし得る。例えば、オプティカルフローに基づくクラスタリングでは、動きの少ない被写体に対しては画像によるグループ分けは困難である。一方、オクルージョン領域に基づくクラスタリングは、動きの少ない被写体に対しても画像によるグループ分けを行い得る。したがって、これらを組合わせることにより、上述のように、実際には異なる被写体が、より正確にグループ分けされ得る。 In addition, the image processing device 10 of this embodiment performs clustering by combining multiple methods. With this configuration, the image processing device 10 can more accurately group actually different subjects in images. For example, with clustering based on optical flow, it is difficult to group subjects with little movement by image. On the other hand, with clustering based on occlusion regions, it is possible to group subjects with little movement by image. Therefore, by combining these methods, as described above, actually different subjects can be more accurately grouped.

また、画像処理装置10は、基準画像内の基準点を含む探索領域と参照画像内で基線長方向に沿って画素単位で変位させる比較領域との第1の相違度と、基準画像及び参照画像の一方を基線長方向に0.5画素変位させた状態で基準画像の探索領域と参照画像内で基線長方向に沿って画素単位で変位させる比較領域との第2の相違度とに基づいて、言換えると、第1フィッティング関数及び第2フィッティング関数に基づいて、探索領域内の被写体像の視差を算出する。このような構成、言換えるとEEC方式により、画像処理装置10は、サブピクセル推定における系統誤差を低減し得る。 The image processing device 10 also calculates the parallax of the subject image within the search area based on a first degree of difference between a search area including a reference point in the reference image and a comparison area displaced in pixel units along the baseline length direction in the reference image, and a second degree of difference between the search area of the reference image and a comparison area displaced in pixel units along the baseline length direction in the reference image with one of the reference image and the reference image displaced by 0.5 pixels in the baseline length direction, in other words, based on a first fitting function and a second fitting function. With this configuration, in other words, the EEC method, the image processing device 10 can reduce systematic errors in sub-pixel estimation.

本開示に係る実施形態について、諸図面及び実施例に基づき説明してきたが、当業者であれば本開示に基づき種々の変形又は修正を行うことが容易であることに注意されたい。従って、これらの変形又は修正は本開示の範囲に含まれることに留意されたい。例えば、各構成部又は各ステップなどに含まれる機能などは論理的に矛盾しないように再配置可能であり、複数の構成部又はステップなどを1つに組み合わせたり、或いは分割したりすることが可能である。本開示に係る実施形態について装置を中心に説明してきたが、本開示に係る実施形態は装置の各構成部が実行するステップを含む方法としても実現し得るものである。本開示に係る実施形態は装置が備えるプロセッサにより実行される方法、プログラム、又はプログラムを記録した記憶媒体としても実現し得るものである。本開示の範囲にはこれらも包含されるものと理解されたい。 Although the embodiments of the present disclosure have been described based on the drawings and examples, it should be noted that those skilled in the art can easily make various modifications or corrections based on the present disclosure. Therefore, it should be noted that these modifications or corrections are included in the scope of the present disclosure. For example, the functions included in each component or step can be rearranged so as not to cause logical inconsistencies, and multiple components or steps can be combined into one or divided. Although the embodiments of the present disclosure have been described mainly with respect to the device, the embodiments of the present disclosure can also be realized as a method including steps executed by each component of the device. The embodiments of the present disclosure can also be realized as a method, a program, or a storage medium on which a program is recorded, executed by a processor provided in the device. It should be understood that these are also included in the scope of the present disclosure.

本開示において「第1」、「第2」などの記載は、当該構成を区別するための識別子である。本開示における「第1」、「第2」などの記載で区別された構成は、当該構成における番号を交換することができる。例えば、第1のカメラは、第2のカメラと識別子である「第1」と「第2」とを交換することができる。識別子の交換は同時に行われる。識別子の交換後も当該構成は区別される。識別子は削除してよい。識別子を削除した構成は、符号で区別される。本開示における「第1」、「第2」などの識別子の記載のみに基づいて、当該構成の順序の解釈、小さい番号の識別子が存在することの根拠に利用してはならない。 In this disclosure, descriptions such as "first" and "second" are identifiers for distinguishing the configuration. Configurations distinguished by descriptions such as "first" and "second" in this disclosure may have their numbers exchanged. For example, a first camera may exchange identifiers "first" and "second" with a second camera. The exchange of identifiers is performed simultaneously. The configurations remain distinguished even after the identifier exchange. Identifiers may be deleted. A configuration from which an identifier has been deleted is distinguished by a code. Descriptions of identifiers such as "first" and "second" in this disclosure alone should not be used to interpret the order of the configurations or to justify the existence of an identifier with a smaller number.

10 画像処理装置
11 ステレオカメラ装置
12 ステレオカメラ
13 移動体
14 外部装置
15 第1のカメラ
16 第2のカメラ
17 取得部
18 出力部
19 メモリ
20 制御部
CR1 第1の比較領域
CR2 第2の比較領域
CR3 第3の比較領域
FP 注目画素
RI 参照画像
SR 探索領域
REFERENCE SIGNS LIST 10 Image processing device 11 Stereo camera device 12 Stereo camera 13 Moving object 14 External device 15 First camera 16 Second camera 17 Acquisition unit 18 Output unit 19 Memory 20 Control unit CR1 First comparison area CR2 Second comparison area CR3 Third comparison area FP Target pixel RI Reference image SR Search area

Claims (7)

ステレオカメラが撮像した基準画像及び参照画像を取得する取得部と、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する制御部と、を備え、
前記制御部は、
前記基準画像内の各画素が被写体別にグループ分けされるように、クラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出し、
前記基準画像及び前記参照画像の一方を前記基線長方向に0.5画素変位させた状態で前記基準画像の探索領域と前記参照画像内で前記基線長方向に沿って画素単位で変位させる比較領域との第2の相違度を算出し、前記第1の相違度及び前記第2の相違度の合計値又は平均値に基づいて、前記視差を算出し、
前記第2の相違度の算出に用いる探索領域において、該探索領域の基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施す
画像処理装置。
An acquisition unit that acquires a standard image and a reference image captured by a stereo camera;
a control unit that calculates a disparity of a subject image within the search area based on a first degree of difference between a search area including a reference point in the base image and a comparison area that is displaced in pixel units along a baseline length direction of the stereo camera in the reference image,
The control unit is
clustering the pixels in the reference image so that the pixels are grouped by object;
calculating the first dissimilarity degree by weighting pixels in the search area that belong to the same object as the object to which the reference point belongs differently from pixels that belong to objects other than the same object ;
calculating a second dissimilarity between a search area of the standard image and a comparison area in the reference image that is displaced by a pixel unit along the base line direction in a state in which one of the standard image and the reference image is displaced by 0.5 pixels in the base line length direction, and calculating the dissimilarity based on a sum or an average value of the first dissimilarity and the second dissimilarity;
In the search area used for calculating the second dissimilarity, a weighting different from that of pixels belonging to an object other than the object to which the reference point of the search area belongs is applied to pixels belonging to the same object.
Image processing device.
請求項1に記載の画像処理装置において、
前記制御部は、少なくとも1つの方法により、前記クラスタリングを行う
画像処理装置。
2. The image processing device according to claim 1,
The control unit performs the clustering by at least one method.
請求項1又は2に記載の画像処理装置において、
前記取得部は、前記基準画像を連続して取得し、
前記制御部は、撮像時点の異なる基準画像間のオプティカルフローに基づいて、前記クラスタリングを行う
画像処理装置。
3. The image processing device according to claim 1,
The acquisition unit continuously acquires the reference images,
The control unit performs the clustering based on an optical flow between reference images captured at different times.
請求項1から3のいずれか1項に記載の画像処理装置において、
前記制御部は、前記基準画像の各画素からの前記参照画像の各画素への視差と、該参照画像の各画素からの前記基準画像の各画素への視差との比較による相違性を算出し、該相違性が閾値以上である画素が構成する輪郭で区分けすることにより、前記クラスタリングを行う
画像処理装置。
4. The image processing device according to claim 1,
The control unit calculates disparity by comparing the disparity from each pixel of the base image to each pixel of the reference image with the disparity from each pixel of the reference image to each pixel of the base image, and performs the clustering by dividing the image into contours made up of pixels whose disparity is equal to or greater than a threshold.
基準画像及び参照画像を撮像するステレオカメラと、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する画像処理装置とを備え、
前記画像処理装置は、
前記基準画像内で、各画素を被写体別にクラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出し、
前記基準画像及び前記参照画像の一方を前記基線長方向に0.5画素変位させた状態で前記基準画像の探索領域と前記参照画像内で前記基線長方向に沿って画素単位で変位させる比較領域との第2の相違度を算出し、前記第1の相違度及び前記第2の相違度の合計値又は平均値に基づいて、前記視差を算出し、
前記第2の相違度の算出に用いる探索領域において、該探索領域の基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施す
ステレオカメラ装置。
A stereo camera that captures a standard image and a reference image;
an image processing device that calculates a disparity of a subject image within the search area based on a first degree of difference between a search area including a reference point in the standard image and a comparison area that is displaced in pixel units along a baseline length direction of the stereo camera in the reference image;
The image processing device includes:
In the reference image, pixels are clustered by subject;
calculating the first dissimilarity degree by weighting pixels in the search area that belong to the same object as the object to which the reference point belongs differently from pixels that belong to objects other than the same object ;
calculating a second dissimilarity between a search area of the standard image and a comparison area in the reference image that is displaced by a pixel unit along the base line direction in a state in which one of the standard image and the reference image is displaced by 0.5 pixels in the base line length direction, and calculating the dissimilarity based on a sum or an average value of the first dissimilarity and the second dissimilarity;
In the search area used for calculating the second dissimilarity, a weighting different from that of pixels belonging to an object other than the object to which the reference point of the search area belongs is applied to pixels belonging to the same object.
Stereo camera device.
基準画像及び参照画像を撮像するステレオカメラと、前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との第1の相違度に基づいて前記探索領域内の被写体像の視差を算出する画像処理装置とを有する、ステレオカメラ装置を備え、
前記ステレオカメラ装置は、
前記基準画像内で、各画素を被写体別にクラスタリングを行い、
前記探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施して、前記第1の相違度を算出し、
前記基準画像及び前記参照画像の一方を前記基線長方向に0.5画素変位させた状態で前記基準画像の探索領域と前記参照画像内で前記基線長方向に沿って画素単位で変位させる比較領域との第2の相違度を算出し、前記第1の相違度及び前記第2の相違度の合計値又は平均値に基づいて、前記視差を算出し、
前記第2の相違度の算出に用いる探索領域において、該探索領域の基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施す
移動体。
a stereo camera device including a stereo camera for capturing a standard image and a reference image; and an image processing device for calculating a parallax of a subject image in a search area based on a first degree of difference between a search area including a standard point in the standard image and a comparison area displaced in pixel units along a base line length direction of the stereo camera in the reference image;
The stereo camera device includes:
In the reference image, pixels are clustered by subject;
calculating the first dissimilarity degree by weighting pixels in the search area that belong to the same object as the object to which the reference point belongs differently from pixels that belong to objects other than the same object ;
calculating a second dissimilarity between a search area of the standard image and a comparison area in the reference image that is displaced by a pixel unit along the base line direction in a state in which one of the standard image and the reference image is displaced by 0.5 pixels in the base line length direction, and calculating the dissimilarity based on a sum or an average value of the first dissimilarity and the second dissimilarity;
In the search area used for calculating the second dissimilarity, a weighting different from that of pixels belonging to an object other than the object to which the reference point of the search area belongs is applied to pixels belonging to the same object.
Mobile body.
ステレオカメラに基準画像及び参照画像を撮像させるステップと、
前記基準画像内で、各画素を被写体別にクラスタリングを行うステップと、
前記基準画像内の基準点を含む探索領域において、前記基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けになるように、各画素の重付けを決定するステップと、
前記基準画像内の基準点を含む探索領域と前記参照画像内で前記ステレオカメラの基線長方向に沿って画素単位で変位させる比較領域との複数の第1の相違度と、前記各画素の重付けとに基づいて前記探索領域内の被写体像の視差を算出するステップと、を備え
前記基準画像及び前記参照画像の一方を前記基線長方向に0.5画素変位させた状態で前記基準画像の探索領域と前記参照画像内で前記基線長方向に沿って画素単位で変位させる比較領域との第2の相違度を算出し、前記第1の相違度及び前記第2の相違度の合計値又は平均値に基づいて、前記視差を算出するステップと、
前記第2の相違度の算出に用いる探索領域において、該探索領域の基準点が属する被写体と同一の被写体に属する画素に対して、該被写体以外の被写体に属する画素と異なる重付けを施すステップと、を更に備え
画像処理方法。
A step of capturing a standard image and a reference image by a stereo camera;
clustering pixels in the reference image by object;
determining a weight for each pixel in a search area including a reference point in the reference image such that pixels belonging to the same subject as the subject to which the reference point belongs are weighted differently from pixels belonging to subjects other than the same subject;
calculating a disparity of a subject image within the search area based on a plurality of first dissimilarities between a search area including a reference point within the standard image and a comparison area displaced in pixel units along a baseline length direction of the stereo camera within the reference image, and a weighting of each pixel ;
calculating a second dissimilarity between a search area of the standard image and a comparison area in the reference image that is displaced by a pixel unit along the base line direction while one of the standard image and the reference image is displaced by 0.5 pixels in the base line length direction, and calculating the dissimilarity based on a sum or average value of the first dissimilarity and the second dissimilarity;
and weighting pixels in a search area used to calculate the second dissimilarity differently from pixels that belong to an object that is the same as an object to which a reference point of the search area belongs .
JP2021024654A 2021-02-18 2021-02-18 IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD Active JP7621828B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021024654A JP7621828B2 (en) 2021-02-18 2021-02-18 IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021024654A JP7621828B2 (en) 2021-02-18 2021-02-18 IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD

Publications (2)

Publication Number Publication Date
JP2022126527A JP2022126527A (en) 2022-08-30
JP7621828B2 true JP7621828B2 (en) 2025-01-27

Family

ID=83058859

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021024654A Active JP7621828B2 (en) 2021-02-18 2021-02-18 IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD

Country Status (1)

Country Link
JP (1) JP7621828B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008275366A (en) 2007-04-26 2008-11-13 Tokyo Institute Of Technology Stereo 3D measurement system
JP2009129318A (en) 2007-11-27 2009-06-11 Fuji Heavy Ind Ltd Image processing device
JP2010140201A (en) 2008-12-10 2010-06-24 Toyota Motor Corp Image processing apparatus, image processing method, image processing program
WO2013073167A1 (en) 2011-11-17 2013-05-23 パナソニック株式会社 Image processing device, imaging device, and image processing method
JP2014096062A (en) 2012-11-09 2014-05-22 Yamaguchi Univ Image processing method and image processing apparatus
JP2015201044A (en) 2014-04-08 2015-11-12 株式会社東芝 Image processing apparatus and image processing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3060114B2 (en) * 1990-09-29 2000-07-10 グローリー工業株式会社 Corresponding point search method
JP3769850B2 (en) * 1996-12-26 2006-04-26 松下電器産業株式会社 Intermediate viewpoint image generation method, parallax estimation method, and image transmission method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008275366A (en) 2007-04-26 2008-11-13 Tokyo Institute Of Technology Stereo 3D measurement system
JP2009129318A (en) 2007-11-27 2009-06-11 Fuji Heavy Ind Ltd Image processing device
JP2010140201A (en) 2008-12-10 2010-06-24 Toyota Motor Corp Image processing apparatus, image processing method, image processing program
WO2013073167A1 (en) 2011-11-17 2013-05-23 パナソニック株式会社 Image processing device, imaging device, and image processing method
JP2014096062A (en) 2012-11-09 2014-05-22 Yamaguchi Univ Image processing method and image processing apparatus
JP2015201044A (en) 2014-04-08 2015-11-12 株式会社東芝 Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP2022126527A (en) 2022-08-30

Similar Documents

Publication Publication Date Title
KR102772870B1 (en) Electronic device and control method
EP3358295B1 (en) Image processing device, stereo camera device, vehicle, and image processing method
JP7308115B2 (en) OBJECT DETECTION DEVICE, OBJECT DETECTION SYSTEM, MOBILE OBJECT AND OBJECT DETECTION METHOD
JP6141562B1 (en) Parallax calculation device, stereo camera device, vehicle, and parallax calculation method
CN116736277A (en) Electronic instruments, removable devices, distance calculation methods and storage media
JP6456499B2 (en) Three-dimensional object detection device, stereo camera device, vehicle, and three-dimensional object detection method
JP6810009B2 (en) Parallax calculator
JP7278846B2 (en) OBJECT POSITION DETECTION DEVICE, TRIP CONTROL SYSTEM, AND TRIP CONTROL METHOD
JP2015207278A (en) Parallax value deriving apparatus, device control system, moving body, robot, parallax value deriving method, and program
CN114402357B (en) Road surface detection device, object detection system, moving body, and object detection method
JP6674959B2 (en) Parallax calculating device, stereo camera device, vehicle, and parallax calculating method
JP5073700B2 (en) Object detection device
EP4191196A1 (en) Image processing device, stereo camera device, moving object, parallax calculation method, and image processing method
CN112639864B (en) Method and apparatus for ranging
JP7229129B2 (en) OBJECT DETECTION DEVICE, OBJECT DETECTION SYSTEM, MOBILE OBJECT AND OBJECT DETECTION METHOD
JP6121641B1 (en) Image processing apparatus, stereo camera apparatus, vehicle, and image processing method
JP7621828B2 (en) IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD
JP7569173B2 (en) IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOBILE BODY, AND IMAGE PROCESSING METHOD
US12620110B2 (en) Image processing device, stereo camera device, mobile object, disparity calculating method, and image processing method
JP7527891B2 (en) IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, MOVING BODY, AND DISPARITY CALCULATION METHOD
JP7652739B2 (en) Image processing device and image processing method
JP2024137371A (en) Electronic device, distance measurement method, and distance measurement program
JP2024050248A (en) IMAGE PROCESSING DEVICE, STEREO CAMERA DEVICE, AND IMAGE PROCESSING METHOD
JP7023212B2 (en) Image processing equipment, image pickup equipment, moving objects and image processing methods
CN113763534A (en) Point cloud mapping method based on visual look-around system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230915

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240709

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240902

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20250115

R150 Certificate of patent or registration of utility model

Ref document number: 7621828

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150