JP6394216B2 - Motion detection method, motion detection apparatus, and motion detection program - Google Patents

Motion detection method, motion detection apparatus, and motion detection program Download PDF

Info

Publication number
JP6394216B2
JP6394216B2 JP2014186178A JP2014186178A JP6394216B2 JP 6394216 B2 JP6394216 B2 JP 6394216B2 JP 2014186178 A JP2014186178 A JP 2014186178A JP 2014186178 A JP2014186178 A JP 2014186178A JP 6394216 B2 JP6394216 B2 JP 6394216B2
Authority
JP
Japan
Prior art keywords
solution
motion detection
evaluation function
motion
pixel
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
JP2014186178A
Other languages
Japanese (ja)
Other versions
JP2016058019A (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.)
Socionext Inc
Original Assignee
Socionext Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Socionext Inc filed Critical Socionext Inc
Priority to JP2014186178A priority Critical patent/JP6394216B2/en
Publication of JP2016058019A publication Critical patent/JP2016058019A/en
Application granted granted Critical
Publication of JP6394216B2 publication Critical patent/JP6394216B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本願開示は、動き検出方法、動き検出装置、及び動き検出プログラムに関する。   The present disclosure relates to a motion detection method, a motion detection device, and a motion detection program.

近年、自動車の安全性への意識の高まりと、カーエレクトロニクス技術の進歩により、ドライバーの運転を支援して安全性を高める技術に注目が集まっている。特に、車の発進時などに、車両に近づく歩行者や他車両などの接近物を自動的に検出し、ドライバーに注意を促すための、車両周辺接近物検知システムについての需要が増加している。接近物の検知には様々な方法が考えられるが、車載カメラの映像を使う方法が、低コストであり、他の運転支援システムとの連携の点からも有効である。   In recent years, attention has been focused on technologies that enhance driving safety by supporting driver's driving due to increasing awareness of automobile safety and advances in car electronics technology. In particular, when a vehicle starts, there is an increasing demand for a vehicle surrounding approach detection system that automatically detects approaching objects such as pedestrians and other vehicles approaching the vehicle and alerts the driver. . Various methods are conceivable for detecting an approaching object, but a method using an on-vehicle camera image is low-cost and effective from the viewpoint of cooperation with other driving support systems.

車載カメラによる車両周辺接近物検知システムにおいては、カメラ映像の動画に対してオプティカルフローを計算し、特定の方向を向いたオプティカルフローが検出された場合、接近物体があったと判断する。オプティカルフローの計算方式としては、SADを使った局所相関演算法がよく用いられる。   In a vehicle peripheral approaching object detection system using an in-vehicle camera, an optical flow is calculated for a moving image of a camera image, and when an optical flow directed in a specific direction is detected, it is determined that there is an approaching object. As a method for calculating an optical flow, a local correlation calculation method using SAD is often used.

車両周辺接近物検知システムにおいては、移動物体が遠くにあるうちに移動物体を検出することが、ドライバーに多くの時間的余裕を与えることになるため、安全性向上の観点から極めて重要である。移動物体が遠くにある場合には、動画中の移動量も小さいので、小さなオプティカルフローを逃さず検出する必要がある。しかしながら、小さなオプティカルフローを検出しようとすると、細かい誤りフローを誤検知するリスクが増加する。誤りフローは、動画中の草木などの細かい移動体や画像のノイズ等の原因により発生するだけでなく、移動物体が全くない状態で輝度の変化が起こっただけでも発生する可能性がある。   In the vehicle periphery approaching object detection system, detecting a moving object while the moving object is far away gives a driver a lot of time, and is extremely important from the viewpoint of improving safety. When the moving object is far away, the moving amount in the moving image is also small, so it is necessary to detect a small optical flow without missing it. However, when trying to detect a small optical flow, the risk of misdetecting a fine error flow increases. The error flow may not only occur due to a fine moving body such as a plant or the like in a moving image or noise of an image, but may also occur only when a luminance change occurs without any moving object.

輝度変化のみに起因して動きが検出されてしまう現象は、画像の輝度変化がグラデーションである場合に特に発生しやすい。画像の輝度変化がグラデーションであるとは、第1の画素位置の第1の輝度から第2の画素位置の第2の輝度まで、輝度が徐々に単調増加する又は単調減少することを意味する。特に、輝度変化が線形(即ち直線的)である場合に、誤った動きが検出されやすい。これは、空間的に直線的な輝度変化が存在する場合、直線的な輝度変化を有する物体が空間的に移動して発生する輝度変化と、全体の輝度が一様に増加(又は減少)することにより発生する輝度変化とは、局所的な情報のみからでは区別がつかないからである。即ち、ある画素位置とその近傍の局所的な領域に着目し、その領域で輝度の増加(又は減少)が発生したときに、物体が実際に動いて発生した輝度変化であるのか、全体の輝度が一様に変化して発生した輝度変化であるのか、区別がつかない。   The phenomenon in which motion is detected due to only the luminance change is particularly likely to occur when the luminance change of the image is gradation. That the luminance change of the image is gradation means that the luminance gradually increases or decreases monotonously from the first luminance at the first pixel position to the second luminance at the second pixel position. In particular, when the luminance change is linear (that is, linear), erroneous movement is likely to be detected. This is because, when there is a spatially linear brightness change, the brightness change caused by spatial movement of an object having a linear brightness change and the overall brightness uniformly increase (or decrease). This is because a change in luminance caused by the above cannot be distinguished from only local information. That is, paying attention to a certain pixel position and a local area in the vicinity of the pixel position, when an increase (or decrease) in luminance occurs in that area, it is a luminance change caused by actual movement of the object, or the entire luminance It is indistinguishable whether the brightness change is caused by uniform change.

なお上述のような輝度変化による誤った動き検出は、車両周辺接近物検知システムに限られる問題ではなく、オプティカルフローを検出する全てのシステムにおいて発生する可能性がある問題である。   The erroneous motion detection due to the luminance change as described above is not limited to the vehicle periphery approaching object detection system, but may be a problem that may occur in all systems that detect optical flows.

特開2006−53692号公報JP 2006-53692 A 特開2013−186668号公報JP 2013-186668 A 特開2013−84140号公報JP2013-84140A 特開2013−101419号公報JP 2013-101419 A 特開2008−257626号公報JP 2008-257626 A 特開2012−68842号公報JP 2012-68842 A

以上を鑑みると、輝度変化による誤ったオプティカルフローの検出を避けることができる動き検出装置及び方法が望まれる。   In view of the above, a motion detection apparatus and method that can avoid detection of an erroneous optical flow due to a change in luminance is desired.

動き検出方法は、輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求め、輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する各段階をコンピュータにより実行する。   In the motion detection method, an optimal optical flow solution is obtained by performing motion search using a first evaluation function that is affected by a luminance change, and the optimal solution is obtained using a second evaluation function that is not affected by the luminance change. Each step of selecting the optimum solution of the stationary solution and the stationary solution where the object is stationary is executed by the computer.

動き検出装置は、プロセッサと、メモリとを含み、前記メモリに格納されたプログラムを前記プロセッサが実行することにより、輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求め、輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する各段階を実行する。   The motion detection device includes a processor and a memory, and when the processor executes a program stored in the memory, a motion search is performed by using the first evaluation function that is affected by a change in luminance, thereby performing an optical flow. And executing each step of selecting the optimum solution of the optimum solution and the stationary solution in which the object is stationary using the second evaluation function that is not affected by the luminance change. To do.

少なくとも1つの実施例によれば、輝度変化による誤ったオプティカルフローの検出を避けることができる。   According to at least one embodiment, detection of an erroneous optical flow due to a luminance change can be avoided.

動き検出装置の構成の一例を示す図である。It is a figure which shows an example of a structure of a motion detection apparatus. 図1の動き検出装置のソフトウェアの構成の一例を示す図である。It is a figure which shows an example of a software structure of the motion detection apparatus of FIG. 動き探索処理を説明するための図である。It is a figure for demonstrating a motion search process. 輝度変化の影響を受けない評価関数を用いた修正処理を説明するための図である。It is a figure for demonstrating the correction process using the evaluation function which is not influenced by a luminance change. 動け探索及び修正処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a motion search and correction process. 輝度変化による誤検出の可能性の有無を判定する手順を示すフローチャートである。It is a flowchart which shows the procedure which determines the presence or absence of the possibility of misdetection by a luminance change. 修正処理の効果を示す表である。It is a table | surface which shows the effect of a correction process. 背景の動きの影響を取り除く処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the process which removes the influence of a background motion. 背景の動きの影響を取り除く処理を説明するための図である。It is a figure for demonstrating the process which removes the influence of a motion of a background. 背景の動きの異なるパターンについて説明するための図である。It is a figure for demonstrating the pattern from which a background motion differs. 背景の動きの異なるパターンについて説明するための図である。It is a figure for demonstrating the pattern from which a background motion differs. 背景の動きの異なるパターンについて説明するための図である。It is a figure for demonstrating the pattern from which a background motion differs.

以下に、本発明の実施例を添付の図面を用いて詳細に説明する。以下の図において、同一又は対応する構成要素は同一又は対応する番号で参照し、その説明は適宜省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following drawings, the same or corresponding components are referred to by the same or corresponding numerals, and the description thereof will be omitted as appropriate.

図1は、動き検出装置の構成の一例を示す図である。図1に示す動き検出装置は、CPU(Central Processing Unit)10、ROM(Read Only Memory)11、RAM(Random Access Memory)12、GPU(Graphics Processing Unit)13、表示インタフェース14、及び映像入力インターフェース15を含む。図1に示す動き検出装置は、制御処理及び演算処理を実行するコンピュータであってよく、例えば車載の車両周辺接近物検知システムに内蔵されるコンピュータであってよいし、監視カメラ等に接続されたパーソナルコンピュータ等であってもよい。   FIG. 1 is a diagram illustrating an example of a configuration of a motion detection device. 1 includes a CPU (Central Processing Unit) 10, a ROM (Read Only Memory) 11, a RAM (Random Access Memory) 12, a GPU (Graphics Processing Unit) 13, a display interface 14, and a video input interface 15. including. The motion detection apparatus shown in FIG. 1 may be a computer that executes control processing and arithmetic processing, for example, a computer built in an on-vehicle peripheral object detection system or connected to a monitoring camera or the like. It may be a personal computer or the like.

CPU10は、ROM11やRAM12に格納されるプログラム及びデータに基づいてプログラムを実行することにより、動き検出装置の全体を制御すると共に、RAM12に格納される画像データを演算処理する。ROM11には、動き検出装置の制御に必要な基本的なプログラムが格納されるRAM12には、動き検出装置上で実行されるアプケーシンプログラム、オプティカルフロー計算処理プログラム、画像処理基本ソフトウェアプグラムが格納される。画像処理基本ソフトウェアプログラムは例えばOenGL等であってよく、GPU13により実行されてよい。   The CPU 10 executes the program based on the program and data stored in the ROM 11 and RAM 12 to control the entire motion detection device and performs arithmetic processing on the image data stored in the RAM 12. The ROM 11 stores a basic program necessary for controlling the motion detection device. The RAM 12 stores an application program executed on the motion detection device, an optical flow calculation processing program, an image processing basic software program, and the like. The basic image processing software program may be OpenGL, for example, and may be executed by the GPU 13.

図2は、図1の動き検出装置のソフトウェアの構成の一例を示す図である。図2には、図1に示す動き検出装置のハードウェアが、ハードウェア104として示されている。CPU10が、例えば映像中の動きを検出して表示するアプリケーション101のプログラムを実行すると、当該プログラムからオプティカルフロー計算処理102が呼び出され、CPU10がオプティカルフロー計算処理102のプログラムを実行する。映像データ(時系列として並ぶ複数の画像データ)からオプティカルフローが計算されると、画像処理基本ソフトウェア103がGPU13により実行され、ハードウェア104内のフレームバッファ領域(RAM12)に対する描画が行われる。なおCPU10がオプティカルフロ計算処理102を実行するのではなく、GPU13がオプティカルフロー計算処理102を実行するのでもよい。   FIG. 2 is a diagram illustrating an example of a software configuration of the motion detection apparatus in FIG. In FIG. 2, hardware of the motion detection device illustrated in FIG. 1 is illustrated as hardware 104. For example, when the CPU 10 executes a program of the application 101 that detects and displays a motion in a video, for example, the optical flow calculation process 102 is called from the program, and the CPU 10 executes the program of the optical flow calculation process 102. When the optical flow is calculated from the video data (a plurality of image data arranged in time series), the image processing basic software 103 is executed by the GPU 13 to perform drawing on the frame buffer area (RAM 12) in the hardware 104. Note that instead of the CPU 10 executing the optical flow calculation process 102, the GPU 13 may execute the optical flow calculation process 102.

オプティカルフロー計算処理102を実行することにより、図1に示す動き検出装置は、最初に、輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求める。動き検出装置は、次に、輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する。ここで動き探索においては、後述するように画素ブロック間の類似度又は相違度を評価関数により計算することにより、最も類似度の高い(相違度の低い)画素ブロック同士を時間的に連続する2つの画像フレーム間で特定する。   By executing the optical flow calculation process 102, the motion detection apparatus shown in FIG. 1 first obtains an optimal optical flow solution by performing a motion search using the first evaluation function that is affected by a change in luminance. Next, the motion detection device selects the optimum solution of the optimum solution and the stationary solution in which the object is stationary using the second evaluation function that is not affected by the luminance change. Here, in motion search, the similarity or dissimilarity between pixel blocks is calculated using an evaluation function as described later, so that pixel blocks having the highest similarity (low dissimilarity) are temporally continuous 2 Identifies between two image frames.

輝度変化の影響を受ける第1の評価関数とは、それを用いて計算した類似度又は相違度の値が、画像全体の輝度が一様に変化するような全体的な輝度の変化により変化してしまう評価関数のことである。また輝度変化の影響を受けない第2の評価関数とは、それを用いて計算した類似度又は相違度の値が、画像全体の輝度が一様に変化するような全体的な輝度の変化により変化しない評価関数のことである。また画像全体の輝度が一様に変化するような全体的な輝度の変化とは、より具体的には、画素ブロック内の各画素の画素値が各々同一の値増加又は減少するような画素値の変化のことである。   The first evaluation function that is affected by the luminance change is that the similarity or difference value calculated by using the first evaluation function changes due to a change in the overall luminance such that the luminance of the entire image changes uniformly. This is an evaluation function. The second evaluation function that is not affected by the luminance change is a value of the similarity or difference calculated by using the second evaluation function due to a change in the overall luminance such that the luminance of the entire image changes uniformly. An evaluation function that does not change. In addition, the change in overall brightness in which the brightness of the entire image changes uniformly, more specifically, a pixel value in which the pixel value of each pixel in the pixel block increases or decreases by the same value. It is a change of.

輝度変化の影響を受けない第2の評価関数を用いるということは、画素ブロック内の各画素についての絶対的な画素値の大小の情報を破棄し、画素間の相対的な画素値の情報のみを用いて類似度又は相違度を計算することに相当する。そのような第2の評価関数を用いる場合、輝度変化の影響を受ける第1の評価関数を用いる場合と比較して、類似度又は相違度の計算において使用される情報量が少ない。従って、輝度変化の影響を受けない第2の評価関数を用いてオプティカルフローの最適解を求めた場合、誤った解が求まっている可能性、即ち実際の動きとは異なる誤った動きを検出している可能性が、第1の評価関数を用いた場合に比較して大きくなってしまう。   The use of the second evaluation function that is not affected by the change in luminance means that the absolute pixel value information for each pixel in the pixel block is discarded, and only the relative pixel value information between the pixels is discarded. This is equivalent to calculating the degree of similarity or difference using. When such a second evaluation function is used, the amount of information used in the calculation of similarity or dissimilarity is small as compared with the case where the first evaluation function that is affected by a change in luminance is used. Therefore, when the optimal solution of the optical flow is obtained using the second evaluation function that is not affected by the luminance change, the possibility that an incorrect solution is obtained, that is, an erroneous motion different from the actual motion is detected. The possibility that the first evaluation function is larger than that in the case where the first evaluation function is used.

そこで上述のように、まず第1の評価関数を用いて最適解を求める動き探索処理を実行することにより適切な解を求め、輝度変化が存在しない状況下において信頼できる解を求める。これにより、オプティカルフロー検出の精度が落ちないことを保証できる。輝度変化が存在しない状況下ではこの最適解で問題ないが、輝度変化が存在する状況下ではこの最適解では誤りである可能性がある。そこで、輝度変化の影響を受けない第2の評価関数を用いて、最適解と静止解との何れの解が最適であるのかを判定し、最適な方の解を選択する修正処理を実行する。これにより、輝度変化の有無に関わらず、動き検出において信頼性の高い解を求めることができる。   Therefore, as described above, first, an appropriate solution is obtained by executing a motion search process for obtaining an optimal solution using the first evaluation function, and a reliable solution is obtained in a situation where there is no luminance change. Thereby, it can be ensured that the accuracy of optical flow detection does not drop. There is no problem with this optimal solution in a situation where there is no luminance change, but there is a possibility that this optimal solution is erroneous in a situation where there is a luminance change. Therefore, using the second evaluation function that is not affected by the luminance change, it is determined which of the optimal solution and the static solution is optimal, and correction processing for selecting the optimal solution is executed. . This makes it possible to obtain a highly reliable solution in motion detection regardless of whether or not there is a luminance change.

図1に戻り、映像入力インターフェース15は、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)撮像素子等の撮像装置やDVD(Digital Versatile Disk)プレイヤー等の映像再生装置に接続されてよい。映像入力インターフェース15が接続先の機器から受け取った映像データは、RAM12に格納されてよい。データ格納装置として、RAM12に加え例えばハードディスク装置が設けられていてよく、映像データを不揮発性データとして格納する場合には、ハードディスク装置が格納先として用いれてよい。   Returning to FIG. 1, the video input interface 15 may be connected to an imaging device such as a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) imaging device or a video playback device such as a DVD (Digital Versatile Disk) player. Video data received by the video input interface 15 from a connection destination device may be stored in the RAM 12. As the data storage device, for example, a hard disk device may be provided in addition to the RAM 12, and when storing video data as nonvolatile data, the hard disk device may be used as a storage destination.

表示インタフェース14は、例えばLCD(Liquid Crystal Display)等の画像表示装置が接続される。例えば、計算されたオプティカルフローをベクトルとして原画像に重ねて表示した画像データが、AM12から読み出され、表示インタフェース14を介して画像表示装置に表示されてよい。   For example, an image display device such as an LCD (Liquid Crystal Display) is connected to the display interface 14. For example, image data obtained by superimposing and displaying the calculated optical flow as a vector on the original image may be read from the RAM 12 and displayed on the image display device via the display interface 14.

図3は、動き探索処理を説明するための図である。フレーム画像データ20とフレーム画像データ21とは、時系列中(時間軸上)で連続するフレームのデータである。フレーム画像データ21が現在のフレームの画像データであり、フレーム画像データ20が現在のフレームの1つ前のフレームの画像データである。図3において、フレーム画像データ20上の着目点、即ち動き検出対象の点が、画素位置30として示されている。フレーム画像データ20上の画素位置30と同一のフレーム画像データ21上の画素位置、即ち、画素位置30と同一の水平方向座標値及び垂直方向座標値を有するフレーム画像データ21上の画素位置が、画素位置32として示されている。   FIG. 3 is a diagram for explaining the motion search process. The frame image data 20 and the frame image data 21 are data of frames that are continuous in time series (on the time axis). The frame image data 21 is the image data of the current frame, and the frame image data 20 is the image data of the frame immediately before the current frame. In FIG. 3, a point of interest on the frame image data 20, that is, a point for motion detection is indicated as a pixel position 30. A pixel position on the frame image data 21 that is the same as the pixel position 30 on the frame image data 20, that is, a pixel position on the frame image data 21 that has the same horizontal direction coordinate value and vertical direction coordinate value as the pixel position 30, Shown as pixel location 32.

動き探索処理においては、1つ前のフレーム画像データ20から現在のフレーム画像データ20への時間の経過に伴い画素位置30において発生した動きを検出する。画素位置30において発生した動きを検出するために、フレーム画像データ20において画素位置30を中心とする小画像領域である画素ブロック31を考える。以降の説明において、異なる位置にある画素ブロックは、全て同一の大きさを有するものとする。   In the motion search process, the motion generated at the pixel position 30 with the passage of time from the previous frame image data 20 to the current frame image data 20 is detected. In order to detect the movement that has occurred at the pixel position 30, a pixel block 31 that is a small image area centered on the pixel position 30 in the frame image data 20 is considered. In the following description, it is assumed that the pixel blocks at different positions all have the same size.

フレーム画像データ20中の画素ブロック31に対し、フレーム画像データ21において最も類似する画素ブロック35を探索する。具体的には、候補画素位置を中心とする小画像領域である画素ブロックと動き検出対象の画素位置30の周囲の画素ブロック31との間の類似度又は相違度を、候補画素位置を順次移動させながら評価関数に用いて計算し、類似度が最も大きくなる画素位置を特定する。このようにして求められたフレーム画像データ21上の画素位置34が、フレーム画像データ20上の画素位置30の移動先であると考えられる。従って、動き探索処理により見つかったオプティカルフローのベクトルは、画素位置30即ち画素位置32から画素位置34に向かうベクトルとなる。   The most similar pixel block 35 in the frame image data 21 is searched for the pixel block 31 in the frame image data 20. Specifically, the candidate pixel positions are sequentially moved according to the similarity or dissimilarity between the pixel block that is a small image region centered on the candidate pixel position and the pixel block 31 around the pixel position 30 to be detected. The pixel position with the highest similarity is specified by using the evaluation function while calculating. The pixel position 34 on the frame image data 21 obtained in this way is considered to be the destination of the pixel position 30 on the frame image data 20. Accordingly, the optical flow vector found by the motion search process is a vector from the pixel position 30, that is, the pixel position 32 to the pixel position 34.

なお類似度が最も大きい画素ブロックを探索する際に、フレーム画像データ21全体を探索範囲としたのでは探索に時間がかかるので、動き検出対象の画素位置30即ち画素位置32の近傍に探索範囲を限定するのが一般的である。具体的には、画素位置32を中心とする矩形領域である探索範囲33を設定して、この探索範囲33内で候補画素位置を順次移動させながら類似度又は相違度を計算し、最も類似の高い画素位置を特定する。   When searching for a pixel block having the highest degree of similarity, if the entire frame image data 21 is used as a search range, it takes time to search. Therefore, a search range is set near the pixel position 30 of the motion detection target, that is, the pixel position 32. It is common to limit. Specifically, a search range 33 that is a rectangular area centered on the pixel position 32 is set, and the similarity or dissimilarity is calculated while sequentially moving candidate pixel positions within the search range 33, and the most similar Specify a high pixel position.

なお、輝度変化の影響を受ける第1の評価関数は、例えば、SSD(Sum of Squared Difference)及びSAD(Sum of Absolute Difference)のうちの何れか1つであってよい。1つ前のフレーム画像データ20の画素ブロック31の各画素の画素値をI(i,j)とし、現在のフレーム画像データ21の比較対象画素ブロックの各画素の画素値をT(i,j)とすると、SSDは以下の式により計算される。   Note that the first evaluation function affected by the luminance change may be any one of SSD (Sum of Squared Difference) and SAD (Sum of Absolute Difference), for example. The pixel value of each pixel of the pixel block 31 of the previous frame image data 20 is I (i, j), and the pixel value of each pixel of the comparison target pixel block of the current frame image data 21 is T (i, j). ), The SSD is calculated by the following equation.

Figure 0006394216
またSADは以下の式により計算される。
Figure 0006394216
SAD is calculated by the following equation.

Figure 0006394216
Figure 0006394216

図4は、輝度変化の影響を受けない評価関数を用いた修正処理を説明するための図である。図4において、図3と同一又は対応する構成要素は同一又は対応する番号で参照し、その説明は適宜省略する。   FIG. 4 is a diagram for explaining a correction process using an evaluation function that is not affected by the luminance change. 4, the same or corresponding elements as those in FIG. 3 are referred to by the same or corresponding numerals, and a description thereof will be omitted as appropriate.

フレーム画像データ20上の画素位置30に対応するフレーム画像データ21上の画素位置、即ち、画素位置30と同一の水平方向及び垂直方向の座標を有するフレーム画像データ21上の画素位置が、画素位置40として示されている。また画素位置40を中心とする画素ブロックが画素ブロック41として示されている。   The pixel position on the frame image data 21 corresponding to the pixel position 30 on the frame image data 20, that is, the pixel position on the frame image data 21 having the same horizontal and vertical coordinates as the pixel position 30 is the pixel position. 40. A pixel block centered on the pixel position 40 is shown as a pixel block 41.

図4に示す例において、フレーム画像データ20中の画素位置30を中心とする画素ブロック31に対して、フレーム画像データ21中の最適解である画素ブロック(即ち探索範囲内で画素ブロック31に最も類似する画素ブロック)は、画素ブロック43である。画素ブロック43は画素位置42を中心とする。このとき、動き探索処理により求まった最適解である画素位置42を、そのまま最終的な動き検出結果として用いるのではなく、修正処理を実行することにより、必要に応じて動き検出結果を修正する。   In the example shown in FIG. 4, the pixel block 31 that is the optimal solution in the frame image data 21 (i.e., the pixel block 31 within the search range is the most) with respect to the pixel block 31 centered on the pixel position 30 in the frame image data 20. A similar pixel block) is a pixel block 43. The pixel block 43 is centered on the pixel position 42. At this time, the pixel position 42 which is the optimum solution obtained by the motion search process is not used as the final motion detection result as it is, but the correction process is executed to correct the motion detection result as necessary.

具体的には、輝度変化の影響を受けない第2の評価関数を用い、画素ブロック31と最適解の画素ブロック43との間の類似度(又は相違度)を計算し、更に画素ブロック31と静止解の画素ブロック41との間の類似度(又は相違度)を計算する。これら2つの類似度(又は相違度)同士を比較して、類似度が大きい(即ち相違度が小さい)方の解を選択する。   Specifically, using the second evaluation function that is not affected by the luminance change, the degree of similarity (or the degree of difference) between the pixel block 31 and the pixel block 43 of the optimal solution is calculated. The similarity (or dissimilarity) between the pixel block 41 of the static solution is calculated. These two similarities (or dissimilarities) are compared with each other, and a solution having a higher similarity (that is, a smaller dissimilarity) is selected.

なお輝度変化の影響を受けない第2の評価関数は、例えば、ZSAD(Zero-mean SAD)、NCC(Normalized Cross-Correlation)、及びZNCC(Zero-mean NCC)のうちの何れか1つであってよい。各画素の画素値がI(i,j)である画素ブロック31の平均画素値を/I("/"はオーバーライン)とし、各画素の画素値がT(i,j)である比較対象画素ブロックの平均画素値を/T("/"はオーバーライン)とすると、ZSADは以下の式により計算される。   The second evaluation function not affected by the luminance change is, for example, any one of ZSAD (Zero-mean SAD), NCC (Normalized Cross-Correlation), and ZNCC (Zero-mean NCC). It's okay. The average pixel value of the pixel block 31 in which the pixel value of each pixel is I (i, j) is / I ("/" is an overline), and the comparison target is that the pixel value of each pixel is T (i, j) If the average pixel value of the pixel block is / T ("/" is an overline), ZSAD is calculated by the following equation.

Figure 0006394216
またNCCは以下の式で計算される。
Figure 0006394216
NCC is calculated by the following equation.

Figure 0006394216
またZNCCは以下の式で計算される。
Figure 0006394216
ZNCC is calculated by the following formula.

Figure 0006394216
Figure 0006394216

図5は、動き探索及び修正処理の手順を示すフローチャートである。図1に示すCPU10が、例えばRAM12に格納されたオプティカルフロー計算処理102のプログラムを実行することにより、図5のフローチャートの各ステップを実行してよい。但し前述のように、CPU10ではなくGPU13にオプティカルフロー計算処理02を実行する機能を持たせてもよい。また図5ではSADを第1の評価関数として用い、ZSADを第2の評関数として用いているが、これは一例にぎず、前の他の評価関数又はそれ以外の評価関数を使ってもよい。   FIG. 5 is a flowchart showing a procedure of motion search and correction processing. The CPU 10 shown in FIG. 1 may execute each step of the flowchart of FIG. 5 by executing a program of the optical flow calculation process 102 stored in the RAM 12, for example. However, as described above, not the CPU 10 but the GPU 13 may be provided with a function of executing the optical flow calculation process 102. In FIG. 5, SAD is used as the first evaluation function and ZSAD is used as the second evaluation function. However, this is only an example, and the above-described other evaluation functions or other evaluation functions may be used. Good.

図5及び以降の図において、フローチャートに記載された各ステップの実行順序は一例にすぎず、本願の意図する技術範囲が、記載された実行順番に限定されるものではない。例えば、Aステップの次にBステップが実行されるように本願に説明されていたとしても、Aステップの次にBステップを実行することが可能なだけでなく、Bステップの次にAステップを実行することが、物理的且つ論理的に可能である場合がある。この場合、どちらの順番でステップを実行しても、当該フローチャートの処理に影響する全ての結果が同一であるならば、本願に開示の技術の目的のためには、Bステップの次にAステップが実行されてもよいことは自明である。Aステップの次にBステップが実行されるように本願に説明されていたとしても、上記のような自明な場合を本願の意図する技術範囲から除外することを意図するものではなく、そのような自明な場合は、当然に本願の意図する技術範囲内に属する。   In FIG. 5 and subsequent figures, the execution order of each step described in the flowchart is merely an example, and the technical scope intended by the present application is not limited to the execution order described. For example, even if it is described in the present application that the B step is executed after the A step, it is not only possible to execute the B step after the A step, but also the A step after the B step. It may be physically and logically possible to perform. In this case, if all the results affecting the processing of the flowchart are the same regardless of the order in which the steps are executed, for the purpose of the technique disclosed in the present application, the A step is followed by the B step. It is obvious that may be executed. Even if it is described in the present application that the B step is executed after the A step, it is not intended to exclude the obvious case as described above from the technical scope intended by the present application. The obvious case naturally falls within the technical scope intended by the present application.

図5のステップS11において、CPU10がSAD_MINとXY_OPTとの両方を未決定とする。ここでSAD_MINはSAの計算値を格納するパラメータであり、XY_OPTは画素位置の座標データを格納するパラメータである。ステップS12において、CPU10が、探索領域全に対してSADの計算が終了したか否かを判定する。計算が終了していない場合、ステップS13に進む。   In step S11 of FIG. 5, the CPU 10 determines that both SAD_MIN and XY_OPT are undecided. Here, SAD_MIN is a parameter for storing a calculated value of SAD, and XY_OPT is a parameter for storing coordinate data of a pixel position. In step S12, the CPU 10 determines whether or not the SAD calculation has been completed for the entire search area. If the calculation has not ended, the process proceeds to step S13.

ステップS13において、CPU10は、XY_CURを探索領域中で未計算の点に設定する。ここでXY_CURは、現在のフレーム画像中の候補画素位置を示す座標データを格納するパラメータである。ステップS14において、CPU10は、XY_PREVを中心とする画素ブロックとXY_CURを中心とする画素ブロックとの間でSADを求め。即ち前述のSADの計算式に従って、絶対的な画素値を用いた相違度を計算する。ここでXY_PREVは、1つ前のフレーム画像中における動検出対象の画素位置を示す座標データである。SADの値を計算すると、CPU10は、計算結果をSAD_CURに格納する。   In step S13, the CPU 10 sets XY_CUR to an uncalculated point in the search area. Here, XY_CUR is a parameter for storing coordinate data indicating candidate pixel positions in the current frame image. In step S14, the CPU 10 obtains SAD between the pixel block centered on XY_PREV and the pixel block centered on XY_CUR. That is, the degree of difference using absolute pixel values is calculated according to the SAD calculation formula described above. Here, XY_PREV is coordinate data indicating the pixel position of the motion detection target in the previous frame image. When calculating the value of SAD, the CPU 10 stores the calculation result in SAD_CUR.

ステップS15において、CPU10は、SAD_MINが未決定である、或いは、SAD_CURがSAD_MINより小さい、の条件が満たされるか否かを判定する。この条件が満たされる場合、ステップS16において、CPU10は、SAD_CURの値をSAD_MINに入し、更に、XY_CURの値をXY_OPTに代入する。その後処理はステップS12に戻り、以降の処理を繰り返す。スップS15の判定において上記の条件が満たされない場合、処理はステップS16を実行することなくステップS12に戻り、以降の処理を繰り返す。   In step S15, the CPU 10 determines whether or not a condition that SAD_MIN is undecided or SAD_CUR is smaller than SAD_MIN is satisfied. When this condition is satisfied, in step S16, the CPU 10 substitutes the value of SAD_CUR for SAD_MIN, and further substitutes the value of XY_CUR for XY_OPT. Thereafter, the process returns to step S12, and the subsequent processes are repeated. If the above condition is not satisfied in the determination in step S15, the process returns to step S12 without executing step S16, and the subsequent processes are repeated.

ステップS12において探索領域全体に対するSADの計算が終了したと判定されると、ステップS17において、CPU10は、XY_OPTに格納される最適解の座標データが、輝度変化による誤りである可能性を判定す。ステップS18において、CPU10は、輝度変化による誤りの可能性の有無に応じて以降の処理を異なたものとする。輝度変化による誤りの可能性が無いと判定された場合、処理は終了する。   If it is determined in step S12 that the calculation of SAD for the entire search region has been completed, in step S17, the CPU 10 determines whether the coordinate data of the optimal solution stored in XY_OPT may be an error due to a luminance change. In step S18, the CPU 10 changes the subsequent processing depending on whether or not there is a possibility of an error due to a luminance change. If it is determined that there is no possibility of an error due to a change in luminance, the process ends.

ステップS18において輝度変化による誤りの可能性があると判定された場合、ステップS19で、CPU10は、XY_PREVを中心とする画素ブロックとXY_OPTを中心とする画素ブロックの間でZSADを求める。即ち前述のZSADの計算式に従って、相対的な画素値を用いた相違度を計算する。ZSADの値を計算すると、CPU10は、計算結果をSAD_REL_OPTに格納る。   If it is determined in step S18 that there is a possibility of an error due to a luminance change, in step S19, the CPU 10 obtains ZSAD between the pixel block centered on XY_PREV and the pixel block centered on XY_OPT. That is, the dissimilarity using relative pixel values is calculated according to the aforementioned ZSAD calculation formula. When calculating the value of ZSAD, the CPU 10 stores the calculation result in SAD_REL_OPT.

ステップS20で、CPU10は、XY_PREVを中心とする画素ブロックとXY_CENTERを中心とする画素ブロックとの間でZSADを求める。ここでXY_CENTER、1つ前のフレーム画像中における動き検出対象の画素位置を示す座標データであるXY_PREVに等しい、現在のフレーム画像中における画素位置を示す座標データである。ZSADの値を計算すると、CPU10は、計算結果をSAD_REL_CENTERに格納する   In step S20, the CPU 10 obtains ZSAD between the pixel block centered on XY_PREV and the pixel block centered on XY_CENTER. Here, XY_CENTER is coordinate data indicating a pixel position in the current frame image, which is equal to XY_PREV, which is coordinate data indicating a pixel position of a motion detection target in the previous frame image. When calculating the value of ZSAD, the CPU 10 stores the calculation result in SAD_REL_CENTER.

ステップS21で、CPU10は、SAD_REL_CENTERがSAD_REL_OPTよりも小さい、との条件が満たされるか否かを判定する。条件が満たされない場合、処はステップS18に戻り、以降の処理を繰り返す。条件が満たされる場合、ステップS22で、CPU10はXY_CENTERの値をXY_OPTに代入する。以上で処理を終了する。XY_OTに格納される座標データが、最終的なオプティカルフローの検出結果となる。   In step S21, the CPU 10 determines whether or not the condition that SAD_REL_CENTER is smaller than SAD_REL_OPT is satisfied. If the condition is not satisfied, the process returns to step S18 and the subsequent processes are repeated. If the condition is satisfied, in step S22, the CPU 10 substitutes the value of XY_CENTER for XY_OPT. The process ends here. The coordinate data stored in XY_OPT is the final optical flow detection result.

なお図5の処理では、ステップS17において輝度変化による誤りである可能性を判定し、動き探索処理により得られた最適解に誤りの可能性があるときにのみ、ZSADを用いた修正処理を実行している。この手順は一例にすぎず、全ての最適解に対して無条件にZSADを用いた修正処理を実行してもよい。全ての最適解に対して修正処理を実行する場合、計算に時間はかかるものの、図5に示す手順の場合と同様に、適切な最終的な動き検出結果を得ることができる。全ての最適解に対して修正処理を実行する場合であっても、ZSADの計算は最適解と静止解との2つの点(XY_OPTとXY_CENTER)についてのみ実行すればよいので、修正処理を実行することにより追加となる計算時間はごく限られたものである。図5に示す手順においては、最適解に誤りの可能性がある場合のみZSADを用いた修正処理を実行するようにしているので、修正処理に掛かる計算時間を更に短くできる。   In the process of FIG. 5, the possibility of an error due to a luminance change is determined in step S17, and the correction process using ZSAD is executed only when there is a possibility of an error in the optimal solution obtained by the motion search process. doing. This procedure is only an example, and correction processing using ZSAD may be executed unconditionally for all optimal solutions. When correction processing is executed for all optimal solutions, although it takes time to calculate, an appropriate final motion detection result can be obtained as in the case of the procedure shown in FIG. Even when correction processing is executed for all optimal solutions, the ZSAD calculation needs to be executed only for two points (XY_OPT and XY_CENTER) of the optimal solution and the static solution, so the correction processing is executed. As a result, the additional calculation time is very limited. In the procedure shown in FIG. 5, the correction process using the ZSAD is executed only when there is a possibility of an error in the optimal solution, so that the calculation time required for the correction process can be further shortened.

図6は、輝度変化による誤検出の可能性の有無を判定する手順を示すフローチャートである。この処理は、図5のフローチャートのステップS17において実行される。   FIG. 6 is a flowchart illustrating a procedure for determining whether or not there is a possibility of erroneous detection due to a change in luminance. This process is executed in step S17 of the flowchart of FIG.

ステップS21において、CPU10は、XY_OPTがY_CENTERであるか否かを判定する。即ち、動き探索処理により検出された結果が動き無しであるか否か、即ち静止解であるか否か、を判定する。動き無しと判定された場合には、ステップS5において、CPU10は、輝度変化による誤りの可能性はないと判定する。   In step S21, the CPU 10 determines whether or not XY_OPT is XY_CENTER. That is, it is determined whether or not the result detected by the motion search process is no motion, that is, whether or not it is a static solution. If it is determined that there is no movement, in step S25, the CPU 10 determines that there is no possibility of an error due to a luminance change.

ステップS21の判定において動き有りと判定された場合には、ステップS22において、CPU10は、XY_OPTとXY_CENTERとの距離が所定の閾値以上であるか否かを判定する。一般に、輝度変化により誤って動きが検出される場合、検出される動き量(移動量)は比較的小さな値となる。従って、検出された動き量が所定の閾値以上である場合には実際に動きが存在する可能性が高いと判断することが適切である。従って、ステップS22の判定において距離が所定の閾値以上である場合には、ステップS25において、CPU10は、輝度変化による誤りの可能性はないと判定する。   If it is determined in step S21 that there is motion, in step S22, the CPU 10 determines whether the distance between XY_OPT and XY_CENTER is equal to or greater than a predetermined threshold. Generally, when a motion is erroneously detected due to a luminance change, the detected motion amount (movement amount) is a relatively small value. Therefore, when the detected amount of motion is equal to or greater than a predetermined threshold, it is appropriate to determine that there is a high possibility that the motion actually exists. Therefore, if the distance is greater than or equal to the predetermined threshold in the determination in step S22, the CPU 10 determines in step S25 that there is no possibility of an error due to a luminance change.

ステップS22の判定において距離が所定の閾値より小さいである場合には、ステップS23において、CPU10は、XY_OPTとXY_CENTERとの周囲の画素値がグラデーション状の変化をしているか否かを判定する。この判定においては、XY_OPTとXY_CENTERとの間を結ぶ直線上又はその近傍に存在する画素の画素値を、XY_OPTの画素値とXY_CENTERの画素値との間を線形補間した画素値と比較してよい。例えばこれら画素値の差の絶対値を合計し、その合計値が所定の閾値以下である場合には、画素値がグラデーション状の変化をしていると判定してよい。前述のように、画素値がグラデーションである領域において輝度変化による誤った動き検出が発生するので、上記判定の結果に応じて、誤り検出の有無の可性を判定することができる。ステップS23の判定においてグラデーション状の画素値変化が検出されない場合には、ステップS25において、CPU10は、輝度変化による誤りの可能性はないと判定する。   If the distance is smaller than the predetermined threshold in the determination in step S22, in step S23, the CPU 10 determines whether or not the surrounding pixel values of XY_OPT and XY_CENTER are changing in gradation. In this determination, the pixel value of the pixel existing on or near the straight line connecting XY_OPT and XY_CENTER may be compared with the pixel value obtained by linear interpolation between the XY_OPT pixel value and the XY_CENTER pixel value. . For example, the absolute values of the differences between the pixel values are summed, and when the sum is equal to or less than a predetermined threshold value, it may be determined that the pixel values are changing in a gradation. As described above, since erroneous motion detection due to a luminance change occurs in an area where the pixel value is gradation, the possibility of error detection can be determined according to the determination result. If no gradation pixel value change is detected in the determination in step S23, in step S25, the CPU 10 determines that there is no possibility of an error due to a luminance change.

ステップS23の判定においてグラデーション状の画素値変化が検出された場合には、ステップS24において、CPU10は、輝度変化による誤りの可能性があると判定する。以上で処理を終了する。   When a gradation-like pixel value change is detected in the determination in step S23, in step S24, the CPU 10 determines that there is a possibility of an error due to a luminance change. The process ends here.

図7は、修正処理の効果を示す表である。231個の試験動画に対して、検知対象とすべき物体を人手で予め特定することにより正解データを作成しておき、この正解データと図5に示す処理による検出結果データとの一致度を計算した。この計算において、検出結果データと一致した正解データの数をTPCとし、検出結果データと一致しなかった正解データの数をFNとする。また正解データと一致した検出結果データの数をTPRとし、正解データと一致しなかった検出結果データの数をFPとする。なおここで「一致する」とは、正解データと検出結果データとのいずれかの出現時において、両者に重なり部分(重複領域)があることを意味する。   FIG. 7 is a table showing the effect of the correction process. For the 231 test videos, correct answer data is created by manually specifying an object to be detected in advance, and the degree of coincidence between the correct answer data and the detection result data obtained by the process shown in FIG. 5 is calculated. did. In this calculation, the number of correct data that matches the detection result data is TPC, and the number of correct data that does not match the detection result data is FN. The number of detection result data that matches the correct answer data is TPR, and the number of detection result data that does not match the correct answer data is FP. Here, “match” means that there is an overlapping portion (overlapping region) between the correct answer data and the detection result data when they appear.

認識精度の評価観点としては、以下の2つの性能指標を使用する。第1の性能指標である網羅率は、正解データを母集合としたときの正解率であり、全体の正解データのうちの何%に対して検出結果データが正しく出力されたのかを示す。この網羅率はTPC/(TPC+FN)により計算される。第2の性能指標である正報率は、検出結果データを母集合としたときの正解率であり、全体の検出結果データのうちの何%が正解データに一致するのかを示す。この正報率はTPR/(TPR+FP)により計算される。   As evaluation viewpoints of recognition accuracy, the following two performance indexes are used. The coverage ratio, which is the first performance index, is a correct answer rate when the correct answer data is used as a population, and indicates what percentage of the entire correct answer data the detection result data is correctly output. This coverage is calculated by TPC / (TPC + FN). The accuracy rate, which is the second performance index, is the accuracy rate when the detection result data is a population, and indicates what percentage of the entire detection result data matches the correct data. This accuracy rate is calculated by TPR / (TPR + FP).

図7には、修正処理適用前の検出結果(図5のステップS11乃至S16による動き探索処理のみの検出結果)と修正処理適用後の検出結果(図5の全てのステップによる動き探索処理と修正処理とによる検出結果)とに対する網羅率と正報率とが示される。網羅率は、修正処理の適用前と適用後とで、殆ど変化はない。正報率は、修正処理の適用前の55.6%に対し、修正処理の適用後には78.1%に向上している。   FIG. 7 shows a detection result before applying the correction process (detection result of only the motion search process in steps S11 to S16 in FIG. 5) and a detection result after applying the correction process (motion search process and correction in all the steps in FIG. 5). The detection rate by the processing) and the correct report rate are shown. The coverage rate hardly changes between before and after the application of the correction process. The correct report rate is improved to 78.1% after applying the correction process, compared to 55.6% before applying the correction process.

図8は、背景の動きの影響を取り除く処理の手順を示すフローチャートである。前述の図5のフローチャートに示す処理手順では、動き検出装置を搭載した車両が移動しており、撮像側の動きにより背景が一様に動いているような場合を想定していない。しかしながら、撮像側の動きによる背景の動きを考慮することにより図5に示すフローチャートを変形することで、撮像側が運動している場合にも修正処理を実行することが可能である。   FIG. 8 is a flowchart showing a processing procedure for removing the influence of the background motion. In the processing procedure shown in the flowchart of FIG. 5 described above, it is not assumed that the vehicle on which the motion detection device is mounted is moving and the background is moving uniformly due to the movement on the imaging side. However, by modifying the flowchart shown in FIG. 5 by considering the background movement due to the movement on the imaging side, it is possible to execute the correction process even when the imaging side is moving.

図8のステップS31において、CPU10が、画面全のオプティカルフローを取得する。具体的には、例えば図5に示す手順のうちステップS11乃至S16をCPU10が実行することにより、オプティカルフローを計算してよい。   In step S31 of FIG. 8, the CPU 10 acquires the optical flow of the entire screen. Specifically, for example, the optical flow may be calculated by the CPU 10 executing steps S11 to S16 in the procedure shown in FIG.

図9は、背景の動きの影響を取り除く処理を説明するための図である。図9(a)に示されるフレーム画像51においては、物体50が動きベクトル52等で示される動きを示している一方で、撮像側の動きにより、背景が動きベクトル53で示されるように同一方向に同一速度で動いている。図8のステップS31の処理により、図9(a)に示されるようなオプティカルフローが検出される。   FIG. 9 is a diagram for explaining processing for removing the influence of background motion. In the frame image 51 shown in FIG. 9A, the object 50 shows the movement indicated by the motion vector 52 and the like, but the background is the same direction as indicated by the motion vector 53 due to the movement on the imaging side. Are moving at the same speed. The optical flow as shown in FIG. 9A is detected by the process of step S31 of FIG.

図8のステップS32において、CPU10が背景の平均移動量を取得する。具体的には、ステップS31で求められた全ての画素の動きベクトルの平均をとり、それを背景の平均移動量としてよい。或いは、ステップS31で求められた全ての画素の動きベクトルの平均をとり、その平均動きベクトルから所定の閾値以上大きさ又は方向が異なる動きベクトルを排除し、残った動きベクトルの平均を再度とることにより、背景の平均移動量を求めてよい。また或いは、例えば車両に搭載されている速計、ハンドル角、加速度センサ、角速度センサ等に基づいて車両の動きを推定し、その推定結果とステップS31で求められた動きベクトルとから、背景の平均移動量を求めてもよい。図9(b)は、フレーム画像51において計算された背景の平均移動量の一例を示す。   In step S32 of FIG. 8, the CPU 10 acquires the average amount of movement of the background. Specifically, the average of the motion vectors of all the pixels obtained in step S31 may be taken and used as the average amount of movement of the background. Alternatively, the motion vectors of all the pixels obtained in step S31 are averaged, and motion vectors having a magnitude or direction different from the average motion vector by a predetermined threshold or larger are excluded, and the remaining motion vectors are averaged again. Thus, the average movement amount of the background may be obtained. Alternatively, for example, the motion of the vehicle is estimated based on a speedometer, a steering wheel angle, an acceleration sensor, an angular velocity sensor, etc. mounted on the vehicle, and the average of the background is calculated from the estimation result and the motion vector obtained in step S31. The amount of movement may be obtained. FIG. 9B shows an example of the average movement amount of the background calculated in the frame image 51.

ステップS33において、CPU10は、画面全体のオプティカルフローから背景の平均移動量に相当するオプティルフローを差し引く。即ち、各画素について求められた動きベクトルから、背景の平均移動量を示す動きベクトルを減算する。図9(c)は、フレーム画像51において、背景の平均移動量に相当するオプティカルフローを差し引いた後に残るオプティカルフローの一例を示す。   In step S33, the CPU 10 subtracts the optical flow corresponding to the average background movement amount from the optical flow of the entire screen. That is, the motion vector indicating the average amount of movement of the background is subtracted from the motion vector obtained for each pixel. FIG. 9C shows an example of the optical flow remaining after subtracting the optical flow corresponding to the average movement amount of the background in the frame image 51.

ステップS34において、CPU10は、背景の平均移動量を差し引いた後のオプティカルフローに基づいて、輝度変化による誤りである可能性を判定す。具体的には、背景の平均移動量を差し引いた後のオプティカルフローに基づいて、CPU10が、図5のステップS17に示される処理を実行してよい。その後、図5のステップS18乃至S22にす処理を実行することで、適切な修正処理を実現することができる。   In step S <b> 34, the CPU 10 determines the possibility of an error due to a luminance change based on the optical flow after subtracting the average amount of background movement. Specifically, based on the optical flow after subtracting the average amount of movement of the background, the CPU 10 may execute the process shown in step S17 of FIG. Thereafter, by executing the processes shown in steps S18 to S22 of FIG. 5, an appropriate correction process can be realized.

上記説明したように、背景が一様に動いている場合には、背景の平均移動量を求め、求めた平均移動量を各画素のオプティカルフローから差し引くことで、背景の動きの影響をなくすことができる。代替的に、XY_CENTERが示す座標位置の代わりに、「XY_PREV+平均移動量」の座標位置を用いて、ステップS20及びS21の計算を実行してもよい。このようにして撮像側の動きに応じた背景の動きの影響を取り除くことにより、輝度変化の影響を受けない第2の評価関数を用いて最適解と対象物が静止している静止解とのうちの最適な方の解を選択することができる。   As described above, when the background is moving uniformly, the average movement amount of the background is obtained, and the obtained average movement amount is subtracted from the optical flow of each pixel to eliminate the influence of the background movement. Can do. Alternatively, the calculation of steps S20 and S21 may be executed using the coordinate position of “XY_PREV + average movement amount” instead of the coordinate position indicated by XY_CENTER. In this way, by removing the influence of the background movement according to the movement on the imaging side, using the second evaluation function not affected by the luminance change, the optimum solution and the stationary solution where the object is stationary You can choose the best solution.

図10乃至図12は、背景の動きの異なるパターンについて説明するための図である。図10(a)に示す例では、車両60が矢印61に示す方向に直進しており、動き検出装置に接続される撮像装置が撮像視野62で示される領域を撮像している。撮像視野62は、車両60が直進する方向とは垂直な方向に向いている。この場合、図10(b)に示されるように、画面全体が同一方向に略同一速度で移動するような動きが発生する。図9を参照して説明した方法と同様にして背景の平均移動量を計算することで、撮像側の動きに応じた背景の動きの影響を取り除くことができる。但し、撮像視野62内での物までの距離に応じて移動速度が異なるので、画面全体を分割した小さな領域内での局所的な平均移動量を求めるなどの工夫をすることが望ましい。   10 to 12 are diagrams for explaining patterns with different background movements. In the example illustrated in FIG. 10A, the vehicle 60 is traveling straight in the direction indicated by the arrow 61, and the imaging device connected to the motion detection device captures an area indicated by the imaging field of view 62. The imaging field of view 62 is oriented in a direction perpendicular to the direction in which the vehicle 60 travels straight. In this case, as shown in FIG. 10B, a movement occurs in which the entire screen moves in the same direction at substantially the same speed. By calculating the average movement amount of the background in the same manner as described with reference to FIG. 9, it is possible to remove the influence of the movement of the background according to the movement on the imaging side. However, since the moving speed varies depending on the distance to the object in the imaging field of view 62, it is desirable to devise methods such as obtaining a local average moving amount in a small area obtained by dividing the entire screen.

図11(a)に示す例では、車両60が矢印61に示す方向に直進しており、動き検出装置に接続される撮像装置が撮像視野63で示される領域を撮像している。撮像視野63は、車両60が直進する方向と同一の方向に向いている。この場合、図11(b)に示されるように、画面の中心から放射状に広がる動きベクトルが発生する。例えば車両に搭載されている速度計、ハンドル角、加速度センサ、角速度センサ等に基づいて車両の動きを推定し、その推定結果と画像から求めた動きベクトルとから、背景の各部分における撮像装置の動きに由来する移動量を求めてよい。このようにして求めた背景の移動量を計算することで、撮像側の動きに応じた背景の動きの影響を取り除くことができる。この場合も、撮像視野63内での物体までの距離に応じて移動速度が異なるので、画面全体を分割した小さな領域内での局所的な平均移動量を求めるなどの工夫をすることが望ましい。   In the example illustrated in FIG. 11A, the vehicle 60 is traveling straight in the direction indicated by the arrow 61, and the imaging device connected to the motion detection device captures an area indicated by the imaging field 63. The imaging visual field 63 faces in the same direction as the direction in which the vehicle 60 goes straight. In this case, as shown in FIG. 11B, motion vectors that radiate from the center of the screen are generated. For example, the motion of the vehicle is estimated based on a speedometer, a handle angle, an acceleration sensor, an angular velocity sensor, etc. mounted on the vehicle, and the imaging device in each part of the background is estimated from the estimation result and the motion vector obtained from the image You may obtain | require the movement amount derived from a motion. By calculating the movement amount of the background thus obtained, it is possible to remove the influence of the background movement according to the movement on the imaging side. Also in this case, since the moving speed varies depending on the distance to the object in the imaging field of view 63, it is desirable to devise such as obtaining a local average moving amount within a small area obtained by dividing the entire screen.

図12(a)に示す例では、車両60が矢印64に示すように右方向に曲がるように進行しており、動き検出装置に接続される撮像装置が撮像視野65で示される領域を撮像している。撮像視野65は、車両60が進行する方向よりも左側を向いている。この場合、図12(b)に示されるように、画面全体が左側に移動するが、移動方向及び移動距離は画面上の位置に依存する。例えば車両に搭載されている速度計、ハンドル角、加速度センサ、角速度センサ等に基づいて車両の動きを推定し、その推定結果と画像から求めた動きベクトルとから、背景の各部分における撮像装置の動きに由来する移動量を求めてよい。このようにして求めた背景の移動量を計算することで、撮像側の動きに応じた背景の動き影響を取り除くことができる。この場合も、撮像視野65内での物体までの距離に応じて移動速度が異なるので、画面全体を分割した小さな領域内での局所的な平均移動量を求めるなどの工夫をすることが望ましい。   In the example shown in FIG. 12A, the vehicle 60 is traveling so as to turn right as indicated by an arrow 64, and the imaging device connected to the motion detection device captures an area indicated by the imaging visual field 65. ing. The imaging visual field 65 faces the left side from the direction in which the vehicle 60 travels. In this case, as shown in FIG. 12B, the entire screen moves to the left side, but the moving direction and moving distance depend on the position on the screen. For example, the motion of the vehicle is estimated based on a speedometer, a handle angle, an acceleration sensor, an angular velocity sensor, etc. mounted on the vehicle, and the imaging device in each part of the background is estimated from the estimation result and the motion vector obtained from the image. You may obtain | require the movement amount derived from a motion. By calculating the movement amount of the background thus obtained, it is possible to remove the influence of the background movement according to the movement on the imaging side. Also in this case, since the moving speed varies depending on the distance to the object in the imaging field of view 65, it is desirable to devise such as obtaining a local average moving amount in a small area obtained by dividing the entire screen.

以上、本発明を実施例に基づいて説明したが、本発明は上記実施例に限定されるものではなく、特許請求の範囲に記載の範囲内で様々な変形が可能である。   As mentioned above, although this invention was demonstrated based on the Example, this invention is not limited to the said Example, A various deformation | transformation is possible within the range as described in a claim.

0 CP
11
ROM
12 RA
13 GPU
14 表示インタフェース
15 映像入力インターフェース
20 1つ前のフレーム画像データ
21 現在のフレーム画像データ
33 探索範囲
10 CPU
11 ROM
12 RAM
13 GPU
14 Display Interface 15 Video Input Interface 20 Previous Frame Image Data 21 Current Frame Image Data 33 Search Range

Claims (7)

輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求め、
輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する
各段階をコンピュータにより実行する動き検出方法。
The optimal solution of the optical flow is obtained by performing motion search using the first evaluation function affected by the luminance change,
A motion detection method for selecting the optimum solution of the optimum solution and the stationary solution in which the object is stationary by using a second evaluation function that is not affected by a change in luminance. .
前記最適解が輝度変化により誤ったオプティカルフローが検出されたものである可能性の有無を判定する段階を更に含み、前記選択する段階は、前記判定する段階により前記可能性有りと判定された最適解についてのみ、前記第2の評価関数を用いて前記最適な方の解を選択する請求項1記載の動き検出方法。   The method further includes the step of determining whether or not there is a possibility that an erroneous optical flow has been detected due to a change in luminance, and the step of selecting includes selecting the optimum determined to be possible by the step of determining. The motion detection method according to claim 1, wherein only the solution is selected using the second evaluation function to select the optimum solution. 前記判定する段階は、前記最適解と前記静止解との間の距離が閾値以上である場合に前記可能性無しと判定する請求項2記載の動き検出方法。   The motion detection method according to claim 2, wherein the determining step determines that the possibility does not exist when a distance between the optimal solution and the stationary solution is equal to or greater than a threshold value. 前記判定する段階は、前記最適解と前記静止解との周辺において画素値変化がグラデーションでない場合に前記可能性無しと判定する請求項2又は3記載の動き検出方法。   4. The motion detection method according to claim 2, wherein the determining step determines that there is no possibility when a pixel value change is not gradation around the optimum solution and the stationary solution. 5. 前記第1の評価関数はSSD(Sum of Squared Difference)及びSAD(Sum of Absolute Difference)のうちの何れか1つであり、前記第2の評価関数はZSAD(Zero-mean SAD)、NCC(Normalized Cross-Correlation)、及びZNCC(Zero-mean NCC)のうちの何れか1つである請求項1乃至4何れか一項記載の動き検出方法。   The first evaluation function is one of SSD (Sum of Squared Difference) and SAD (Sum of Absolute Difference), and the second evaluation function is ZSAD (Zero-mean SAD), NCC (Normalized). The motion detection method according to any one of claims 1 to 4, wherein the motion detection method is one of Cross-Correlation) and ZNCC (Zero-mean NCC). プロセッサと、
メモリと、
を含み、前記メモリに格納されたプログラムを前記プロセッサが実行することにより、
輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求め、
輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する
各段階を実行する動き検出装置。
A processor;
Memory,
And when the processor executes a program stored in the memory,
The optimal solution of the optical flow is obtained by performing motion search using the first evaluation function affected by the luminance change,
A motion detection apparatus that executes each step of selecting an optimum solution of the optimum solution and a stationary solution in which an object is stationary by using a second evaluation function that is not affected by a luminance change.
輝度変化の影響を受ける第1の評価関数を用いて動き探索することによりオプティカルフローの最適解を求め、
輝度変化の影響を受けない第2の評価関数を用いて前記最適解と対象物が静止している静止解とのうちの最適な方の解を選択する
各段階を含む動き検出プログラム。
The optimal solution of the optical flow is obtained by performing motion search using the first evaluation function affected by the luminance change,
A motion detection program including each step of selecting an optimum solution of the optimum solution and a stationary solution in which an object is stationary by using a second evaluation function that is not affected by a luminance change.
JP2014186178A 2014-09-12 2014-09-12 Motion detection method, motion detection apparatus, and motion detection program Active JP6394216B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014186178A JP6394216B2 (en) 2014-09-12 2014-09-12 Motion detection method, motion detection apparatus, and motion detection program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014186178A JP6394216B2 (en) 2014-09-12 2014-09-12 Motion detection method, motion detection apparatus, and motion detection program

Publications (2)

Publication Number Publication Date
JP2016058019A JP2016058019A (en) 2016-04-21
JP6394216B2 true JP6394216B2 (en) 2018-09-26

Family

ID=55758758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014186178A Active JP6394216B2 (en) 2014-09-12 2014-09-12 Motion detection method, motion detection apparatus, and motion detection program

Country Status (1)

Country Link
JP (1) JP6394216B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7019309B2 (en) 2016-06-01 2022-02-15 ゼネラル・エレクトリック・カンパニイ 3D imaging system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3035420B2 (en) * 1993-03-31 2000-04-24 大倉電気株式会社 Image motion vector detection method
JP3549175B2 (en) * 1996-05-28 2004-08-04 株式会社東芝 Motion vector detection method and apparatus
JP4622265B2 (en) * 2004-03-01 2011-02-02 ソニー株式会社 Motion vector detection device, motion vector detection method, and program
JP2012068842A (en) * 2010-09-22 2012-04-05 Olympus Corp Motion vector detection apparatus, motion vector detection method, and, motion vector detection program
JP2013084140A (en) * 2011-10-11 2013-05-09 Suzuki Motor Corp Optical flow detection device and detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7019309B2 (en) 2016-06-01 2022-02-15 ゼネラル・エレクトリック・カンパニイ 3D imaging system

Also Published As

Publication number Publication date
JP2016058019A (en) 2016-04-21

Similar Documents

Publication Publication Date Title
JP6230751B1 (en) Object detection apparatus and object detection method
US10853950B2 (en) Moving object detection apparatus, moving object detection method and program
US20180114067A1 (en) Apparatus and method for extracting objects in view point of moving vehicle
EP2180695B1 (en) Apparatus and method for improving frame rate using motion trajectory
JP6188592B2 (en) Object detection apparatus, object detection method, and object detection program
JP2010097561A (en) Vehicle periphery monitoring device
JP2005209019A (en) Apparatus, method and program for obstacle detection
WO2014033936A1 (en) Image processing device, image processing method, and image processing program
JP6097150B2 (en) Image processing apparatus, image processing method, and program
JP2010102427A (en) Lane division line detection device, lane division line detection method and line division line detection program
JP2017058274A (en) Measurement device, method, and program
JP2009277021A (en) Approaching object detection apparatus and approaching object detection method
JP4962304B2 (en) Pedestrian detection device
JP6384802B2 (en) MOBILE BODY DETECTING DEVICE, IMAGE PROCESSING DEVICE, MOBILE BODY DETECTING METHOD, AND INTEGRATED CIRCUIT
KR101239718B1 (en) System and method for detecting object of vehicle surroundings
JP2012252501A (en) Traveling path recognition device and traveling path recognition program
KR101637535B1 (en) Apparatus and method for correcting distortion in top view image
US8983196B2 (en) Vehicle periphery monitoring apparatus
JP6394216B2 (en) Motion detection method, motion detection apparatus, and motion detection program
JP6407596B2 (en) Image processing apparatus and driving support system
JP2014085842A (en) White line detection device and method
JP2009181310A (en) Road parameter estimation device
JP2006080761A (en) Vehicle detector
JP2008257399A (en) Image processor
JP2018147241A (en) Image processing device, image processing method, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180723

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180813

R150 Certificate of patent or registration of utility model

Ref document number: 6394216

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150