JP2009288893A - Image processor - Google Patents

Image processor Download PDF

Info

Publication number
JP2009288893A
JP2009288893A JP2008138553A JP2008138553A JP2009288893A JP 2009288893 A JP2009288893 A JP 2009288893A JP 2008138553 A JP2008138553 A JP 2008138553A JP 2008138553 A JP2008138553 A JP 2008138553A JP 2009288893 A JP2009288893 A JP 2009288893A
Authority
JP
Japan
Prior art keywords
image
region
area
correlation
processing apparatus
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.)
Pending
Application number
JP2008138553A
Other languages
Japanese (ja)
Inventor
Hiroshi Sakai
宏 酒井
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2008138553A priority Critical patent/JP2009288893A/en
Publication of JP2009288893A publication Critical patent/JP2009288893A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide technology for executing an actual correlation process at a smaller calculation cost. <P>SOLUTION: An image processor 1 is provided restricting the region for executing the correlation process by specifying the region in which a movement exists from an image. The image processor 1 is provided with an image processing section 111 for executing a distortion correction process for an original image; a difference detection section 112 for detecting a region with movement from the image to which a correction process is applied; and a correlation calculation section 113 for executing the correlation process, regarding the region in which the movement is detected. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、ステレオ画像の処理技術に関するものである。   The present invention relates to a stereo image processing technique.

ステレオカメラによる1対の撮像画像についてその対応関係を相関し、ずれ量(視差)から三角測量により各点の3次元的位置を推測するような技術が知られている。   A technique is known that correlates the correspondence relationship between a pair of images captured by a stereo camera and estimates the three-dimensional position of each point by triangulation from a deviation amount (parallax).

しかしながら相関処理を実行する際には、基準となる撮像画像上に設定される領域(テンプレートブロック)の全てについて、他方の画像と相関を取るため、その処理負荷の大きさが問題となる。   However, when executing the correlation process, since all the regions (template blocks) set on the reference captured image are correlated with the other image, the size of the processing load becomes a problem.

この点、特許文献1には、両カメラによる画像の濃度データからオプティカルフローを算出し、これに基づいて直前の視差を推定することにより、短時間で測距が可能な技術が記載されている。   In this regard, Patent Document 1 describes a technique that can perform distance measurement in a short time by calculating an optical flow from image density data of both cameras and estimating a previous parallax based on the optical flow. .

特開平5−256610号公報JP-A-5-256610

特許文献1の技術では、オプティカルフローから視差を予測・補完することによって画像処理の負荷を減らすことは可能であっても、実際の相関処理による演算コストを減らすことは出来なかった。   With the technique of Patent Document 1, although it is possible to reduce the load of image processing by predicting and complementing parallax from an optical flow, it has not been possible to reduce the calculation cost by actual correlation processing.

そこで本発明では、実際の相関処理を、より少ない演算コストで実行すること可能な技術を提供することを目的とする。   Therefore, an object of the present invention is to provide a technique capable of executing actual correlation processing at a lower calculation cost.

前記課題を解決するために、本発明の画像処理装置は、例えば、異なる視点から撮像された第一の画像および第二の画像に関する処理を行う画像処理装置であって、第一の画像から動きのある領域を検出する差分検出手段と、前記第一の画像における動きのある領域と、第二の画像における前記動きのある領域に対応するエピポーラ線上の領域と、について相関処理を実行する相関演算手段と、を備えることを特徴とする。   In order to solve the above-described problem, an image processing apparatus of the present invention is an image processing apparatus that performs processing related to a first image and a second image captured from different viewpoints, for example. Correlation calculation for performing correlation processing on a difference detection means for detecting a certain region, a region having motion in the first image, and a region on an epipolar line corresponding to the region having motion in the second image And means.

以上のように、本発明によれば、ステレオ画像の相関処理による負荷を低減することが可能な技術を提供することを目的とする。   As described above, an object of the present invention is to provide a technique capable of reducing the load caused by the correlation processing of stereo images.

以下、本発明を実施するための最良の形態について、図面を参照して説明する。
<第一の実施形態>
図1は、本願の第一の実施形態に係る画像処理装置1の機能構成を示すブロック図である。
The best mode for carrying out the present invention will be described below with reference to the drawings.
<First embodiment>
FIG. 1 is a block diagram showing a functional configuration of an image processing apparatus 1 according to the first embodiment of the present application.

画像処理装置1には、撮像装置50が接続されている。   An imaging device 50 is connected to the image processing device 1.

撮像装置50は、第一のカメラである左側カメラ50aと、第二のカメラである右側カメラ50bと、を有する。これらは同一の高さで、かつ、それぞれの光軸が平行になるような所定の間隔(基線長)で配置されるステレオカメラである。なお、各カメラには、CCDやCMOS等の任意のイメージセンサを用いることが可能である。   The imaging device 50 includes a left camera 50a that is a first camera and a right camera 50b that is a second camera. These are stereo cameras arranged at the same height and at a predetermined interval (base line length) such that their optical axes are parallel to each other. Note that an arbitrary image sensor such as a CCD or a CMOS can be used for each camera.

各カメラはフレームレートに従って、1対のステレオ画像(以下、原画像と称する)を出力し、原画像は図示しないA/D変換器を経て、デジタルデータとして画像処理装置1へと送られる。また、各カメラの駆動は、画像処理装置1からの制御を受けても良いし、撮像装置50の備える図示しないカメラCPUの制御によって、独立して駆動しても良い。   Each camera outputs a pair of stereo images (hereinafter referred to as original images) according to the frame rate, and the original images are sent to the image processing apparatus 1 as digital data via an A / D converter (not shown). The driving of each camera may be controlled by the image processing apparatus 1 or may be independently driven by control of a camera CPU (not shown) provided in the imaging apparatus 50.

画像処理装置1は、CPU(Central Processing Unit)などのプロセッサ100と、プロセッサ100にて扱うデータを記憶させるメモリ20およびグラフィックメモリ30と、
カメラの設定や補正に関する補正テーブル41を記憶する記憶装置40と、から構成される。
The image processing apparatus 1 includes a processor 100 such as a CPU (Central Processing Unit), a memory 20 and a graphic memory 30 for storing data handled by the processor 100,
And a storage device 40 that stores a correction table 41 relating to camera settings and correction.

メモリ20は、輝度情報記憶領域21を構成し、プロセッサ100によって生成される後述の輝度情報を格納する。   The memory 20 forms a luminance information storage area 21 and stores luminance information described later generated by the processor 100.

グラフィックメモリ30は、複数の画像バッファを有する。   The graphic memory 30 has a plurality of image buffers.

画像バッファ31は、例えばフレームバッファであり、撮像装置50より出力された1対の原画像を描画するためのものである。ここでは、左側カメラ50aによる原画像と、右側カメラ50bによる原画像と、が順次ストアされる。従って、画像バッファ31は、少なくとも画像データを2フレーム分格納する領域を持つ。   The image buffer 31 is a frame buffer, for example, for rendering a pair of original images output from the imaging device 50. Here, the original image by the left camera 50a and the original image by the right camera 50b are stored sequentially. Therefore, the image buffer 31 has an area for storing at least two frames of image data.

画像バッファ32は、原画像に補正処理を施して生成される1対の補正画像6を描画するためのものである。ここでは少なくとも、左側カメラ50aによる原画像に基づく補正画像と、右側カメラ50bによる原画像に基づく補正画像と、がストアされるため、画像バッファ32は、少なくとも画像データを2フレーム分格納する領域を持つ。   The image buffer 32 is for rendering a pair of corrected images 6 generated by performing correction processing on the original image. Here, since at least a corrected image based on the original image by the left camera 50a and a corrected image based on the original image by the right camera 50b are stored, the image buffer 32 has an area for storing at least two frames of image data. Have.

距離画像メモリ33には、後述する相関演算部113によって生成される視差マップが描画される。視差マップについては、後述する。   In the distance image memory 33, a parallax map generated by a correlation calculation unit 113 described later is drawn. The parallax map will be described later.

記憶装置40は、例えば、フラッシュメモリ等の記憶デバイスである。記憶装置40には、後述の補正処理に用いられる補正テーブル41が格納されている。   The storage device 40 is a storage device such as a flash memory, for example. The storage device 40 stores a correction table 41 used for correction processing described later.

プロセッサ100は、その機能部として、原画像に対して歪み補正処理を実行する画像処理部111と、補正処理の施された画像から動きのある領域を検出する差分検出部112と、動きの検出された領域について相関処理を実行する相関演算部113と、を備えている。なお、これらの機能部は、プロセッサ100がメモリ20にロードした所定のプログラムを実行することで実現される。   The processor 100 includes, as its functional units, an image processing unit 111 that performs distortion correction processing on the original image, a difference detection unit 112 that detects a region with motion from the image subjected to the correction processing, and motion detection And a correlation calculation unit 113 that executes correlation processing on the region that has been processed. Note that these functional units are realized by the processor 100 executing a predetermined program loaded into the memory 20.

画像処理部111は、撮像装置50から出力される画像を取得して画像バッファ31へとストアし、当該1対の原画像に対して歪み補正処理を実行する。具体的に、画像処理部111は、撮像装置50からフレームレートに従って出力される1対の原画像を、グラフィックメモリ30内の画像バッファ31に描画する。そして、当該原画像について、補正処理を施す。   The image processing unit 111 acquires an image output from the imaging device 50, stores it in the image buffer 31, and executes distortion correction processing on the pair of original images. Specifically, the image processing unit 111 draws a pair of original images output from the imaging device 50 according to the frame rate in the image buffer 31 in the graphic memory 30. Then, correction processing is performed on the original image.

補正処理とは、各カメラのパラメータ差や位置、および角度のずれにより生じる歪みを補正し、相関処理の認識精度を向上させるために施される前処理である。具体的に、画像処理部111は、記憶装置40に格納される補正テーブル41に従って、例えば、アフィン変換やシェーディング補正等の処理を施し、1対の補正画像6を生成する。さらに、画像処理部111は、生成した補正画像6を画像バッファ32へと描画する。   The correction process is a pre-process that is performed to correct distortion caused by a difference in parameter, position, and angle of each camera and improve the recognition accuracy of the correlation process. Specifically, the image processing unit 111 performs a process such as affine transformation or shading correction according to the correction table 41 stored in the storage device 40 to generate a pair of corrected images 6. Further, the image processing unit 111 draws the generated corrected image 6 on the image buffer 32.

差分検出部112は、補正処理の施された1対の補正画像6のうち、一方の補正画像(以下、基準画像と称する)から、動きのある領域を抽出する。具体的に、差分検出部112は、生成された一対の補正画像6のうち、第一のカメラである左側カメラ50aによって撮像された補正画像(以下、基準画像6a;図2(a)参照)から、所定の領域(ブロック)ごとの輝度値を格納した輝度情報を生成する。   The difference detection unit 112 extracts a region having motion from one corrected image (hereinafter referred to as a reference image) of the pair of corrected images 6 subjected to the correction process. Specifically, the difference detection unit 112 corrects an image captured by the left camera 50a, which is the first camera, of the generated pair of corrected images 6 (hereinafter referred to as a reference image 6a; see FIG. 2A). Then, luminance information storing luminance values for each predetermined area (block) is generated.

ここで、輝度情報について、図2(a)および図2(b)を参照しながら説明する。図2(a)は、所定の大領域に分割された基準画像6aおよび探索画像6bの概略図、図2(b)は、基準画像6aから生成される輝度情報の概略図である。   Here, the luminance information will be described with reference to FIGS. 2 (a) and 2 (b). FIG. 2A is a schematic diagram of the reference image 6a and the search image 6b divided into predetermined large areas, and FIG. 2B is a schematic diagram of luminance information generated from the reference image 6a.

まず、差分検出部112は、画像バッファ32より読み出した基準画像6aを、4つの小領域(S〜S;例えば、4×4画素で構成)よりなる大領域(L〜L12;例えば、8×8画素で構成)に分割する。 First, the difference detection unit 112 converts the reference image 6a read from the image buffer 32 into a large area (L 1 to L 12 ; 4 areas consisting of 4 small areas (S 1 to S 4 ; for example, 4 × 4 pixels)). For example, it is divided into 8 × 8 pixels.

さらに、差分検出部112は、各大領域内に存在する画素の平均輝度値を算出して、輝度情報を生成し、メモリ20の輝度情報記憶領域21へと格納する。   Further, the difference detection unit 112 calculates an average luminance value of pixels existing in each large area, generates luminance information, and stores the luminance information in the luminance information storage area 21 of the memory 20.

輝度情報は、差分検出部112によって基準画像6aごとに生成され、メモリ20の輝度情報記憶領域21へと格納される。輝度情報記憶領域21は、少なくとも前フレームの基準画像6aに基づく輝度情報と、現フレームの基準画像6aに基づく輝度情報と、を記憶する。輝度情報は、図2(b)に示すように、領域ID格納領域21aと、輝度値格納領域21bと、フラグ格納領域21cと、を有する。   The luminance information is generated for each reference image 6 a by the difference detection unit 112 and stored in the luminance information storage area 21 of the memory 20. The luminance information storage area 21 stores at least luminance information based on the reference image 6a of the previous frame and luminance information based on the reference image 6a of the current frame. As shown in FIG. 2B, the luminance information includes an area ID storage area 21a, a luminance value storage area 21b, and a flag storage area 21c.

領域ID格納領域21aには、差分検出部112によって分割される所定の大領域を識別するための識別子が格納される。   The area ID storage area 21 a stores an identifier for identifying a predetermined large area divided by the difference detection unit 112.

輝度値格納領域21bには、大領域内に含まれる画素の平均輝度値が格納される。   The luminance value storage area 21b stores the average luminance value of the pixels included in the large area.

フラグ格納領域21cには、差分検出部112によって動きが検出された大領域であることを示すフラグが登録される。   In the flag storage area 21c, a flag indicating that the movement is detected by the difference detection unit 112 is registered.

図1に戻って、差分検出部112は、輝度情報を用いて、基準画像6aから動きのある領域を検出する。具体的に、差分検出部112は、最新の輝度情報と、以前の(即ち、1フレーム前の基準画像に基づく)輝度情報と、について、画像上で対応する位置に存在する大領域を比較する(例えば、LとR、LとR)。そして、差分検出部112は、平均輝度値に所定の閾値Th以上の変化がある大領域が存在するか否かを検出する。前フレームとの輝度差が閾値Th以上ある大領域が存在する場合には、当該大領域の領域IDを格納する最新の輝度情報のフラグ格納領域21cに、フラグ(例えば、「1」)を登録し、後述する相関処理の対象となる領域としてラベリングする。 Returning to FIG. 1, the difference detection unit 112 detects an area with motion from the reference image 6 a using luminance information. Specifically, the difference detection unit 112 compares the latest luminance information and the previous luminance information (that is, based on the reference image of the previous frame) with a large region existing at a corresponding position on the image. (For example, L 1 and R 1 , L 2 and R 2 ). Then, the difference detector 112, a large area to the average luminance value is a predetermined threshold value Th 1 or more changes to detect whether there. When there is a large area whose luminance difference from the previous frame is equal to or greater than the threshold Th 1 , a flag (eg, “1”) is set in the flag storage area 21c of the latest luminance information that stores the area ID of the large area. It is registered and labeled as an area to be subjected to correlation processing described later.

相関演算部113は、差分検出部112によってラベリングされた大領域内に含まれる各小領域について、相関処理を実行して視差マップを更新する。   The correlation calculation unit 113 performs a correlation process on each small region included in the large region labeled by the difference detection unit 112 and updates the parallax map.

まず、一般的な相関処理(ステレオマッチング)について、図3を用いて説明する。図3は、area-based matchingの概略説明図である。   First, general correlation processing (stereo matching) will be described with reference to FIG. FIG. 3 is a schematic explanatory diagram of area-based matching.

まず、一方のカメラによって撮像された画像(基準画像)が、所定のテンプレートブロック(T〜T)に分割される。そして、全てのテンプレートブロックごとに、他方のカメラによって撮像された画像(探索画像)のエピポーラ線を含む所定の領域(サーチウィンドウ)内を探索し、テンプレートブロックと最も一致する点を決定して、その水平シフト値から視差dを得るものである。 First, an image (reference image) captured by one camera is divided into predetermined template blocks (T 1 to T n ). Then, for every template block, search within a predetermined area (search window) including an epipolar line of an image (search image) imaged by the other camera, determine a point that most closely matches the template block, The parallax d is obtained from the horizontal shift value.

本実施形態にかかる相関演算部113は、このような相関処理を差分検出部112のラベリングした大領域に含まれる各小領域についてのみ実行する。まず、相関演算部113は、輝度情報のフラグ格納領域21cを参照して、ラベリングされた大領域を特定する。   The correlation calculation unit 113 according to the present embodiment executes such correlation processing only for each small region included in the large region labeled by the difference detection unit 112. First, the correlation calculation unit 113 refers to the flag storage area 21c for luminance information and identifies a large labeled area.

次に、相関演算部113は、ラベリングされた大領域に含まれる基準画像6aの小領域と、当該小領域に対応する探索画像6bのエピポーラ線を含む所定の小領域列(サーチウィンドウ)と、を画像バッファ32から読み出す。そして、このテンプレートブロックをサーチウィンドウ上で1画素ずつずらしながら一致度(評価値)を算出していく。   Next, the correlation calculation unit 113 includes a small region of the reference image 6a included in the labeled large region, a predetermined small region sequence (search window) including the epipolar line of the search image 6b corresponding to the small region, Are read from the image buffer 32. Then, the degree of coincidence (evaluation value) is calculated while shifting this template block pixel by pixel on the search window.

例えば、図2(a)に示す基準画像6aの大領域Lがラベリングされている場合、相関演算部113は、大領域Lと、そのエピポーラ線を含む大領域R〜Rを画像バッファ32から読み出す。 For example, when a large area L 7 of the reference image 6a shown in FIG. 2 (a) is labeled, the correlation calculation unit 113, a large area L 7, the image a large area R 5 to R 8 containing the epipolar line Read from buffer 32.

そして、相関演算部113は、図4に示すように、大領域Lに含まれる小領域SおよびSのエピポーラ線を含む所定の小領域列であるサーチウィンドウ101aと、小領域SおよびSのエピポーラ線を含む所定の小領域列であるサーチウィンドウ101bと、を各小領域で探索し、それぞれの評価値を算出する。 Then, correlation calculation section 113, as shown in FIG. 4, a search window 101a which is a predetermined small area columns containing epipolar line of the small areas S 1 and S 2 included in the large region L 7, small areas S 3 and a search window 101b is a predetermined small area columns containing epipolar lines S 4, were searched in each small region, it calculates the respective evaluation values.

評価値の算出には、例えば、SAD(Sum of Absolute Difference)法を用いる。SAD法とは、両画像のブロック内の各画素について差の絶対値を取り、その総和を評価値とするものである。この評価値が小さいほどブロック間の一致度が高く、その水平方向のシフト量から視差dが与えられる。   For example, an SAD (Sum of Absolute Difference) method is used to calculate the evaluation value. In the SAD method, the absolute value of the difference is taken for each pixel in the blocks of both images, and the sum is used as the evaluation value. The smaller this evaluation value is, the higher the matching degree between the blocks is, and the parallax d is given from the horizontal shift amount.

ここで、基準画像をImgL、探索画像をImgR、画像平面上の座標について水平方向をi座標、垂直方向をj座標と定義し、小領域をi×j(i=0〜n,j=0〜n)画素からなるブロックとするとき、評価値は(1)の式によって求められる。   Here, a reference image is defined as ImgL, a search image is defined as ImgR, a horizontal direction is defined as an i coordinate, and a vertical direction is defined as a j coordinate, and a small region is defined as i × j (i = 0 to n, j = 0). N) When the block is composed of pixels, the evaluation value is obtained by the equation (1).

S=Σ|ImgL(i,j)−ImgR(i,j)| ・・・(1)
なお、評価値の算出法は上記に限定されず、SAD法の他に、ブロック内の各画素について差の二乗を取るSSD(Sum of Squared intensity Difference)法、各画素の輝度値から局所的な平均値を引き、分散値の類似度を求めるNCC(Normalized Cross Correlation)法等、どのような手法を用いてもよい。
S = Σ | ImgL (i, j) −ImgR (i, j) | (1)
Note that the evaluation value calculation method is not limited to the above. In addition to the SAD method, an SSD (Sum of Squared Intensity Difference) method that takes the square of the difference for each pixel in the block, and a local value from the luminance value of each pixel. Any method such as an NCC (Normalized Cross Correlation) method for subtracting the average value and calculating the similarity of the variance values may be used.

さらに、相関演算部113は、算出した各小領域間の視差に基づいて、視差マップを更新する。視差マップとは、画素毎に算出された視差を用いて作成される距離画像であり、相関演算部113は、新たに視差が算出された小領域に関してのみ新規の視差を用いて視差マップを再構築し、その他の領域については以前の演算結果を用いる。   Furthermore, the correlation calculation unit 113 updates the parallax map based on the calculated parallax between the small regions. The disparity map is a distance image created using the disparity calculated for each pixel, and the correlation calculation unit 113 re-creates the disparity map using the new disparity only for the small area for which the new disparity is calculated. Construct and use previous calculation results for other areas.

視差マップは、画像処理装置1がその初期動作に際して、補正画像6の全領域について相関処理を実行して生成する。このような視差マップが距離画像メモリ33に描画されていることにより、相関演算部113は、動きのある領域についてのみ視差マップを更新することできる。   The parallax map is generated by performing correlation processing on the entire region of the corrected image 6 in the initial operation of the image processing apparatus 1. Since such a parallax map is drawn in the distance image memory 33, the correlation calculation unit 113 can update the parallax map only for a region with motion.

以上のように構成される画像処理装置1の実行する処理の流れについて、図5に示すフローチャートを用いて説明する。   A flow of processing executed by the image processing apparatus 1 configured as described above will be described with reference to a flowchart shown in FIG.

画像処理装置1の画像処理部111は、撮像装置50から一対の原画像が入力されると、これを画像バッファ31に描画する(S11)。   When a pair of original images is input from the imaging device 50, the image processing unit 111 of the image processing device 1 draws the images in the image buffer 31 (S11).

次に、画像処理部111は、原画像に補正処理を施して補正画像6を生成し、画像バッファ32に描画する(S12)。具体的に、画像処理部111は、画像バッファ31から原画像を読み出す。そして、記憶装置40に記憶される補正テーブル41を用いてこれらに補正処理を施して、1対の補正画像(基準画像6aおよび探索画像6b)を画像バッファ32にストアさせる。その後、画像処理部111は、差分検出部112に輝度情報生成要求を出力する。   Next, the image processing unit 111 performs a correction process on the original image to generate the corrected image 6 and draws it in the image buffer 32 (S12). Specifically, the image processing unit 111 reads an original image from the image buffer 31. Then, correction processing is performed on these using the correction table 41 stored in the storage device 40, and a pair of corrected images (reference image 6 a and search image 6 b) is stored in the image buffer 32. Thereafter, the image processing unit 111 outputs a luminance information generation request to the difference detection unit 112.

差分検出部112は、画像処理部111からの輝度情報生成要求を受け付けると、基準画像6aを所定の領域に分割して、輝度情報を生成する(S13)。具体的に、差分検出部112は、画像バッファ32から基準画像6aを読み出して、所定の大領域(例えば、8×8画素で構成)に分割し、大領域ごとに平均輝度値を検出して輝度情報を生成する。生成した輝度情報は、メモリ20の輝度情報記憶領域21に記憶させる。   Upon receiving the luminance information generation request from the image processing unit 111, the difference detection unit 112 divides the reference image 6a into predetermined regions and generates luminance information (S13). Specifically, the difference detection unit 112 reads the reference image 6a from the image buffer 32, divides the reference image 6a into predetermined large regions (for example, configured by 8 × 8 pixels), and detects an average luminance value for each large region. Generate luminance information. The generated luminance information is stored in the luminance information storage area 21 of the memory 20.

次に、差分検出部112は、基準画像6aから動きのある領域を検出する(S14)。具体的に、差分検出部112は、最新の輝度情報と、前フレームの輝度情報と、を輝度情報記憶領域21から読み出して、両輝度情報を対応する大領域ごとに比較し、それぞれ輝度差(変化量)を検出する。そして、差分検出部112は、輝度差が所定の閾値Th以上である大領域が存在するか否かを判断し、存在する場合には(S14でYES)、当該大領域の領域IDが格納される最新の輝度情報のフラグ格納領域21cにフラグを登録し、相関演算部113へ相関処理要求を出力する。存在しなかった場合には(S14でNO)、処理を終了する。 Next, the difference detection unit 112 detects a moving area from the reference image 6a (S14). Specifically, the difference detection unit 112 reads the latest luminance information and the luminance information of the previous frame from the luminance information storage area 21, compares the luminance information for each corresponding large area, and compares the luminance difference ( Change). Then, the difference detection unit 112 determines whether or not there is a large region whose luminance difference is equal to or greater than the predetermined threshold Th 1. If there is a large region (YES in S14), the region ID of the large region is stored. The flag is registered in the flag storage area 21c of the latest luminance information, and a correlation processing request is output to the correlation calculation unit 113. If it does not exist (NO in S14), the process is terminated.

相関演算部113は、差分検出部112からの相関処理要求を受け付けると、相関処理の対象となるテンプレートブロックと、サーチウィンドウと、を特定する(S15)。具体的に、相関演算部113は、まず、メモリ20に格納される最新の輝度情報を参照して、フラグ格納領域21cにフラグの格納されている大領域の領域IDを特定し、当該大領域に含まれる各小領域を、テンプレートブロックとして画像バッファ32からそれぞれ読み出す。さらに、相関演算部113は、テンプレートブロックに対応する(エピポーラ線を含む)探索画像6bの小領域列を画像バッファ32から読み出し、それぞれサーチウィンドウとして特定する。   When the correlation calculation unit 113 receives the correlation processing request from the difference detection unit 112, the correlation calculation unit 113 specifies a template block to be subjected to correlation processing and a search window (S15). Specifically, the correlation calculation unit 113 first refers to the latest luminance information stored in the memory 20 to identify the area ID of the large area in which the flag is stored in the flag storage area 21c, and the large area Are read from the image buffer 32 as template blocks. Further, the correlation calculation unit 113 reads out the small region sequence of the search image 6b (including the epipolar line) corresponding to the template block from the image buffer 32, and specifies each as a search window.

次に、相関演算部113は、ステップ15で特定した各テンプレートブロックと、サーチウィンドウと、で相関処理を実行する(S16)。相関演算部113は、各テンプレートブロックを対応するサーチウィンドウ上で1画素ずつずらしながら一致度(評価値)を算出して、最も一致度の高い領域に対する水平方向のシフト量を求め、視差を算出する。   Next, the correlation calculation unit 113 executes a correlation process with each template block specified in step 15 and the search window (S16). The correlation calculation unit 113 calculates the degree of coincidence (evaluation value) while shifting each template block pixel by pixel on the corresponding search window, obtains the horizontal shift amount for the region with the highest degree of coincidence, and calculates the parallax. To do.

そして、相関演算部113は、算出した視差に基づいて、視差マップを更新する(S17)。   Then, the correlation calculation unit 113 updates the parallax map based on the calculated parallax (S17).

以上のような構成により、本実施形態にかかる画像処理装置1は、動きのある領域のみについて相関処理を実行することで、処理に要する演算量の増大を抑制し、低負荷で距離画像を生成することが可能である。   With the configuration as described above, the image processing apparatus 1 according to the present embodiment suppresses an increase in the amount of computation required for processing by executing correlation processing only for a region with motion, and generates a distance image with low load. Is possible.

なお、輝度値格納領域21bに格納される輝度値は、大領域に含まれる画素の平均輝度値の代わりに、各画素の輝度値を加算した合計輝度値を用いても良い。この場合、差分検出部112は、各大領域の合計輝度値の差から動きのある領域を特定すれば良い。   The luminance value stored in the luminance value storage area 21b may be a total luminance value obtained by adding the luminance values of each pixel instead of the average luminance value of the pixels included in the large area. In this case, the difference detection unit 112 may specify an area with movement from the difference in total luminance values of the large areas.

なお、本発明は上記の実施形態に限定されるものではなく、その要旨の範囲内で様々な変形が可能である。
<変形例>
例えば、上記実施形態は、動きのある大領域が複数検出された場合、それら全ての領域について相関処理を実行するが、本変形例では、最大の動きが検出される大領域についてのみ相関処理を行う場合について説明する。
In addition, this invention is not limited to said embodiment, A various deformation | transformation is possible within the range of the summary.
<Modification>
For example, in the above embodiment, when a plurality of large areas with motion are detected, correlation processing is executed for all of the areas. In this modification, however, correlation processing is performed only for the large area where the maximum motion is detected. The case where it performs is demonstrated.

差分検出部112は、基準画像6aより最大の動きが検出された大領域を特定して、当該大領域に含まれる各小領域についてのみ相関処理を実行する。   The difference detection unit 112 identifies a large area in which the maximum motion is detected from the reference image 6a, and executes correlation processing only for each small area included in the large area.

差分検出部112は、図5のステップ14において、平均輝度値に所定の閾値Th以上の変化がある大領域が複数存在する場合、その輝度差(変化量)が最大の大領域を特定する。そして、差分検出部112は、当該大領域のフラグ格納領域21cにフラグを登録し、相関演算部113へ相関処理要求を出力する。 In step 14 of FIG. 5, if there are a plurality of large areas in which the average luminance value has a change greater than or equal to the predetermined threshold value Th 1 , the difference detection unit 112 identifies the large area having the maximum luminance difference (change amount). . Then, the difference detection unit 112 registers a flag in the large flag storage area 21 c and outputs a correlation processing request to the correlation calculation unit 113.

以上のような構成により、本変形例においては、動きが大きな領域のみを特定して相関処理を実行することにより、複数の領域で動きが検出された場合でも、相関処理の処理コストを低く抑えることが可能である。
<第二の実施形態>
次に、本発明の第二の実施形態に係る画像処理装置2について説明する。
With the configuration as described above, in this modification, only the region with large motion is specified and correlation processing is executed, so that even when motion is detected in a plurality of regions, the processing cost of the correlation processing is kept low. It is possible.
<Second Embodiment>
Next, an image processing apparatus 2 according to the second embodiment of the present invention will be described.

本実施形態にかかる画像処理装置2は、プロセッサ200と、記憶装置60と、メモリ70と、グラフィックメモリ80と、から構成される。   The image processing apparatus 2 according to the present embodiment includes a processor 200, a storage device 60, a memory 70, and a graphic memory 80.

記憶装置60は、補正テーブル41と、順序データ62と、を予め記憶する。   The storage device 60 stores the correction table 41 and the order data 62 in advance.

順序データ62は、撮像画像上に動きのある領域が存在しない場合に、相関処理の対象となる(テンプレートブロックとなる)小領域の順序を予め設定したものである。よって、撮像画像上から動きが検出されない場合、相関処理の実行順序はこの順序データに基づいて定められる。詳細については後述する。   The order data 62 is obtained by presetting the order of small areas to be subjected to correlation processing (to be a template block) when there is no moving area on the captured image. Therefore, when no motion is detected from the captured image, the correlation processing execution order is determined based on this order data. Details will be described later.

メモリ70は、輝度情報記憶領域71と、差分情報記憶領域72と、を有する。   The memory 70 has a luminance information storage area 71 and a difference information storage area 72.

輝度情報記憶領域71は、差分検出部212の生成する基準画像6aに基づく輝度情報A、および、探索画像6bに基づく輝度情報Bを記憶する。   The luminance information storage area 71 stores luminance information A based on the reference image 6a generated by the difference detection unit 212 and luminance information B based on the search image 6b.

差分情報記憶領域72は、輝度情報Aを前フレームの輝度情報と比較した場合の大領域ごとの輝度差分を格納する差分情報Aと、輝度情報Bを前フレームの輝度情報と比較した場合の大領域ごとの輝度差分を格納する差分情報Bと、を記憶する。   The difference information storage area 72 stores difference information A for storing the luminance difference for each large area when the luminance information A is compared with the luminance information of the previous frame, and large information when the luminance information B is compared with the luminance information of the previous frame. Difference information B for storing a luminance difference for each region is stored.

グラフィックメモリ80は、画像バッファ31および距離画像メモリ33に加えて、画像バッファ82を有する。   The graphic memory 80 includes an image buffer 82 in addition to the image buffer 31 and the distance image memory 33.

画像バッファ82は、例えばラインバッファであり、原画像に補正処理を施した1対の補正画像6のうち、相関処理に要する走査線を描画するためのものである。画像バッファ82は、少なくとも画像データを2ライン分格納する領域を有し、差分検出部212から入力される画像データを順次格納していく。   The image buffer 82 is, for example, a line buffer, and is used to draw a scanning line required for correlation processing among a pair of corrected images 6 obtained by performing correction processing on the original image. The image buffer 82 has an area for storing at least two lines of image data, and sequentially stores the image data input from the difference detection unit 212.

プロセッサ200は、その機能部として、原画像に対して補正処理を実行する画像処理部211と、補正処理の施された画像の輝度差から相関処理の対象となる領域を抽出する差分検出部212と、抽出された領域について相関処理を実行する相関演算部213と、を備えている。   The processor 200 has, as its functional units, an image processing unit 211 that executes correction processing on the original image, and a difference detection unit 212 that extracts a region subjected to correlation processing from the luminance difference of the image subjected to correction processing. And a correlation calculation unit 213 that executes correlation processing on the extracted region.

画像処理部211は第一の実施形態と同様の構成であり、撮像装置50より出力された1対の原画像を画像バッファ31へ描画するとともに、補正処理を施して補正画像6(基準画像6aおよび探索画像6b)を生成する。   The image processing unit 211 has the same configuration as that of the first embodiment. The image processing unit 211 draws a pair of original images output from the imaging device 50 in the image buffer 31 and performs a correction process to perform a corrected image 6 (reference image 6a). And search image 6b).

差分検出部212は、基準画像6aおよび探索画像6bについて各輝度情報を生成し、前フレームとの輝度差が類似する領域を特定する。具体的に、差分検出部212は、基準画像6aおよび探索画像6bを所定の小領域を含む大領域ごとに分割し、基準画像6aの各大領域に存在する画素の平均輝度値を格納した輝度情報Aと、探索画像6bの各大領域に存在する画素の平均輝度値を格納した輝度情報Bと、を生成して、輝度情報記憶領域71に記憶させる。   The difference detection unit 212 generates each piece of luminance information for the reference image 6a and the search image 6b, and specifies a region where the luminance difference with the previous frame is similar. Specifically, the difference detection unit 212 divides the reference image 6a and the search image 6b into large regions including predetermined small regions, and stores the average luminance value of the pixels existing in each large region of the reference image 6a. Information A and luminance information B storing the average luminance value of the pixels existing in each large area of the search image 6 b are generated and stored in the luminance information storage area 71.

大領域および小領域の構成は、図7に示すように第一の実施形態とほぼ同様であるが、その画素数において第一の実施形態とは異なる。ここでは、大領域に含まれる4つの小領域(S〜S)は、それぞれ1画素で構成されるものとする。従って、大領域(L〜L12およびR〜R12)は、2×2画素から構成されている。 The configuration of the large area and the small area is substantially the same as that of the first embodiment as shown in FIG. 7, but the number of pixels is different from that of the first embodiment. Here, it is assumed that each of the four small regions (S 1 to S 4 ) included in the large region is composed of one pixel. Therefore, the large areas (L 1 to L 12 and R 1 to R 12 ) are composed of 2 × 2 pixels.

なお、本実施形態にかかる基準画像6aおよび探索画像6bは、6本の走査線(ライン1〜ライン6;図7参照)から構成される。各走査線を走査する際、リフレッシュレートに従って、一定の間隔でブランク期間Bが回ってくる。本実施形態においては、ブランク期間B内で実行可能な相関処理は、走査線一本(小領域8ブロック)分のマッチング演算である。よって、小領域8ブロック以下のマッチング演算を実行する場合には、処理落ちが生じず、フレームレートに対して遅延なく相関処理が実行可能となる構成である。   The reference image 6a and the search image 6b according to the present embodiment are composed of six scanning lines (line 1 to line 6; see FIG. 7). When scanning each scanning line, the blank period B rotates at regular intervals according to the refresh rate. In the present embodiment, the correlation process that can be executed within the blank period B is a matching operation for one scanning line (8 blocks of small areas). Therefore, when executing a matching calculation for 8 blocks or less in the small area, the processing is not lost, and the correlation processing can be executed without delay with respect to the frame rate.

輝度情報AおよびBについても、図8(a)に示すように、第一の実施形態にかかる輝度情報とほぼ同じ構成であるが、フラグ格納領域21cの代わりに、領域対ID格納領域71cを有する点で異なる。領域対ID格納領域71cには、輝度情報AおよびBの間で、類似する輝度差分を有する大領域の識別子が格納される。詳細については、後述する。   As shown in FIG. 8A, the luminance information A and B have substantially the same configuration as the luminance information according to the first embodiment. However, instead of the flag storage area 21c, an area pair ID storage area 71c is provided. It is different in having. In the area pair ID storage area 71c, identifiers of large areas having similar luminance differences between the luminance information A and B are stored. Details will be described later.

次に、差分検出部212は、各輝度情報AおよびBについて、前フレームの輝度情報との差分を取り、差分情報AおよびBを生成する。具体的に、差分検出部212は、最新の輝度情報AおよびBを、以前の(例えば、1フレーム前の)輝度情報AおよびBと比較し、対応する大領域ごとの差分を差分情報AおよびBとして、差分情報記憶領域72へと記憶させる。   Next, the difference detection unit 212 takes the difference between the luminance information A and B and the luminance information of the previous frame, and generates difference information A and B. Specifically, the difference detection unit 212 compares the latest luminance information A and B with the previous luminance information A and B (for example, one frame before), and compares the difference for each large area with the difference information A and B. As B, the difference information storage area 72 is stored.

差分情報AおよびBは、図8(b)に示すように、領域ID格納領域72aと、輝度差分格納領域72bと、からなる。領域ID格納領域72aには、大領域を識別するための識別子が格納される。輝度差分格納領域72bには、各輝度情報を前フレームの輝度情報と比較した際の、輝度差分値が格納される。   As shown in FIG. 8B, the difference information A and B includes an area ID storage area 72a and a luminance difference storage area 72b. The area ID storage area 72a stores an identifier for identifying a large area. In the luminance difference storage area 72b, the luminance difference value when each luminance information is compared with the luminance information of the previous frame is stored.

さらに、差分検出部212は、差分情報Aに格納される輝度差分値ごとに、差分情報Bに格納される輝度差分値と比較して、その差の絶対値が所定の閾値Th以下で、かつ、最も小さい(すなわち、輝度差分値が最も近い値の)類似領域対を検出する。そして、輝度情報の領域対ID格納領域71cに、類似領域対となる大領域の識別子を格納する。また、差分検出部212は、類似領域対を構成する各走査線を、画像バッファ82に描画する。 Further, the difference detection unit 212 compares the luminance difference value stored in the difference information B for each luminance difference value stored in the difference information A, and the absolute value of the difference is equal to or less than a predetermined threshold Th 2 . And the smallest similar area pair (that is, the closest brightness difference value) is detected. And the identifier of the large area which becomes a similar area pair is stored in the area pair ID storage area 71c of the luminance information. In addition, the difference detection unit 212 draws each scanning line constituting the similar region pair in the image buffer 82.

例えば、図7に示すように、大領域Lと大領域Rとが類似領域対として特定された場合、相関演算部213は、当該類似領域対が含まれる基準画像6aおよび探索画像6bの走査線(ここでは、それぞれの画像のライン1とライン2、計4本)、を画像バッファ82に描画する。 For example, as illustrated in FIG. 7, when the large region L 2 and the large region R 3 are specified as a similar region pair, the correlation calculation unit 213 determines whether the reference image 6 a and the search image 6 b including the similar region pair are included. The scanning lines (here, line 1 and line 2 of each image, a total of four lines) are drawn in the image buffer 82.

なお、差の絶対値が所定の閾値Th以下の類似領域対が存在しない場合、差分検出部212は、記憶装置60の記憶する順序データ62を参照し、相関処理に用いる(テンプレートブロックとなる)小領域を特定し、当該小領域含む走査線と、そのエピポーラ線を含む小領域列(走査線)を、画像バッファ82に描画する。 In the case where the absolute value of the difference does not exist the predetermined threshold value Th 2 or less similar pair of regions, the difference detection unit 212 refers to the order data 62 to be stored in the storage device 60, the (template block used in the correlation process ) A small area is specified, and a scanning line including the small area and a small area sequence (scanning line) including the epipolar line are drawn in the image buffer 82.

順序データ62には、類似領域対が検出されなかった場合に実行される相関処理の実行順序が小領域単位で設定されている。この順序はどのようなものであってもよいが、本実施形態においては、図10に示すように、テンプレートブロックとなる小領域は左上から走査線に沿って移動してゆく。   In the order data 62, the execution order of correlation processing executed when a similar area pair is not detected is set in units of small areas. Any order may be used, but in the present embodiment, as shown in FIG. 10, the small area serving as the template block moves along the scanning line from the upper left.

例えば、図10に示すように、ライン5上にテンプレートブロックとなる小領域が存在する場合、差分検出部212は、基準画像6aおよび探索画像6bのライン5(計2本)を、それぞれ画像バッファ82へと描画する。   For example, as shown in FIG. 10, when there is a small region that becomes a template block on the line 5, the difference detection unit 212 uses the line 5 (two in total) of the reference image 6 a and the search image 6 b as image buffers. Draw to 82.

次に、本実施形態にかかる相関演算部213の実行する処理について、図7および図9を参照しながら説明する。   Next, processing executed by the correlation calculation unit 213 according to the present embodiment will be described with reference to FIGS. 7 and 9.

相関演算部213は、領域対ID格納領域71cに類似領域対が格納されている場合、すなわち、差分検出部212によって類似領域対が検出された場合、基準画像6aの類似大領域に含まれる各小領域について、探索画像6bで対となる小領域と、当該小領域に隣接する両側の小領域と、の3ブロックについて、相関処理を実行する。   When a similar area pair is stored in the area pair ID storage area 71c, that is, when a similar area pair is detected by the difference detection unit 212, the correlation calculation unit 213 includes each similar area included in the reference image 6a. For the small area, the correlation process is executed for the three blocks of the small area to be paired in the search image 6b and the small areas on both sides adjacent to the small area.

例えば、大領域Lと大領域Rとが類似領域対として特定された場合、相関演算部213は、図9に示すように、大領域Lに含まれる各小領域S〜Sをテンプレートブロックとして、大領域Rに含まれる対応する小領域と、その両側に位置する小領域と、の計3ブロック(サーチウィンドウ)について相関を取る。 For example, if a large region L 2 and the large area R 3 is identified as a similar region pairs, the correlation calculation unit 213, as shown in FIG. 9, each of the small areas S 1 to S 4 included in the large region L 2 as a template block, take the corresponding small regions included in the large region R 3, and small regions located on both sides of the correlation for a total of three blocks (search window).

また、相関演算部213は、領域対ID格納領域71cに類似領域対が格納されていない場合、記憶装置60の記憶する順序データ62を参照し、所定の順序に従ってテンプレートブロックとなる小領域を特定し、対応する探索画像6bの走査線1本(小領域8ブロック;図10ではライン5)をサーチウィンドウとして相関処理を実行する。   In addition, the correlation calculation unit 213 refers to the order data 62 stored in the storage device 60 when the similar area pair is not stored in the area pair ID storage area 71c, and specifies a small area that becomes a template block according to a predetermined order. Then, the correlation processing is executed using one scanning line (8 blocks of a small area; line 5 in FIG. 10) of the corresponding search image 6b as a search window.

そして、相関演算部213は、算出した各小領域間の視差に基づいて、視差マップを更新する。   Then, the correlation calculation unit 213 updates the parallax map based on the calculated parallax between the small regions.

以上のように構成される本実施形態にかかる画像処理装置2での処理の流れについて、図11に示すフローチャートを用いて説明する。   A processing flow in the image processing apparatus 2 according to the present embodiment configured as described above will be described with reference to a flowchart shown in FIG.

画像処理装置2の画像処理部211は、撮像装置50から一対の原画像が入力されると、これを画像バッファ31に描画する(S21)。   When a pair of original images is input from the imaging device 50, the image processing unit 211 of the image processing device 2 draws the images in the image buffer 31 (S21).

次に、画像処理部211は、原画像に補正処理を施して補正画像6(基準画像6aおよび探索画像6b)を生成する(S22)。そして、画像処理部211は、差分検出部212に輝度情報生成要求を出力する。   Next, the image processing unit 211 performs correction processing on the original image to generate a corrected image 6 (a reference image 6a and a search image 6b) (S22). Then, the image processing unit 211 outputs a luminance information generation request to the difference detection unit 212.

差分検出部212は、画像処理部211からの輝度情報生成要求を受け付けると、基準画像6aおよび探索画像6bを所定の領域に分割して、輝度情報AおよびBを生成する(S23)。   Upon receiving the luminance information generation request from the image processing unit 211, the difference detection unit 212 divides the reference image 6a and the search image 6b into predetermined areas and generates luminance information A and B (S23).

次に、差分検出部212は、輝度情報AおよびBを前フレームの輝度情報と比較して、その差分値を格納する差分情報AおよびBを生成する(S24)。具体的に、差分検出部212は、輝度情報記憶領域71に記憶される最新の輝度情報AおよびBを、以前の輝度情報AおよびBと比較し、対応する大領域ごとの差分を検出して差分情報AおよびBを生成し、差分情報記憶領域72へと記憶させる。   Next, the difference detection unit 212 compares the luminance information A and B with the luminance information of the previous frame, and generates difference information A and B for storing the difference values (S24). Specifically, the difference detection unit 212 compares the latest luminance information A and B stored in the luminance information storage area 71 with the previous luminance information A and B, and detects a difference for each corresponding large area. Difference information A and B are generated and stored in the difference information storage area 72.

そして、差分検出部212は、差分情報Aに格納される輝度差分値ごとに、差分情報Bに格納される輝度差分値と比較して、差の絶対値が所定の閾値Th以下であり、かつ、最も差の絶対値の小さい、相互に有する類似領域対を検出する(S25)。 Then, the difference detection unit 212 compares the luminance difference value stored in the difference information B for each luminance difference value stored in the difference information A, and the absolute value of the difference is equal to or less than a predetermined threshold Th 2 . A pair of similar regions having the smallest absolute value of the difference is detected (S25).

S25において類似領域対が検出された場合、差分検出部212は、輝度情報AおよびBの領域対ID格納領域71cに、類似領域対を識別するための識別子を格納する。そして、当該大領域を含む走査線を画像バッファ82へと描画し、相関演算部213へ相関処理要求を出力する。   When a similar area pair is detected in S25, the difference detection unit 212 stores an identifier for identifying the similar area pair in the area pair ID storage area 71c of the luminance information A and B. Then, the scanning line including the large area is drawn on the image buffer 82, and a correlation processing request is output to the correlation calculation unit 213.

S25において類似領域対が検出されなかった場合、差分検出部212は、順序データ62を参照して相関処理の対象となる小領域を特定する。そして、当該小領域を含む基準画像6aの走査線と、エピポーラ線を含む探索画像6bの走査線と、を画像バッファ82へと描画し、相関演算部213へ相関処理要求を出力する。   When the similar region pair is not detected in S25, the difference detection unit 212 refers to the order data 62 and specifies a small region to be subjected to correlation processing. Then, the scanning line of the reference image 6 a including the small area and the scanning line of the search image 6 b including the epipolar line are drawn on the image buffer 82, and a correlation processing request is output to the correlation calculation unit 213.

相関演算部213は、差分検出部212からの相関処理要求を受け付けると、S25において類似領域対が検出されたか否かを判断する(S26)。具体的に、相関演算部213は、輝度情報AおよびBの領域対ID格納領域71cに、類似領域対となる領域IDが格納されるレコードが存在するか否かを検出する。レコードが存在する場合には(S26でYES)、ステップ27へ進み、レコードが存在しない場合には(S26でNO)、ステップ30へと進む。   When the correlation calculation unit 213 receives the correlation processing request from the difference detection unit 212, the correlation calculation unit 213 determines whether a similar region pair is detected in S25 (S26). Specifically, the correlation calculation unit 213 detects whether or not there is a record in which the region ID that is a similar region pair is stored in the region pair ID storage region 71c of the luminance information A and B. If a record exists (YES in S26), the process proceeds to step 27. If no record exists (NO in S26), the process proceeds to step 30.

類似領域対が存在する場合(S26でYES)、相関演算部213は、類似領域対についてテンプレートブロックと、サーチウィンドウと、を特定する(S27)。具体的に、相関演算部213は、まず、メモリ20に格納される最新の輝度情報AおよびBを参照して、領域対ID格納領域71cに格納される領域IDから、基準画像6aの大領域を特定し、当該大領域に含まれる各小領域を、テンプレートブロックとして画像バッファ82からそれぞれ読み出す。さらに、相関演算部213は、テンプレートブロックである各小領域に対応する探索画像6bの小領域と、当該小領域の両側の小領域と、をサーチウィンドウとして特定し、画像バッファ82から読み出す。   When the similar region pair exists (YES in S26), the correlation calculation unit 213 specifies a template block and a search window for the similar region pair (S27). Specifically, the correlation calculation unit 213 first refers to the latest luminance information A and B stored in the memory 20 and calculates the large area of the reference image 6a from the area ID stored in the area pair ID storage area 71c. And each small area included in the large area is read from the image buffer 82 as a template block. Furthermore, the correlation calculation unit 213 identifies the small area of the search image 6b corresponding to each small area that is a template block and the small areas on both sides of the small area as a search window, and reads out from the image buffer 82.

類似領域対が検出されなかった場合には(S26でNO)、相関演算部213は、所定の順序に従って、テンプレートブロックと、サーチウィンドウと、を特定する(S30)。具体的に、相関演算部213は、記憶装置60に格納される順序データ62に基づいて、テンプレートブロックとなる基準画像6a上の小領域を特定し、画像バッファ82から読み出す。そして、サーチウィンドウとなる当該小領域に対応する探索画像6bの走査線を、画像バッファ82から読み出す。   When the similar region pair is not detected (NO in S26), the correlation calculation unit 213 specifies a template block and a search window according to a predetermined order (S30). Specifically, the correlation calculation unit 213 specifies a small area on the reference image 6 a serving as a template block based on the order data 62 stored in the storage device 60, and reads it from the image buffer 82. Then, the scanning line of the search image 6b corresponding to the small area serving as the search window is read from the image buffer 82.

そして、相関演算部213は、ステップ27またはステップ30特定した各テンプレートブロックと、サーチウィンドウと、で相関処理を実行し(S28)、算出した小領域ごとの視差に基づいて、視差マップを更新する(S29)。   Then, the correlation calculation unit 213 performs correlation processing between each template block identified in step 27 or step 30 and the search window (S28), and updates the parallax map based on the calculated parallax for each small region. (S29).

以上のような構成によれば、本実施形態にかかる画像処理装置2は、輝度差分から両ステレオ画像間で対応する領域を推測して相関処理を実行する範囲を限定することにより、フレームレートに遅延なく、ブランク期間内での処理が可能である。   According to the configuration as described above, the image processing apparatus 2 according to the present embodiment estimates the corresponding region between the two stereo images from the luminance difference and limits the range in which the correlation processing is performed, thereby reducing the frame rate. Processing within the blank period is possible without delay.

また、輝度値の変化が少ないような領域についても、所定の順序で随時相関処理が実行されるため、より正確な視差マップを、少ない処理コスト得ることが出来る。   In addition, since the correlation process is performed at any time in a predetermined order even in an area where the change in luminance value is small, a more accurate parallax map can be obtained with a low processing cost.

さらに、ブランク期間内に処理を終了させることで、補正画像をフレームごとバッファしなくても良く、少ないメモリ容量での画像処理が実現可能である。   Further, by terminating the processing within the blank period, it is not necessary to buffer the corrected image for each frame, and image processing with a small memory capacity can be realized.

なお、各領域のサイズ(水平、垂直画素数)は、一例であって上記実施形態に本願発明が限定されるものではない。   The size of each region (horizontal and vertical pixel count) is an example, and the present invention is not limited to the above embodiment.

本発明の第一の実施形態に係る画像処理装置の機能的な構成を示すブロック図。1 is a block diagram showing a functional configuration of an image processing apparatus according to a first embodiment of the present invention. (a)基準画像6aおよび探索画像6bの概略図、(b)基準画像6aから生成される輝度情報の概略図。(A) Schematic diagram of reference image 6a and search image 6b, (b) Schematic diagram of luminance information generated from reference image 6a. area-based matchingの概略説明図。Schematic explanatory diagram of area-based matching. 相関処理の対象となるテンプレートブロックとサーチウィンドウの概略図。FIG. 5 is a schematic diagram of a template block and a search window that are objects of correlation processing. 第一の実施形態に係る画像処理装置での処理のフローを示すフローチャート。6 is a flowchart showing a flow of processing in the image processing apparatus according to the first embodiment. 本発明の第二の実施形態に係る画像処理装置の機能的な構成を示すブロック図。The block diagram which shows the functional structure of the image processing apparatus which concerns on 2nd embodiment of this invention. 第二の実施形態に係る基準画像6aおよび探索画像6bの概略図。Schematic of the reference image 6a and the search image 6b according to the second embodiment. (a)輝度情報AおよびBの概略図、(b)差分情報AおよびBの概略図。(A) Schematic diagram of luminance information A and B, (b) Schematic diagram of difference information A and B. 本発明の第二の実施形態に係る画像処理装置において、類似領域対が検出された際に、相関処理の対象となるテンプレートブロックとサーチウィンドウの概略図。FIG. 10 is a schematic diagram of a template block and a search window that are correlation processing targets when a similar region pair is detected in the image processing apparatus according to the second embodiment of the present invention. 本発明の第二の実施形態に係る画像処理装置において、類似領域対が検出されなかった際、相関処理の対象となるテンプレートブロックとサーチウィンドウの概略図。FIG. 10 is a schematic diagram of a template block and a search window that are correlation processing targets when a similar region pair is not detected in the image processing apparatus according to the second embodiment of the present invention. 第二の実施形態に係る画像処理装置での処理のフローを示すフローチャート。10 is a flowchart showing a flow of processing in the image processing apparatus according to the second embodiment.

符号の説明Explanation of symbols

1・2:画像処理装置、100・200:プロセッサ、111・211:画像処理部、112・212:差分検出部、113・313:相関演算部、40・60:記憶装置、41:補正テーブル、62:順序データ、20・70:メモリ、30・80:グラフィックメモリ、50:撮像装置。   1, 2: Image processing device, 100/200: Processor, 111/211: Image processing unit, 112/212: Difference detection unit, 113/313: Correlation calculation unit, 40/60: Storage device, 41: Correction table, 62: Order data, 20.70: Memory, 30.80: Graphic memory, 50: Imaging device.

Claims (7)

異なる視点から撮像された第1の画像および第2の画像を撮像手段から取得する処理部と、
第1の画像から動きのある領域を検出する差分検出手段と、
前記第1の画像における動きのある領域と、前記動きのある領域に対応する前記第2の画像のエピポーラ線を含む所定の領域と、について相関処理を実行する相関演算手段と、を備えること
を特徴とする画像処理装置。
A processing unit that acquires the first image and the second image captured from different viewpoints from the imaging unit;
Difference detection means for detecting a region of motion from the first image;
Correlation calculating means for executing correlation processing on a region having motion in the first image and a predetermined region including the epipolar line of the second image corresponding to the region having motion. A featured image processing apparatus.
請求項1に記載の画像処理装置であって、
前記差分検出手段は、
第1の画像を複数の第一の領域からなる第二の領域に分割し、
前記第1の画像に含まれる第二の領域の輝度値の変化量が、所定の閾値以上である場合に、当該第二の領域を動きのある領域として判断すること
を特徴とする画像処理装置。
The image processing apparatus according to claim 1,
The difference detecting means includes
Dividing the first image into a second region comprising a plurality of first regions;
When the amount of change in the luminance value of the second area included in the first image is equal to or greater than a predetermined threshold, the second area is determined as a moving area. .
請求項2に記載の画像処理装置であって、
前記差分検出手段は、
前記第1の画像に含まれる前記第二の領域の輝度値の変化量が、所定の閾値以上であり、かつ、最大である場合に、当該第二の領域を動きのある領域として判断すること
を特徴とする画像処理装置。
The image processing apparatus according to claim 2,
The difference detecting means includes
When the amount of change in the luminance value of the second area included in the first image is equal to or greater than a predetermined threshold and is the maximum, the second area is determined as a moving area. An image processing apparatus.
請求項2または3に記載の画像処理装置であって、
前記相関演算手段は、
前記動きのある領域として検出された第二の領域に含まれる第一の領域と、
当該第一の領域に対応する、前記第2の画像のエピポーラ線を含む所定の領域と、
について相関処理を実行すること
を特徴とする画像処理装置。
The image processing apparatus according to claim 2 or 3,
The correlation calculation means includes
A first region included in the second region detected as the region of movement;
A predetermined region corresponding to the first region and including an epipolar line of the second image;
An image processing apparatus characterized by executing correlation processing for.
異なる視点から撮像された第1の画像および第2の画像を撮像手段から取得する処理部と、
第1の画像を複数の第一の領域からなる第二の領域に分割し、
第2の画像を複数の第三の領域からなる第四の領域に分割し、
前記第1の画像に含まれる第二の領域の輝度値の変化量を検出し、
前記第2の画像に含まれる第四の領域の輝度値の変化量を検出して、
前記第1の画像に含まれる第二の領域の輝度値の変化量と、前記第2の画像に含まれる第四の領域の輝度値の変化量と、を比較して、両変化量の差分が、所定の閾値以下である領域対を検出する差分検出手段と、
前記領域対について、相関処理を実行する相関演算手段と、を備えること
を特徴とする画像処理装置。
A processing unit that acquires the first image and the second image captured from different viewpoints from the imaging unit;
Dividing the first image into a second region comprising a plurality of first regions;
Dividing the second image into a fourth region comprising a plurality of third regions;
Detecting a change amount of a luminance value of a second region included in the first image;
Detecting the amount of change in the luminance value of the fourth region included in the second image;
The amount of change in the luminance value of the second region included in the first image is compared with the amount of change in the luminance value of the fourth region included in the second image. Is a difference detection means for detecting a pair of regions that are equal to or less than a predetermined threshold;
An image processing apparatus comprising: correlation calculation means for executing correlation processing for the region pair.
請求項5に記載の画像処理装置であって、
前記相関演算手段は、
前記領域対として検出された第二の領域に含まれる第一の領域と、
当該第一の領域に対応する第三の領域、および、当該第三の領域の左右に存在する第三の領域と、
について相関処理を実行すること
を特徴とする画像処理装置。
The image processing apparatus according to claim 5,
The correlation calculation means includes
A first region included in a second region detected as the region pair;
A third region corresponding to the first region, and a third region present on the left and right of the third region;
An image processing apparatus characterized by executing correlation processing for.
請求項5または6に記載の画像処理装置であって、
前記差分検出手段によって領域対が検出されなかった場合に、
前記相関演算手段は、
所定の順序で定まる第一の領域と、当該第一の領域に対応するエピポーラ線を含む第三の領域列と、
について相関処理を実行すること
を特徴とする画像処理装置。
The image processing apparatus according to claim 5, wherein:
When the region pair is not detected by the difference detection unit,
The correlation calculation means includes
A first region determined in a predetermined order; a third region row including an epipolar line corresponding to the first region;
An image processing apparatus characterized by executing correlation processing for.
JP2008138553A 2008-05-27 2008-05-27 Image processor Pending JP2009288893A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008138553A JP2009288893A (en) 2008-05-27 2008-05-27 Image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008138553A JP2009288893A (en) 2008-05-27 2008-05-27 Image processor

Publications (1)

Publication Number Publication Date
JP2009288893A true JP2009288893A (en) 2009-12-10

Family

ID=41458070

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008138553A Pending JP2009288893A (en) 2008-05-27 2008-05-27 Image processor

Country Status (1)

Country Link
JP (1) JP2009288893A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016200702A (en) * 2015-04-09 2016-12-01 キヤノン株式会社 Focus detection device, control method therefor, program, and storage medium
WO2019082474A1 (en) * 2017-10-23 2019-05-02 パナソニックIpマネジメント株式会社 Three-dimensional intrusion detection system and three-dimensional intrusion detection method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016200702A (en) * 2015-04-09 2016-12-01 キヤノン株式会社 Focus detection device, control method therefor, program, and storage medium
WO2019082474A1 (en) * 2017-10-23 2019-05-02 パナソニックIpマネジメント株式会社 Three-dimensional intrusion detection system and three-dimensional intrusion detection method
JP2019079173A (en) * 2017-10-23 2019-05-23 パナソニックIpマネジメント株式会社 Three-dimensional intrusion detection system and three-dimensional intrusion detection method

Similar Documents

Publication Publication Date Title
CN110493488B (en) Video image stabilization method, video image stabilization device and computer readable storage medium
US9131155B1 (en) Digital video stabilization for multi-view systems
JP2008236642A (en) Object tracking device
US20200013179A1 (en) Inspection support apparatus and inspection support method
US8922627B2 (en) Image processing device, image processing method and imaging device
US9449389B2 (en) Image processing device, image processing method, and program
JP2014515197A (en) Multi-view rendering apparatus and method using background pixel expansion and background-first patch matching
JP2008090583A (en) Information processing system, program, and information processing method
TW201428689A (en) Optical navigation method and device using same
JP2014085120A (en) Stereo image processing device and stereo image processing method
JP2013257244A (en) Distance measurement device, distance measurement method, and distance measurement program
JP2004356747A (en) Method and apparatus for matching image
TW201715882A (en) Device and method for depth estimation
JP2009288893A (en) Image processor
WO2014054124A1 (en) Road surface markings detection device and road surface markings detection method
JP6579816B2 (en) Image processing apparatus, image processing method, and program
JP6901424B2 (en) Image processing device and image processing method
JP6668740B2 (en) Road surface estimation device
JP6602089B2 (en) Image processing apparatus and control method thereof
US10346680B2 (en) Imaging apparatus and control method for determining a posture of an object
JP2009239391A (en) Compound eye photographing apparatus, control method therefor, and program
JP2021131377A (en) Generation device, method for generation, and program
US10430971B2 (en) Parallax calculating apparatus
KR20180051241A (en) Method and system for stereo matching by using rectangular window
JP2013190938A (en) Stereo image processing device