Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7580914B2 - Image processing device, image processing method, and program - Google Patents
[go: Go Back, main page]

JP7580914B2 - Image processing device, image processing method, and program - Google Patents

Image processing device, image processing method, and program Download PDF

Info

Publication number
JP7580914B2
JP7580914B2 JP2019239379A JP2019239379A JP7580914B2 JP 7580914 B2 JP7580914 B2 JP 7580914B2 JP 2019239379 A JP2019239379 A JP 2019239379A JP 2019239379 A JP2019239379 A JP 2019239379A JP 7580914 B2 JP7580914 B2 JP 7580914B2
Authority
JP
Japan
Prior art keywords
image
feature points
feature point
motion vector
camera shake
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
JP2019239379A
Other languages
Japanese (ja)
Other versions
JP2021108035A (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2019239379A priority Critical patent/JP7580914B2/en
Publication of JP2021108035A publication Critical patent/JP2021108035A/en
Priority to JP2024190099A priority patent/JP7826423B2/en
Application granted granted Critical
Publication of JP7580914B2 publication Critical patent/JP7580914B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Description

本発明は、画像の動きを検出する画像処理技術に関する。 The present invention relates to image processing technology for detecting image movement.

従来、臨場感のある映像体験を提供するために、立体視表示用の画像撮影が可能なステレオカメラが提供されている。ステレオカメラから取り込まれた画像データを用いて動きベクトルを検出する場合、画像データにはほぼ同一被写体が撮像されているため、画像データ全体で動きベクトルを検出するのは非効率である。特許文献1には、テンプレートマッチングの方法を工夫することで、その問題を解決可能とする技術が開示されている。テンプレートマッチングでは、画像中のある2枚のフレーム画像の一方を原画像、もう一方を参照画像とする。そして、原画像上に配置した矩形領域をテンプレートブロックとし、参照画像上に配置した矩形領域をサーチ領域とし、サーチ領域の各位置においてテンプレートブロック内の画素値の分布との相関を求める。ここで、ステレオカメラが左眼画像及び左眼画像を取り込んだ場合、左眼画像におけるサーチ領域と右眼画像におけるサーチ領域とで、重複する領域が存在する。特許文献1の技術では、その重複したサーチ領域に対しては、左眼画像または右眼画像のどちらか一方でのみテンプレートマッチングを行うことによって、演算コストを低減させている。 Conventionally, in order to provide a realistic video experience, stereo cameras capable of capturing images for stereoscopic display have been provided. When detecting a motion vector using image data captured by a stereo camera, since the image data contains images of almost the same subject, it is inefficient to detect the motion vector in the entire image data. Patent Document 1 discloses a technology that can solve this problem by devising a template matching method. In template matching, one of two frame images in an image is used as the original image and the other is used as the reference image. Then, a rectangular area placed on the original image is used as the template block, and a rectangular area placed on the reference image is used as the search area, and a correlation with the distribution of pixel values in the template block is obtained at each position of the search area. Here, when the stereo camera captures a left eye image and a right eye image, there is an overlapping area between the search area in the left eye image and the search area in the right eye image. In the technology of Patent Document 1, template matching is performed on only one of the left eye image or the right eye image for the overlapping search area, thereby reducing the computation cost.

特開2000-165909号公報JP 2000-165909 A

前述したように特許文献1の手法では、演算コストを低減させるために、左眼画像と右眼画像とで重複したサーチ領域に対して、左眼画像または右眼画像のどちらか一方でのみテンプレートマッチングを行う。しかしながら、手振れ等に起因したカメラの動きによっては、テンプレートブロック内の画像が左眼画像と右眼画像とで異なる方向に移動することがある。この場合、正しくテンプレートマッチングが実行できなくなり、その結果、動きベクトルを正しく検出できなくなって、動きベクトルの検出性能が低下する。 As mentioned above, in the method of Patent Document 1, in order to reduce computational costs, template matching is performed on only one of the left eye image or the right eye image for a search area that overlaps between the left eye image and the right eye image. However, depending on the movement of the camera caused by camera shake or the like, the image in the template block may move in different directions in the left eye image and the right eye image. In this case, template matching cannot be performed correctly, and as a result, motion vectors cannot be detected correctly, resulting in reduced motion vector detection performance.

そこで、本発明は、演算コストの低減に加えて、動きベクトルの検出性能の向上をも可能にすることを目的とする。 Therefore, the present invention aims to reduce computational costs as well as improve motion vector detection performance.

本発明の画像処理装置は、複数の光学系による視差を有した複数の画像を取得する取得手段と、前記画像から特徴点を抽出する抽出手段と、前記特徴点を基に動きベクトルを検出する検出手段と、前記複数の画像のうちの第1の画像から前記抽出された特徴点を、前記複数の画像のうちの第2の画像から前記抽出された特徴点に対して、前記視差を加味して反映する反映手段と、前記複数の光学系による視差を有した前記複数の画像を撮像した撮像装置の回転方向の振れを検出する手振れ検出手段と、を有し、前記検出手段、前記第2の画像については前記第1の画像の特徴点が前記反映された特徴点を基に、前記動きベクトルの検出を行い、前記手振れ検出手段は、前記第1の画像の前記特徴点を基に検出された動きベクトルと、前記第2の画像の特徴点に前記第1の画像の特徴点が前記反映された特徴点を基に検出された動きベクトルとを用いて前記撮像装置の回転方向の手振れを検出することを特徴とする。 The image processing device of the present invention comprises an acquisition means for acquiring a plurality of images having parallax due to a plurality of optical systems, an extraction means for extracting feature points from the images, a detection means for detecting a motion vector based on the feature points , a reflection means for reflecting the feature points extracted from a first image of the plurality of images on the feature points extracted from a second image of the plurality of images while taking into account the parallax, and a camera shake detection means for detecting camera shake in the rotational direction of an imaging device that captured the plurality of images having parallax due to the plurality of optical systems, wherein the detection means detects the motion vector for the second image based on feature points in which the feature points of the first image are reflected, and the camera shake detection means detects camera shake in the rotational direction of the imaging device using the motion vector detected based on the feature points of the first image and the motion vector detected based on the feature points of the second image in which the feature points of the first image are reflected .

本発明によれば、演算コストの低減に加えて、動きベクトルの検出性能の向上をも図ることが可能になる。 The present invention makes it possible to reduce computational costs and also improve motion vector detection performance.

実施形態のデジタルカメラの構成例を示す図である。FIG. 1 illustrates an example of the configuration of a digital camera according to an embodiment. 動きベクトル検出部の構成例を示す図である。FIG. 4 is a diagram illustrating an example of the configuration of a motion vector detection unit. グリッド配置と特徴点、テンプレートマッチング領域の説明図である。1A and 1B are explanatory diagrams of a grid arrangement, feature points, and a template matching area. 動きベクトル検出部の処理を示すフローチャートである。13 is a flowchart showing a process performed by a motion vector detection unit. 特徴点抽出部の構成例を示す図である。FIG. 4 illustrates an example of the configuration of a feature point extraction unit. 精度判定部における画素値と判定との関係を示す図である。13 is a diagram showing the relationship between pixel values and judgments in an accuracy judgment unit. FIG. 追跡先特徴点決定部の処理を示すフローチャートである。13 is a flowchart showing a process of a tracking target feature point determining unit. 回転方向の手振れが生じた場合の動きベクトル分布例を示す図である。11A and 11B are diagrams illustrating an example of motion vector distribution when camera shake occurs in a rotational direction; 2つのイメージサークルの例を示す図である。FIG. 1 is a diagram showing examples of two image circles. 2つのイメージサークルの画像の動きベクトル分布例を示す図である。FIG. 13 is a diagram showing an example of motion vector distribution of two image circle images. 特徴点反映処理の説明に用いる図である。FIG. 11 is a diagram used to explain feature point reflection processing. 特徴点反映処理のフローチャートである。13 is a flowchart of a feature point reflection process. 特徴点数設定処理のフローチャートである。13 is a flowchart of a feature point number setting process. 特徴点の点数が適切な場合の特徴点分布例を示す図である。FIG. 13 is a diagram showing an example of feature point distribution when the number of feature points is appropriate. 11点の時の動きベクトル検出に関するタイミングチャートである。13 is a timing chart relating to motion vector detection in the case of 11 points. 特徴点の点数が不適切な場合の特徴点分布例を示す図である。FIG. 13 is a diagram showing an example of feature point distribution when the number of feature points is inappropriate. 16点の時の動きベクトル検出に関するタイミングチャートである。13 is a timing chart relating to motion vector detection in the case of 16 points.

以下、添付図面を参照して本発明に係る実施形態について説明する。
<第1の実施形態>
図1は、本発明の第1の実施形態に係る画像処理装置の一適用例としてのデジタルカメラの概略的な機能ブロック構成を示した図である。本実施形態のデジタルカメラは、左右の眼に対応した例えば広画角な2つの光学系によって撮像された、左右の眼に対応した視差を有する2つの視差画像のデータを取得可能な撮像装置(以下、ステレオカメラとする)であるとする。なお本実施形態では、2つの光学系が並列に並んでいる構成を例に挙げるが、これには限定されず、3つ以上の複数の光学系によって構成されていてもよい。
Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings.
First Embodiment
1 is a diagram showing a schematic functional block configuration of a digital camera as an application example of an image processing device according to a first embodiment of the present invention. The digital camera of this embodiment is an imaging device (hereinafter, referred to as a stereo camera) capable of acquiring data of two parallax images having parallax corresponding to the left and right eyes, which are captured by, for example, two optical systems with wide angles of view corresponding to the left and right eyes. Note that in this embodiment, a configuration in which two optical systems are arranged in parallel is given as an example, but the present invention is not limited to this, and may be configured by three or more optical systems.

図1において、第1の結像光学部101及び第2の結像光学部131は、それぞれレンズおよび絞りなどを備えており、それら2つで1組となるように光学系が並列に構成されている。撮影の際、第1の結像光学部101及び第2の結像光学部131は、フォーカス調節および露出調節を行い、撮像素子102に対してそれら2つの光学系のイメージサークルを結像する。撮像素子102に対する2つの光学系のイメージサークルの具体例については後に図9を用いて説明する。 In FIG. 1, the first imaging optical unit 101 and the second imaging optical unit 131 each include a lens and an aperture, and the two are arranged in parallel to form a pair of optical systems. When taking a photograph, the first imaging optical unit 101 and the second imaging optical unit 131 perform focus adjustment and exposure adjustment, and form an image circle of the two optical systems on the image sensor 102. A specific example of the image circle of the two optical systems on the image sensor 102 will be described later using FIG. 9.

撮像素子102は、光学像を電気信号(アナログ画像信号)に変換する光電変換機能を有し、CCDやCMOSセンサ等で構成される。A/D変換部103は、撮像素子102からのアナログ画像信号をデジタル画像データ(以下、画像データを、適宜、画像とのみ表記する)に変換する。 The image sensor 102 has a photoelectric conversion function that converts an optical image into an electrical signal (analog image signal), and is composed of a CCD or CMOS sensor. The A/D converter 103 converts the analog image signal from the image sensor 102 into digital image data (hereinafter, image data will be referred to simply as image, where appropriate).

揮発性メモリであるDRAM107は、データを記憶するメモリであり、所定枚数の静止画像、所定時間の動画像、音声等のデータ、およびCPU112の動作用の定数、プログラム等を格納するのに十分な記憶容量を備えている。DRAMはダイナミックRAM(Dynamic Random Access Memory)の略称である。DRAMは、書き込みを行って時間が経つと内容が失われるため、一定時間ごとにリフレッシュを行なって記憶を維持する必要がある。メモリ制御部106は、CPU112或いはデータ転送部105からの指示に応じて、DRAM107へのデータ書き込み及びデータ読み出しを行う。 DRAM 107 is a volatile memory that stores data and has sufficient storage capacity to store a predetermined number of still images, a predetermined amount of moving images, audio data, and other data, as well as constants and programs for the operation of CPU 112. DRAM is an abbreviation for Dynamic Random Access Memory (Dynamic Random Access Memory). Since the contents of DRAM are lost over time after writing, it is necessary to refresh it at regular intervals to maintain the memory. Memory control unit 106 writes data to and reads data from DRAM 107 in response to instructions from CPU 112 or data transfer unit 105.

不揮発性メモリ制御部108は、CPU112からの指示に応じて、不揮発性メモリであるROM109にデータの書き込み及び読み出しを行う。ROM109は、電気的に消去・記録可能なメモリであり、EEPROM等が用いられる。ROM109には、CPU112の動作用の定数、プログラム等が記憶される。 The non-volatile memory control unit 108 writes and reads data to the ROM 109, which is a non-volatile memory, in response to instructions from the CPU 112. The ROM 109 is an electrically erasable and recordable memory, and an EEPROM or the like is used. The ROM 109 stores constants, programs, etc. for the operation of the CPU 112.

バス114はシステムバスであり、バス115は画像データバスである。
データ転送部105は、データ転送を行う複数のDMAC(Direct Memory Access Controller)で構成されている。なお、DMAはダイレクトメモリアクセス(Direct Memory Access)の略称である。DMAとはコンピュータシステム内でのデータ転送方式の一つであり、CPUを介さずに周辺機器やメインメモリ(RAM)などの間で直接データ転送を行う方式である。またDMACはDMAコントローラの略称である。DMAコントローラとは、メモリとメモリ、メモリとハードウェア間で直接データ転送を制御するコントローラである。
The bus 114 is a system bus, and the bus 115 is an image data bus.
The data transfer unit 105 is composed of multiple DMACs (Direct Memory Access Controllers) that perform data transfer. DMA is an abbreviation for Direct Memory Access. DMA is one of the data transfer methods within a computer system, and is a method of directly transferring data between peripheral devices and main memory (RAM) without going through the CPU. DMAC is also an abbreviation for DMA controller. A DMA controller is a controller that controls direct data transfer between memories and between memories and hardware.

CPU112は、ステレオカメラ全体の制御を司るマイクロコンピュータ等で構成され、各機能ブロックに対して動作指示を行い、各種の制御処理を実行する。CPU112は、バス114を介して画像処理部104、データ転送部105、メモリ制御部106、不揮発性メモリ制御部108、表示制御部110、操作部113、撮像素子102等を制御する。なお、CPU112におけるマイクロコンピュータの実行は、ROM109に記録されたプログラムを実行することにより、本実施形態に係る各処理を実現する。 The CPU 112 is composed of a microcomputer that controls the entire stereo camera, and issues operational instructions to each functional block to execute various control processes. The CPU 112 controls the image processing unit 104, data transfer unit 105, memory control unit 106, non-volatile memory control unit 108, display control unit 110, operation unit 113, image sensor 102, etc. via the bus 114. The microcomputer in the CPU 112 executes programs recorded in the ROM 109 to realize each process according to this embodiment.

表示部111は、液晶モニタ等から成り、表示制御部110により制御され、各種画像データ等を表示部111に表示する。
操作部113は、ユーザにより操作されるスイッチやボタン等を含み、電源のON/OFF、シャッタのON/OFF等の操作に使用される。
The display unit 111 is made up of a liquid crystal monitor or the like, and is controlled by the display control unit 110 to display various image data and the like on the display unit 111 .
The operation unit 113 includes switches, buttons, and the like that are operated by the user, and is used for operations such as turning the power on/off and the shutter on/off.

画像処理部104は、ホワイトバランス調整、色補間、縮小/拡大、フィルタリング、符号化、復号などの各種画像処理を行う部分及びバッファメモリ等から構成されており、さらに動きベクトル検出部121と被写体検出部122等を具備する。また、画像処理部104は、2つの光学系のイメージサークルで撮像された画像データに対して、光学中心ずれを考慮して各種画像処理を実施し、立体視表示用の画像データを生成することができる。 The image processing unit 104 is composed of a buffer memory and other components that perform various types of image processing, such as white balance adjustment, color interpolation, reduction/enlargement, filtering, encoding, and decoding, and further includes a motion vector detection unit 121 and a subject detection unit 122. The image processing unit 104 also performs various types of image processing on image data captured in the image circles of the two optical systems, taking into account the optical center shift, and can generate image data for stereoscopic display.

被写体検出部122は、既知の手法により、撮像された画像から被写体の顔部分や物体部分など主となる被写体を検出する。被写体の座標は例えば画像の左上の開始座標と右下の終了座標とで有効範囲が表現され、当該被写体の座標情報はデータ転送部105及びメモリ制御部106を介してDRAM107に格納される。 The subject detection unit 122 detects the main subject, such as the face or object of the subject, from the captured image using a known method. The effective range of the subject's coordinates is expressed, for example, by the start coordinates in the upper left corner of the image and the end coordinates in the lower right corner, and the subject's coordinate information is stored in the DRAM 107 via the data transfer unit 105 and memory control unit 106.

動きベクトル検出部121は、画像データを基に動きベクトルを検出する。
ここで、動きベクトルを検出する技術としては、動きベクトルの検出精度を向上させるために、特徴点を抽出し、抽出した特徴点にテンプレートブロックを配置する技術が知られている。ただし、画像全体で特徴点抽出を行うと、特徴点の分布は不均一になることが多い。そして、不均一な特徴点に基づいて得られた動きベクトルを、例えば手振れ補正のために使用すると、特徴点の集中した領域が主となる手振れ補正となってしまう。そこで、特徴点を均一に分布させるために、画像をグリッド状に分割して、特徴の大きさを表す特徴値を画素ごとに計算し、各グリッド内で特徴値が最も大きい画素を特徴点として抽出する技術がある。本実施形態の動きベクトル検出部121は、このようにして抽出した特徴点を中心とし、予め設定されたサイズの矩形領域状のサーチ領域及びテンプレート領域を用いたテンプレートマッチング処理を行う。
The motion vector detection unit 121 detects a motion vector based on the image data.
Here, as a technique for detecting a motion vector, a technique is known in which feature points are extracted and template blocks are arranged at the extracted feature points in order to improve the detection accuracy of the motion vector. However, when feature points are extracted from the entire image, the distribution of feature points is often uneven. If a motion vector obtained based on uneven feature points is used for, for example, image stabilization, the image stabilization will be dominated by the area where feature points are concentrated. Therefore, in order to distribute feature points uniformly, there is a technique in which an image is divided into a grid, a feature value representing the size of the feature is calculated for each pixel, and the pixel with the largest feature value in each grid is extracted as the feature point. The motion vector detection unit 121 of this embodiment performs template matching processing using a rectangular search area and a template area of a preset size centered on the feature point extracted in this way.

図2は、動きベクトル検出部121の構成例を示したブロック図である。また、図3は、動きベクトル検出部121が読み出すグリッド配置と特徴点、テンプレートマッチング領域の関係を示す図である。さらに図4は、図2に示した動きベクトル検出部121の各ブロックによる処理の流れを示したフローチャートである。 Fig. 2 is a block diagram showing an example of the configuration of the motion vector detection unit 121. Fig. 3 is a diagram showing the relationship between the grid arrangement, feature points, and template matching area read by the motion vector detection unit 121. Fig. 4 is a flowchart showing the flow of processing by each block of the motion vector detection unit 121 shown in Fig. 2.

動きベクトル検出部121は、複数のフレーム画像間で特徴点を追跡し、動きベクトルを検出する。動きベクトル検出部121は、時間軸上で連続する2枚のフレームの画像の一方を原画像(現フレームの画像)とし、もう一方を参照画像(前フレームの画像)とし、特徴点を中心とする参照画像の矩形領域内と原画像の矩形領域内の画素値で相関値演算処理を行う。そして、動きベクトル検出部121は、相関値演算処理によって検出した動きベクトルを基に、被写体の追跡を行う。 The motion vector detection unit 121 tracks feature points between multiple frame images and detects motion vectors. The motion vector detection unit 121 takes one of two consecutive frame images on the time axis as an original image (image of the current frame) and the other as a reference image (image of the previous frame), and performs correlation value calculation processing on pixel values within a rectangular area of the reference image centered on the feature point and a rectangular area of the original image. The motion vector detection unit 121 then tracks the subject based on the motion vector detected by the correlation value calculation processing.

以下、図2以降の各図を参照しながら動きベクトル検出部121の構成及び動作について説明する。
まず図3に示した、グリッド配置と特徴点、テンプレートマッチング領域の関係について説明する。動きベクトル検出部121は、図3に示すように、フレーム画像を複数のグリッドに分割する。各グリッドは、予め設定されたサイズの特徴点配置グリッド302及び周辺グリッド301(図3中のドット模様が付されたグリッド)として、水平,垂直方向にそれぞれ設定された個数分配置される。動きベクトル検出部121は、特徴点配置グリッド302毎に、特徴点303を一つ抽出する。図3の例は、開始座標が(Xs,Ys)で終了座標が(Xe,Ye)の特徴点配置グリッド302において、座標(x,y)で示された特徴点303が抽出された例を示している。周辺グリッド301は、各特徴点配置グリッド302からなる特徴点配置グリッド群の周囲に配置される。周辺グリッド301は、特徴点抽出は実施されないが、テンプレートマッチングで使用される領域である。動きベクトル検出部121は、現フレームである原画像から抽出した特徴点303の座標(x,y)を中心とし、前フレームの参照画像で予め決めたサイズの矩形領域のサーチ領域305及びテンプレート領域304を設定してテンプレートマッチング処理を行う。
The configuration and operation of the motion vector detection unit 121 will be described below with reference to FIG. 2 and subsequent figures.
First, the relationship between the grid arrangement, the feature points, and the template matching area shown in FIG. 3 will be described. As shown in FIG. 3, the motion vector detection unit 121 divides a frame image into a plurality of grids. The grids are arranged in a predetermined size as feature point arrangement grids 302 and peripheral grids 301 (grids with dot patterns in FIG. 3) in a predetermined number in the horizontal and vertical directions. The motion vector detection unit 121 extracts one feature point 303 from each feature point arrangement grid 302. The example in FIG. 3 shows an example in which a feature point 303 indicated by coordinates (x, y) is extracted from a feature point arrangement grid 302 whose start coordinates are (Xs, Ys) and whose end coordinates are (Xe, Ye). The peripheral grids 301 are arranged around a group of feature point arrangement grids made up of the feature point arrangement grids 302. The peripheral grids 301 are an area in which feature point extraction is not performed but which is used in template matching. The motion vector detection unit 121 performs template matching processing by setting a rectangular search area 305 and a template area 304 of a predetermined size in the reference image of the previous frame, centered on the coordinates (x, y) of a feature point 303 extracted from the original image, which is the current frame.

次に図4のフローチャートを参照して、動きベクトル検出部121の各ブロックにおける処理の概要を説明する。
ステップS401において、データ転送部105が具備する第1のRDDMAC221は、バス115を介して、DRAM107から動きベクトル検出対象となる現フレームの入力画像データ241を読み出す。なお、RDDMACは、メモリからハードウェアに直接データ読み出す制御を行うコントローラである。このとき読み出すデータ量は、図3に示されるように設定された特徴点配置グリッド302及び周辺グリッド301のサイズに応じたデータ量となされる。なお、入力画像データ241は、画像処理部104において各種画像処理が実施された後のデータである。第1のRDDMAC221によってグリッド単位で読み出された画像データ241は、マッチング用画像生成部201及び特徴点抽出部202に出力される。また、第1のRDDMAC221は、読み出したグリッドの座標位置を示すグリッド座標情報252を、後述する追跡先特徴点決定部205に出力する。ステップS401の処理後、動きベクトル検出部121は、ステップS402およびその次のステップS403の処理と、ステップS404の処理とを並行して実施する。
Next, an overview of the processing in each block of the motion vector detection unit 121 will be described with reference to the flowchart of FIG.
In step S401, the first RDDMAC 221 included in the data transfer unit 105 reads input image data 241 of a current frame to be subjected to motion vector detection from the DRAM 107 via the bus 115. The RDDMAC is a controller that controls direct data reading from memory to hardware. The amount of data read at this time is set to an amount according to the sizes of the feature point arrangement grid 302 and the surrounding grid 301 set as shown in FIG. 3. The input image data 241 is data after various image processes are performed in the image processing unit 104. The image data 241 read in units of grids by the first RDDMAC 221 is output to the matching image generation unit 201 and the feature point extraction unit 202. The first RDDMAC 221 also outputs grid coordinate information 252 indicating the coordinate position of the read grid to the tracking target feature point determination unit 205 described later. After the process of step S401, the motion vector detection unit 121 performs the process of step S402, the process of the following step S403, and the process of step S404 in parallel.

ステップS402に進むと、マッチング用画像生成部201は、動きベクトル検出時のテンプレートマッチングに使用するマッチング用画像を生成し、WRDMAC231に出力する。なお、WRDMACは、ハードウェアからメモリに直接データ書き出す制御を行うコントローラである。また、マッチング用画像生成部201は、バンドパスフィルタ回路を有し、テンプレートマッチング処理に不要な画像信号の高周波成分と低周波成分をカットする。 When proceeding to step S402, the matching image generation unit 201 generates a matching image to be used for template matching during motion vector detection, and outputs it to the WRDMAC 231. The WRDMAC is a controller that controls the direct writing of data from the hardware to memory. The matching image generation unit 201 also has a band-pass filter circuit, which cuts out high-frequency and low-frequency components of the image signal that are not required for template matching processing.

次にステップS403に進むと、データ転送部105が具備するWRDMAC231は、バス115を介してDRAM107に入力されたマッチング用画像データ242を書き出す処理を行う。また、DRAM107には、現フレームに対して時間軸上で前である前フレームで生成されたマッチング用画像データ243が格納されている。ステップS403の後、動きベクトル検出部121の処理はステップS405に進む。 Next, in step S403, the WRDMAC 231 of the data transfer unit 105 performs processing to write out the matching image data 242 input to the DRAM 107 via the bus 115. The DRAM 107 also stores matching image data 243 generated in the previous frame, which precedes the current frame on the time axis. After step S403, the processing of the motion vector detection unit 121 proceeds to step S405.

またステップS404に進むと、特徴点抽出部202または特徴点反映部207は、現フレームの新規特徴点を算出する。
ここで、特徴点抽出部202における特徴点抽出処理について説明する。図5は、特徴点抽出部202の構成例を示したブロック図である。特徴点抽出部202は、特徴フィルタ部501、特徴評価部502、および特徴点決定部503を有して構成されている。
In step S404, the feature point extraction unit 202 or the feature point reflection unit 207 calculates new feature points for the current frame.
Here, a description will be given of the feature point extraction process in the feature point extraction unit 202. Fig. 5 is a block diagram showing an example of the configuration of the feature point extraction unit 202. The feature point extraction unit 202 is configured to include a feature filter unit 501, a feature evaluation unit 502, and a feature point determination unit 503.

特徴フィルタ部501は、バンドパスフィルタ、水平微分フィルタ、垂直微分フィルタ、平滑化フィルタなど、複数のフィルタを有して構成される。特徴フィルタ部501は、まずバンドパスフィルタによって画像データから不要な高周波成分と低周波成分をカットする。次に特徴フィルタ部501は、バンドパスフィルタ処理後のデータに対し、さらに水平微分フィルタによる水平方向の微分フィルタ処理と、垂直微分フィルタによる垂直方向の微分フィルタ処理とを施す。そして、特徴フィルタ部501は、水平方向の微分フィルタ処理を施した画像データと、垂直方向の微分フィルタ処理を施した画像データとの、各々に対して平滑化フィルタ処理を施した後の画像データを、特徴評価部502に出力する。 The feature filter unit 501 is configured with multiple filters, such as a bandpass filter, a horizontal differential filter, a vertical differential filter, and a smoothing filter. The feature filter unit 501 first cuts out unnecessary high-frequency and low-frequency components from the image data using a bandpass filter. Next, the feature filter unit 501 further performs horizontal differential filtering using a horizontal differential filter and vertical differential filtering using a vertical differential filter on the data after bandpass filtering. The feature filter unit 501 then outputs the image data after smoothing filtering on each of the image data after horizontal differential filtering and the image data after vertical differential filtering to the feature evaluation unit 502.

特徴評価部502は、特徴フィルタ部501によりフィルタ処理された後のグリッド単位の画像データから、特徴点を算出する。例えば、特徴評価部502は、所定の特徴評価式を用いた演算を行って、画素ごとに2つのエッジの交点や曲率が極大である曲線状の点など画素の周辺の微分値が多方向に大きい点を、特徴値として算出する。 The feature evaluation unit 502 calculates feature points from the image data in grid units after filtering by the feature filter unit 501. For example, the feature evaluation unit 502 performs a calculation using a predetermined feature evaluation formula and calculates, as feature values, points where the differential values around a pixel are large in multiple directions, such as the intersection of two edges or curved points with maximum curvature for each pixel.

以下、ここでは、いわゆるShi and Tomasiの手法を例に挙げて、特徴評価部502における特徴点の算出例について説明する。
特徴評価部502は、まず、前述した水平微分フィルタによってフィルタ処理が施されたデータと、垂直微分フィルタによってフィルタ処理が施されたデータとを用いて、下記の式(1)に示す演算式により、自己相関行列Hを作成する。なお、式中のIxは水平微分フィルタを施した結果を表し、Iyは垂直微分フィルタを施した結果を表しており、式(1)は、ガウシアンフィルタGを畳み込んで自己相関行列Hを作成する演算式である。
Hereinafter, an example of calculation of feature points in the feature evaluation unit 502 will be described, taking the so-called Shi and Tomasi method as an example.
First, the feature evaluation unit 502 uses the data filtered by the above-mentioned horizontal differential filter and the data filtered by the vertical differential filter to create an autocorrelation matrix H according to the following formula (1): In the formula, Ix represents the result of applying the horizontal differential filter, and Iy represents the result of applying the vertical differential filter, and formula (1) is a formula for convolving a Gaussian filter G to create the autocorrelation matrix H.

Figure 0007580914000001
Figure 0007580914000001

そして、特徴評価部502は、下記の式(2)に示すShi and Tomasiの特徴評価式により特徴値を算出する。なお、式(2)は、式(1)の自己相関行列Hの固有値λ1、λ2のうち、小さい方の固有値を特徴値とすることを示している。 Then, the feature evaluation unit 502 calculates the feature value by the Shi and Tomasi feature evaluation formula shown in the following formula (2). Note that formula (2) indicates that the smaller eigenvalue of λ1 and λ2 of the autocorrelation matrix H in formula (1) is set as the feature value.

Shi and Tomasi=min(λ1,λ2) 式(2) Shi and Tomasi = min(λ1, λ2) Equation (2)

このようにして特徴評価部502にて画素ごとに算出された特徴値は、特徴点決定部503に送られる。
特徴点決定部503は、グリッド毎に、特徴評価部502にてグリッド内の各画素について算出された特徴値の中で最も大きい値を持つ画素を、そのグリッド内の特徴点として決定する。本実施形態の場合、特徴点の情報は、グリッドの左上端を座標(0,0)とした相対座標(PX,PY)が用いられる。なお、その特徴点座標は、フレーム画像における絶対座標により表現されてもよい。そして、特徴点決定部503により決定された特徴点の情報(以下、特徴点座標情報とする)は、特徴点抽出部202が具備している内部メモリに格納される。この内部メモリは、前フレームから取得された各特徴点の情報と現フレームから取得された各特徴点座標情報とを格納できるだけの容量を有している。
The feature value calculated for each pixel in this manner by the feature evaluation unit 502 is sent to a feature point determination unit 503 .
The feature point determination unit 503 determines, for each grid, the pixel having the largest feature value among the feature values calculated by the feature evaluation unit 502 for each pixel in the grid as the feature point in that grid. In the case of this embodiment, the feature point information is expressed as relative coordinates (PX, PY) with the upper left corner of the grid being coordinates (0, 0). The feature point coordinates may be expressed as absolute coordinates in the frame image. The feature point information determined by the feature point determination unit 503 (hereinafter referred to as feature point coordinate information) is stored in an internal memory provided in the feature point extraction unit 202. This internal memory has a capacity sufficient to store the information of each feature point obtained from the previous frame and the feature point coordinate information obtained from the current frame.

特徴点抽出部202は、マッチング処理部203にて対応するグリッドのテンプレートマッチング処理が開始される際に、前フレームで算出された特徴点座標情報251を、内部メモリから読み出して追跡先特徴点決定部205に出力する。
追跡先特徴点決定部205は、特徴点抽出部202から送られてきた特徴点座標情報251を、追跡先特徴点座標情報257として、データ転送部105が具備している第2のRDDMAC222に出力する。
When the matching processing unit 203 starts template matching processing of the corresponding grid, the feature point extraction unit 202 reads out feature point coordinate information 251 calculated in the previous frame from the internal memory and outputs it to the tracked feature point determination unit 205.
The tracked feature point determination unit 205 outputs the feature point coordinate information 251 sent from the feature point extraction unit 202 as tracked feature point coordinate information 257 to the second RDDMAC 222 included in the data transfer unit 105 .

次に特徴点反映部207における特徴点反映処理について説明する。
ここでは、第1の結像光学部101から取り込まれた画像を第1の画像と呼び、第2の結像光学部131から取り込まれた画像を第2の画像と呼ぶ。
特徴点反映部207は、特徴点抽出部202が第1の画像から抽出した特徴点を、第2の画像の特徴点に対して視差を加味するようにして反映する。視差をu、被写体までの距離をZ、第1の結像光学部101及び第2の結像光学部131の互いの距離である基線距離をd、それら光学部の焦点距離をfとすると、視差uは下記の式(3)で求められる。
Next, the feature point reflection process in the feature point reflection unit 207 will be described.
Here, the image captured by the first imaging optical section 101 is called a first image, and the image captured by the second imaging optical section 131 is called a second image.
The feature point reflecting unit 207 reflects the feature points extracted from the first image by the feature point extracting unit 202 onto the feature points of the second image in such a way that the parallax is taken into consideration. If the parallax is u, the distance to the subject is Z, the base line distance between the first imaging optical unit 101 and the second imaging optical unit 131 is d, and the focal length of these optical units is f, the parallax u can be calculated by the following formula (3).

u=(d×f)/Z 式(3) u=(d×f)/Z Formula (3)

さらに特徴点反映部207は、第1の画像の任意の特徴点座標(x,y)に対して、視差uを加算することで、視差が加味された第2の画像の特徴点座標(x+u,y)を求める。反映元である現フレーム特徴点はSRAM206に格納されており、前述のような特徴点反映処理がなされた新規特徴点が、特徴点反映部207の具備する内部メモリに格納される。 The feature point reflection unit 207 further adds the parallax u to any feature point coordinate (x, y) in the first image to obtain the feature point coordinate (x+u, y) in the second image with the parallax added. The current frame feature points that are the source of reflection are stored in the SRAM 206, and new feature points that have been subjected to the feature point reflection process described above are stored in the internal memory of the feature point reflection unit 207.

そして特徴点反映部207は、マッチング処理部203にて対応するグリッドのテンプレートマッチング処理が開始される際に、特徴点反映処理がなされた特徴点座標情報259を、内部メモリから読み出して追跡先特徴点決定部205に出力する。
追跡先特徴点決定部205は、特徴点反映部207から送られてきた特徴点座標情報259を、第2の画像における追跡先特徴点座標情報257として、データ転送部105が具備している第2のRDDMAC222に出力する。
なお、ステレオカメラから取り込まれた画像に対して、前述の特徴点反映処理による新規特徴点を算出する具体的な説明は後述する。
Then, when the matching processing unit 203 starts template matching processing of the corresponding grid, the feature point reflection unit 207 reads out from the internal memory the feature point coordinate information 259 that has been subjected to the feature point reflection processing, and outputs it to the tracked target feature point determination unit 205.
The tracked feature point determination unit 205 outputs the feature point coordinate information 259 sent from the feature point reflection unit 207 to the second RDDMAC 222 included in the data transfer unit 105 as tracked feature point coordinate information 257 in the second image.
A specific description of how new feature points are calculated for images captured by the stereo camera through the feature point reflection process described above will be given later.

図4のフローチャートに説明を戻す。
前述したようにそれぞれ並行して行われるステップS404とステップS403の処理後、動きベクトル検出部121は、ステップS405に処理を進める。
ステップS405に進むと、第2のRDDMAC222は、前述のようにして前フレームにおいて算出された追跡先特徴点座標情報257を中心とし、予め設定されたサイズの矩形領域のデータを読み出す。すなわち現フレームで生成されたマッチング用画像データ242からは、図3のサーチ領域305のデータが、一方、前フレームで生成されたマッチング用画像データ243からは、テンプレート領域304のデータが読み出される。そして、それら読み出されたサーチ領域画像データ253とテンプレート領域画像データ254は、マッチング処理部203へ送られる。ただし、最初のテンプレートマッチング処理では、前フレームから追跡先特徴点座標を算出することができないため、全て現フレームで算出された新規特徴点座標を用いた処理が実施される。ステップS405の後、動きベクトル検出部121の処理は、ステップS406に進む。
Returning to the flowchart of FIG.
After the processes of steps S404 and S403, which are performed in parallel as described above, the motion vector detection unit 121 advances the process to step S405.
In step S405, the second RDDMAC 222 reads out data of a rectangular area of a preset size centered on the tracking target feature point coordinate information 257 calculated in the previous frame as described above. That is, data of the search area 305 in FIG. 3 is read out from the matching image data 242 generated in the current frame, while data of the template area 304 is read out from the matching image data 243 generated in the previous frame. Then, the read out search area image data 253 and template area image data 254 are sent to the matching processing unit 203. However, in the first template matching process, since the tracking target feature point coordinates cannot be calculated from the previous frame, the process is performed using all new feature point coordinates calculated in the current frame. After step S405, the process of the motion vector detection unit 121 proceeds to step S406.

ステップS406に進むと、マッチング処理部203は、入力されたサーチ領域画像データ253とテンプレート領域画像データ254とを用いて、相関値を算出し、その相関値を基にベクトル値を算出する。ステップS406の後、動きベクトル検出部121の処理は、ステップS407に進む。 When the process proceeds to step S406, the matching processing unit 203 calculates a correlation value using the input search area image data 253 and template area image data 254, and calculates a vector value based on the correlation value. After step S406, the process of the motion vector detection unit 121 proceeds to step S407.

本実施形態では、相関値の算出方法として、差分絶対値和(Sum of Absolute Difference、以下SADと略す。)を使用する。式(4)はSADの算出式である。 In this embodiment, the correlation value is calculated using the sum of absolute differences (hereinafter abbreviated as SAD). Equation (4) is the calculation formula for SAD.

Figure 0007580914000002
Figure 0007580914000002

式(4)において、f(i,j)はテンプレート領域画像データ254における座標(i,j)の画素値を表しており、g(i,j)はサーチ領域画像データ253において相関値算出の対象領域(以下、相関値算出領域とする。)内の各画素値を表している。相関値算出領域は、テンプレート領域画像データ254における領域と同じ大きさである。そして、マッチング処理部203は、それら領域の各画素値f(i,j)及びg(i,j)について差の絶対値を計算し、それらの総和を求めることで相関値S_SADを算出する。ここで、相関値S_SADの値が小さいほど両領域間の輝度値の差分が小さい、つまりテンプレート領域画像データ254と相関値算出領域内のテクスチャとが類似していることになる。なお、本実施形態では、相関値の一例としてSADを使用しているが、これに限るものではなく、例えば、差分二乗和(SSD)や正規化相互相関(NCC)等の他の相関値が用いられてもよい。 In formula (4), f(i,j) represents the pixel value of the coordinates (i,j) in the template area image data 254, and g(i,j) represents each pixel value in the target area for correlation value calculation (hereinafter referred to as the correlation value calculation area) in the search area image data 253. The correlation value calculation area is the same size as the area in the template area image data 254. The matching processing unit 203 calculates the absolute value of the difference between each pixel value f(i,j) and g(i,j) in these areas and calculates the correlation value S_SAD by calculating the sum of these values. Here, the smaller the correlation value S_SAD, the smaller the difference in luminance values between the two areas, that is, the more similar the textures are between the template area image data 254 and the correlation value calculation area. In this embodiment, SAD is used as an example of a correlation value, but this is not limited thereto, and other correlation values such as the sum of squared differences (SSD) and normalized cross correlation (NCC) may be used.

そして、マッチング処理部203は、相関値の最小値の位置を、グリッドの動きベクトル値として求める。マッチング処理部203は、前述のようにして算出したベクトル値及び相関値情報255を、精度判定部204に出力する。 Then, the matching processing unit 203 finds the position of the minimum correlation value as the motion vector value of the grid. The matching processing unit 203 outputs the vector value and correlation value information 255 calculated as described above to the accuracy determination unit 204.

次にステップS407に進むと、精度判定部204は、ステップS406の処理で算出されたベクトル値及び相関値情報255のうち、相関値を用いて、当該相関値の最大値、最小値、平均値、極小値を求める。そして、精度判定部204は、それら相関値の最大値、最小値、平均値、極小値を用いて、以下に説明するような低コントラスト判定、画素値の最大値突出判定、繰り返しパターン判定の処理を行う。ステップS407の後、動きベクトル検出部121の処理は、ステップS408に進む。 Next, proceeding to step S407, the accuracy determination unit 204 uses the correlation values from the vector values and correlation value information 255 calculated in the process of step S406 to determine the maximum, minimum, average, and minimum values of the correlation values. Then, using the maximum, minimum, average, and minimum values of these correlation values, the accuracy determination unit 204 performs processes of low contrast determination, maximum pixel value protrusion determination, and repetitive pattern determination, as described below. After step S407, the process of the motion vector detection unit 121 proceeds to step S408.

図6(a)~図6(d)は、相関値の最大値、最小値、平均値、極小値と、それらを用いた判定例との関係説明に用いるグラフである。ただし、本実施形態の場合、相関値が小さいほど類似度が高いことになるため、図6(a)~図6(d)において、画素値の最大値は相関値では最小値、画素値の最小値は相関値では最大値、画素値の極大値は相関値では極小値を表す。 Figures 6(a) to 6(d) are graphs used to explain the relationship between the maximum, minimum, average, and minimum values of the correlation value and examples of judgments using them. However, in this embodiment, the smaller the correlation value, the higher the similarity, so in Figures 6(a) to 6(d), the maximum pixel value represents the minimum correlation value, the minimum pixel value represents the maximum correlation value, and the maximum pixel value represents the minimum correlation value.

図6(a)は、それぞれの判定結果が良好な結果となる例を示している。
図6(b)は、低コントラスト判定において低コントラストと判定される例を示している。低コントラスト判定とは、相関値算出領域内が低コントラストであるか否かを判定する処理である。本実施形態における低コントラスト判定では、相関値算出領域内の相関値の最大値と最小値との差分が、予め設定されている所定の閾値よりも小さい場合に、相関値算出領域内は低コントラストであると判定される。図6(b)の場合、図6(a)と比べて、画素値の最大値と最小値との差が少なく、相関値算出領域内の相関値の最大値と最小値の差分も所定の閾値より小さいとする。したがって、図6(b)の場合、精度判定部204は、相関値算出領域内の相関値の最大値と最小値の差分が所定の閾値よりも小さいため、相関値算出領域内は低コントラストであると判定する。
FIG. 6A shows an example in which each determination result is good.
FIG. 6B shows an example of a low contrast determination. The low contrast determination is a process for determining whether the correlation value calculation region has low contrast. In the low contrast determination in this embodiment, when the difference between the maximum and minimum correlation values in the correlation value calculation region is smaller than a predetermined threshold value set in advance, the correlation value calculation region is determined to have low contrast. In the case of FIG. 6B, the difference between the maximum and minimum pixel values is smaller than that in FIG. 6A, and the difference between the maximum and minimum correlation values in the correlation value calculation region is also smaller than a predetermined threshold value. Therefore, in the case of FIG. 6B, the accuracy determination unit 204 determines that the correlation value calculation region has low contrast because the difference between the maximum and minimum correlation values in the correlation value calculation region is smaller than a predetermined threshold value.

図6(c)は、画素値の最大値突出判定において低ピークと判定される例を示している。画素値の最大値突出判定とは、相関値算出領域内の相関値の最小値がどれだけ際立っているかを判定する処理である。本実施形態における画素値の最大値突出判定では、画素値の最大値と平均値との差分と、画素値の最大値と最小値との差分との除算結果の値が、予め設定されている所定の閾値よりも小さい場合に、相関値算出領域内は低ピークであると判定される。一方、除算結果の値が所定の閾値よりも大きい場合、相関値算出領域内は高ピークであると判定される。図6(c)の場合、図6(a)と比べて、画素値の最大値と平均値との差分と、画素値の最大値と最小値との差分との除算結果の値が小さく、閾値よりも小さいとする。したがって、図6(c)の場合、精度判定部204は、除算結果の値が所定の閾値より小さいため、相関値算出領域内は低ピークであると判定する。 Figure 6 (c) shows an example where a pixel value is determined to be a low peak in the maximum value protrusion judgment. The pixel value maximum value protrusion judgment is a process for judging how prominent the minimum value of the correlation value in the correlation value calculation area is. In the pixel value maximum value protrusion judgment in this embodiment, if the value of the division result of the difference between the maximum and average pixel values and the difference between the maximum and minimum pixel values is smaller than a predetermined threshold value set in advance, the correlation value calculation area is determined to be a low peak. On the other hand, if the value of the division result is larger than the predetermined threshold value, the correlation value calculation area is determined to be a high peak. In the case of Figure 6 (c), the value of the division result of the difference between the maximum and average pixel values and the difference between the maximum and minimum pixel values is smaller than the threshold value compared to Figure 6 (a). Therefore, in the case of Figure 6 (c), the accuracy judgment unit 204 judges that the correlation value calculation area is a low peak because the value of the division result is smaller than the predetermined threshold value.

図6(d)は、繰り返しパターン判定で繰り返しパターンと判定される例を示している。繰り返しパターン判定とは、画素値が繰り返し変動しているか否かを判定する処理である。本実施形態における繰り返しパターン判定では、相関値算出領域内の画素値の最大値と極大値との差分が、予め設定されている所定の閾値よりも小さい場合に、繰り返しパターンであると判定される。図6(d)の場合、図6(a)と比べて、画素値の最大値と極大値との差分が小さく、所定の閾値よりも小さいとする。したがって、図6(d)の場合、精度判定部204は、相関値算出領域内の画素値の最大値と極大値との差分が所定の閾値より小さいため、繰り返しパターンであると判定する。 Figure 6(d) shows an example where a repeating pattern is determined by the repeating pattern determination. Repeating pattern determination is a process for determining whether or not pixel values are fluctuating repeatedly. In the repeating pattern determination of this embodiment, a repeating pattern is determined when the difference between the maximum and maximum pixel values in the correlation value calculation area is smaller than a predetermined threshold value that is set in advance. In the case of Figure 6(d), the difference between the maximum and maximum pixel values is smaller than the predetermined threshold value compared to Figure 6(a). Therefore, in the case of Figure 6(d), the accuracy determination unit 204 determines that a repeating pattern exists because the difference between the maximum and maximum pixel values in the correlation value calculation area is smaller than the predetermined threshold value.

図4のフローチャートに説明を戻す。ステップS407の後、動きベクトル検出部121は、ステップS408の処理に進む。ステップS408に進むと、精度判定部204は、前述した低コントラスト、低ピーク、繰り返しパターンの各判定情報及びベクトル情報256を、SRAM206に書き込む。これにより、SRAM206の格納領域244にはそれら各情報が格納される。なお、SRAMはスタティックRAM(Static Random Access Memory)の略称である。SRAMは半導体記憶装置(半導体メモリ)のうち、電源を落とすと記録が失われる揮発性メモリの一つで、素子にデータの書き込みを行うとリフレッシュ動作を行わなくても通電中は内容が失われないという特徴がある。ステップS408の後、動きベクトル検出部121は、ステップS409の処理に進む。 Return to the explanation of the flowchart in FIG. 4. After step S407, the motion vector detection unit 121 proceeds to the process of step S408. When proceeding to step S408, the precision determination unit 204 writes the above-mentioned low contrast, low peak, and repeat pattern determination information and vector information 256 to the SRAM 206. As a result, each piece of information is stored in the storage area 244 of the SRAM 206. Note that SRAM is an abbreviation for static random access memory (static RAM). Among semiconductor storage devices (semiconductor memories), SRAM is one of the volatile memories whose records are lost when the power is turned off, and has the characteristic that when data is written to the element, the contents are not lost while the power is on even if a refresh operation is not performed. After step S408, the motion vector detection unit 121 proceeds to the process of step S409.

ステップS409に進むと、追跡先特徴点決定部205は、次フレームのテンプレートマッチング処理に用いるための追跡先特徴点の算出を行う。
ここで、図7は、追跡先特徴点決定部205における処理の流れを示すフローチャートである。以下、図7のフローチャートを参照しながら、追跡先特徴点決定部205における追跡先特徴点決定処理の概要を説明する。
In step S409, the tracked feature point determination unit 205 calculates tracked feature points to be used in the template matching process of the next frame.
7 is a flowchart showing the flow of processing in the tracked feature point determining unit 205. Below, an overview of the tracked feature point determination processing in the tracked feature point determining unit 205 will be described with reference to the flowchart in FIG.

先ず、ステップS701の処理として、追跡先特徴点決定部205は、SRAM206からベクトル値及び前述の判定情報258を取得する。追跡先特徴点決定部205は、取得したベクトル値を用いて現フレームの追跡先特徴点を算出し、更にその追跡先特徴点座標を中心としてテンプレートマッチング処理で算出したベクトル値を加算して、次フレームの追跡先特徴点の座標を算出する。ステップS701の後、追跡先特徴点決定部205はステップS702に進む。 First, in the process of step S701, the tracked feature point determination unit 205 acquires vector values and the aforementioned judgment information 258 from the SRAM 206. The tracked feature point determination unit 205 calculates the tracked feature point of the current frame using the acquired vector values, and further calculates the coordinates of the tracked feature point of the next frame by adding the vector value calculated in the template matching process centered on the coordinates of the tracked feature point. After step S701, the tracked feature point determination unit 205 proceeds to step S702.

ステップS702に進むと、追跡先特徴点決定部205は、SRAM206から取得した前述の判定情報を基に、ステップS701で算出された追跡先特徴点が、次フレームのテンプレートマッチング処理に使用可能な有効な追跡先特徴点であるか否かを判定する。追跡先特徴点決定部205は、低コントラスト判定で低コントラストと判定、又は、画素値の最大値突出判定で低ピークと判定、又は、繰り返しパターン判定で繰り返しパターンと判定されている場合、追跡先特徴点は有効でないと判定(NG判定)する。一方、追跡先特徴点決定部205は、低コントラスト、低ピーク、繰り返しパターンの何れでもない場合には、追跡先特徴点は有効であると判定(OK判定)する。そして、追跡先特徴点決定部205は、ステップS702において、NG判定とした場合(NO)にはステップS704に処理を進め、一方、OK判定とした場合(YES)にはステップS703に処理を進める。 In step S702, the tracked feature point determination unit 205 determines whether the tracked feature point calculated in step S701 is a valid tracked feature point that can be used for template matching processing of the next frame, based on the aforementioned determination information acquired from the SRAM 206. If the tracked feature point is determined to be low contrast in the low contrast determination, or a low peak in the maximum pixel value protrusion determination, or a repeating pattern in the repeating pattern determination, the tracked feature point determination unit 205 determines that the tracked feature point is not valid (NG determination). On the other hand, if the tracked feature point is not low contrast, low peak, or a repeating pattern, the tracked feature point determination unit 205 determines that the tracked feature point is valid (OK determination). If the tracked feature point determination unit 205 determines that the tracked feature point is NG (NO) in step S702, the process proceeds to step S704, whereas if the tracked feature point determination unit 205 determines that the tracked feature point is OK (YES), the process proceeds to step S703.

ステップS703に進むと、追跡先特徴点決定部205は、ステップS701で算出された追跡先特徴点座標が、グリッド内であるか否か判定する。具体的には、追跡先特徴点決定部205は、追跡先特徴点座標が特徴点配置グリッド302の内側に収まっている場合にはOKと判定する。前述の図3の例の場合、追跡先特徴点決定部205は、特徴点配置グリッド302の開始座標(Xs,Ys)及び終了座標(Xe,Ye)と、特徴点303の座標(x,y)とから、Xs≦x≦Xe、かつYs≦y≦Yeの時にOKと判定する。一方、追跡先特徴点決定部205は、追跡先特徴点座標が特徴点配置グリッド302の内側に収まっていない場合にはNGと判定する。つまり、追跡先特徴点決定部205は、x<Xs、Xe<x、y<Ys、Ye<yのいずれかを満たす時にはNGと判定する。そして、追跡先特徴点決定部205は、OKと判定した場合にはステップS703に進み、NGと判定した場合にはステップS704に進む。 When the process proceeds to step S703, the tracked feature point determination unit 205 determines whether the tracked feature point coordinates calculated in step S701 are within the grid. Specifically, the tracked feature point determination unit 205 determines that the tracked feature point coordinates are OK when they are inside the feature point arrangement grid 302. In the case of the example in FIG. 3 described above, the tracked feature point determination unit 205 determines that the tracked feature point coordinates are OK when Xs≦x≦Xe and Ys≦y≦Ye are satisfied based on the start coordinates (Xs, Ys) and end coordinates (Xe, Ye) of the feature point arrangement grid 302 and the coordinates (x, y) of the feature point 303. On the other hand, the tracked feature point determination unit 205 determines that the tracked feature point coordinates are not OK when they are not inside the feature point arrangement grid 302. That is, the tracked feature point determination unit 205 determines that the result is NG when any one of x<Xs, Xe<x, y<Ys, and Ye<y is satisfied. If the tracked feature point determination unit 205 determines that the result is OK, the process proceeds to step S703, and if the tracked feature point determination unit 205 determines that the result is NG, the process proceeds to step S704.

ステップS704に進むと、追跡先特徴点決定部205は、ステップS702又はステップS703でNG判定された座標位置に該当する追跡先特徴点座標を削除する。そして、追跡先特徴点決定部205は、削除された追跡先特徴点座標を、ステップS404で算出される新規特徴点座標により置き換える処理を行う。ステップS704の後、追跡先特徴点決定部205は、ステップS705に処理を進める。 When the process proceeds to step S704, the tracked feature point determination unit 205 deletes the tracked feature point coordinates corresponding to the coordinate position determined as NG in step S702 or step S703. The tracked feature point determination unit 205 then performs processing to replace the deleted tracked feature point coordinates with the new feature point coordinates calculated in step S404. After step S704, the tracked feature point determination unit 205 advances the process to step S705.

ステップS705に進むと、追跡先特徴点決定部205は、特徴点数分の全ての追跡先特徴点座標が算出されたか否か判定する。ここで、特徴点数は、特徴点数設定部208により設定される。追跡先特徴点決定部205は、ステップS705において、全ての追跡先特徴点座標が算出されていないと判定(NO)した場合にはステップS701に処理を戻して前述の処理を行う。ステップS701からステップS705までの処理は、ステップS705において全ての追跡先特徴点座標が算出されたと判定(YES)されるまで反復される。一方、ステップS705において、追跡先特徴点決定部205は、全ての追跡先特徴点座標が算出されたと判定(YES)した場合には図7のフローチャートの処理を終了する。以上で、図4のフローチャートの各ステップの処理を基にした動きベクトル検出部121の各ブロックの処理が完了する。 In step S705, the tracked feature point determination unit 205 determines whether or not all the tracked feature point coordinates have been calculated. Here, the number of feature points is set by the feature point number setting unit 208. If the tracked feature point determination unit 205 determines in step S705 that all the tracked feature point coordinates have not been calculated (NO), the process returns to step S701 and performs the above-mentioned process. The processes from step S701 to step S705 are repeated until it is determined in step S705 that all the tracked feature point coordinates have been calculated (YES). On the other hand, if the tracked feature point determination unit 205 determines in step S705 that all the tracked feature point coordinates have been calculated (YES), the process of the flowchart in FIG. 7 ends. This completes the process of each block of the motion vector detection unit 121 based on the process of each step in the flowchart in FIG. 4.

次に、図4に示したフローチャートのステップS404において、特徴点反映部207で行われる特徴点反映処理による新規特徴点の算出処理の詳細を、図8から図11を参照しながら説明する。
図8は、手振れなどにより生ずるカメラの動きのうち、例えば第1の結像光学部101と第2の結像光学部131との間の中間点を軸とした軸回り方向(ロール方向)にカメラが回転する手振れが生じた場合の画像における動きベクトルの分布例を示す図である。なお、カメラの手振れには、一般的にはロール方向の他にもヨー方向やピッチ方向にカメラが動く成分も含まれるが図8ではそれらヨー方向やピッチ方向による動きベクトルは省略している。以下では、2つの結像光学部間の中間点での軸回り回転方向の手振れのみを例に挙げて説明する。
Next, the details of the calculation process of new feature points by the feature point reflection process performed by the feature point reflection unit 207 in step S404 of the flowchart shown in FIG. 4 will be described with reference to FIGS.
Fig. 8 is a diagram showing an example of distribution of motion vectors in an image when, for example, camera shake occurs in which the camera rotates in an axis direction (roll direction) about the midpoint between the first imaging optical unit 101 and the second imaging optical unit 131, among the camera movements caused by camera shake and the like. Note that camera shake generally includes components of camera movement in the yaw direction and pitch direction in addition to the roll direction, but Fig. 8 omits the motion vectors in the yaw direction and pitch direction. In the following, an explanation will be given by taking as an example only camera shake in the axis direction at the midpoint between the two imaging optical units.

図8に示すように、回転方向の手振れが生じている場合、画像データ801の各動きベクトル802は点対称で円を描くような分布になる。図8の画像データ801の例の場合、動きベクトル802は、左側では上方向を指し、右側では下方向を指している。このような回転方向の動きベクトルの分布は、ステレオカメラから取り込まれた画像に対しても同様になると考えることができる。つまり、ステレオカメラから取り込まれた画像の場合、動きベクトルは2つの結像光学部の中間点に対応して点対称で円を描くような分布になると考えられる。 As shown in Figure 8, when camera shake occurs in the rotational direction, each motion vector 802 of image data 801 is distributed in a point-symmetrical circular fashion. In the example of image data 801 in Figure 8, motion vector 802 points upward on the left side and downward on the right side. This distribution of rotational motion vectors can be considered to be similar for images captured from a stereo camera. In other words, in the case of images captured from a stereo camera, the motion vectors are considered to be distributed in a point-symmetrical circular fashion corresponding to the midpoint of the two imaging optical sections.

図9は、本実施形態のステレオカメラのように、第1の結像光学部101と第2の結像光学部131との2つの光学系を有し、それらによって撮像素子102の撮像面上に形成される2つのイメージサークル901,902の例を示した図である。撮像素子102は、それら2つのイメージサークル901,902の画像を撮像することにより、同じ被写体905が写った視差を有する2つの視差画像のデータを取得する。以下の説明では、左側のイメージサークル902に対応した画像を左眼画像と呼び、右側のイメージサークル901に対応した画像を右眼画像と呼ぶ。 Figure 9 is a diagram showing an example of two image circles 901, 902 formed on the imaging surface of the image sensor 102 by two optical systems, the first imaging optical unit 101 and the second imaging optical unit 131, as in the stereo camera of this embodiment. The image sensor 102 captures images of the two image circles 901, 902 to obtain data of two parallax images having parallax in which the same subject 905 is captured. In the following description, the image corresponding to the image circle 902 on the left side is called the left eye image, and the image corresponding to the image circle 901 on the right side is called the right eye image.

図10は、2つの結像光学部間の中間点での軸回り回転方向の手振れが生じている場合に、ステレオカメラから取り込まれた左眼画像1002及び右眼画像1003からなる画像データ1001に対する特徴点及び動きベクトルの分布の例を示した図である。なお図10は、図3と同様に特徴点配置グリッドや周辺グリッド等が表されている。 Figure 10 shows an example of the distribution of feature points and motion vectors for image data 1001 consisting of a left eye image 1002 and a right eye image 1003 captured from a stereo camera when camera shake occurs in the rotational direction around an axis at the midpoint between two imaging optical units. Note that Figure 10 also shows a feature point arrangement grid and surrounding grid, as in Figure 3.

本実施形態の動きベクトル検出部121は、左眼画像1002の全ての特徴点配置グリッドにおいて特徴点を抽出する。一方、動きベクトル検出部121は、右眼画像1003については一部の特徴点配置グリッドから特徴点を抽出し、左眼画像1002から抽出した一部の特徴点を右眼画像1003の特徴点に反映する。そして動きベクトル検出部121は、それら左眼画像1002及び右眼画像1003の各々の特徴点に対して動きベクトルを検出する。すなわち動きベクトル検出部121は、左眼画像1002については被写体の移動要因及び手振れ要因の動きベクトルを検出するために用い、右眼画像1003については回転方向の手振れ検出に適した特徴点による動きベクトルのみを検出するために用いる。言い換えると、本実施形態において、動きベクトル検出部121は、基本的には左眼画像1002を用いてベクトル検出を行い、右眼画像1003については回転方向の手振れ検出を補助するために用いる。なお、右眼画像1003から特徴点を抽出する特徴点配置グリッドをいずれのグリッドにするか、また、左眼画像1002の特徴点のうち右眼画像1003の特徴点に対して反映する特徴点をいずれの特徴点にするのか、についての詳細は後述する。 The motion vector detection unit 121 of this embodiment extracts feature points in all feature point arrangement grids of the left eye image 1002. On the other hand, the motion vector detection unit 121 extracts feature points from some of the feature point arrangement grids for the right eye image 1003, and reflects some of the feature points extracted from the left eye image 1002 in the feature points of the right eye image 1003. The motion vector detection unit 121 then detects motion vectors for each of the feature points of the left eye image 1002 and the right eye image 1003. That is, the motion vector detection unit 121 is used for detecting the motion vectors of the subject movement factors and camera shake factors for the left eye image 1002, and for detecting only the motion vectors due to feature points suitable for camera shake detection in the rotational direction for the right eye image 1003. In other words, in this embodiment, the motion vector detection unit 121 basically performs vector detection using the left eye image 1002, and uses the right eye image 1003 to assist in camera shake detection in the rotational direction. Details regarding which feature point arrangement grid is to be used to extract feature points from the right eye image 1003, and which feature points of the left eye image 1002 are to be reflected in the feature points of the right eye image 1003, will be described later.

ここで例えば仮に左眼画像1002のみを用いて、動きベクトル検出を実施したとすると、回転方向の手振れは検出することができない。なぜなら、図10の場合、左眼画像1002における動きベクトルはすべて上方向を指しており、回転方向の手振れであるのか、上方向への並進の手振れであるのか判断できないためである。このとき、もしも右眼画像における動きベクトルが、例えば下方向を指すならば回転方向の手振れであり、一方、上方向を指すならば上方向への並進の手振れであると判断することができる。したがって、右眼画像1003において動きベクトルが少なくとも1点でも存在していれば、回転方向の手振れか、あるいは並進の手振れであるかの判断が可能になる。 If, for example, motion vector detection were performed using only the left eye image 1002, it would be impossible to detect rotational camera shake. This is because, in the case of FIG. 10, all of the motion vectors in the left eye image 1002 point upward, making it impossible to determine whether the camera shake is rotational or upward translational. In this case, if the motion vector in the right eye image points downward, for example, it can be determined that the camera shake is rotational, and if it points upward, it can be determined that the camera shake is upward translational. Therefore, if there is at least one motion vector in the right eye image 1003, it becomes possible to determine whether the camera shake is rotational or translational.

また例えば、抽出する特徴点数を増やすようにすれば、回転方向の手振れ検出精度を向上させることができるが、その場合、動きベクトル検出の処理量が増え、演算コストが増加する。このため、本実施形態では、右眼画像において扱う特徴点の数を例えば2点のように限定(数を制限)している。このように、本実施形態では、左眼画像1002と比較して、右眼画像1003において扱う特徴点数を少なくすることにより、動きベクトル検出の処理量を減らし、演算コストを低減させることを可能にしている。 For example, increasing the number of extracted feature points can improve the accuracy of camera shake detection in the rotational direction, but in that case, the amount of processing required for motion vector detection increases, and the calculation costs rise. For this reason, in this embodiment, the number of feature points handled in the right eye image is limited (restricted in number), for example, to two. In this way, in this embodiment, by reducing the number of feature points handled in the right eye image 1003 compared to the left eye image 1002, it is possible to reduce the amount of processing required for motion vector detection and reduce calculation costs.

一方、右眼画像1003の特徴点が被写体由来の特徴点である場合、被写体要因の動きベクトルが手振れ要因の動きベクトルと比較して大きいとき、手振れ要因の動きベクトルが確認できなくなり、回転方向の手振れ検出が正しく成されなくなる。したがって、本実施形態の動きベクトル検出部121は、左眼画像1002において被写体が存在していない特徴点配置グリッドから抽出した特徴点を、右眼画像1003に反映する。つまり、本実施形態では、左眼画像1002から抽出される特徴点のうち、被写体要因の特徴点を、右眼画像1003の特徴点に反映しないようにする。 On the other hand, if the feature points of the right eye image 1003 are feature points derived from the subject, when the motion vector of the subject is larger than the motion vector of the camera shake, the motion vector of the camera shake cannot be confirmed, and camera shake detection in the rotational direction cannot be performed correctly. Therefore, the motion vector detection unit 121 of this embodiment reflects feature points extracted from a feature point arrangement grid in which no subject exists in the left eye image 1002 to the right eye image 1003. In other words, in this embodiment, of the feature points extracted from the left eye image 1002, feature points of the subject are not reflected in the feature points of the right eye image 1003.

図11は、ステレオカメラから取り込まれた左眼画像1102及び右眼画像1103よりなる画像データ1101の各特徴点の分布及び被写体1105の例を示した図である。なお、図11も図3と同様に特徴点配置グリッドや周辺グリッド等が表されている。図11は、被写体1105が存在している左眼画像1102及び右眼画像1103からなる画像データ1101に対して、左眼画像1102の特徴点を右眼画像1103の画像データに反映する処理例が示されている。 Figure 11 is a diagram showing an example of the distribution of feature points in image data 1101 consisting of a left eye image 1102 and a right eye image 1103 captured by a stereo camera, and an example of a subject 1105. Note that, like Figure 3, Figure 11 also shows a feature point arrangement grid and a surrounding grid. Figure 11 shows an example of processing in which, for image data 1101 consisting of a left eye image 1102 and a right eye image 1103 in which a subject 1105 exists, the feature points of the left eye image 1102 are reflected in the image data of the right eye image 1103.

図12は、本実施形態の動きベクトル検出部121で行われる特徴点反映処理の流れを示すフローチャートである。以下、図12で示すフローチャートを参照しながら、図11に示したような特徴点反映処理について説明する。
先ずステップS1201において、動きベクトル検出部121は、新しく特徴点を算出する領域が左眼画像であるのか右眼画像であるのかで処理を分ける。動きベクトル検出部121は、新しく特徴点を算出する領域が左眼画像である場合には左眼画像から特徴点を抽出する処理に進み、一方、新しく特徴点を算出する領域が右眼画像である場合には左眼画像から右目画像に特徴点を反映する処理に進む。
12 is a flowchart showing the flow of the feature point reflection process performed by the motion vector detection unit 121 of this embodiment. The feature point reflection process as shown in FIG. 11 will be described below with reference to the flowchart shown in FIG.
First, in step S1201, the motion vector detection unit 121 performs processing depending on whether the area for which feature points are to be newly calculated is a left-eye image or a right-eye image. If the area for which feature points are to be newly calculated is a left-eye image, the motion vector detection unit 121 proceeds to processing for extracting feature points from the left-eye image, whereas if the area for which feature points are to be newly calculated is a right-eye image, the motion vector detection unit 121 proceeds to processing for reflecting feature points from the left-eye image to the right-eye image.

新しく特徴点を算出する領域が左眼画像であり、ステップS1202に進むと、特徴点抽出部202は、当該左眼画像から特徴点を抽出する。具体的には特徴点抽出部202は、前述のステップS704のように、削除された追跡先特徴点が一番初めに新規特徴点として算出された位置の特徴点配置グリッドについて、該当する位置で算出された現フレームの新規特徴点座標で置き換える処理を行う。 When the area for calculating new feature points is the left eye image and the process proceeds to step S1202, the feature point extraction unit 202 extracts feature points from the left eye image. Specifically, as in step S704 described above, the feature point extraction unit 202 performs a process of replacing the feature point arrangement grid at the position where the deleted tracked feature point was first calculated as a new feature point with the new feature point coordinates of the current frame calculated at the corresponding position.

一方、新しく特徴点を算出する領域が右眼画像であり、ステップS1203に進むと、特徴点抽出部202は、右眼画像の特徴点配置グリッドに対し、特徴点を反映する優先順位を表す番号Gnを割り振る。ここで本実施形態の場合、右眼画像においては、すべての特徴点配置グリッドに特徴点が配置するのではなく、一部に限定される。また本実施形態の場合、右眼画像における特徴点の数は、動きベクトルを算出する処理速度及び回転方向の手振れ検出の精度に基づいて決定される。 On the other hand, when the area for which new feature points are to be calculated is the right eye image and the process proceeds to step S1203, the feature point extraction unit 202 assigns a number Gn representing the priority order reflecting the feature points to the feature point arrangement grid of the right eye image. Here, in the case of this embodiment, feature points are not arranged in all feature point arrangement grids in the right eye image, but are limited to a portion. Also, in the case of this embodiment, the number of feature points in the right eye image is determined based on the processing speed for calculating the motion vector and the accuracy of camera shake detection in the rotational direction.

ここで、回転方向の手振れを十分な精度で検出可能な特徴点の最低点数をNminとし、リアルタイム性を保持できる十分な処理速度で動きベクトルを算出できる特徴点の最高点数をNmaxとすると、特徴点数NはNmin≦N≦Nmaxを満たす必要がある。また演算コストを低減させる場合は、N=Nminと設定すればよい。なお図11の例では右眼画像における特徴点数を2点として説明している。このため、特徴点抽出部202は、ステップS1203において、右眼画像の特徴点配置グリッドに対し、後述する特徴点反映部207で特徴点を反映する優先順位を表す番号Gn=1-Gmaxを割り振る。なお、番号Gn=1は最も優先順位が高く、Gn=Gmaxは最も優先順位が低いことを示す。図11の例の場合、最も優先順位が低い特徴点配置グリッドはGmax=9である。つまり左眼画像と右眼画像との中間点からの距離が大きいほど、回転方向の手振れ要因の動きベクトル値は大きくなると考えられる。このため、本実施形態では、左眼画像と右眼画像との中間点からの距離が大きいグリッドほど高い優先順位を設定する。すなわち、図11の例の場合、回転方向の手振れ要因の動きベクトル値は、右眼画像では図の右側の特徴点配置グリッドにおいて大きい値になると考えられる。このため本実施形態では、右眼画像の右側の特徴点配置グリッド(図11の例ではGn=1)の優先順番が高くなるように設定する。本実施形態の場合、特徴点抽出部202によって、始めに優先順位の番号Gnが1に初期化されることで、最も優先順位の高い特徴点配置グリッドから順番に処理が行われる。 Here, if the minimum number of feature points that can detect camera shake in the rotational direction with sufficient accuracy is Nmin, and the maximum number of feature points that can calculate a motion vector at a processing speed sufficient to maintain real-time performance is Nmax, the number of feature points N must satisfy Nmin≦N≦Nmax. To reduce the calculation cost, N=Nmin may be set. In the example of FIG. 11, the number of feature points in the right eye image is described as two. For this reason, in step S1203, the feature point extraction unit 202 assigns a number Gn=1-Gmax to the feature point arrangement grid of the right eye image, which represents the priority of reflecting the feature points in the feature point reflection unit 207 described later. Note that the number Gn=1 indicates the highest priority, and Gn=Gmax indicates the lowest priority. In the example of FIG. 11, the feature point arrangement grid with the lowest priority is Gmax=9. In other words, it is considered that the greater the distance from the midpoint between the left eye image and the right eye image, the greater the motion vector value of the camera shake factor in the rotational direction. For this reason, in this embodiment, a higher priority is set for grids that are farther away from the midpoint between the left eye image and the right eye image. That is, in the example of FIG. 11, it is considered that the motion vector value of the cause of camera shake in the rotational direction will be a large value in the feature point arrangement grid on the right side of the figure in the right eye image. For this reason, in this embodiment, the priority is set to be higher for the feature point arrangement grid on the right side of the right eye image (Gn=1 in the example of FIG. 11). In this embodiment, the feature point extraction unit 202 first initializes the priority number Gn to 1, and processing is performed in order starting from the feature point arrangement grid with the highest priority.

次にステップS1204において、特徴点抽出部202は、着目するグリッド内に既に特徴点が存在しているか否かを判定する。すなわち本実施形態の場合、1つの特徴点配置グリッドに対して配置される特徴点は最大1つであるため、特徴点抽出部202は、右眼画像において優先順位の番号Gnに対応する特徴点配置グリッドに既に特徴点が存在するか否かで処理を分ける。特徴点抽出部202は、着目グリッドに既に特徴点が存在すると判定した場合にはステップS1211に進んで、番号Gnをインクリメント(G=Gn+1)した後、ステップS1204に処理を戻す。例えば図11の画像データ1101の場合、右眼画像1103のGn=3に対応した特徴点配置グリッドには既に特徴点1104が存在しているため、Gn=3以外のグリッドで特徴点の算出処理が行われることになる。一方、特徴点抽出部202は、着目グリッドに特徴点が存在していないと判定した場合にはステップS1205に処理を進める。 Next, in step S1204, the feature point extraction unit 202 determines whether or not a feature point already exists in the grid of interest. That is, in the present embodiment, since a maximum of one feature point is arranged in one feature point arrangement grid, the feature point extraction unit 202 divides the process according to whether or not a feature point already exists in the feature point arrangement grid corresponding to the priority number Gn in the right eye image. If the feature point extraction unit 202 determines that a feature point already exists in the grid of interest, the process proceeds to step S1211, increments the number Gn (G=Gn+1), and then returns to step S1204. For example, in the case of the image data 1101 in FIG. 11, the feature point 1104 already exists in the feature point arrangement grid corresponding to Gn=3 in the right eye image 1103, so that the calculation process of the feature point is performed in a grid other than Gn=3. On the other hand, if the feature point extraction unit 202 determines that a feature point does not exist in the grid of interest, the process proceeds to step S1205.

ステップS1205に進むと、特徴点抽出部202は、着目するグリッド内に被写体が存在するか否かを判定する。すなわち特徴点抽出部202は、右眼画像の特徴点の反映元である左眼画像おける番号Gnに対応する特徴点配置グリッド内に、図1の被写体検出部122にて検出された被写体が存在しているか否かで処理を分ける。そして特徴点抽出部202において被写体が存在していないと判定された場合には、特徴点反映部207で行われるステップS1210に処理が進む。一方、被写体が存在していると判定した場合、特徴点抽出部202は、ステップS1206以降に処理を進める。すなわち被写体が存在している場合、回転方向の手振れ検出が正しく成されないことになるため、特徴点抽出部202は、他の番号Gnの特徴点配置グリッドについて特徴点算出処理を行う。図11の画像データ1101の場合、Gn=1及びGn=2のグリッドに被写体1105が存在しているため、Gn=1及びGn=2以外のグリッドで特徴点を算出する必要がある。 In step S1205, the feature point extraction unit 202 determines whether or not a subject exists in the grid of interest. That is, the feature point extraction unit 202 divides the process according to whether or not a subject detected by the subject detection unit 122 in FIG. 1 exists in the feature point arrangement grid corresponding to the number Gn in the left eye image, which is the source of reflection of the feature points of the right eye image. If the feature point extraction unit 202 determines that a subject does not exist, the process proceeds to step S1210 performed by the feature point reflection unit 207. On the other hand, if it is determined that a subject exists, the feature point extraction unit 202 proceeds to the process after step S1206. That is, if a subject exists, the camera shake detection in the rotation direction is not performed correctly, so the feature point extraction unit 202 performs feature point calculation processing for the feature point arrangement grids of other numbers Gn. In the case of the image data 1101 in FIG. 11, the subject 1105 exists in the grids Gn=1 and Gn=2, so it is necessary to calculate feature points in grids other than Gn=1 and Gn=2.

ステップS1206に進むと、特徴点抽出部202は、Gn=Gmaxになったか否かを判定する。そして、特徴点抽出部202は、Gn=Gmaxになったと判定した場合には特徴点反映部207で行われるステップS1209に処理が進む。一方、Gn=Gmaxになっていないと判定した場合、特徴点抽出部202は、ステップS1207に処理を進める。 When the process proceeds to step S1206, the feature point extraction unit 202 determines whether or not Gn=Gmax has been achieved. If the feature point extraction unit 202 determines that Gn=Gmax has been achieved, the process proceeds to step S1209, which is performed by the feature point reflection unit 207. On the other hand, if the feature point extraction unit 202 determines that Gn=Gmax has not been achieved, the process proceeds to step S1207.

ステップS1207に進むと、特徴点抽出部202は、本特徴点抽出処理において初めて本ステップを通過したか否かを判定する。そして、特徴点抽出部202は、既に本ステップを通過したことがある場合には、ステップS1211へ処理を進め、Gn=Gn+1とした後にステップS1204へ処理を戻す。一方、本ステップを初めて通過したと判定した場合、特徴点抽出部202は、ステップS1208に処理を進める。 When the process proceeds to step S1207, the feature point extraction unit 202 determines whether this step has been passed for the first time in this feature point extraction process. If the feature point extraction unit 202 has already passed this step, the process proceeds to step S1211, sets Gn=Gn+1, and returns to step S1204. On the other hand, if the feature point extraction unit 202 determines that this step has been passed for the first time, the process proceeds to step S1208.

ステップS1208に進むと、特徴点抽出部202は、番号Gnの値を保持した上で、ステップS1201に処理を進め、Gn=Gn+1とした後にステップS1204へ処理を戻す。 When the process proceeds to step S1208, the feature point extraction unit 202 retains the value of number Gn, proceeds to step S1201, sets Gn = Gn + 1, and then returns to step S1204.

ステップS1206でGn=Gmaxになったと判定されてステップS1209に進むと、特徴点反映部207は、ステップS1208で保持された番号Gnの値を基に、左眼画像から右眼画像に特徴点を反映する処理を行う。ステップS1209の処理は、左眼画像から右眼画像に反映する適切な特徴点を見つけることができなかった場合の処置であり、被写体が検出された特徴点配置グリッド内の特徴点ではあるが、優先順位が高いデータを用いて、特徴点が反映されることになる。ステップS1209の後、特徴点反映部207は、ステップS1210に処理を進める。 When it is determined in step S1206 that Gn=Gmax and the process proceeds to step S1209, the feature point reflection unit 207 performs processing to reflect feature points from the left eye image to the right eye image based on the value of number Gn held in step S1208. The processing in step S1209 is a procedure to be taken when an appropriate feature point to be reflected from the left eye image to the right eye image cannot be found, and although the feature point is within the feature point arrangement grid in which the subject is detected, the feature point is reflected using data with a high priority. After step S1209, the feature point reflection unit 207 proceeds to step S1210.

ステップS1210に進むと、特徴点反映部207は、番号Gnの値に基づいて、左眼画像の特徴点を右眼画像の特徴点に、それら左眼画像と右眼画像との間の視差を加味して反映する。図11の画像データ1101の場合は、Gn=4において特徴点が反映されている例を示している。 When proceeding to step S1210, the feature point reflection unit 207 reflects the feature points of the left eye image to the feature points of the right eye image based on the value of number Gn, taking into account the parallax between the left eye image and the right eye image. In the case of image data 1101 in FIG. 11, an example is shown in which feature points are reflected when Gn=4.

その後、前述したように追跡先特徴点決定部205、マッチング処理部203による処理を経ることで動きベクトルが算出され、これにより動きベクトル検出部121では回転方向の手振れ検出が可能となる。 Then, as described above, the tracking target feature point determination unit 205 and the matching processing unit 203 perform processing to calculate a motion vector, which enables the motion vector detection unit 121 to detect camera shake in the rotational direction.

前述のように、第1の実施形態に係る画像処理装置は、回転方向の手振れ要因の動きベクトルを検出するために、左眼画像の特徴点のうち一部を右目画像の特徴点に反映させることで、回転方向の手振れは検出しつつ、演算コストを低減させることが可能となる。 As described above, the image processing device according to the first embodiment detects the motion vector of the cause of the camera shake in the rotational direction by reflecting some of the feature points of the left eye image in the feature points of the right eye image, thereby making it possible to reduce the computational cost while still detecting the camera shake in the rotational direction.

前述した図11では、優先順位の番号の割り振りを、右眼画像の右側の優先順番を高くするように設定したが、優先順位は自由に決定することができる。例えば、ステレオカメラから取り込まれた画像データにおいては、左眼画像及び右眼画像の各々の画像の中心付近(中心座標から所定範囲内の領域あるいは所定幅、所定高さの矩形領域)で、より画像の歪みが小さい。よって、各々の画像の中心付近の優先順位を高く設定(優先的に設定)するとしても良い。また、特徴点がある一定箇所に集まり、得られる動きベクトルに偏りが生じることを防ぐために、優先順位は、特徴点を画像の全体に均等に散りばめるように設定されてもよい。これにより、例えば右眼画像における各特徴点の間の距離が均等に配置されるように特徴点の反映がなされるようになる。 In FIG. 11, the priority order numbers are assigned so that the right side of the right eye image has a higher priority, but the priority order can be freely determined. For example, in image data captured from a stereo camera, image distortion is smaller near the center of each of the left eye image and right eye image (a region within a specified range from the center coordinates or a rectangular region of a specified width and height). Therefore, the priority order may be set higher (preferentially set) near the center of each image. In addition, to prevent feature points from concentrating in a certain location and causing bias in the obtained motion vectors, the priority order may be set so that the feature points are evenly scattered throughout the entire image. This allows the feature points to be reflected so that the distance between each feature point in the right eye image is evenly distributed, for example.

<第2の実施形態>
次に本発明の第2の実施形態に係る画像処理装置について説明する。なお、第2の実施形態に係る画像処理装置の構成は前述の図1、図2と同様であるためそれらの図示及び説明は省略する。また第2の実施形態の画像処理装置での処理も図3~図12で説明したのと概ね同様であるが、第1の実施形態では左眼画像から右目画像に反映する特徴点数を固定していたのに対し、第2の実施形態の画像処理装置は特徴点数を時間的にダイナミックに制御する。
Second Embodiment
Next, an image processing device according to a second embodiment of the present invention will be described. Note that the configuration of the image processing device according to the second embodiment is the same as that of Fig. 1 and Fig. 2 described above, and therefore illustration and description thereof will be omitted. The processing in the image processing device of the second embodiment is also generally similar to that described in Fig. 3 to Fig. 12, but whereas the number of feature points reflected from the left eye image to the right eye image is fixed in the first embodiment, the image processing device of the second embodiment dynamically controls the number of feature points over time.

以下、図13から図17を参照しながら、第2の実施形態の画像処理装置において特徴点数を時間的にダイナミックに制御する特徴点数設定処理について説明する。
図13は、第2の実施形態の画像処理装置における特徴点数設定処理の流れを示すフローチャートである。
Hereinafter, a feature point number setting process for dynamically controlling the number of feature points over time in the image processing apparatus of the second embodiment will be described with reference to FIGS.
FIG. 13 is a flowchart showing the flow of the feature point number setting process in the image processing apparatus of the second embodiment.

まずステップS1301において、回転方向手振れ検出部209は、SRAM206に格納されている動きベクトルデータを用いて、回転方向の手振れを検出し、回転方向の手振れ量の情報を特徴点数設定部208に送る。 First, in step S1301, the rotational direction camera shake detection unit 209 detects camera shake in the rotational direction using the motion vector data stored in the SRAM 206, and sends information on the amount of camera shake in the rotational direction to the feature point number setting unit 208.

特徴点数設定部208は、回転方向手振れ検出部209において現フレームで検出された回転方向の手振れ量と、前フレームで検出された回転方向の手振れ量とを比較する。そして、特徴点数設定部208は、前フレームと比較して現フレームでは回転方向の手振れ量が増加したか否かを判定する。そして、特徴点数設定部208は、前フレームと比較して現フレームでは回転方向の手振れ量が増加したと判定した場合には、演算コストを低減させるために特徴点数を減らすフローであるステップS1304以降に処理を進める。一方、特徴点数設定部208は、前フレームと比較して現フレームでは回転方向の手振れ量が増加していないと判定した場合には、回転方向の手振れ検出の精度を上げるために特徴点数を増やすフローであるステップS1302以降に処理を進める。 The feature point number setting unit 208 compares the amount of camera shake in the rotational direction detected in the current frame by the rotational direction camera shake detection unit 209 with the amount of camera shake in the rotational direction detected in the previous frame. The feature point number setting unit 208 then determines whether the amount of camera shake in the rotational direction has increased in the current frame compared to the previous frame. If the feature point number setting unit 208 determines that the amount of camera shake in the rotational direction has increased in the current frame compared to the previous frame, the process proceeds to step S1304 and subsequent steps, which are steps for reducing the number of feature points in order to reduce calculation costs. On the other hand, if the feature point number setting unit 208 determines that the amount of camera shake in the rotational direction has not increased in the current frame compared to the previous frame, the process proceeds to step S1302 and subsequent steps, which are steps for increasing the number of feature points in order to improve the accuracy of camera shake detection in the rotational direction.

ステップS1302に進むと、特徴点数設定部208は、特徴点数Nが、回転方向の手振れ検出が可能な特徴点の最低点数Nminと等しいか否かを判定する。そして、特徴点数設定部208は、N=Nminである場合、特徴点数Nをさらに減らすことはできないため、図13のフローチャートによる特徴点数設定処理を終了する。一方、特徴点数設定部208は、特徴点数Nが最低点数Nminと等しくないと判定した場合にはステップS1303に処理を進める。 When the process proceeds to step S1302, the feature point number setting unit 208 determines whether the number of feature points N is equal to the minimum number of feature points Nmin at which camera shake in the rotational direction can be detected. If N=Nmin, the feature point number setting unit 208 terminates the feature point number setting process according to the flowchart in FIG. 13 because the number of feature points N cannot be further reduced. On the other hand, if the feature point number setting unit 208 determines that the number of feature points N is not equal to the minimum number Nmin, the process proceeds to step S1303.

ステップS1303に進むと、特徴点数設定部208は、特徴点数Nが最低点数Nmin未満(N<Nmin)にならない範囲で、特徴点数Nを減少させる。このステップS1303の後、特徴点数設定部208は図13のフローチャートの処理を終了する。 When the process proceeds to step S1303, the feature point number setting unit 208 reduces the feature point number N to the extent that the feature point number N does not become less than the minimum number of points Nmin (N<Nmin). After step S1303, the feature point number setting unit 208 ends the processing of the flowchart in FIG. 13.

またステップS1304に進むと、特徴点数設定部208は、特徴点数Nが、リアルタイム性を保持して動きベクトルを算出できる特徴点の最高点数Nmaxと等しいか否を判定する。そして、特徴点数設定部208は、N=Nmaxである場合、特徴点数Nをさらに増やすことはできないため、図13のフローチャートの処理を終了する。一方、特徴点数設定部208は、特徴点数Nが最高点数Nmaxと等しくないと判定した場合にはステップS1305に処理を進める。 When the process proceeds to step S1304, the feature point number setting unit 208 determines whether the number of feature points N is equal to the maximum number of feature points Nmax for which a motion vector can be calculated while maintaining real-time performance. If N=Nmax, the feature point number setting unit 208 ends the process of the flowchart in FIG. 13 because the number of feature points N cannot be increased further. On the other hand, if the feature point number setting unit 208 determines that the number of feature points N is not equal to the maximum number of points Nmax, the process proceeds to step S1305.

ステップS1305に進むと、特徴点数設定部208は、特徴点数Nが最高点数Nmaxを超えない(N>Nmax)範囲で、特徴点数Nを増加させる。このステップS1305の後、特徴点数設定部208は図13のフローチャートの処理を終了する。 When the process proceeds to step S1305, the feature point number setting unit 208 increases the feature point number N within a range in which the feature point number N does not exceed the maximum number of points Nmax (N>Nmax). After step S1305, the feature point number setting unit 208 ends the processing of the flowchart in FIG. 13.

ここで最高点数Nmaxの決め方について、図14から図17を用いて説明する。
図14は、前述の図10の例と同様に、ステレオカメラから取り込まれた左眼画像1402及び右眼画像1403からなる画像データ1401に対する特徴点の分布の例を示す図である。なお図14には動きベクトルを表す矢印は図示していない。また図14は、図3と同様に特徴点配置グリッドや周辺グリッド等が表されている。図14の例では、左眼画像1402には特徴点が9点、右眼画像1403には特徴点が2点の、合計で特徴点が11点配置されている。
Here, how the maximum score Nmax is determined will be described with reference to FIGS.
Fig. 14 is a diagram showing an example of distribution of feature points for image data 1401 consisting of a left eye image 1402 and a right eye image 1403 captured by a stereo camera, similar to the example of Fig. 10 described above. Note that arrows representing motion vectors are not shown in Fig. 14. Fig. 14 also shows a feature point arrangement grid and surrounding grid, similar to Fig. 3. In the example of Fig. 14, nine feature points are arranged in the left eye image 1402, and two feature points are arranged in the right eye image 1403, for a total of 11 feature points.

図15は、図14に例示したように特徴点が11点の場合の動きベクトル検出に関するタイミングチャートである。動きベクトル検出部121では、図15に示すように、1フレーム間で、撮像素子102から出力された画像データからマッチング用画像が生成され、特徴点数Nに応じてテンプレートマッチングが順次行われる。ここで、1フレームの時間1505をRVDとし、一つ目の特徴点に対するテンプレートマッチングが開始されるまでに要する時間1506をT0、予め求めた1つ当たりのテンプレートマッチングを実行するのに要する処理時間1507をTTとする。この場合、それら時間は、TDV>T0>T0+N×TTの関係を満たす必要がある。 Figure 15 is a timing chart relating to motion vector detection when there are 11 feature points as illustrated in Figure 14. As shown in Figure 15, in the motion vector detection unit 121, during one frame, a matching image is generated from the image data output from the image sensor 102, and template matching is performed sequentially according to the number of feature points N. Here, the time 1505 of one frame is RVD, the time 1506 required until template matching for the first feature point begins is T0, and the processing time 1507 required to perform one template matching operation calculated in advance is TT. In this case, these times must satisfy the relationship TDV>T0>T0+NxTT.

図15に示すように、特徴点数が11点である場合、それら11点の特徴点に対する動きベクトル検出の処理時間(T0+N×TT)は、図15のVDで示す1フレームの時間TDVに収まっている。このことから、特徴点数が11点である場合には、リアルタイム性を保持して動きベクトルが算出可能であることがわかる。 As shown in FIG. 15, when the number of feature points is 11, the processing time (T0 + N × TT) for detecting motion vectors for these 11 feature points falls within the time TDV of one frame shown as VD in FIG. 15. From this, it can be seen that when the number of feature points is 11, motion vectors can be calculated while maintaining real-time performance.

また図16は、ステレオカメラから取り込まれた左眼画像1602及び右眼画像1603からなる画像データ1601に対する特徴点の分布の例を示す図である。図16の例では、左眼画像1602には特徴点が9点、右眼画像1603には特徴点が7点の、合計で特徴点が16点配置されている。なお図16は、図3と同様に特徴点配置グリッドや周辺グリッド等が表されている。 Fig. 16 is a diagram showing an example of the distribution of feature points for image data 1601 consisting of a left eye image 1602 and a right eye image 1603 captured by a stereo camera. In the example of Fig. 16, a total of 16 feature points are arranged, with nine feature points arranged in the left eye image 1602 and seven feature points arranged in the right eye image 1603. Note that Fig. 16 also shows a feature point arrangement grid and surrounding grid, etc., in the same way as Fig. 3.

図17は、図16に例示したように特徴点が16点の場合の動きベクトル検出に関するタイミングチャートである。なお図17では、1フレームの時間が時間1705、一つ目の特徴点に対するテンプレートマッチング開始されるまでの時間が時間1706、1つ当たりのテンプレートマッチングの実行に要する処理時間が時間1707としている。動きベクトル検出部121では、前述同様に、1フレーム間で、撮像素子102から出力された画像データからマッチング用画像が生成され、特徴点数Nに応じてテンプレートマッチングが順次行われる。特徴点が16点の場合、それら16点の特徴点に対する動きベクトル検出の処理時間(T0+N×TT)は、図17のVDで示す1フレームの時間TDV内には収まらず、したがってリアルタイム性を保持して動きベクトルは算出できないことがわかる。すなわち、16点の特徴点数Nは適切ではない。そして、図17の例からは、リアルタイム性を保持して動きベクトルを算出できる特徴点の最高点数Nmaxは15点であると言える。 17 is a timing chart for motion vector detection when there are 16 feature points as shown in FIG. 16. In FIG. 17, the time for one frame is time 1705, the time until template matching for the first feature point starts is time 1706, and the processing time required for executing one template matching is time 1707. In the motion vector detection unit 121, as described above, a matching image is generated from the image data output from the image sensor 102 during one frame, and template matching is performed sequentially according to the number of feature points N. When there are 16 feature points, the processing time (T0+N×TT) for detecting motion vectors for the 16 feature points does not fall within the time TDV for one frame shown by VD in FIG. 17, and therefore it is understood that the motion vector cannot be calculated while maintaining real-time performance. In other words, the number of feature points N of 16 points is not appropriate. And, from the example of FIG. 17, it can be said that the maximum number Nmax of feature points for which a motion vector can be calculated while maintaining real-time performance is 15 points.

以上説明したように、第2の実施形態に係る画像処理装置は、左眼画像から右目画像に反映する特徴点数を時間的にダイナミックに制御している。これにより、第2の実施形態によれば、動きベクトルを算出する処理速度と回転方向の手振れ検出の精度とに基づいて、最適な条件で演算コストを低減させることができる。 As described above, the image processing device according to the second embodiment dynamically controls the number of feature points reflected from the left eye image to the right eye image over time. As a result, according to the second embodiment, it is possible to reduce the computational cost under optimal conditions based on the processing speed for calculating the motion vector and the accuracy of camera shake detection in the rotational direction.

前述したように第1、第2の実施形態の画像処理装置においては、サーチ領域を限定せずに、特徴点数を限定することでテンプレートマッチングに費やされる演算コストを低減させことができる。これにより、第1、第2の実施形態の画像処理装置によれば、ステレオカメラが取り込んだ画像データに対して、安価に回転方向の手振れを検出することが可能となり、動きベクトル検出の性能を向上させることができる。 As described above, in the image processing device of the first and second embodiments, the computational cost consumed for template matching can be reduced by limiting the number of feature points without limiting the search area. As a result, the image processing device of the first and second embodiments can inexpensively detect camera shake in the rotational direction for image data captured by the stereo camera, and can improve the performance of motion vector detection.

なお、第1、第2の実施形態では、左眼画像から右目画像に特徴点を反映する例を挙げたが、右眼画像から左眼画像に特徴点が反映されてもよい。また、第1、第2の実施形態において、左眼画像及び右眼画像の2つの画像の場合に限らず、複数の画像の場合でも同様に処理すればよい。 In the first and second embodiments, an example was given in which feature points were reflected from a left eye image to a right eye image, but feature points may also be reflected from a right eye image to a left eye image. Furthermore, in the first and second embodiments, the processing is not limited to the case of two images, a left eye image and a right eye image, and similar processing may be performed in the case of multiple images.

以上、本発明をその好適な実施形態に基づいて詳述してきたが、本発明はこれら特定の実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。上述の実施形態の一部を適宜組み合わせてもよい。 The present invention has been described in detail above based on preferred embodiments, but the present invention is not limited to these specific embodiments, and various forms within the scope of the gist of the invention are also included in the present invention. Parts of the above-mentioned embodiments may be combined as appropriate.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention can also be realized by supplying a program that realizes one or more of the functions of the above-described embodiments to a system or device via a network or storage medium, and having one or more processors in the computer of the system or device read and execute the program. It can also be realized by a circuit (e.g., an ASIC) that realizes one or more of the functions.

上述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。即ち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。 The above-described embodiments are merely examples of how the present invention can be implemented, and the technical scope of the present invention should not be interpreted in a limiting manner based on these. In other words, the present invention can be implemented in various forms without departing from its technical concept or main characteristics.

101:第1の結像光学部、131:第2の結像光学部、102:撮像素子、104:画像処理部、112:CPU、121:動きベクトル検出部、202:特徴点抽出部、207:特徴点反映部、208:特徴点数設定部、209:回転方向手振れ検出部 101: First imaging optical unit, 131: Second imaging optical unit, 102: Image sensor, 104: Image processing unit, 112: CPU, 121: Motion vector detection unit, 202: Feature point extraction unit, 207: Feature point reflection unit, 208: Feature point number setting unit, 209: Rotational direction shake detection unit

Claims (12)

複数の光学系による視差を有した複数の画像を取得する取得手段と、
前記画像から特徴点を抽出する抽出手段と、
前記特徴点を基に動きベクトルを検出する検出手段と、
前記複数の画像のうちの第1の画像から前記抽出された特徴点を、前記複数の画像のうちの第2の画像から前記抽出された特徴点に対して、前記視差を加味して反映する反映手段と、
記複数の光学系による視差を有した前記複数の画像を撮像した撮像装置の回転方向の振れを検出する手振れ検出手段と、
を有し、
前記検出手段は、前記第2の画像については前記第1の画像の特徴点が前記反映された特徴点を基に、前記動きベクトルの検出を行い、
前記手振れ検出手段は、前記第1の画像の前記特徴点を基に検出された動きベクトルと、前記第2の画像の特徴点に前記第1の画像の特徴点が前記反映された特徴点を基に検出された動きベクトルとを用いて前記撮像装置の回転方向の手振れを検出することを特徴とする画像処理装置。
An acquisition means for acquiring a plurality of images having parallax by a plurality of optical systems;
An extraction means for extracting feature points from the image;
A detection means for detecting a motion vector based on the feature points;
a reflecting means for reflecting the feature points extracted from a first image of the plurality of images on the feature points extracted from a second image of the plurality of images while taking into account the parallax;
a camera shake detection unit that detects camera shake in a rotational direction of an imaging device that captures the plurality of images having parallax due to the plurality of optical systems;
having
the detection means detects the motion vector for the second image based on feature points reflecting feature points of the first image;
The image processing device is characterized in that the camera shake detection means detects camera shake in the rotational direction of the imaging device using a motion vector detected based on the feature points of the first image and a motion vector detected based on feature points of the second image in which the feature points of the first image are reflected .
前記反映手段は、前記第1の画像の特徴点を前記反映する、前記第2の画像の特徴点の数を限定することを特徴とする請求項に記載の画像処理装置。 2. The image processing apparatus according to claim 1 , wherein said reflecting means limits the number of feature points of said second image that reflect the feature points of said first image. 前記反映手段は、前記検出手段が前記動きベクトルを検出する処理の速度に基づいて、前記限定する特徴点の数を決定することを特徴とする請求項に記載の画像処理装置。 3. The image processing apparatus according to claim 2 , wherein said reflecting means determines the number of said feature points to be limited based on a processing speed at which said detecting means detects said motion vector. 前記反映手段は、前記回転方向の手振れ検出の精度に基づいて、前記限定する特徴点の数を決定することを特徴とする請求項に記載の画像処理装置。 3. The image processing apparatus according to claim 2 , wherein said reflecting means determines the number of said feature points to be limited based on the accuracy of the camera shake detection in the rotational direction. 前記反映手段は、前記第1の画像から前記抽出された特徴点のうち、前記撮像装置の回転方向の手振れ検出に適する特徴点を、前記第2の画像の特徴点に前記反映することを特徴とする請求項から請求項のいずれか1項に記載の画像処理装置。 5. The image processing device according to claim 2, wherein the reflecting means reflects, among the feature points extracted from the first image, feature points suitable for detecting camera shake in the rotational direction of the imaging device, on the feature points of the second image. 前記画像から被写体を検出する被写体検出手段を有し、
前記手振れ検出手段は、前記被写体の特徴点を用いずに検出された動きベクトルに基づいて前記回転方向の手振れを検出することを特徴とする請求項1から請求項のいずれか1項に記載の画像処理装置。
a subject detection means for detecting a subject from the image,
6. The image processing apparatus according to claim 1, wherein the camera shake detection means detects camera shake in the rotational direction based on a motion vector detected without using feature points of the subject.
前記反映手段は、複数の領域に分割された前記第2の画像の各々の領域に対して優先順位を設定し、前記第1の画像から前記抽出した特徴点を、前記設定された領域ごとの優先順位に基づいて前記第2の画像の前記領域の特徴点に反映することを特徴とする請求項から請求項のいずれか1項に記載の画像処理装置。 6. The image processing device according to claim 1, wherein the reflection means sets a priority for each of the second image divided into a plurality of regions, and reflects the feature points extracted from the first image on the feature points of the regions of the second image based on the priority set for each region. 前記反映手段は、前記第1の画像と前記第2の画像との中間点からの距離の大きい前記領域ほど高い優先順位を設定することを特徴とする請求項に記載の画像処理装置。 8. The image processing apparatus according to claim 7 , wherein the reflecting means sets a higher priority order for the area located farther away from the midpoint between the first image and the second image. 前記反映手段は、前記第2の画像の中心から所定範囲内の領域に対して優先的に特徴点を反映することを特徴とする請求項に記載の画像処理装置。 8. The image processing apparatus according to claim 7 , wherein the reflecting means reflects the feature points preferentially in an area within a predetermined range from the center of the second image. 前記検出手段は、時間軸上で連続する2枚の画像の一方を原画像とし、もう一方を参照画像として、前記特徴点を中心とする前記参照画像の矩形領域内と前記原画像の矩形領域内の画素値で相関値演算を行って前記動きベクトルを検出することを特徴とする請求項1から請求項のいずれか1項に記載の画像処理装置。 10. The image processing device according to claim 1, wherein the detection means detects the motion vector by calculating a correlation value between pixel values within a rectangular area of the reference image centered on the feature point and a rectangular area of the original image, using one of two consecutive images on a time axis as an original image and the other as a reference image. 画像処理装置が実行する画像処理方法であって、
複数の光学系による視差を有した複数の画像を取得する取得工程と、
前記画像から特徴点を抽出する抽出工程と、
前記特徴点を基に動きベクトルを検出する検出手段と、
前記複数の画像のうちの第1の画像から前記抽出された特徴点を、前記複数の画像のうちの第2の画像から前記抽出された特徴点に対して、前記視差を加味して反映する反映工程と、
記複数の光学系による視差を有した前記複数の画像を撮像した撮像装置の回転方向の振れを検出する手振れ検出工程と、
を有し、
前記検出工程では、前記第2の画像については前記第1の画像の特徴点が前記反映された特徴点を基に、前記動きベクトルの検出を行い、
前記手振れ検出工程では、前記第1の画像の前記特徴点を基に検出された動きベクトルと、前記第2の画像の特徴点に前記第1の画像の特徴点が前記反映された特徴点を基に検出された動きベクトルとを用いて前記撮像装置の回転方向の手振れを検出することを特徴とする画像処理方法。
An image processing method executed by an image processing device, comprising:
An acquisition step of acquiring a plurality of images having parallax by a plurality of optical systems;
An extraction step of extracting feature points from the image;
A detection means for detecting a motion vector based on the feature points;
an application step of applying the feature points extracted from a first image of the plurality of images to the feature points extracted from a second image of the plurality of images while taking into account the parallax;
a camera shake detection step of detecting a camera shake in a rotational direction of an imaging device that captures the plurality of images having parallax by the plurality of optical systems;
having
In the detection step, the motion vector is detected for the second image based on the feature points reflecting the feature points of the first image,
an image processing method characterized in that, in the camera shake detection process, camera shake in the rotational direction of the imaging device is detected using a motion vector detected based on the feature points of the first image and a motion vector detected based on feature points in which the feature points of the first image are reflected in the feature points of the second image .
コンピュータを、請求項1から請求項1のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each of the means of the image processing device according to any one of claims 1 to 10 .
JP2019239379A 2019-12-27 2019-12-27 Image processing device, image processing method, and program Active JP7580914B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2019239379A JP7580914B2 (en) 2019-12-27 2019-12-27 Image processing device, image processing method, and program
JP2024190099A JP7826423B2 (en) 2019-12-27 2024-10-29 Image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019239379A JP7580914B2 (en) 2019-12-27 2019-12-27 Image processing device, image processing method, and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2024190099A Division JP7826423B2 (en) 2019-12-27 2024-10-29 Image processing device, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2021108035A JP2021108035A (en) 2021-07-29
JP7580914B2 true JP7580914B2 (en) 2024-11-12

Family

ID=76967943

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2019239379A Active JP7580914B2 (en) 2019-12-27 2019-12-27 Image processing device, image processing method, and program
JP2024190099A Active JP7826423B2 (en) 2019-12-27 2024-10-29 Image processing device, image processing method, and program

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2024190099A Active JP7826423B2 (en) 2019-12-27 2024-10-29 Image processing device, image processing method, and program

Country Status (1)

Country Link
JP (2) JP7580914B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119963440B (en) * 2025-04-08 2025-08-01 华能澜沧江水电股份有限公司 Signal processing-based equipment miniaturization method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016152027A (en) 2015-02-19 2016-08-22 株式会社リコー Image processing device, image processing method and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5742179B2 (en) * 2010-11-05 2015-07-01 ソニー株式会社 Imaging apparatus, image processing apparatus, image processing method, and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016152027A (en) 2015-02-19 2016-08-22 株式会社リコー Image processing device, image processing method and program

Also Published As

Publication number Publication date
JP7826423B2 (en) 2026-03-09
JP2021108035A (en) 2021-07-29
JP2025003715A (en) 2025-01-09

Similar Documents

Publication Publication Date Title
US8928730B2 (en) Method and system for correcting a distorted input image
CN102959586B (en) Depth estimation device and depth estimation method
JP6577703B2 (en) Image processing apparatus, image processing method, program, and storage medium
US10839529B2 (en) Image processing apparatus and image processing method, and storage medium
US11153479B2 (en) Image processing apparatus, capable of detecting an amount of motion between images by tracking a point across one or more images, image capturing apparatus, image processing method, and storage medium
JP7826423B2 (en) Image processing device, image processing method, and program
CN107360354A (en) Photographing method, device, mobile terminal and computer-readable storage medium
JP2010152521A (en) Apparatus and method for performing stereographic processing to image
JP7077115B2 (en) Image processing equipment, image processing methods, and programs
US10880457B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP6576179B2 (en) Image processing apparatus, image processing method, and program
JP6351364B2 (en) Information processing apparatus, information processing method, and program
JP2021107976A (en) Image processing device, image processing method, and program
JP7341712B2 (en) Image processing device, image processing method, imaging device, and program
JP2019192048A (en) Imaging apparatus
JP6344903B2 (en) Image processing apparatus, control method therefor, imaging apparatus, and program
JP6915016B2 (en) Information processing equipment and methods, information processing systems, and programs
JP7086761B2 (en) Image processing equipment, information processing methods and programs
JP3915037B1 (en) Image processing program, computer-readable recording medium recorded with the same, and image processing apparatus
JP2018072895A (en) Image processing device, image processing method and program
CN118967742A (en) Data reconstruction method and system
JP2026054261A (en) Information processing device, imaging device, control method, and program
JP5535840B2 (en) 3D image generator
CN121438256A (en) Image processing methods, electronic devices, vehicles, and computer-readable storage media

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20221212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20231010

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20231121

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240409

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240606

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20241030

R150 Certificate of patent or registration of utility model

Ref document number: 7580914

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150