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
JP6477193B2 - Image processing apparatus and image processing method - Google Patents
[go: Go Back, main page]

JP6477193B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6477193B2
JP6477193B2 JP2015085856A JP2015085856A JP6477193B2 JP 6477193 B2 JP6477193 B2 JP 6477193B2 JP 2015085856 A JP2015085856 A JP 2015085856A JP 2015085856 A JP2015085856 A JP 2015085856A JP 6477193 B2 JP6477193 B2 JP 6477193B2
Authority
JP
Japan
Prior art keywords
image
subject
calculation unit
parallax
image processing
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
JP2015085856A
Other languages
Japanese (ja)
Other versions
JP2016208178A (en
Inventor
創一 萩原
創一 萩原
佐藤 秀彦
秀彦 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Socionext Inc
Original Assignee
Socionext Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Socionext Inc filed Critical Socionext Inc
Priority to JP2015085856A priority Critical patent/JP6477193B2/en
Publication of JP2016208178A publication Critical patent/JP2016208178A/en
Application granted granted Critical
Publication of JP6477193B2 publication Critical patent/JP6477193B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Description

本発明は、画像処理装置および画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method.

ステレオカメラ等の撮像装置は、互いに異なるレンズを介して被写体を撮像する2つの撮像素子を有し、被写体までの距離を三角測量の原理を用いて測定する。例えば、ステレオカメラで撮影された2つの動画を用いて、2つの動画間における被写体の視差から実空間における被写体の位置を算出し、算出した位置の時間変化から実空間における被写体の速度を算出する技術が提案されている(例えば、特許文献1参照)。   An imaging apparatus such as a stereo camera has two imaging elements that capture an image of a subject via different lenses, and measures the distance to the subject using the principle of triangulation. For example, using two moving images taken by a stereo camera, the position of the subject in real space is calculated from the parallax of the subject between the two moving images, and the speed of the subject in real space is calculated from the time change of the calculated position. A technique has been proposed (see, for example, Patent Document 1).

CMOS(Complementary Metal Oxide Semiconductor)イメージセンサを用いた撮像装置は、複数の画素が行列状に配置された画素アレイの各行の露光時刻を順次にずらして被写体を撮像する。このため、移動する被写体がCMOSイメージセンサを用いた撮像装置により撮像される場合、被写体の画像が歪む、いわゆるローリングシャッタ歪みが発生する場合がある。   An imaging apparatus using a CMOS (Complementary Metal Oxide Semiconductor) image sensor images a subject by sequentially shifting the exposure time of each row of a pixel array in which a plurality of pixels are arranged in a matrix. For this reason, when a moving subject is picked up by an image pickup apparatus using a CMOS image sensor, a so-called rolling shutter distortion in which the subject image is distorted may occur.

一方、2つの撮像素子における行の走査順序を互いに逆にして撮影された2つの画像における被写体に対するローリングシャッタ歪みの違いから被写体の動きと移動方向とを検出する撮像装置が提案されている(例えば、特許文献2参照)。   On the other hand, there has been proposed an imaging device that detects a movement and a moving direction of a subject from a difference in rolling shutter distortion with respect to the subject in two images taken with the scanning order of rows in two imaging elements reversed (for example, for example) , See Patent Document 2).

特開2008−015815号公報JP 2008-015815 A 特開2011−205215号公報JP 2011-205215 A

ステレオカメラで撮像される2つの動画を用いて、移動する被写体の速度を算出する場合、2つの動画のそれぞれにおいて、少なくとも2フレーム(合計4フレーム)が使用される。すなわち、被写体の速度を算出するために、メモリ等の記憶装置は、記憶領域の一部が少なくとも4フレームに占有される。   When calculating the speed of a moving subject using two moving images captured by a stereo camera, at least two frames (four frames in total) are used in each of the two moving images. That is, in order to calculate the speed of the subject, in a storage device such as a memory, a part of the storage area is occupied by at least four frames.

一つの側面では、本発明が開示する画像処理装置および画像処理方法は、被写体の速度を算出するために用いる画像のデータ量を削減することを目的とする。   In one aspect, an image processing apparatus and an image processing method disclosed in the present invention are intended to reduce the amount of image data used for calculating the speed of a subject.

一つの観点の画像処理装置は、行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、複数の行の読み出しが第1の撮像素子および第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理装置において、第1の撮像素子から読み出された第1の画像および第2の撮像素子から読み出された第2の画像を用いて、第1の画像上の被写体である第1の被写体の位置と第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出する第1の算出部と、第1の被写体と第2の被写体との形状の差異である歪み情報を算出する第2の算出部と、視差および歪み情報を用い、被写体の速度を算出する第3の算出部とを有する。   An image processing apparatus according to one aspect includes a first image sensor and a second image sensor in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted. Is read out from the first image sensor in an image processing apparatus that calculates the speed of the subject from an image captured by an image capturing apparatus in which the first image sensor and the second image sensor are opposite to each other. And the second subject read out from the second image sensor and the position of the first subject that is the subject on the first image and the second subject that is the subject on the second image A first calculation unit that calculates a parallax indicating a difference from the position of the first, a second calculation unit that calculates distortion information that is a difference in shape between the first subject and the second subject, and parallax and distortion information And a third calculation unit for calculating the speed of the subject. That.

別の観点の画像処理方法は、行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、複数の行の読み出しが第1の撮像素子および第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理方法において、第1の撮像素子から読み出された第1の画像および第2の撮像素子から読み出された第2の画像を用いて、第1の画像上の被写体である第1の被写体の位置と第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出し、第1の被写体と第2の被写体との形状の差異である歪み情報を算出し、視差および歪み情報を用い、被写体の速度を算出する。   An image processing method according to another aspect includes a first image sensor and a second image sensor in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted, and the plurality of rows In the image processing method for calculating the speed of a subject from an image captured by an imaging device in which the first imaging device and the second imaging device are opposite to each other, the first read from the first imaging device And the second subject read out from the second image sensor and the position of the first subject that is the subject on the first image and the second subject that is the subject on the second image Parallax indicating a difference from the position of the first subject is calculated, distortion information which is a difference in shape between the first subject and the second subject is calculated, and the velocity of the subject is calculated using the parallax and the distortion information.

本発明が開示する画像処理装置および画像処理方法は、被写体の速度を算出するために用いる画像のデータ量を削減することができる。   The image processing apparatus and the image processing method disclosed in the present invention can reduce the amount of data of an image used for calculating the speed of a subject.

画像処理装置および画像処理方法の一実施形態を示す図である。It is a figure which shows one Embodiment of an image processing apparatus and an image processing method. 画像処理装置および画像処理方法の別の実施形態を示す図である。It is a figure which shows another embodiment of an image processing apparatus and an image processing method. 図2に示した撮像素子から画素信号が読み出されるタイミングの一例を示す図である。FIG. 3 is a diagram illustrating an example of a timing at which a pixel signal is read from the image sensor illustrated in FIG. 2. 図2に示した撮像素子が図3に示したタイミング図に基づいて撮影した画像の一例を示す図である。FIG. 4 is a diagram illustrating an example of an image captured by the image sensor illustrated in FIG. 2 based on the timing diagram illustrated in FIG. 3. 図2に示した視差算出部における視差の算出処理の一例を示す図である。It is a figure which shows an example of the calculation process of the parallax in the parallax calculation part shown in FIG. 図2に示した歪み算出部における演算処理の一例を示す図である。It is a figure which shows an example of the arithmetic processing in the distortion calculation part shown in FIG. 図2に示した画像処理装置における画像処理の一例を示す図である。It is a figure which shows an example of the image process in the image processing apparatus shown in FIG. 画像処理装置および画像処理方法の別の実施形態を示す図である。It is a figure which shows another embodiment of an image processing apparatus and an image processing method. 図8に示した撮像素子が図3に示したタイミング図に基づいて撮影した画像の一例を示す図である。It is a figure which shows an example of the image image | photographed based on the timing diagram which the imaging device shown in FIG. 8 showed in FIG. 図8に示した歪み算出部における演算処理の一例を示す図である。It is a figure which shows an example of the arithmetic processing in the distortion calculation part shown in FIG. 図8に示した画像処理装置における画像処理の一例を示す図である。It is a figure which shows an example of the image process in the image processing apparatus shown in FIG. 画像処理装置および画像処理方法の別の実施形態を示す図である。It is a figure which shows another embodiment of an image processing apparatus and an image processing method. 図12に示した撮像素子が図3に示したタイミング図に基づいて撮影した画像の一例を示す図である。It is a figure which shows an example of the image image | photographed based on the timing diagram which the imaging device shown in FIG. 12 showed in FIG. 図12に示した歪み算出部における演算処理の一例を示す図である。It is a figure which shows an example of the arithmetic processing in the distortion calculation part shown in FIG. 図12に示した画像処理装置における画像処理の一例を示す図である。It is a figure which shows an example of the image process in the image processing apparatus shown in FIG. 画像処理装置および画像処理方法の別の実施形態を示す図である。It is a figure which shows another embodiment of an image processing apparatus and an image processing method. 図16に示した画像処理装置における画像処理の一例を示す図である。It is a figure which shows an example of the image process in the image processing apparatus shown in FIG. 図17に示した画像処理の続きを示す図である。FIG. 18 is a diagram showing a continuation of the image processing shown in FIG. 17. 画像処理装置および画像処理方法の別の実施形態を示す図である。It is a figure which shows another embodiment of an image processing apparatus and an image processing method. 図19に示した撮像素子が図3に示したタイミング図に基づいて撮影した画像の一例を示す図である。It is a figure which shows an example of the image image | photographed based on the timing diagram shown in FIG. 3 by the imaging device shown in FIG. 図19に示した歪み算出部における演算処理の一例を示す図である。It is a figure which shows an example of the arithmetic processing in the distortion calculation part shown in FIG. 図19に示した画像処理装置における画像処理の一例を示す図である。It is a figure which shows an example of the image process in the image processing apparatus shown in FIG.

以下、図面を用いて実施形態を説明する。   Hereinafter, embodiments will be described with reference to the drawings.

図1は、画像処理装置および画像処理方法の一実施形態を示す。図1の破線の矢印は、信号等の情報の流れを示す。図1に示した画像処理装置100は、被写体OBJを互いに異なる位置から同時に撮像するステレオカメラ等の撮像装置CAMに記憶部MEMを介して接続される。記憶部MEMは、フレームメモリ等であり、撮像装置CAMが撮影した画像を記憶する。なお、記憶部MEMは、撮像装置CAM内に配置されてもよく、画像処理装置100内に配置されてもよい。また、画像処理装置100と記憶部MEMとの間、あるいは記憶部MEMと撮像装置CAMとの間は、有線で接続されてもよく、無線で接続されてもよい。   FIG. 1 shows an embodiment of an image processing apparatus and an image processing method. The dashed arrows in FIG. 1 indicate the flow of information such as signals. The image processing apparatus 100 illustrated in FIG. 1 is connected to an imaging device CAM such as a stereo camera that simultaneously images the subject OBJ from different positions via a storage unit MEM. The storage unit MEM is a frame memory or the like, and stores an image captured by the imaging device CAM. Note that the storage unit MEM may be disposed in the imaging device CAM, or may be disposed in the image processing device 100. Further, the image processing apparatus 100 and the storage unit MEM, or the storage unit MEM and the imaging device CAM may be connected by wire or may be connected wirelessly.

撮像装置CAMは、レンズLEN1、LEN2、レンズLEN1を介して被写体OBJを撮像する撮像素子ISEN1、レンズLEN2を介して被写体OBJを撮像する撮像素子ISEN2、および撮像素子ISEN1、ISEN2を駆動する駆動部DRVを有する。   The imaging device CAM includes lenses LEN1 and LEN2, an imaging element ISEN1 that images the subject OBJ via the lens LEN1, an imaging element ISEN2 that images the subject OBJ via the lens LEN2, and a drive unit DRV that drives the imaging elements ISEN1 and ISEN2. Have

撮像素子ISEN1、ISEN2は、CMOSイメージセンサ等であり、複数の画素が行列状に配置された画素アレイを有する。駆動部DRVは、撮像素子ISEN1、ISEN2の各々に対して、画素アレイの各行の露光(走査)の開始時刻を順次にずらす制御を実行し、露光により得られる画素信号の読み出しを行毎に順番に実行する。撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2は、記憶部MEMに出力される。   The imaging elements ISEN1 and ISEN2 are CMOS image sensors or the like, and have a pixel array in which a plurality of pixels are arranged in a matrix. The drive unit DRV performs control for sequentially shifting the start time of exposure (scanning) of each row of the pixel array for each of the image sensors ISEN1 and ISEN2, and sequentially reads out pixel signals obtained by exposure for each row. To run. The images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2 are output to the storage unit MEM.

なお、図1に示す撮像装置CAMにおいて、2つの括弧内に示すタイミング図に含まれる横に長い矩形は、時刻t0から時刻teまでの、各撮像素子ISEN1、ISEN2の画素アレイの行L1、・・・Leの露光時間を示す。タイミング図に示すように、各撮像素子ISEN1、ISEN2の画素アレイの各行L1、・・・Leにおける露光の開始時刻および画素信号の読み出し時刻は、互いに時間Δtずらされる。   In the imaging device CAM shown in FIG. 1, the horizontally long rectangles included in the timing diagrams shown in the two parentheses are the rows L1,... Of the pixel arrays of the imaging elements ISEN1, ISEN2, from time t0 to time te. .. Indicates the exposure time of Le. As shown in the timing diagram, the exposure start time and the pixel signal read time in each row L1,... Le of the pixel array of each image sensor ISEN1, ISEN2 are shifted by a time Δt.

例えば、行L1は、各撮像素子ISEN1、ISEN2の一番上の行を示し、行Leは、各撮像素子ISEN1、ISEN2の一番下の行を示す。撮像素子ISEN1では、露光により画素アレイに蓄積された電荷は、向きD1で示される順に各行から読み出され、撮像素子ISEN2では、露光により画素アレイに蓄積された電荷は、向きD2で示される順に各行から読み出される。すなわち、撮像素子ISEN1は、画素アレイの上側の行から画素アレイの下側の行に向けて露光を行毎に実行し、撮像素子ISEN2は、画素アレイの下側の行から画素アレイの上側の行に向けて露光を行毎に実行する。例えば、時刻t0に、撮像素子ISEN1の最初の行L1および撮像素子ISEN2の最初の行Leの露光が開始される。   For example, the row L1 indicates the top row of each of the image sensors ISEN1 and ISEN2, and the row Le indicates the bottom row of each of the image sensors ISEN1 and ISEN2. In the image sensor ISEN1, the charges accumulated in the pixel array by exposure are read from each row in the order indicated by the direction D1, and in the image sensor ISEN2, the charges accumulated in the pixel array by the exposure in the order indicated by the direction D2. Read from each row. That is, the image sensor ISEN1 performs exposure for each row from the upper row of the pixel array toward the lower row of the pixel array, and the image sensor ISEN2 performs the exposure from the lower row of the pixel array to the upper side of the pixel array. Exposure is performed row by row toward the row. For example, exposure of the first row L1 of the image sensor ISEN1 and the first row Le of the image sensor ISEN2 is started at time t0.

そして、時刻t1に、駆動部DRVは、撮像素子ISEN1の行L1および撮像素子ISEN2の行Leから画素信号をそれぞれ読み出す。以降、駆動部DRVは、撮像素子ISEN1、ISEN2の各行の露光が終了する毎に、各行から画素信号を読み出す。これにより、画像IMG(IMG1、IMG2)が撮像素子ISEN(ISEN1、ISEN2)から読み出され、記憶部MEMに記憶される。なお、画像IMG1、IMG2は、画像処理装置100に出力されてもよい。   At time t1, the driving unit DRV reads out pixel signals from the row L1 of the image sensor ISEN1 and the row Le of the image sensor ISEN2. Thereafter, the driving unit DRV reads pixel signals from each row every time exposure of each row of the imaging elements ISEN1 and ISEN2 is completed. Thereby, the image IMG (IMG1, IMG2) is read from the image sensor ISEN (ISEN1, ISEN2) and stored in the storage unit MEM. Note that the images IMG1 and IMG2 may be output to the image processing apparatus 100.

このように、駆動部DRVは、露光を実行する行の順序および画素信号を読み出す行の順序(すなわち、向きD1、D2)を、撮像素子ISEN1、ISEN2で互いに逆にする。なお、撮像素子ISEN1、ISEN2の行の配列方向の走査の向きD1、D2は、駆動部DRVに予め設定されていてもよく、画像処理装置100の制御により駆動部DRVに設定されてもよい。   As described above, the drive unit DRV reverses the order of the rows for performing exposure and the order of the rows for reading pixel signals (that is, the orientations D1 and D2) with the imaging elements ISEN1 and ISEN2. Note that the scanning directions D1 and D2 in the arrangement direction of the rows of the imaging elements ISEN1 and ISEN2 may be set in advance in the drive unit DRV, or may be set in the drive unit DRV under the control of the image processing apparatus 100.

各撮像素子ISEN1、ISEN2において、画素アレイの各行の露光時刻を互いにずらす場合、撮像で得られる画像IMG1、IMG2にローリングシャッタ歪みが発生する場合がある。   In each of the imaging elements ISEN1 and ISEN2, when the exposure times of the respective rows of the pixel array are shifted from each other, rolling shutter distortion may occur in the images IMG1 and IMG2 obtained by imaging.

画像処理装置100は、撮像素子ISEN1、ISEN2で撮影された2つの画像IMG1、IMG2を用い、画像IMG1、IMG2に含まれる被写体OBJの速度を算出する。例えば、画像処理装置100は、画像処理プログラムを実行するCPU(Central Processing Unit)等の演算処理装置により実現されてもよく、専用のハードウェアにより実現されてもよい。画像処理装置100は、視差算出部10、歪み算出部20および速度算出部30を有する。視差算出部10は、記憶部MEMから画像IMG1、IMG2を取得し、画像IMG1上の被写体OBJの位置と画像IMG2上の被写体OBJの位置との差を示す視差DPFを算出する第1の算出部の一例である。   The image processing apparatus 100 calculates the speed of the subject OBJ included in the images IMG1 and IMG2 using the two images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2. For example, the image processing device 100 may be realized by an arithmetic processing device such as a CPU (Central Processing Unit) that executes an image processing program, or may be realized by dedicated hardware. The image processing apparatus 100 includes a parallax calculation unit 10, a distortion calculation unit 20, and a speed calculation unit 30. The parallax calculation unit 10 obtains the images IMG1 and IMG2 from the storage unit MEM, and calculates a parallax DPF indicating a difference between the position of the subject OBJ on the image IMG1 and the position of the subject OBJ on the image IMG2. It is an example.

図1において、画像処理装置100に示す2つの括弧内の図は、撮像素子ISEN1、ISEN2からそれぞれ読み出された画像IMG1、IMG2の一例を示す。図1に示す例では、細長い矩形の形状を有する被写体OBJは、所定の速度で移動しているため、ローリングシャッタ歪みにより、画像IMG1上では、被写体OBJ1として表れ、画像IMG2上では、被写体OBJ2として表れる。括弧内に示す画像IMG1、IMG2において、破線で示す矩形は、ローリングシャッタ歪みがない場合の本来の被写体OBJの形状を示す。   In FIG. 1, two parentheses shown in the image processing apparatus 100 show an example of images IMG1 and IMG2 read from the image sensors ISEN1 and ISEN2, respectively. In the example shown in FIG. 1, the subject OBJ having an elongated rectangular shape moves at a predetermined speed, and therefore appears as the subject OBJ1 on the image IMG1 and as the subject OBJ2 on the image IMG2 due to rolling shutter distortion. appear. In the images IMG1 and IMG2 shown in parentheses, a rectangle indicated by a broken line indicates the original shape of the subject OBJ when there is no rolling shutter distortion.

被写体OBJが画角内を左から右に移動する場合、画像IMG1上の被写体OBJ1は、画角の下に向かうほど、本来の形状に対して右側にずれた形状を示す。また、画像IMG2上の被写体OBJ2は、画角の上に向かうほど、本来の形状に対して右側にずれた形状を示す。各被写体OBJ1、OBJ2の歪みは、被写体OBJの上と下とで互いに逆向きの力を被写体OBJが受けたように見えるため(すなわち、せん断変形)、以下の説明ではせん断歪みとも称される。画像IMG1上の被写体OBJ1の位置と画像IMG2上の被写体OBJ2の位置とのずれは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる。   When the subject OBJ moves from the left to the right within the angle of view, the subject OBJ1 on the image IMG1 shows a shape shifted to the right side with respect to the original shape as it goes below the angle of view. In addition, the subject OBJ2 on the image IMG2 shows a shape that is shifted to the right side with respect to the original shape as the angle of view increases. The distortion of each of the subjects OBJ1 and OBJ2 is also referred to as shear strain in the following description because the subject OBJ appears to have received forces opposite to each other above and below the subject OBJ. The deviation between the position of the subject OBJ1 on the image IMG1 and the position of the subject OBJ2 on the image IMG2 is caused by imaging the subject OBJ through the lenses LEN1 and LEN2 arranged at different positions.

視差算出部10は、例えば、画像IMG1を基準にして画像IMG2に対するテンプレートマッチング等の画像処理を実行し、画像IMG1上の被写体OBJ1の位置と画像IMG2上の被写体OBJ2の位置との差を示す視差DPFを算出する。そして、視差算出部10は、算出した視差DPFを歪み算出部20および速度算出部30に出力する。   For example, the parallax calculation unit 10 performs image processing such as template matching on the image IMG2 with the image IMG1 as a reference, and indicates the difference between the position of the subject OBJ1 on the image IMG1 and the position of the subject OBJ2 on the image IMG2. DPF is calculated. Then, the parallax calculation unit 10 outputs the calculated parallax DPF to the distortion calculation unit 20 and the speed calculation unit 30.

歪み算出部20は、被写体OBJの速度を算出するために、画像IMG1と画像IMG2とを比較する第2の算出部の一例である。例えば、歪み算出部20は、走査の向きD1、D2を撮像素子ISEN1、ISEN2で互いに逆にすることで、互いに異なる歪みが生じた被写体OBJ1、OBJ2の形状の差異を示す歪み情報INFを算出する。歪み算出部20は、視差算出部10により算出された視差DPFを用い、被写体OBJ1、OBJ2を互いに重ねる処理を実行する。例えば、歪み算出部20は、画像IMG1上の被写体OBJ1の位置に画像IMG2上の被写体OBJ2の位置を合わせる。そして、歪み算出部20は、被写体OBJ1の形状に一致させるように、被写体OBJ2の上側と下側とで行に沿う方向に互いに逆向きに変形させるせん断変形等の変形処理を被写体OBJ2に実行する。例えば、歪み算出部20は、せん断変形の変形量を変化させて変形処理を複数回実行し、被写体OBJ2の形状と被写体OBJ1の形状との一致の度合いを示すSAD(Sum of Absolute Difference)値等を算出する。歪み算出部20は、SAD値が最小値を示す(被写体OBJ2の形状が被写体OBJ1の形状に合わせ込まれた)際の被写体OBJ2に対するせん断変形による変形量を、歪み情報INFとして算出する。例えば、歪み算出部20は、画像IMG1上の被写体OBJ1が示すせん断歪み(ローリングシャッタ歪み)の変化量(被写体OBJ1が示す傾き)を歪み情報INFとして算出する。歪み算出部20は、算出した歪み情報INFを速度算出部30に出力する。   The distortion calculation unit 20 is an example of a second calculation unit that compares the image IMG1 and the image IMG2 in order to calculate the speed of the subject OBJ. For example, the distortion calculation unit 20 calculates the distortion information INF indicating the difference in the shapes of the subjects OBJ1 and OBJ2 having different distortions by reversing the scanning directions D1 and D2 by the imaging elements ISEN1 and ISEN2. . The distortion calculation unit 20 uses the parallax DPF calculated by the parallax calculation unit 10 and executes a process of superimposing the subjects OBJ1 and OBJ2. For example, the distortion calculation unit 20 aligns the position of the subject OBJ2 on the image IMG2 with the position of the subject OBJ1 on the image IMG1. Then, the distortion calculation unit 20 performs deformation processing such as shear deformation that deforms the object OBJ2 in opposite directions in the direction along the row on the upper side and the lower side of the object OBJ2 so as to match the shape of the object OBJ1. . For example, the strain calculation unit 20 performs deformation processing a plurality of times while changing the deformation amount of the shear deformation, and a SAD (Sum of Absolute Difference) value indicating the degree of coincidence between the shape of the subject OBJ2 and the shape of the subject OBJ1. Is calculated. The distortion calculation unit 20 calculates, as distortion information INF, the amount of deformation due to shear deformation of the subject OBJ2 when the SAD value has the minimum value (the shape of the subject OBJ2 is matched with the shape of the subject OBJ1). For example, the distortion calculation unit 20 calculates the amount of change (slope indicated by the subject OBJ1) of the shear distortion (rolling shutter distortion) indicated by the subject OBJ1 on the image IMG1 as the distortion information INF. The distortion calculation unit 20 outputs the calculated distortion information INF to the speed calculation unit 30.

速度算出部30は、視差算出部10により算出された視差DPFおよび歪み算出部20により算出された歪み情報INFを用い、実空間における被写体OBJの速度VLを算出する第3の算出部の一例である。例えば、速度算出部30は、撮像素子ISEN1における画素の行数(走査の向きD1の画素数)と画像IMG1上の被写体OBJ1が示すせん断歪みの傾きとから、被写体OBJが撮像素子ISEN1上を移動した画素数(距離)を算出する。次に、速度算出部30は、算出した画素数を、撮像素子ISEN1が画素信号を読み出す時刻t1から時刻teまでの読み出し時間で除算し、被写体OBJが撮像素子ISEN1上を移動する速度(撮像素子ISEN1上の被写体OBJの速度)を算出する。そして、速度算出部30は、例えば、視差DPF、レンズLEN1とレンズLEN2とにおける光軸間の距離、およびレンズLEN1の焦点距離を用いて、撮像素子ISEN1上の被写体OBJの速度から実空間における被写体OBJの速度VLを算出する。速度算出部30は、算出した速度VLをモニタ等の外部の出力装置に出力する。なお、速度算出部30は、算出した速度VLと画像IMG1、IMG2とを記憶部MEMに格納してもよい。   The speed calculation unit 30 is an example of a third calculation unit that calculates the speed VL of the subject OBJ in real space using the parallax DPF calculated by the parallax calculation unit 10 and the distortion information INF calculated by the distortion calculation unit 20. is there. For example, the speed calculation unit 30 moves the subject OBJ on the image sensor ISEN1 based on the number of rows of pixels in the image sensor ISEN1 (the number of pixels in the scanning direction D1) and the slope of the shear distortion indicated by the subject OBJ1 on the image IMG1. The number of pixels (distance) obtained is calculated. Next, the speed calculation unit 30 divides the calculated number of pixels by the readout time from time t1 when the image sensor ISEN1 reads out the pixel signal to time te, and the speed at which the subject OBJ moves on the image sensor ISEN1 (image sensor) The speed of the subject OBJ on ISEN1 is calculated. Then, the speed calculation unit 30 uses the parallax DPF, the distance between the optical axes of the lens LEN1 and the lens LEN2, and the focal length of the lens LEN1, for example, from the speed of the subject OBJ on the image sensor ISEN1 to determine the subject in real space. OBJ speed VL is calculated. The speed calculation unit 30 outputs the calculated speed VL to an external output device such as a monitor. Note that the speed calculation unit 30 may store the calculated speed VL and the images IMG1 and IMG2 in the storage unit MEM.

以上、図1に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きD1、D2を互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100は、画像IMG2上の被写体OBJ2に対してせん断変形等の変形処理を実行し、被写体OBJ2の形状を被写体OBJ1の形状に合わせ込むことで、歪み情報INFを算出する。画像処理装置100は、歪み情報INFに含まれるせん断変形の変形量と、撮像素子ISEN1における画素の行数(走査の向きD1の画素数)とから、被写体OBJが撮像素子ISEN1上を移動した画素数を算出する。画像処理装置100は、算出した画素数を画素信号の読み出し時間で除算した除算値(撮像素子ISEN1上の被写体OBJの速度)と視差DPF等とを用いて、実空間における被写体OBJの速度VLを算出する。   As described above, in the embodiment illustrated in FIG. 1, the reading of the pixel signals from the imaging elements ISEN1 and ISEN2 is executed with the scanning directions D1 and D2 in the row arrangement direction opposite to each other. As a result, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 show different shapes (rolling shutter distortion). Therefore, the image processing apparatus 100 performs deformation processing such as shear deformation on the subject OBJ2 on the image IMG2, and calculates the distortion information INF by matching the shape of the subject OBJ2 with the shape of the subject OBJ1. The image processing apparatus 100 uses the deformation amount of the shear deformation included in the distortion information INF and the number of pixels in the image sensor ISEN1 (the number of pixels in the scanning direction D1) as the pixel on which the subject OBJ has moved on the image sensor ISEN1. Calculate the number. The image processing apparatus 100 uses the division value (the speed of the subject OBJ on the image sensor ISEN1) obtained by dividing the calculated number of pixels by the readout time of the pixel signal, the parallax DPF, and the like to obtain the speed VL of the subject OBJ in real space. calculate.

これにより、画像処理装置100は、撮像装置CAMにおける撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)を記憶部MEMから取得することで、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100は、走査の向きが互いに同じ撮像素子を2つ有するステレオカメラが撮像した少なくとも4つのフレームを用いる場合と比べて、記憶部MEMに記憶される画像のデータ量を削減できる。   Thereby, the image processing apparatus 100 acquires two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM from the storage unit MEM, and thus in the real space. The speed VL of the subject OBJ can be calculated. That is, the image processing apparatus 100 can reduce the data amount of the image stored in the storage unit MEM, compared to a case where at least four frames captured by a stereo camera having two imaging elements having the same scanning direction are used. .

また、画像処理装置100は、撮像装置CAMにおける撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの画像IMG1、IMG2を用いて、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100は、実空間における被写体OBJの速度VLを算出するために、撮像装置CAMに2回以上撮影させなくてもよい。   Further, the image processing apparatus 100 can calculate the speed VL of the subject OBJ in the real space using the two images IMG1 and IMG2 obtained by one imaging with the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM. That is, the image processing apparatus 100 does not have to cause the imaging device CAM to capture images twice or more in order to calculate the speed VL of the subject OBJ in real space.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離を算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100と同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance between the imaging device and the subject OBJ from two frames taken by one imaging device, the speed of the subject OBJ in real space is the same as or similar to that of the image processing device 100. It is difficult to calculate.

図2は、画像処理装置および画像処理方法の別の実施形態を示す。図2に示した画像処理装置100Aは、撮像装置CAM2に接続される。撮像装置CAM2は、図1に示した撮像装置CAMと同一または同様である。図1で説明した要素と同一または同様の要素については、同一または同様の符号を付し、これ等については、詳細な説明を省略する。図2の破線の矢印は、信号等の情報の流れを示す。撮像装置CAM2の撮像素子ISEN1、ISEN2および駆動部DRVは、画像処理装置100A内のバスBUSに接続される。   FIG. 2 shows another embodiment of the image processing apparatus and the image processing method. The image processing apparatus 100A illustrated in FIG. 2 is connected to the imaging apparatus CAM2. The imaging device CAM2 is the same as or similar to the imaging device CAM shown in FIG. The same or similar elements as those described in FIG. 1 are denoted by the same or similar reference numerals, and detailed description thereof will be omitted. The dashed arrows in FIG. 2 indicate the flow of information such as signals. The imaging elements ISEN1 and ISEN2 and the drive unit DRV of the imaging device CAM2 are connected to a bus BUS in the image processing device 100A.

駆動部DRVは、例えば、画像処理装置100Aの制御に基づいて、画素信号の読み出しを行毎に順番に実行する際の行の配列方向の走査の向きを撮像素子ISEN1、ISEN2で互いに逆にして、撮像素子ISEN1、ISEN2をそれぞれ駆動する。駆動部DRVは、画素信号の読み出しを、撮像素子ISEN1と撮像素子ISEN2とで共通のクロックを用いて実行する。なお、撮像素子ISEN1、ISEN2の行の配列方向の走査の向きは、駆動部DRVに予め設定されていてもよい。駆動部DRVの動作については、図3で説明する。   The drive unit DRV, for example, reverses the scanning direction in the row arrangement direction when the pixel signals are sequentially read out for each row based on the control of the image processing apparatus 100A by the imaging elements ISEN1 and ISEN2. The imaging elements ISEN1 and ISEN2 are driven. The drive unit DRV reads out pixel signals using a common clock for the image sensor ISEN1 and ISEN2. Note that the scanning direction in the arrangement direction of the rows of the imaging elements ISEN1 and ISEN2 may be set in advance in the drive unit DRV. The operation of the drive unit DRV will be described with reference to FIG.

撮像素子ISEN1の行の配列方向の走査の向きと撮像素子ISEN2の行の配列方向の走査の向きとを互いに逆にして撮像素子ISEN1、ISEN2から読み出された画像IMG1、IMG2は、画像処理装置100Aに出力される。また、駆動部DRVは、読み出しの開始時刻および終了時刻等を示す読み出し時間情報TINFを画像処理装置100Aに出力する。   The images IMG1 and IMG2 read from the imaging elements ISEN1 and ISEN2 with the scanning direction of the imaging element ISEN1 in the array direction and the scanning direction of the imaging element ISEN2 in the array direction are reversed. Is output to 100A. In addition, the drive unit DRV outputs read time information TINF indicating a read start time and an end time to the image processing apparatus 100A.

画像処理装置100Aは、制御部CNTL、視差算出部10a、歪み算出部20a、速度算出部30a、記録部REC、表示部DIP、メモリMEM1、MEM2およびバスBUSを有する。制御部CNTL、視差算出部10a、歪み算出部20a、速度算出部30a、記録部REC、表示部DIPおよびメモリMEM1、MEM2は、バスBUSに接続される。   The image processing apparatus 100A includes a control unit CNTL, a parallax calculation unit 10a, a distortion calculation unit 20a, a speed calculation unit 30a, a recording unit REC, a display unit DIP, memories MEM1, MEM2, and a bus BUS. The control unit CNTL, the parallax calculation unit 10a, the distortion calculation unit 20a, the speed calculation unit 30a, the recording unit REC, the display unit DIP, and the memories MEM1 and MEM2 are connected to the bus BUS.

メモリMEM1は、撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2を記憶するフレームメモリ等である。また、メモリMEM2は、視差DPF、歪み情報INF、読み出し時間情報TINF等を記憶するRAM(Random Access Memory)等である。   The memory MEM1 is a frame memory or the like that stores images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2. The memory MEM2 is a RAM (Random Access Memory) that stores parallax DPF, distortion information INF, readout time information TINF, and the like.

制御部CNTLは、CPU(Central Processing Unit)等の演算処理装置であり、画像処理装置100Aおよび撮像装置CAM2の各要素を制御する。例えば、制御部CNTLは、撮像素子ISEN1、ISEN2の行の配列方向の走査の向きを互いに逆にする駆動処理を、駆動部DRVに実行させる。制御部CNTLの動作については、図3で説明する。   The control unit CNTL is an arithmetic processing device such as a CPU (Central Processing Unit) and controls each element of the image processing device 100A and the imaging device CAM2. For example, the control unit CNTL causes the drive unit DRV to execute drive processing for reversing the scanning directions in the arrangement direction of the rows of the imaging elements ISEN1 and ISEN2. The operation of the control unit CNTL will be described with reference to FIG.

視差算出部10aは、撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2をバスBUSを介してメモリMEM1から受け、画像IMG1上の被写体OBJの位置と画像IMG2上の被写体OBJの位置との差を示す視差DPFを算出する。すなわち、視差算出部10aは、第1の算出部の一例である。視差算出部10aは、算出した視差DPFをバスBUSを介してメモリMEM2に出力する。視差算出部10aの動作については、図5および図7で説明する。   The parallax calculation unit 10a receives the images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2 from the memory MEM1 via the bus BUS, and the difference between the position of the subject OBJ on the image IMG1 and the position of the subject OBJ on the image IMG2 Is calculated. That is, the parallax calculation unit 10a is an example of a first calculation unit. The parallax calculation unit 10a outputs the calculated parallax DPF to the memory MEM2 via the bus BUS. The operation of the parallax calculation unit 10a will be described with reference to FIGS.

歪み算出部20aは、画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。そして、歪み算出部20aは、撮像素子ISEN1、ISEN2で走査の向きが互いに逆のために生じた画像IMG1の被写体OBJ1と画像IMG2の被写体OBJ2との形状の差異を示す歪み情報INFを算出する。すなわち、歪み算出部20aは、第2の算出部の一例である。歪み算出部20aは、算出した歪み情報INFをメモリMEM2に出力する。歪み算出部20aの動作については、図6で説明する。   The distortion calculation unit 20a receives the images IMG1 and IMG2 from the memory MEM1 via the bus BUS. Then, the distortion calculation unit 20a calculates distortion information INF indicating the difference in shape between the subject OBJ1 of the image IMG1 and the subject OBJ2 of the image IMG2 that are generated because the scanning directions of the imaging elements ISEN1 and ISEN2 are opposite to each other. That is, the distortion calculation unit 20a is an example of a second calculation unit. The distortion calculation unit 20a outputs the calculated distortion information INF to the memory MEM2. The operation of the distortion calculation unit 20a will be described with reference to FIG.

速度算出部30aは、視差DFP、歪み情報INF、読み出し時間情報TINF等をバスBUSを介してメモリMEM2から受け、実空間における被写体OBJの速度VLを算出する第3の算出部の一例である。速度算出部30aは、算出した速度VLを記録部RECおよび表示部DIPに出力する。速度算出部30aの動作については、図4で説明する。   The speed calculation unit 30a is an example of a third calculation unit that receives the parallax DFP, distortion information INF, readout time information TINF, and the like from the memory MEM2 via the bus BUS and calculates the speed VL of the subject OBJ in real space. The speed calculation unit 30a outputs the calculated speed VL to the recording unit REC and the display unit DIP. The operation of the speed calculation unit 30a will be described with reference to FIG.

記録部RECは、画像IMG1、IMG2および速度VL等を記録するメモリ等である。表示部DIPは、画像IMG1、IMG2および速度VL等を表示する液晶ディスプレイ等である。   The recording unit REC is a memory or the like that records the images IMG1, IMG2, and the speed VL. The display unit DIP is a liquid crystal display that displays the images IMG1, IMG2, the speed VL, and the like.

図3は、図2に示した撮像素子ISEN1、ISEN2から画素信号が読み出されるタイミングの一例を示す。図3に示すタイミング図では、画像IMG1、IMG2の読み出しタイミングを示す。タイミング図が示すように、撮像素子ISEN1、ISEN2の画素アレイに配置された複数の画素は、行の配列方向にk行毎にn個の画素領域AR(AR1、AR2、・・・ARn)に分割される。タイミング図の縦軸のL1、L1+k、L1+2k、・・・Leは、撮像素子ISEN1、ISEN2の行を示し、タイミング図の横軸は、時刻を示す。行L1、L1+k、L1+2k、・・・Le−(k−1)は、各画素領域ARの上側の境界に位置する行である。タイミング図の符号VDは、垂直同期信号の周期(フレームの周期)に対応する。なお、図3では、図を見やすくするために、各行の境界線の記載を省略している。   FIG. 3 shows an example of the timing at which pixel signals are read from the image sensors ISEN1 and ISEN2 shown in FIG. In the timing chart shown in FIG. 3, the read timing of the images IMG1 and IMG2 is shown. As shown in the timing diagram, a plurality of pixels arranged in the pixel arrays of the image sensors ISEN1 and ISEN2 are arranged in n pixel areas AR (AR1, AR2,... ARn) every k rows in the row arrangement direction. Divided. In the timing chart, L1, L1 + k, L1 + 2k,... Le indicate rows of the image sensors ISEN1 and ISEN2, and the horizontal axis of the timing chart indicates time. Rows L1, L1 + k, L1 + 2k,... Le− (k−1) are rows located at the upper boundary of each pixel area AR. Symbol VD in the timing diagram corresponds to the period of the vertical synchronization signal (frame period). In FIG. 3, the boundary lines of each row are not shown for easy viewing of the drawing.

撮像素子ISEN1のタイミング図は、図1に示した撮像素子ISEN1のタイミング図と同一または同様である。例えば、撮像素子ISEN1は、時刻t0に画素領域AR1の行L1の露光を開始し、時刻t1に行L1の画素信号を読み出す。撮像素子ISEN1は、露光(走査)の開始時刻を順次に、例えば図1に示したΔtずらす制御を実行し、画素領域AR1の行L1+(k−1)に向けて(図3の破線の矢印)露光を行毎に実行する。撮像素子ISEN1は、画素領域AR1の行L1+(k−1)の露光を開始した時刻からΔtずらした時刻に、画素領域AR2の行L1+kの露光を開始する。すなわち、撮像素子ISEN1は、図1に示した撮像素子ISEN1のタイミング図と同一または同様に、露光(走査)の開始時刻を順次にずらす制御を実行し、画素領域ARnの行Leに向けて(図3の破線の矢印)露光を行毎に実行する。撮像素子ISEN1は、時刻teに行Leの画素信号を読み出す。   The timing chart of the image sensor ISEN1 is the same as or similar to the timing chart of the image sensor ISEN1 shown in FIG. For example, the imaging element ISEN1 starts exposure of the row L1 of the pixel area AR1 at time t0, and reads out the pixel signal of the row L1 at time t1. The imaging element ISEN1 sequentially executes the control to shift the exposure (scanning) start time, for example, by Δt shown in FIG. 1, toward the row L1 + (k−1) of the pixel area AR1 (broken line arrow in FIG. 3). ) Perform exposure line by line. The imaging element ISEN1 starts exposure of the row L1 + k of the pixel area AR2 at a time shifted by Δt from the time of starting exposure of the row L1 + (k−1) of the pixel area AR1. That is, the imaging element ISEN1 executes control for sequentially shifting the start time of exposure (scanning) in the same or similar manner as the timing chart of the imaging element ISEN1 shown in FIG. 1, and moves toward the row Le of the pixel area ARn ( (Dotted arrows in FIG. 3) The exposure is executed for each row. The image sensor ISEN1 reads the pixel signal of the row Le at time te.

一方、撮像素子ISEN2のタイミング図では、撮像素子ISEN2は、時刻t0に画素領域AR1の行L1+(k−1)の露光を開始し、時刻t1に行L1+(k−1)の画素信号を読み出す。撮像素子ISEN2は、露光の開始時刻を順次にずらす制御を実行し、画素領域AR1の行L1に向けて(図3の破線の矢印)露光を行毎に実行する。撮像素子ISEN2は、画素領域AR1の行L1の露光を開始した時刻からΔtずらした時刻(撮像素子ISEN1が画素領域AR2の行L+kを露光を開始する時刻)に、画素領域AR2の行L1+(2k−1)の露光を開始する。そして、撮像素子ISEN2は、露光の開始時刻を順次にずらす制御を実行し、画素領域AR2の行L1+kに向けて(図3の破線の矢印)露光を行毎に実行する。撮像素子ISEN2は、このような露光処理を画素領域ARnまで繰り返し実行する。撮像素子ISEN2は、時刻teに画素領域ARnの行Le−(k−1)の画素信号を読み出す。撮像素子ISEN2が図3に示したタイミング図で露光を実行することで、画像処理装置100Aは、撮像素子ISEN1と撮像素子ISEN2との間の読み出し時刻が一致する行を画素領域AR毎に得ることができる。   On the other hand, in the timing chart of the image sensor ISEN2, the image sensor ISEN2 starts exposure of the row L1 + (k−1) of the pixel area AR1 at time t0 and reads out the pixel signal of the row L1 + (k−1) at time t1. . The image sensor ISEN2 executes control for sequentially shifting the exposure start time, and performs exposure for each row toward the row L1 of the pixel region AR1 (broken arrow in FIG. 3). The image sensor ISEN2 is shifted by Δt from the time when exposure of the row L1 in the pixel area AR1 is started (time when the image sensor ISEN1 starts exposure of the row L + k of the pixel area AR2), and the row L1 + (2k -1) exposure is started. Then, the image sensor ISEN2 executes control to sequentially shift the exposure start time, and performs exposure for each row toward the row L1 + k of the pixel area AR2 (broken arrow in FIG. 3). The image sensor ISEN2 repeatedly performs such exposure processing up to the pixel area ARn. The image sensor ISEN2 reads out the pixel signal of the row Le− (k−1) of the pixel area ARn at time te. When the image sensor ISEN2 performs exposure according to the timing chart shown in FIG. 3, the image processing apparatus 100A obtains, for each pixel area AR, a row in which the readout times between the image sensor ISEN1 and the image sensor ISEN2 match. Can do.

図4は、図2に示した撮像素子ISEN1、ISEN2が図3に示したタイミング図に基づいて撮影した画像IMG1、IMG2の一例を示す。図4では、被写体OBJは、画角内を左から右に移動する。また、図4では、図を見やすくするために、画素領域ARは3つ(n=3)とする。この場合、画像IMG1上の被写体OBJ1は、図1と同様に、画角の下に向かうほど、破線の矩形で示す本来の形状に対して右側にずれる。一方、画像IMG2上の被写体OBJ2(OBJ2a、OBJ2b、OBJ2c)は、画素領域ARが3つのため3つに分れる。そして、画像IMG2上の被写体OBJ2の形状は、画素領域AR1から画素領域AR3に向かうほど、且つ各画素領域ARにおける画角の上に向かうほど、破線の矩形で示す本来の形状に対して右側にずれる。なお、図1で説明したように、画像IMG1上の被写体OBJ1と画像IMG2上の被写体OBJ2の左右方向のずれは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる。   FIG. 4 shows an example of images IMG1 and IMG2 taken by the imaging elements ISEN1 and ISEN2 shown in FIG. 2 based on the timing chart shown in FIG. In FIG. 4, the subject OBJ moves from left to right within the angle of view. Further, in FIG. 4, the number of pixel areas AR is assumed to be three (n = 3) for easy viewing of the drawing. In this case, the subject OBJ1 on the image IMG1 shifts to the right with respect to the original shape indicated by the broken-line rectangle as it goes below the angle of view, as in FIG. On the other hand, the subject OBJ2 (OBJ2a, OBJ2b, OBJ2c) on the image IMG2 is divided into three because the pixel area AR is three. The shape of the subject OBJ2 on the image IMG2 is on the right side of the original shape indicated by the dashed rectangle as it goes from the pixel area AR1 toward the pixel area AR3 and toward the angle of view in each pixel area AR. Shift. As described with reference to FIG. 1, the subject OBJ1 on the image IMG1 and the subject OBJ2 on the image IMG2 are displaced in the left-right direction because the subject OBJ is imaged through the lenses LEN1 and LEN2 arranged at different positions. Caused by.

図5は、図2に示した視差算出部10aにおける視差DPFの算出処理の一例を示す。図5(a)に示した画像IMG1、IMG2は、図4と同一または同様であり、詳細な説明は省略する。図5(b)は、図5(a)に示した画像IMG1、IMG2のうち被写体OBJ1、OBJ2bをそれぞれ含む画像領域を示す。   FIG. 5 illustrates an example of a parallax DPF calculation process in the parallax calculation unit 10a illustrated in FIG. The images IMG1 and IMG2 shown in FIG. 5A are the same as or similar to those in FIG. FIG. 5B shows image areas including the subjects OBJ1 and OBJ2b in the images IMG1 and IMG2 shown in FIG.

視差算出部10aは、例えば、画像IMG1の被写体OBJ1と画像IMG2の被写体OBJ2との視差DPFを算出するために、画像IMG2の各画素領域ARを行方向(図5の横方向)にk列毎に分割する。図5(a)では、視差算出部10aは、画像IMG1、IMG2の各画素領域ARを5つに分割する。すなわち、画像IMG1は、画像領域MBa(MBa11−MBa15、MBa21−MBa25、MBa31−MBa35)に区分けされる。画像IMG2は、画像領域MBb(MBb11−MBb15、MBb21−MBb25、MBb31−MBb35)に区分けされる。画像領域MBa、MBbは、第1の画像領域の一例であり、マクロブロックとも称される。   For example, the parallax calculation unit 10a calculates the parallax DPF between the subject OBJ1 of the image IMG1 and the subject OBJ2 of the image IMG2 for each pixel region AR of the image IMG2 in k rows in the row direction (lateral direction in FIG. 5). Divide into In FIG. 5A, the parallax calculation unit 10a divides each pixel area AR of the images IMG1 and IMG2 into five. That is, the image IMG1 is divided into image areas MBa (MBa11-MBa15, MBa21-MBa25, MBa31-MBa35). The image IMG2 is divided into image areas MBb (MBb11-MBb15, MBb21-MBb25, MBb31-MBb35). The image areas MBa and MBb are examples of the first image area and are also referred to as macro blocks.

視差算出部10aは、例えば、マクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10aは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行する。例えば、視差算出部10aは、処理対象のマクロブロックMBbと各マクロブロックMBaとにおける一致の度合いを示すSAD(Sum of Absolute Difference)値を算出する。視差算出部10aは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。図5(a)では、視差算出部10aは、画像IMG2のうち網掛けで示した画素領域AR2のマクロブロックMBb24が処理対象の場合、網掛けで示した画像IMG1の画素領域AR2におけるマクロブロックMBa22で最小のSAD値を算出する。すなわち、図5(a)に示したマクロブロックMBa22の被写体OBJ1は、マクロブロックMBb24の被写体OBJ2bに対応することを示す。   For example, the parallax calculation unit 10a smoothes the pixel values of the images IMG1 and IMG2 for each of the macro blocks MBa and MBb. The parallax calculation unit 10a generates a template between the macroblock MBb to be processed in the smoothed image IMG2 and each macroblock MBa in the pixel area AR that includes the macroblock MBb to be processed in the smoothed image IMG1. Image processing such as matching is executed. For example, the parallax calculation unit 10a calculates a SAD (Sum of Absolute Difference) value indicating the degree of matching between the macro block MBb to be processed and each macro block MBa. The parallax calculation unit 10a extracts the macroblock MBa of the image IMG1 indicating the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). In FIG. 5A, when the macro block MBb24 in the pixel area AR2 indicated by shading in the image IMG2 is a processing target, the parallax calculation unit 10a performs the macro block MBa22 in the pixel area AR2 of the image IMG1 indicated by shading. To calculate the minimum SAD value. That is, the subject OBJ1 of the macroblock MBa22 shown in FIG. 5A corresponds to the subject OBJ2b of the macroblock MBb24.

そして、視差算出部10aは、処理対象のマクロブロックMBbの位置と、処理対象のマクロブロックMBbに対応するマクロブロックMBaの位置との差から、被写体OBJの視差DPFを算出する。視差算出部10aは、画像IMG2のマクロブロックMBb毎に算出した視差DPFをメモリMEM2に出力する。   Then, the parallax calculation unit 10a calculates the parallax DPF of the subject OBJ from the difference between the position of the processing target macroblock MBb and the position of the macroblock MBa corresponding to the processing target macroblock MBb. The parallax calculation unit 10a outputs the parallax DPF calculated for each macroblock MBb of the image IMG2 to the memory MEM2.

なお、視差算出部10aがマクロブロックMBa、MBb毎に画像IMG1、IMG2を平滑化するため、視差DPFの精度は、マクロブロックMBa、MBbの大きさ程度である。そこで、視差算出部10aは、視差DPFの精度を上げる処理を実行してもよい。例えば、視差算出部10aは、図5(b)に示すように、処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとのうち、中央の行LMBCを含む網掛けで示したm行の幅の画像領域を抽出する。なお、m行は、マクロブロックMBa、MBbの行数kより少ない。図5(b)では、視差算出部10aは、抽出した処理対象のマクロブロックMBb24と対応するマクロブロックMBa22とのm行の幅の画像領域でテンプレートマッチング等の画像処理を実行する。   In addition, since the parallax calculation unit 10a smoothes the images IMG1 and IMG2 for each of the macro blocks MBa and MBb, the accuracy of the parallax DPF is about the size of the macro blocks MBa and MBb. Therefore, the parallax calculation unit 10a may execute processing for increasing the accuracy of the parallax DPF. For example, as shown in FIG. 5B, the disparity calculating unit 10a is shaded including the central row LMBC among the processing target macroblock MBb and the macroblock MBa corresponding to the processing target macroblock MBb. The image area having the width of the indicated m rows is extracted. Note that m rows is smaller than the number k of macroblocks MBa and MBb. In FIG. 5B, the parallax calculation unit 10a executes image processing such as template matching in the image region having a width of m rows between the extracted macro block MBb24 to be processed and the corresponding macro block MBa22.

視差算出部10aは、m行の幅の画像領域においてSAD値が最小値を示す位置を算出し、算出した位置で視差DPFを補正する。マクロブロックMBa、MBbの行数kより小さいm行の幅の画像領域で位置を算出するため、補正した視差DPFは画素単位の精度を有する。また、撮像素子ISEN1、ISEN2の走査の向きが画素領域AR毎に互いに逆のため、画像IMG2のマクロブロックMBbと画像IMG1のマクロブロックMBaとの中央に位置する行LMBCの画素信号の読み出し時刻は互いに一致またはほぼ一致する。すなわち、m行の幅の画像領域における被写体OBJ1、OBJ2の形状は、マクロブロックMBa、MBbの大きさにおける被写体OBJ1、OBJ2の形状と比べて互いに一致する。これにより、補正した視差DPFは画素単位の精度で良くなる。   The parallax calculation unit 10a calculates a position where the SAD value has a minimum value in an image area having a width of m rows, and corrects the parallax DPF at the calculated position. Since the position is calculated in an image area having a width of m rows smaller than the number k of rows of the macro blocks MBa and MBb, the corrected parallax DPF has an accuracy in pixel units. In addition, since the scanning directions of the imaging elements ISEN1 and ISEN2 are opposite to each other for each pixel area AR, the readout time of the pixel signal of the row LMBC located at the center between the macroblock MBb of the image IMG2 and the macroblock MBa of the image IMG1 is Match or nearly match each other. That is, the shapes of the subjects OBJ1 and OBJ2 in the image area having the width of m rows match each other as compared with the shapes of the subjects OBJ1 and OBJ2 in the sizes of the macro blocks MBa and MBb. As a result, the corrected parallax DPF is improved with accuracy in pixel units.

また、視差算出部10aは、図7で示すように、歪み算出部20aにより算出された歪み情報INFを用いて、視差を再算出してもよい。   Further, as illustrated in FIG. 7, the parallax calculation unit 10a may recalculate the parallax using the distortion information INF calculated by the distortion calculation unit 20a.

図6は、図2に示した歪み算出部20aにおける演算処理の一例を示す。図6に示した処理では、歪み算出部20aは、図5(b)に示した画像IMG1のマクロブロックMBa22と画像IMG2のマクロブロックMBb24とを用い、被写体OBJ1、OBJ2の形状の差異を示す歪み情報INFを算出する。なお、歪み算出部20aは、画像IMG2のマクロブロックMBb24以外の他のマクロブロックMBbに対しても、マクロブロックMBb24と同一あるいは同様の演算処理を実行する。   FIG. 6 shows an example of calculation processing in the distortion calculation unit 20a shown in FIG. In the process shown in FIG. 6, the distortion calculation unit 20a uses the macroblock MBa22 of the image IMG1 and the macroblock MBb24 of the image IMG2 shown in FIG. 5B, and shows the distortion indicating the difference in shape between the subjects OBJ1 and OBJ2. Information INF is calculated. Note that the distortion calculation unit 20a performs the same or similar calculation process as that of the macro block MBb24 on the macro block MBb other than the macro block MBb24 of the image IMG2.

歪み算出部20aは、視差算出部10aにより画像IMG2のマクロブロックMBb毎に算出された視差DPFを用い、被写体OBJ1、OBJ2を互いに重ね合わせる処理を実行する。例えば、歪み算出部20aは、処理対象のマクロブロックMBb24における視差DPFを用いて、マクロブロックMBb24における被写体OBJ2bの位置と、マクロブロックMBa22における被写体OBJ1の位置とを互いに合わせる。そして、歪み算出部20aは、マクロブロックMBa22の被写体OBJ1の形状に一致させるように、せん断変形の変形処理(被写体OBJ2bの上下を図6の点線の矢印で示したように互いに逆向きで変形させる処理)をマクロブロックMBb24に実行する。例えば、歪み算出部20aは、アフィン変換の行列を含む式(1)を用いて処理対象のマクロブロックMBb24にせん断変形の変形処理を実行し、せん断変形された破線で示すマクロブロックMBcを得る。   The distortion calculation unit 20a performs a process of superimposing the subjects OBJ1 and OBJ2 on each other using the parallax DPF calculated by the parallax calculation unit 10a for each macroblock MBb of the image IMG2. For example, the distortion calculation unit 20a matches the position of the subject OBJ2b in the macroblock MBb24 and the position of the subject OBJ1 in the macroblock MBa22 using the parallax DPF in the processing target macroblock MBb24. Then, the distortion calculation unit 20a deforms the deformation of the shear deformation (the upper and lower sides of the subject OBJ2b are deformed in opposite directions as indicated by dotted arrows in FIG. 6 so as to match the shape of the subject OBJ1 of the macroblock MBa22. Process) is executed on the macroblock MBb24. For example, the strain calculation unit 20a performs a shear deformation process on the macro block MBb 24 to be processed using Expression (1) including an affine transformation matrix, and obtains a macro block MBc indicated by a broken broken line.

Figure 0006477193
Figure 0006477193

(x,y)は、処理対象のマクロブロックMBb24の画素の位置を示し、(xa,ya)はせん断変形されたマクロブロックMBcの画素の位置を示す。変数αは、せん断変形の変形量であり、マクロブロックMBa22の被写体OBJ1が示すせん断歪み(ローリングシャッタ歪み)の傾きを示す。以下、変数αは、せん断率とも称する。変数Txは、マクロブロックMBb24とマクロブロックMBa22との位置の差(すなわち視差)を示す。 (X, y) indicates the pixel position of the macro block MBb24 to be processed, and (xa, ya) indicates the pixel position of the macro block MBc subjected to shear deformation. The variable α is a deformation amount of the shear deformation, and indicates the inclination of the shear distortion (rolling shutter distortion) indicated by the subject OBJ1 of the macro block MBa22. Hereinafter, the variable α is also referred to as a shear rate. The variable Tx indicates a position difference (that is, parallax) between the macroblock MBb24 and the macroblock MBa22.

歪み算出部20aは、例えば、せん断率α、変数Txをそれぞれ変化させてせん断変形したマクロブロックMBcとマクロブロックMBa22との間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。なお、変数Txをせん断率αおよびマクロブロックMBbの行数(行の配列方向の画素数)kとを用い、式(2)のように定義ことにより、式(1)を用いた変形処理で変化させる変数の数をせん断率αの1つにすることができる。   For example, the strain calculation unit 20a performs image processing such as template matching between the macroblock MBc and the macroblock MBa22 that have undergone shear deformation by changing the shear rate α and the variable Tx, and calculates the SAD value. Note that the variable Tx is defined by the equation (2) using the shear rate α and the number of rows of the macroblock MBb (number of pixels in the row arrangement direction) k, so that the transformation process using the equation (1) is performed. The number of variables to be changed can be one of the shear rates α.

Tx=−α×k/2 …(2)
これにより、歪み算出部20aは、変形処理の演算量を削減できる。また、歪み算出部20aは、式(2)を用いることでマクロブロックMBb24に変形処理を実行しても、せん断変形したマクロブロックMBcとマクロブロックMBa22との中心を互いに一致させることができる。
Tx = −α × k / 2 (2)
Thereby, the distortion calculation unit 20a can reduce the calculation amount of the deformation process. Further, the distortion calculation unit 20a can make the centers of the shear-deformed macroblock MBc and the macroblock MBa22 coincide with each other even if the macroblock MBb24 is subjected to the deformation process by using Expression (2).

歪み算出部20aは、SAD値が最小値を示す際のせん断変形された被写体OBJ2bが被写体OBJ1に最も一致すると判定し、SAD値が最小値を示す際のせん断率αを歪み情報INFとして算出する。   The distortion calculation unit 20a determines that the subject OBJ2b subjected to shear deformation when the SAD value indicates the minimum value most closely matches the object OBJ1, and calculates the shear rate α when the SAD value indicates the minimum value as the distortion information INF. .

速度算出部30aは、視差算出部10aにより算出された視差DPF、歪み算出部20aにより算出された歪み情報INFおよび読み出し時間情報TINFを用い、実空間における被写体OBJの速度VLを算出する。例えば、被写体OBJが撮像素子ISEN1上を移動した画素数(距離)ΔPXは、マクロブロックMBaにおける行数(行の配列方向の画素数)kとマクロブロックMBaの被写体OBJ1が示すせん断率αとを用いて、式(3)で表される。速度算出部30aは、式(3)から画素数ΔPXを算出する。   The speed calculation unit 30a calculates the speed VL of the subject OBJ in real space using the parallax DPF calculated by the parallax calculation unit 10a, the distortion information INF calculated by the distortion calculation unit 20a, and the readout time information TINF. For example, the number of pixels (distance) ΔPX that the subject OBJ has moved on the image sensor ISEN1 is the number of rows (number of pixels in the row arrangement direction) k in the macroblock MBa and the shear rate α indicated by the subject OBJ1 of the macroblock MBa. And is represented by Formula (3). The speed calculation unit 30a calculates the number of pixels ΔPX from Expression (3).

ΔPX=α×k/2 …(3)
次に、速度算出部30aは、撮像素子ISEN1がマクロブロックMBaにおける画素信号を読み出す読み出し時間ΔtRを式(4)から算出する。
ΔPX = α × k / 2 (3)
Next, the speed calculation unit 30a calculates the readout time ΔtR for the image sensor ISEN1 to read out the pixel signal in the macro block MBa from Expression (4).

ΔtR=(te−t1)×k/(Le−L1+1) …(4)
変数t1、teは、読み出し時間情報TINFに含まれる図3に示した画素信号の読み出しの開始時刻および終了時刻を示す。変数kは、マクロブロックMBaの行数(行の配列方向の画素数)を示す。変数L1、Leは、図3に示した撮像素子ISEN1の1番目の行および最終行をそれぞれ示し、(Le−L1+1)は、撮像素子ISEN1の画素アレイの全行数(行の配列方向の全画素数)を示す。
ΔtR = (te−t1) × k / (Le−L1 + 1) (4)
Variables t1 and te indicate the start time and end time of reading of the pixel signal shown in FIG. 3 included in the read time information TINF. The variable k indicates the number of rows of the macroblock MBa (the number of pixels in the row arrangement direction). The variables L1 and Le respectively indicate the first row and the last row of the image sensor ISEN1 shown in FIG. 3, and (Le−L1 + 1) indicates the total number of pixel arrays of the image sensor ISEN1 (total number of rows in the array direction). Number of pixels).

速度算出部30aは、撮像素子ISEN1上を移動した画素数ΔPXを読み出し時間ΔtRで除算し、撮像素子ISEN1上を移動する被写体OBJの速度を算出する。そして、速度算出部30aは、撮像素子ISEN1上を移動する被写体OBJの速度、視差DPF、レンズLEN1とレンズLEN2との光軸間の距離、およびレンズLEN1の焦点距離を用いて、実空間における被写体OBJの速度VLを算出する。例えば、撮像装置CAM2と被写体OBJとの距離DISは、視差DPF、レンズLEN1とレンズLEN2との光軸間の距離B、およびレンズLEN1の焦点距離fとを用い、式(5)で表される。   The speed calculation unit 30a calculates the speed of the subject OBJ moving on the image sensor ISEN1 by dividing the number of pixels ΔPX moved on the image sensor ISEN1 by the readout time ΔtR. Then, the speed calculation unit 30a uses the speed of the subject OBJ moving on the imaging element ISEN1, the parallax DPF, the distance between the optical axes of the lens LEN1 and the lens LEN2, and the focal length of the lens LEN1, and uses the subject in real space. OBJ speed VL is calculated. For example, the distance DIS between the imaging device CAM2 and the subject OBJ is expressed by Expression (5) using the parallax DPF, the distance B between the optical axes of the lens LEN1 and the lens LEN2, and the focal length f of the lens LEN1. .

DIS=B×f/DPF …(5)
速度算出部30aは、式(6)を用いて実空間における被写体OBJの速度VLを算出する。
VL=V0×DIS/f=V0×(B×f/DPF)/f=V0×B/DPF …(6)
変数V0は、撮像素子ISEN1上を移動する被写体OBJの速度を示す。速度算出部30aは、算出した速度VLを、画像IMG1、IMG2とともに記録部RECおよび表示部DIPに出力する。
DIS = B × f / DPF (5)
The speed calculation unit 30a calculates the speed VL of the subject OBJ in the real space using Expression (6).
VL = V0 * DIS / f = V0 * (B * f / DPF) / f = V0 * B / DPF (6)
A variable V0 indicates the speed of the subject OBJ that moves on the imaging element ISEN1. The speed calculation unit 30a outputs the calculated speed VL to the recording unit REC and the display unit DIP together with the images IMG1 and IMG2.

図7は、図2に示した画像処理装置100Aにおける画像処理の一例を示す。図7に示した処理は、制御部CNTLが画像処理プログラムを実行することにより実現される。なお、図7に示した処理は、画像処理装置100Aに設けられるハードウェアにより実行されてもよい。この場合、図2に示した視差算出部10a、歪み算出部20aおよび速度算出部30aは、画像処理装置100A内に配置される回路により実現される。   FIG. 7 shows an example of image processing in the image processing apparatus 100A shown in FIG. The processing shown in FIG. 7 is realized by the control unit CNTL executing an image processing program. Note that the processing illustrated in FIG. 7 may be executed by hardware provided in the image processing apparatus 100A. In this case, the parallax calculation unit 10a, the distortion calculation unit 20a, and the speed calculation unit 30a illustrated in FIG. 2 are realized by a circuit arranged in the image processing apparatus 100A.

ステップS100では、視差算出部10aは、撮像装置CAM2で撮影された画像IMG1、IMG2をメモリMEM1から取得する。   In step S100, the parallax calculation unit 10a acquires images IMG1 and IMG2 captured by the imaging device CAM2 from the memory MEM1.

ステップS110では、視差算出部10aは、画像IMG2のマクロブロックMBbのうち処理対象のマクロブロックMBbと、処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaとの位置の差から視差DPFを算出する。例えば、視差算出部10aはマクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10aは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbを選択する。視差算出部10aは、選択した処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。視差算出部10aは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。そして、視差算出部10aは、処理対象のマクロブロックMBbの位置と抽出したマクロブロックMBaの位置との差から、被写体OBJの視差DPFを算出する。視差算出部10aは、マクロブロックMBb毎に算出した視差DPFをメモリMEM2に出力する。   In step S110, the parallax calculation unit 10a calculates the parallax DPF from the position difference between the macro block MBb to be processed among the macro blocks MBb of the image IMG2 and the macro block MBa of the image IMG1 corresponding to the macro block MBb to be processed. calculate. For example, the parallax calculation unit 10a smoothes the pixel values of the images IMG1 and IMG2 for each of the macro blocks MBa and MBb. The parallax calculation unit 10a selects the macro block MBb to be processed from the smoothed image IMG2. The parallax calculation unit 10a performs image processing such as template matching between the selected processing target macroblock MBb and each macroblock MBa in the pixel area AR in which the processing target macroblock MBb is included in the smoothed image IMG1. To calculate the SAD value. The parallax calculation unit 10a extracts the macroblock MBa of the image IMG1 indicating the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). Then, the parallax calculation unit 10a calculates the parallax DPF of the subject OBJ from the difference between the position of the macro block MBb to be processed and the position of the extracted macro block MBa. The parallax calculation unit 10a outputs the parallax DPF calculated for each macroblock MBb to the memory MEM2.

ステップS120では、視差算出部10aは、ステップS110で算出した視差DPFを補正する。例えば、視差算出部10aは、ステップS110で用いたマクロブロックMBa、MBbのうち、中央の行LMBCを含むm行の幅の画像領域でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。視差算出部10aは、m行の幅の画像領域においてSAD値が最小値を示す位置を算出し、算出した位置で視差DPFを補正する。視差算出部10aは、補正した視差DPFをメモリMEM2に出力する。なお、視差DPFを補正するステップS120の処理は、省略されてもよい。   In step S120, the parallax calculation unit 10a corrects the parallax DPF calculated in step S110. For example, the parallax calculation unit 10a performs image processing such as template matching on the image area having a width of m rows including the central row LMBC among the macroblocks MBa and MBb used in step S110, and calculates an SAD value. . The parallax calculation unit 10a calculates a position where the SAD value has a minimum value in an image area having a width of m rows, and corrects the parallax DPF at the calculated position. The parallax calculation unit 10a outputs the corrected parallax DPF to the memory MEM2. Note that the process of step S120 for correcting the parallax DPF may be omitted.

ステップS130では、歪み算出部20aは、ステップS120で補正された視差DPFを用いて、処理対象のマクロブロックMBbの位置を対応する画像IMG1のマクロブロックMBaの位置に合わせる。   In step S130, the distortion calculation unit 20a uses the parallax DPF corrected in step S120 to align the position of the macro block MBb to be processed with the position of the macro block MBa of the corresponding image IMG1.

ステップS140では、歪み算出部20aは、画像IMG2の処理対象のマクロブロックMBbに変形処理を実行し歪み情報INFを算出する。例えば、歪み算出部20aは、被写体OBJ2の形状をステップS110で抽出されたマクロブロックMBaの被写体OBJ1の形状に一致させるように、式(1)のせん断率αを変化させて処理対象のマクロブロックMBbにせん断変形の変形処理を実行する。歪み算出部20aは、せん断変形した処理対象のマクロブロックMBbとステップS110で抽出したマクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20aは、SAD値が最小値を示す場合、せん断変形した被写体OBJ2の形状が被写体OBJ1の形状に最も一致すると判定する。そして、歪み算出部20aは、SAD値が最小値を示す際のせん断率αを歪み情報INFとして算出し、算出した歪み情報INFをメモリMEM2に出力する。   In step S140, the distortion calculation unit 20a calculates a distortion information INF by performing a deformation process on the processing target macroblock MBb of the image IMG2. For example, the distortion calculation unit 20a changes the shear rate α in Expression (1) so as to match the shape of the subject OBJ2 with the shape of the subject OBJ1 of the macroblock MBa extracted in step S110. A deformation process of shear deformation is executed on MBb. The distortion calculation unit 20a performs image processing such as template matching between the macro block MBb to be processed that has undergone shear deformation and the macro block MBa extracted in step S110, and calculates an SAD value. When the SAD value indicates the minimum value, the distortion calculation unit 20a determines that the shape of the subject OBJ2 that has undergone shear deformation most closely matches the shape of the subject OBJ1. Then, the strain calculation unit 20a calculates the shear rate α when the SAD value shows the minimum value as the strain information INF, and outputs the calculated strain information INF to the memory MEM2.

ステップS150では、歪み算出部20aは、ステップS140で算出した歪み情報INFのせん断率αが0か否かを判定する。例えば、歪み算出部20aは、せん断率αが0(すなわち被写体OBJのローリングシャッタ歪みがない)の場合、被写体OBJは動いていない(すなわち実空間上の速度VLが0)と判定する。この場合、画像処理装置100Aの処理は、ステップS180に移る。一方、歪み算出部20aが、せん断率αが0でない(すなわち被写体OBJのローリングシャッタ歪みがある)と判定する場合、画像処理装置100Aの処理は、ステップS160に移る。   In step S150, the strain calculation unit 20a determines whether or not the shear rate α of the strain information INF calculated in step S140 is zero. For example, when the shear rate α is 0 (ie, there is no rolling shutter distortion of the subject OBJ), the distortion calculation unit 20a determines that the subject OBJ is not moving (ie, the speed VL in real space is 0). In this case, the process of the image processing apparatus 100A moves to step S180. On the other hand, when the distortion calculation unit 20a determines that the shear rate α is not 0 (that is, there is a rolling shutter distortion of the subject OBJ), the process of the image processing apparatus 100A proceeds to step S160.

ステップS160では、視差算出部10aは、ステップS140で算出された歪み情報INFを用い視差DPFを再算出する。視差算出部10aは、ステップS120で、マクロブロックMBa、MBbのうち中央の行LMBCを含むm行の幅の画像領域を用い視差DPFを補正する。しかしながら、m行の幅の画像領域における被写体OBJ1、OBJ2の形状は依然として互いに異なる。このため、ステップS120で補正された視差DPFは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる視差との誤差を含む。そこで、視差算出部10aは、例えば、ステップS140で算出されたせん断率αを用い処理対象のマクロブロックMBbに対してせん断変形を実行する。視差算出部10aは、せん断変形した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの間でテンプレートマッチングを実行し、SAD値を算出する。視差算出部10aは、SAD値が最小値を示す場合、せん断変形した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの位置の差から、被写体OBJの視差DPFを再算出する。視差算出部10aは、再算出した視差DPFをメモリMEM2に出力する。   In step S160, the parallax calculation unit 10a recalculates the parallax DPF using the distortion information INF calculated in step S140. In step S120, the parallax calculation unit 10a corrects the parallax DPF using an image region having a width of m rows including the central row LMBC among the macroblocks MBa and MBb. However, the shapes of the subjects OBJ1 and OBJ2 in the image area having a width of m rows are still different from each other. For this reason, the parallax DPF corrected in step S120 includes an error from the parallax caused by imaging the subject OBJ through the lenses LEN1 and LEN2 arranged at different positions. Therefore, for example, the parallax calculation unit 10a performs shear deformation on the processing target macroblock MBb using the shear rate α calculated in step S140. The parallax calculation unit 10a performs template matching between the shear-deformed macroblock MBb to be processed and the macroblock MBa corresponding to the macroblock MBb to be processed, and calculates an SAD value. When the SAD value indicates the minimum value, the parallax calculation unit 10a calculates the parallax DPF of the subject OBJ based on the difference in position between the shear-deformed processing target macroblock MBb and the macroblock MBa corresponding to the processing target macroblock MBb. Recalculate. The parallax calculation unit 10a outputs the recalculated parallax DPF to the memory MEM2.

ステップS170では、速度算出部30aは、ステップS160で再算出した視差DPFおよびステップS140で算出した歪み情報INF等を用い、式(3)−式(6)から実空間における被写体の速度VLを算出する。   In step S170, the speed calculation unit 30a calculates the speed VL of the subject in the real space from the equations (3) to (6) using the parallax DPF recalculated in step S160 and the distortion information INF calculated in step S140. To do.

ステップS180では、制御部CNTLは、画像IMG2において次のマクロブロックMBbがあるか否かを判定する。制御部CNTLが次の処理対象となるマクロブロックMBbがあると判定した場合、画像処理装置100Aの処理は、ステップS110に移る。一方、制御部CNTLが次の処理対象となるマクロブロックMBbがないと判定した場合、画像処理装置100Aの処理は終了する。   In step S180, the control unit CNTL determines whether or not there is a next macroblock MBb in the image IMG2. When the control unit CNTL determines that there is a macroblock MBb to be processed next, the processing of the image processing apparatus 100A proceeds to step S110. On the other hand, when the control unit CNTL determines that there is no macro block MBb to be processed next, the processing of the image processing apparatus 100A ends.

以上、図2から図7に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きを画素領域AR毎に互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、画素領域AR毎に互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100Aは、画像IMG2上の被写体OBJ2に対してマクロブロックMBb毎にせん断変形等の変形処理を実行し、被写体OBJ2の形状を被写体OBJ1の形状に合わせ込むことで、歪み情報INFを算出する。画像処理装置100Aは、歪み情報INFに含まれるせん断率αとマクロブロックMBaの行数kとから、被写体OBJが撮像素子ISEN1上を移動した画素数ΔPXを算出する。画像処理装置100Aは、算出した画素数ΔPXを画素信号の読み出し時間ΔtRで除算した除算値(速度V0)と視差DPF等とを用いて、実空間における被写体OBJの速度VLを算出する。   As described above, in the embodiment shown in FIGS. 2 to 7, the reading of the pixel signals from the image sensors ISEN1 and ISEN2 is executed with the scanning directions in the row arrangement direction reversed for each pixel area AR. Accordingly, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 have different shapes (rolling shutter distortion) for each pixel area AR. Therefore, the image processing apparatus 100A executes deformation processing such as shear deformation on the subject OBJ2 on the image IMG2 for each macroblock MBb, and adjusts the shape of the subject OBJ2 to the shape of the subject OBJ1, thereby distortion information INF. Is calculated. The image processing apparatus 100A calculates the number of pixels ΔPX that the subject OBJ has moved on the image sensor ISEN1 from the shear rate α included in the distortion information INF and the number k of rows of the macroblock MBa. The image processing apparatus 100A calculates the speed VL of the subject OBJ in the real space using a division value (speed V0) obtained by dividing the calculated number of pixels ΔPX by the pixel signal readout time ΔtR, the parallax DPF, and the like.

これにより、画像処理装置100Aは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)から、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Aは、走査の向きが互いに同じ撮像素子を2つ有するステレオカメラが撮像した少なくとも4つのフレームを用いる場合と比べて、メモリMEM1に記憶される画像のデータ量を削減できる。   Thereby, the image processing apparatus 100A can calculate the speed VL of the subject OBJ in the real space from two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. . That is, the image processing apparatus 100A can reduce the data amount of the image stored in the memory MEM1 as compared with the case where at least four frames captured by a stereo camera having two imaging elements having the same scanning direction are used.

また、画像処理装置100Aは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの画像IMG1、IMG2を用いて、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Aは、実空間における被写体OBJの速度VLを算出するために、撮像装置CAM2に2回以上撮影させなくてもよい。そして、画像処理装置100Aは、実空間における被写体OBJの速度を算出する演算量を、従来と比べて削減できる。   Further, the image processing apparatus 100A can calculate the speed VL of the subject OBJ in the real space using the two images IMG1 and IMG2 obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. In other words, the image processing apparatus 100A does not have to cause the imaging device CAM2 to capture images twice or more in order to calculate the speed VL of the subject OBJ in the real space. Then, the image processing apparatus 100A can reduce the amount of calculation for calculating the speed of the subject OBJ in the real space compared to the conventional case.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離DISを算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100Aと同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance DIS between the imaging device and the subject OBJ from the two frames taken by one imaging device, the speed of the subject OBJ in real space is the same or similar to that of the image processing device 100A. It is difficult to calculate with.

図8は、画像処理装置および画像処理方法の別の実施形態を示す。図2で説明した要素と同一または同様の要素については、同一または同様の符号を付し、これ等については、詳細な説明を省略する。図8の破線の矢印は、信号等の情報の流れを示す。   FIG. 8 shows another embodiment of the image processing apparatus and the image processing method. The same or similar elements as those described in FIG. 2 are denoted by the same or similar reference numerals, and detailed description thereof will be omitted. The dashed arrows in FIG. 8 indicate the flow of information such as signals.

画像処理装置100Bは、制御部CNTL、視差算出部10b、歪み算出部20b、速度算出部30b、記録部REC、表示部DIP、メモリMEM1、MEM2およびバスBUSを有する。制御部CNTL、視差算出部10b、歪み算出部20b、速度算出部30b、記録部REC、表示部DIPおよびメモリMEM1、MEM2は、バスBUSに接続される。   The image processing apparatus 100B includes a control unit CNTL, a parallax calculation unit 10b, a distortion calculation unit 20b, a speed calculation unit 30b, a recording unit REC, a display unit DIP, memories MEM1, MEM2, and a bus BUS. The control unit CNTL, the parallax calculation unit 10b, the distortion calculation unit 20b, the speed calculation unit 30b, the recording unit REC, the display unit DIP, and the memories MEM1 and MEM2 are connected to the bus BUS.

制御部CNTLは、CPU等の演算処理装置であり、画像処理装置100Bおよび撮像装置CAM2の各要素を制御する。例えば、制御部CNTLは、図3に示したタイミング図のように、撮像素子ISEN1、ISEN2の行の配列方向の走査の向きを画素領域AR毎に互いに逆にする駆動処理を、駆動部DRVに実行させる。   The control unit CNTL is an arithmetic processing device such as a CPU, and controls each element of the image processing device 100B and the imaging device CAM2. For example, as shown in the timing diagram of FIG. 3, the control unit CNTL performs a driving process for reversing the scanning directions in the arrangement direction of the rows of the imaging elements ISEN1 and ISEN2 for each pixel region AR in the driving unit DRV. Let it run.

視差算出部10bは、撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。視差算出部10bは、図2に示した視差算出部10aと同様に、画像IMG1上の被写体OBJ1の位置と画像IMG2上の被写体OBJ2の位置との差を示す視差DPFを、画像IMG2のマクロブロックMBb毎に算出する。視差算出部10bは、第1の算出部の一例である。視差算出部10bの動作については、図9で説明する
歪み算出部20bは、画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。歪み算出部20bは、撮像素子ISEN1、ISEN2で走査の向きが互いに逆のために生じた画像IMG1の被写体OBJ1と画像IMG2の被写体OBJ2との形状の差異を示す歪み情報INFを、画像IMG2のマクロブロックMBb毎に算出する。歪み算出部20bは、第2の算出部の一例である。歪み算出部20bは、算出した歪み情報INFをメモリMEM2に出力する。歪み算出部20bの動作については、図10で説明する。
The parallax calculation unit 10b receives the images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2 from the memory MEM1 via the bus BUS. Similar to the parallax calculation unit 10a illustrated in FIG. 2, the parallax calculation unit 10b generates a parallax DPF indicating a difference between the position of the subject OBJ1 on the image IMG1 and the position of the subject OBJ2 on the image IMG2 as a macroblock of the image IMG2. Calculated for each MBb. The parallax calculation unit 10b is an example of a first calculation unit. The operation of the parallax calculation unit 10b will be described with reference to FIG. 9. The distortion calculation unit 20b receives the images IMG1 and IMG2 from the memory MEM1 via the bus BUS. The distortion calculation unit 20b generates distortion information INF indicating the difference in shape between the subject OBJ1 of the image IMG1 and the subject OBJ2 of the image IMG2 generated by the imaging elements ISEN1 and ISEN2 because the scanning directions are opposite to each other. Calculated for each block MBb. The distortion calculation unit 20b is an example of a second calculation unit. The distortion calculation unit 20b outputs the calculated distortion information INF to the memory MEM2. The operation of the distortion calculation unit 20b will be described with reference to FIG.

速度算出部30bは、視差DPF、歪み情報INF、読み出し時間情報TINF等をバスBUSを介してメモリMEM2から受け、実空間における被写体OBJの速度VLを算出する第3の算出部の一例である。速度算出部30bは、算出した速度VLを記録部RECおよび表示部DIPに出力する。速度算出部30bの動作については、図10で説明する。   The speed calculation unit 30b is an example of a third calculation unit that receives parallax DPF, distortion information INF, readout time information TINF, and the like from the memory MEM2 via the bus BUS and calculates the speed VL of the subject OBJ in real space. The speed calculation unit 30b outputs the calculated speed VL to the recording unit REC and the display unit DIP. The operation of the speed calculation unit 30b will be described with reference to FIG.

図9は、図8に示した撮像素子ISEN1、ISEN2が図3に示したタイミング図に基づいて撮影した画像IMG1、IMG2の一例を示す。図9では、被写体OBJは、例えば、画角内を上から下(撮像素子ISEN1の走査の向き)に移動する。また、図9では、図を見やすくするために、図4と同様に、画素領域ARは3つ(n=3)とする。さらに、画像IMG1、IMG2は、図5と同様に、視差算出部10bにより各画素領域ARを行方向(図9の横方向)にk列毎に分割される。すなわち、画像IMG1は、画像領域MBa(MBa11−MBa15、MBa21−MBa25、MBa31−MBa35)に区分けされる。画像IMG2は、画像領域MBb(MBb11−MBb15、MBb21−MBb25、MBb31−MBb35)に区分けされる。   FIG. 9 shows an example of images IMG1 and IMG2 taken by the image pickup devices ISEN1 and ISEN2 shown in FIG. 8 based on the timing chart shown in FIG. In FIG. 9, the subject OBJ moves, for example, from the top to the bottom (the scanning direction of the image sensor ISEN1) within the angle of view. Also, in FIG. 9, in order to make the drawing easier to see, the number of pixel areas AR is three (n = 3) as in FIG. Furthermore, in the images IMG1 and IMG2, as in FIG. 5, the parallax calculation unit 10b divides each pixel area AR into k columns in the row direction (horizontal direction in FIG. 9). That is, the image IMG1 is divided into image areas MBa (MBa11-MBa15, MBa21-MBa25, MBa31-MBa35). The image IMG2 is divided into image areas MBb (MBb11-MBb15, MBb21-MBb25, MBb31-MBb35).

撮像素子ISEN1の画素領域ARにおける走査の向きと被写体OBJが移動する向きとは、互いに同じである。このため、撮像素子ISEN1が画素信号を読み出す行の配列方向の走査速度と撮像素子ISEN1上を移動する被写体OBJの速度との相対的な速度差は、小さくなる。これにより、画像IMG1上の被写体OBJ1は、網掛けの矩形で示す本来の形状に対して下の方向に伸びた形状を示す。一方、撮像素子ISEN2における行の配列方向の走査速度と撮像素子ISEN2上を移動する被写体OBJの速度との相対的な速度差は、撮像素子ISEN2の画素領域ARにおける走査の向きと被写体OBJが移動する向きが互いに逆のため大きくなる。このため、画像IMG2上の被写体OBJ2は、網掛けの矩形で示す本来の形状に対して上下方向に縮んだ形状を示す。なお、図1で説明したように、画像IMG1上の被写体OBJ1と画像IMG2上の被写体OBJ2の左右方向のずれは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる。   The direction of scanning in the pixel area AR of the image sensor ISEN1 is the same as the direction in which the subject OBJ moves. For this reason, the relative speed difference between the scanning speed in the arrangement direction of the row from which the image sensor ISEN1 reads out the pixel signal and the speed of the subject OBJ moving on the image sensor ISEN1 becomes small. Thereby, the subject OBJ1 on the image IMG1 shows a shape extending in a downward direction with respect to the original shape indicated by a shaded rectangle. On the other hand, the relative speed difference between the scanning speed of the image sensor ISEN2 in the row arrangement direction and the speed of the subject OBJ moving on the image sensor ISEN2 is determined by the scanning direction in the pixel area AR of the image sensor ISEN2 and the subject OBJ moving. Since the directions to do are opposite to each other, it becomes larger. Therefore, the subject OBJ2 on the image IMG2 shows a shape contracted in the vertical direction with respect to the original shape indicated by the shaded rectangle. As described with reference to FIG. 1, the subject OBJ1 on the image IMG1 and the subject OBJ2 on the image IMG2 are displaced in the left-right direction because the subject OBJ is imaged through the lenses LEN1 and LEN2 arranged at different positions. Caused by.

視差算出部10bは、例えば、図2に示した視差算出部10aと同様に、マクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10bは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行する。そして、視差算出部10bは、処理対象のマクロブロックMBbと各マクロブロックMBaとにおける一致の度合いを示すSAD値を算出する。視差算出部10bは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。図9では、視差算出部10bは、画像IMG2のうち画素領域AR1のマクロブロックMBb14が処理対象の場合、画像IMG1の画素領域AR1におけるマクロブロックMBa12で最小のSAD値を算出する。すなわち、図9に示したマクロブロックMBa12の被写体OBJ1は、マクロブロックMBb14の被写体OBJ2に対応することを示す。   For example, the parallax calculation unit 10b smoothes the pixel values of the images IMG1 and IMG2 for each of the macroblocks MBa and MBb, similarly to the parallax calculation unit 10a illustrated in FIG. The parallax calculation unit 10b generates a template between the macroblock MBb to be processed in the smoothed image IMG2 and each macroblock MBa in the pixel area AR that includes the macroblock MBb to be processed in the smoothed image IMG1. Image processing such as matching is executed. Then, the parallax calculation unit 10b calculates a SAD value indicating the degree of coincidence between the processing target macroblock MBb and each macroblock MBa. The parallax calculation unit 10b extracts the macroblock MBa of the image IMG1 indicating the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). In FIG. 9, when the macro block MBb14 in the pixel area AR1 of the image IMG2 is the processing target, the parallax calculation unit 10b calculates the minimum SAD value in the macro block MBa12 in the pixel area AR1 of the image IMG1. That is, the subject OBJ1 of the macroblock MBa12 shown in FIG. 9 corresponds to the subject OBJ2 of the macroblock MBb14.

そして、視差算出部10bは、処理対象のマクロブロックMBbの位置と処理対象のマクロブロックMBbに対応するマクロブロックMBaの位置との差から、被写体OBJの視差DPFを算出する。視差算出部10bは、画像IMG2のマクロブロックMBb毎に算出した視差DPFをメモリMEM2に出力する。   Then, the parallax calculation unit 10b calculates the parallax DPF of the subject OBJ from the difference between the position of the processing target macroblock MBb and the position of the macroblock MBa corresponding to the processing target macroblock MBb. The parallax calculation unit 10b outputs the parallax DPF calculated for each macroblock MBb of the image IMG2 to the memory MEM2.

図10は、図8に示した歪み算出部20bにおける演算処理の一例を示す。図10に示した例では、歪み算出部20bは、図9に示した画像IMG2のマクロブロックMBb14とマクロブロックMBb14に対応する画像IMG1のマクロブロックMBa12とを用い、被写体OBJ1、OBJ2の形状の差異を示す歪み情報INFを算出する。なお、歪み算出部20bは、画像IMG2のマクロブロックMBb14以外の他のマクロブロックMBbに対しても、マクロブロックMBb14と同一あるいは同様の演算処理を実行する。   FIG. 10 shows an example of calculation processing in the distortion calculation unit 20b shown in FIG. In the example shown in FIG. 10, the distortion calculation unit 20b uses the macroblock MBb14 of the image IMG2 and the macroblock MBa12 of the image IMG1 corresponding to the macroblock MBb14 shown in FIG. 9, and the difference in the shapes of the subjects OBJ1 and OBJ2 Is calculated. Note that the distortion calculation unit 20b performs the same or similar calculation process as that of the macroblock MBb14 on the macroblock MBb other than the macroblock MBb14 of the image IMG2.

歪み算出部20bは、視差算出部10bにより画像IMG2のマクロブロックMBb毎に算出された視差DPFを用い、被写体OBJ1、OBJ2を互いに重ね合わせる処理を実行する。例えば、歪み算出部20bは、処理対象のマクロブロックMBb14における視差DPFを用いて、マクロブロックMBb14における被写体OBJ2の位置と、マクロブロックMBa12における被写体OBJ1の位置とを互いに合わせる。そして、歪み算出部20bは、マクロブロックMBa12の被写体OBJ1の形状に一致させるように、被写体OBJ2を図10に示す矢印の向きで拡大(あるいは縮小)する変形処理(以下、拡縮変形とも称する)をマクロブロックMBb14に実行する。例えば、歪み算出部20bは、アフィン変換の行列を含む式(7)を用いて処理対象のマクロブロックMBb14に拡縮処理を実行し、拡縮された破線で示すマクロブロックMBdを得る。   The distortion calculation unit 20b executes a process of superimposing the subjects OBJ1 and OBJ2 on each other using the parallax DPF calculated for each macroblock MBb of the image IMG2 by the parallax calculation unit 10b. For example, the distortion calculation unit 20b matches the position of the subject OBJ2 in the macroblock MBb14 and the position of the subject OBJ1 in the macroblock MBa12 using the parallax DPF in the processing target macroblock MBb14. Then, the distortion calculation unit 20b performs a deformation process (hereinafter also referred to as expansion / contraction deformation) for enlarging (or reducing) the subject OBJ2 in the direction of the arrow illustrated in FIG. 10 so as to match the shape of the subject OBJ1 of the macroblock MBa12. The macro block MBb14 is executed. For example, the distortion calculation unit 20b performs an enlargement / reduction process on the macroblock MBb14 to be processed using Expression (7) including an affine transformation matrix, and obtains an enlarged / reduced macroblock MBd indicated by a broken line.

Figure 0006477193
Figure 0006477193

(x,y)は、処理対象のマクロブロックMBb14の画素の位置を示し、(xa,ya)は拡縮されたマクロブロックMBdの画素の位置を示す。変数βは、拡縮処理による変形量であり、拡縮率とも称される。変数Tyは、被写体OBJ1における行の配列方向の中心位と被写体OBJ2における行の配列方向の中心との差を示す。 (X, y) indicates the pixel position of the macro block MBb14 to be processed, and (xa, ya) indicates the pixel position of the enlarged or reduced macro block MBd. The variable β is a deformation amount due to the enlargement / reduction process, and is also referred to as an enlargement / reduction ratio. The variable Ty indicates the difference between the center position in the row arrangement direction of the subject OBJ1 and the center in the row arrangement direction of the subject OBJ2.

歪み算出部20bは、例えば、拡縮率β、変数Tyをそれぞれ変化させて拡縮したマクロブロックMBdとマクロブロックMBa12との間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20bは、SAD値が最小値を示す場合、拡縮した被写体OBJ2が被写体OBJ1に最も一致すると判定する、そして、歪み算出部20bは、SAD値が最小値を示す際の拡縮率βを歪み情報INFとして算出する。   For example, the distortion calculation unit 20b performs image processing such as template matching between the macroblock MBd and the macroblock MBa12 that are scaled by changing the scaling ratio β and the variable Ty, and calculates the SAD value. When the SAD value indicates the minimum value, the distortion calculation unit 20b determines that the enlarged / reduced subject OBJ2 most closely matches the subject OBJ1, and the distortion calculation unit 20b determines the expansion / contraction rate β when the SAD value indicates the minimum value. Calculated as distortion information INF.

速度算出部30bは、視差算出部10bにより算出された視差DPF、歪み算出部20bにより算出された歪み情報INFおよび読み出し時間情報TINFを用い、実空間における被写体OBJの速度VLを算出する。例えば、図9に示したように、撮像素子ISEN1における行の配列方向の走査速度と撮像素子ISEN1上を移動する被写体OBJの速度との相対的な速度差が小さくなるため、画像IMG1上の被写体OBJ1は、被写体OBJが下方向に伸びた形状を示す。一方、撮像素子ISEN2における行の配列方向の走査速度と撮像素子ISEN2上を移動する被写体OBJの速度との相対的な速度差が大きくなるため、画像IMG2上の被写体OBJ2は、被写体OBJを上下方向に縮めた形状を示す。換言すれば、図9は、行の配列方向の被写体OBJ1、OBJ2の大きさは、撮像素子ISEN1、ISEN2における行の配列方向の走査速度と、撮像素子ISEN1、ISEN2上を移動する被写体OBJの速度との速度差に反比例することを示す。被写体OBJ1、OBJ2の行の配列方向における大きさの比が拡縮率βとする場合、拡縮率βは、撮像素子ISEN1、ISEN2における行の配列方向の走査速度および撮像素子ISEN1、ISEN2上の被写体OBJの速度とを用い、式(8)で表される。   The speed calculation unit 30b calculates the speed VL of the subject OBJ in real space using the parallax DPF calculated by the parallax calculation unit 10b, the distortion information INF calculated by the distortion calculation unit 20b, and the readout time information TINF. For example, as shown in FIG. 9, since the relative speed difference between the scanning speed in the row arrangement direction of the image sensor ISEN1 and the speed of the object OBJ moving on the image sensor ISEN1 is small, the object on the image IMG1 OBJ1 indicates a shape in which the subject OBJ extends downward. On the other hand, since the relative speed difference between the scanning speed of the image sensor ISEN2 in the row arrangement direction and the speed of the subject OBJ moving on the image sensor ISEN2 increases, the subject OBJ2 on the image IMG2 moves the subject OBJ in the vertical direction. Shows the shrunk shape. In other words, FIG. 9 shows that the sizes of the subjects OBJ1 and OBJ2 in the row arrangement direction are the scanning speed in the row arrangement direction of the imaging elements ISEN1 and ISEN2, and the speed of the subject OBJ moving on the imaging elements ISEN1 and ISEN2. It is inversely proportional to the speed difference. When the ratio of the sizes of the subjects OBJ1 and OBJ2 in the row arrangement direction is the enlargement / reduction rate β, the enlargement / reduction rate β is determined by the scanning speed in the row arrangement direction of the imaging elements ISEN1 and ISEN2 and the subject OBJ on the imaging elements ISEN1 and ISEN2. The speed is expressed by the equation (8).

Figure 0006477193
Figure 0006477193

変数L1、L2は、被写体OBJ1、OBJ2の行の配列方向における大きさ(画素数)を示す。変数Vsrは、撮像素子ISEN1、ISEN2における行の配列方向の走査速度を示す。変数V0は、撮像素子ISEN1、ISEN2上を移動する被写体OBJの速度を示す。そして、式(8)から撮像素子ISEN1、ISEN2上を移動する被写体OBJの速度V0を算出する式(9)が導かれる。   Variables L1 and L2 indicate the size (number of pixels) of the rows of the subjects OBJ1 and OBJ2 in the arrangement direction. The variable Vsr indicates the scanning speed in the row arrangement direction of the imaging elements ISEN1 and ISEN2. A variable V0 indicates the speed of the subject OBJ that moves on the imaging elements ISEN1 and ISEN2. Then, Expression (9) for calculating the speed V0 of the subject OBJ moving on the imaging elements ISEN1 and ISEN2 is derived from Expression (8).

Figure 0006477193
Figure 0006477193

また、式(4)が示すように、撮像素子ISEN1、ISEN2が行数kのマクロブロックMBa、MBbから画素信号を読み出すのに、読み出し時間ΔtRかかる。このことから、撮像素子ISEN1、ISEN2における行の配列方向の走査速度Vsrは、式(10)のように表される。   Further, as shown in Expression (4), it takes a readout time ΔtR for the image sensors ISEN1 and ISEN2 to read out pixel signals from the macroblocks MBa and MBb having k rows. From this, the scanning speed Vsr in the row arrangement direction in the imaging elements ISEN1 and ISEN2 is expressed as in Expression (10).

Vsr=k/ΔtR=(Le−L1+1)/(te−t1) …(10)
速度算出部30bは、拡縮率β、読み出し時間情報TINFを用い、式(9)、式(10)から撮像素子ISEN1上を移動する被写体OBJの速度V0を算出する。速度算出部30bは、撮像素子ISEN1上を移動する被写体OBJの速度V0、視差DPF、レンズLEN1とレンズLEN2との光軸間の距離B、およびレンズLEN1の焦点距離fを用い、式(6)から実空間における被写体OBJの速度VLを算出する。そして、速度算出部30bは、算出した速度VLを、画像IMG1、IMG2とともに記録部RECおよび表示部DIPに出力する。
Vsr = k / ΔtR = (Le−L1 + 1) / (te−t1) (10)
The speed calculation unit 30b calculates the speed V0 of the subject OBJ moving on the image sensor ISEN1 from the expressions (9) and (10) using the enlargement / reduction ratio β and the readout time information TINF. The speed calculation unit 30b uses the speed V0 of the subject OBJ moving on the image sensor ISEN1, the parallax DPF, the distance B between the optical axes of the lens LEN1 and the lens LEN2, and the focal length f of the lens LEN1, and the expression (6) To calculate the speed VL of the subject OBJ in real space. Then, the speed calculation unit 30b outputs the calculated speed VL to the recording unit REC and the display unit DIP together with the images IMG1 and IMG2.

図11は、図8に示した画像処理装置100Bにおける画像処理の一例を示す。図11に示した処理は、制御部CNTLが画像処理プログラムを実行することにより実現される。なお、図11に示したステップの動作のうち、図7に示したステップと同一または同様の処理を示すものについては、同一のステップ番号を付し、詳細な説明を省略する。   FIG. 11 shows an example of image processing in the image processing apparatus 100B shown in FIG. The processing shown in FIG. 11 is realized by the control unit CNTL executing an image processing program. Note that among the operations of the steps shown in FIG. 11, those showing the same or similar processing as the steps shown in FIG. 7 are given the same step numbers, and detailed descriptions thereof are omitted.

また、図11に示した処理は、画像処理装置100Bに設けられるハードウェアにより実行されてもよい。この場合、図8に示した視差算出部10b、歪み算出部20bおよび速度算出部30bは、画像処理装置100B内に配置される回路により実現される。   Further, the process illustrated in FIG. 11 may be executed by hardware provided in the image processing apparatus 100B. In this case, the parallax calculation unit 10b, the distortion calculation unit 20b, and the speed calculation unit 30b illustrated in FIG. 8 are realized by circuits arranged in the image processing apparatus 100B.

画像処理装置100Bは、図11に示したステップS100、ステップS110およびステップS130の処理を実行した後、ステップS140aの処理を実行する。   The image processing apparatus 100B executes the process of step S140a after executing the processes of step S100, step S110, and step S130 shown in FIG.

ステップS140aでは、歪み算出部20bは、画像IMG2の処理対象のマクロブロックMBbに変形処理を実行し歪み情報INFを算出する。例えば、歪み算出部20bは、被写体OBJ2の形状をステップS110で抽出されたマクロブロックMBaの被写体OBJ1の形状に一致させるように、式(7)の拡縮率βおよび変数Tyを変化させて処理対象のマクロブロックMBbに拡縮処理を実行する。歪み算出部20bは、拡縮処理した処理対象のマクロブロックMBbとステップS110で抽出されたマクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20bは、SAD値が最小値を示す場合、拡縮された被写体OBJ2の形状が被写体OBJ1の形状に最も一致すると判定する。そして、歪み算出部20bは、SAD値が最小値を示す際の拡縮率βを歪み情報INFとして算出し、算出した歪み情報INFをメモリMEM2に出力する。   In step S140a, the distortion calculation unit 20b performs a deformation process on the processing target macroblock MBb of the image IMG2 to calculate distortion information INF. For example, the distortion calculation unit 20b changes the enlargement / contraction ratio β and the variable Ty in Expression (7) so that the shape of the subject OBJ2 matches the shape of the subject OBJ1 of the macroblock MBa extracted in step S110. The enlargement / reduction processing is executed on the macro block MBb. The distortion calculation unit 20b performs image processing such as template matching between the macroblock MBb to be processed that has been enlarged / reduced and the macroblock MBa extracted in step S110, and calculates an SAD value. When the SAD value indicates the minimum value, the distortion calculation unit 20b determines that the shape of the scaled subject OBJ2 most closely matches the shape of the subject OBJ1. Then, the distortion calculation unit 20b calculates the expansion / contraction rate β when the SAD value shows the minimum value as the distortion information INF, and outputs the calculated distortion information INF to the memory MEM2.

ステップS150aでは、歪み算出部20bは、ステップS140aで算出した歪み情報INFの拡縮率βが1か否かを判定する。例えば、歪み算出部20bは、拡縮率βが1(すなわち被写体OBJのローリングシャッタ歪みがない)の場合、被写体OBJは動いていない(すなわち実空間上の速度VLが0)と判定する。この場合、画像処理装置100Bの処理は、ステップS180に移る。一方、歪み算出部20bが、拡縮率βが1でない(すなわち被写体OBJのローリングシャッタ歪みがある)と判定する場合、画像処理装置100Bの処理は、ステップS160aに移る。   In step S150a, the distortion calculation unit 20b determines whether the expansion / contraction rate β of the distortion information INF calculated in step S140a is 1. For example, when the enlargement / reduction ratio β is 1 (that is, there is no rolling shutter distortion of the subject OBJ), the distortion calculation unit 20b determines that the subject OBJ is not moving (that is, the speed VL in real space is 0). In this case, the process of the image processing apparatus 100B moves to step S180. On the other hand, when the distortion calculation unit 20b determines that the enlargement / reduction ratio β is not 1 (that is, there is a rolling shutter distortion of the subject OBJ), the processing of the image processing apparatus 100B proceeds to step S160a.

ステップS160aでは、視差算出部10bは、ステップS140aで算出された歪み情報INFを用い視差DPFを再算出する。視差算出部10bは、例えば、ステップS140aで算出された拡縮率βを用い処理対象のマクロブロックMBbに対して拡縮処理を実行する。視差算出部10bは、拡縮した処理対象のマクロブロックMBbの被写体OBJ2の形状を、処理対象のマクロブロックMBbに対応するマクロブロックMBaの被写体OBJ1の形状に合わせる。視差算出部10bは、拡縮した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの間でテンプレートマッチングを実行し、SAD値を算出する。視差算出部10bは、SAD値が最小値を示す場合、拡縮した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの位置の差から、被写体OBJの視差DPFを再算出する。視差算出部10bは、再算出した視差DPFをメモリMEM2に出力する。   In step S160a, the parallax calculation unit 10b recalculates the parallax DPF using the distortion information INF calculated in step S140a. For example, the parallax calculation unit 10b performs an enlargement / reduction process on the processing target macroblock MBb using the enlargement / reduction ratio β calculated in step S140a. The parallax calculation unit 10b matches the shape of the subject OBJ2 of the macro block MBb to be scaled up and down with the shape of the subject OBJ1 of the macro block MBa corresponding to the macro block MBb to be processed. The parallax calculation unit 10b performs template matching between the enlarged / reduced macro block MBb to be processed and the macro block MBa corresponding to the macro block MBb to be processed, and calculates an SAD value. When the SAD value indicates the minimum value, the parallax calculation unit 10b re-analyzes the parallax DPF of the subject OBJ from the position difference between the enlarged / reduced macro block MBb and the macro block MBa corresponding to the macro block MBb to be processed. calculate. The parallax calculation unit 10b outputs the recalculated parallax DPF to the memory MEM2.

ステップS170aでは、速度算出部30bは、ステップS160aで再算出された視差DPFおよびステップS140aで算出された歪み情報INF等を用い、式(6)、式(9)、式(10)から実空間における被写体OBJの速度VLを算出する。   In step S170a, the speed calculation unit 30b uses the parallax DPF recalculated in step S160a, the distortion information INF calculated in step S140a, and the like from the equations (6), (9), and (10). The speed VL of the subject OBJ at is calculated.

画像処理装置100Bは、ステップS170aの処理を実行した後、ステップS180の処理を実行する。   The image processing apparatus 100B executes the process of step S180 after executing the process of step S170a.

以上、図8から図11に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きを画素領域AR毎に互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、画素領域AR毎に互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100Bは、画像IMG2上の被写体OBJ2に対してマクロブロックMBb毎に拡縮する変形処理を実行し、被写体OBJ2の形状を被写体OBJ1の形状に合わせ込むことで、歪み情報INFを算出する。画像処理装置100Bは、視差DPF、歪み情報INFの拡縮率β、および読み出し時間情報TINF等を用いて、実空間における被写体OBJの速度VLを算出する。   As described above, in the embodiment shown in FIGS. 8 to 11, the reading of the pixel signals from the image sensors ISEN1 and ISEN2 is executed with the scanning directions in the row arrangement direction reversed for each pixel area AR. Accordingly, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 have different shapes (rolling shutter distortion) for each pixel area AR. Therefore, the image processing apparatus 100B calculates a distortion information INF by executing a deformation process for scaling up and down the subject OBJ2 on the image IMG2 for each macroblock MBb and matching the shape of the subject OBJ2 with the shape of the subject OBJ1. To do. The image processing apparatus 100B calculates the speed VL of the subject OBJ in the real space using the parallax DPF, the scaling factor β of the distortion information INF, the readout time information TINF, and the like.

これにより、画像処理装置100Bは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)から、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Bは、走査の向きが互いに同じ撮像素子を2つ有するステレオカメラが撮像した少なくとも4つのフレームを用いる場合と比べて、メモリMEM1に記憶される画像のデータ量を削減できる。   Thereby, the image processing apparatus 100B can calculate the speed VL of the subject OBJ in the real space from two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. . That is, the image processing apparatus 100B can reduce the data amount of the image stored in the memory MEM1 as compared to the case where at least four frames captured by a stereo camera having two imaging elements having the same scanning direction are used.

また、画像処理装置100Bは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの画像IMG1、IMG2を用いて、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Bは、実空間における被写体OBJの速度VLを算出するために、撮像装置CAM2に2回以上撮影させなくてもよい。そして、画像処理装置100Bは、実空間における被写体OBJの速度を算出する演算量を、従来と比べて削減できる。   Further, the image processing apparatus 100B can calculate the speed VL of the subject OBJ in the real space using the two images IMG1 and IMG2 obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. That is, the image processing apparatus 100B does not have to cause the imaging device CAM2 to capture images twice or more in order to calculate the speed VL of the subject OBJ in the real space. Then, the image processing apparatus 100B can reduce the amount of calculation for calculating the speed of the subject OBJ in the real space compared to the conventional case.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離DISを算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100Bと同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance DIS between the imaging device and the subject OBJ from the two frames taken by one imaging device, the speed of the subject OBJ in the real space is the same or similar to that of the image processing device 100B. It is difficult to calculate with.

図12は、画像処理装置および画像処理方法の別の実施形態を示す。図8で説明した要素と同一または同様の要素については、同一または同様の符号を付し、これ等については、詳細な説明を省略する。図12の破線の矢印は、信号等の情報の流れを示す。   FIG. 12 shows another embodiment of the image processing apparatus and the image processing method. The same or similar elements as those described in FIG. 8 are denoted by the same or similar reference numerals, and detailed description thereof will be omitted. The dashed arrows in FIG. 12 indicate the flow of information such as signals.

画像処理装置100Cは、制御部CNTL、視差算出部10c、歪み算出部20c、速度算出部30c、記録部REC、表示部DIP、メモリMEM1、MEM2およびバスBUSを有する。制御部CNTL、視差算出部10c、歪み算出部20c、速度算出部30c、記録部REC、表示部DIPおよびメモリMEM1、MEM2は、バスBUSに接続される。   The image processing apparatus 100C includes a control unit CNTL, a parallax calculation unit 10c, a distortion calculation unit 20c, a speed calculation unit 30c, a recording unit REC, a display unit DIP, memories MEM1, MEM2, and a bus BUS. The control unit CNTL, the parallax calculation unit 10c, the distortion calculation unit 20c, the speed calculation unit 30c, the recording unit REC, the display unit DIP, and the memories MEM1 and MEM2 are connected to the bus BUS.

視差算出部10cは、撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。視差算出部10cは、図8に示した視差算出部10bと同様に、画像IMG1上の被写体OBJ1の位置と画像IMG2上の被写体OBJ2の位置との差を示す視差DPFを、画像IMG2のマクロブロックMBb毎に算出する。視差算出部10cは、第1の算出部の一例である。視差算出部10cの動作については、図13で説明する
歪み算出部20cは、画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。歪み算出部20cは、撮像素子ISEN1、ISEN2で走査の向きが互いに逆のために生じた画像IMG1の被写体OBJ1と画像IMG2の被写体OBJ2との形状の差異を示す歪み情報INFを、画像IMG2のマクロブロックMBb毎に算出する。歪み算出部20cは、第2の算出部の一例である。歪み算出部20cは、算出した歪み情報INFをメモリMEM2に出力する。歪み算出部20cの動作については、図14で説明する。
The parallax calculation unit 10c receives images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2 from the memory MEM1 via the bus BUS. Similar to the parallax calculation unit 10b illustrated in FIG. 8, the parallax calculation unit 10c generates a parallax DPF indicating the difference between the position of the subject OBJ1 on the image IMG1 and the position of the subject OBJ2 on the image IMG2 as a macroblock of the image IMG2. Calculated for each MBb. The parallax calculation unit 10c is an example of a first calculation unit. The operation of the parallax calculation unit 10c will be described with reference to FIG. 13. The distortion calculation unit 20c receives the images IMG1 and IMG2 from the memory MEM1 via the bus BUS. The distortion calculation unit 20c generates distortion information INF indicating the difference in shape between the subject OBJ1 of the image IMG1 and the subject OBJ2 of the image IMG2 generated by the imaging elements ISEN1 and ISEN2 because the scanning directions are opposite to each other. Calculated for each block MBb. The distortion calculation unit 20c is an example of a second calculation unit. The distortion calculation unit 20c outputs the calculated distortion information INF to the memory MEM2. The operation of the distortion calculation unit 20c will be described with reference to FIG.

速度算出部30cは、視差DPF、歪み情報INF、読み出し時間情報TINF等をバスBUSを介してメモリMEM2から受け、実空間における被写体OBJの速度VLを算出する第3の算出部の一例である。速度算出部30cは、算出した速度VLを記録部RECおよび表示部DIPに出力する。速度算出部30cの動作については、図14で説明する。   The speed calculation unit 30c is an example of a third calculation unit that receives parallax DPF, distortion information INF, readout time information TINF, and the like from the memory MEM2 via the bus BUS and calculates the speed VL of the subject OBJ in real space. The speed calculation unit 30c outputs the calculated speed VL to the recording unit REC and the display unit DIP. The operation of the speed calculation unit 30c will be described with reference to FIG.

図13は、図12に示した撮像素子ISEN1、ISEN2が図3に示したタイミング図に基づいて撮影した画像IMG1、IMG2の一例を示す。図13では、被写体OBJは、例えば、画角内を上から下(撮像素子ISEN1の走査の向き)に移動する。また、図13では、図を見やすくするために、図9と同様に、画素領域ARは3つ(n=3)とする。さらに、画像IMG1、IMG2は、図9と同様に、視差算出部10cにより各画素領域ARを行方向(図13の横方向)にk列毎に分割される。すなわち、画像IMG1は、画像領域MBa(MBa11−MBa15、MBa21−MBa25、MBa31−MBa35)に区分けされる。画像IMG2は、画像領域MBb(MBb11−MBb15、MBb21−MBb25、MBb31−MBb35)に区分けされる。   FIG. 13 shows an example of images IMG1 and IMG2 taken by the image pickup devices ISEN1 and ISEN2 shown in FIG. 12 based on the timing chart shown in FIG. In FIG. 13, the subject OBJ moves, for example, from the top to the bottom (the scanning direction of the image sensor ISEN1) within the angle of view. Further, in FIG. 13, in order to make the drawing easier to see, the number of pixel regions AR is three (n = 3) as in FIG. Furthermore, in the images IMG1 and IMG2, as in FIG. 9, the parallax calculation unit 10c divides each pixel area AR into k columns in the row direction (horizontal direction in FIG. 13). That is, the image IMG1 is divided into image areas MBa (MBa11-MBa15, MBa21-MBa25, MBa31-MBa35). The image IMG2 is divided into image areas MBb (MBb11-MBb15, MBb21-MBb25, MBb31-MBb35).

撮像素子ISEN1の画素領域ARにおける走査の向きと被写体OBJが移動する向きとが互いに同じため、撮像素子ISEN1における行の配列方向の走査速度Vsrと撮像素子ISEN1上を移動する被写体OBJの速度V0との相対的な速度差は、小さくなる。これにより、例えば、画像IMG1上の被写体OBJ1(OBJ1a、OBJ1b)は、網掛けの矩形で示す本来の形状に対して下の方向に、画素領域AR1、AR2に跨って伸びた形状を示す。一方、撮像素子ISEN2の画素領域ARにおける走査の向きと被写体OBJが移動する向きが互いに逆のため、撮像素子ISEN2での行の配列方向の走査速度Vsrと撮像素子ISEN2上を移動する被写体OBJの速度V0との相対的な速度差は、大きくなる。このため、例えば、画像IMG2上の被写体OBJ2(OBJ2a、OBJ2b)は、網掛けの矩形で示す本来の形状に対して上下方向に縮んだ形状を各画素領域AR1、AR2で示す。なお、図1で説明したように、画像IMG1上の被写体OBJ1と画像IMG2上の被写体OBJ2の左右方向のずれは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる。   Since the scanning direction in the pixel area AR of the image sensor ISEN1 and the moving direction of the subject OBJ are the same, the scanning speed Vsr in the row arrangement direction of the image sensor ISEN1 and the speed V0 of the subject OBJ moving on the image sensor ISEN1 The relative speed difference becomes smaller. Thereby, for example, the subject OBJ1 (OBJ1a, OBJ1b) on the image IMG1 has a shape extending across the pixel areas AR1, AR2 in the downward direction with respect to the original shape indicated by the shaded rectangle. On the other hand, since the scanning direction in the pixel area AR of the image sensor ISEN2 and the moving direction of the subject OBJ are opposite to each other, the scanning speed Vsr in the row arrangement direction of the image sensor ISEN2 and the subject OBJ moving on the image sensor ISEN2 The relative speed difference from the speed V0 is increased. For this reason, for example, the subject OBJ2 (OBJ2a, OBJ2b) on the image IMG2 has a shape contracted in the vertical direction with respect to the original shape indicated by the shaded rectangles as the pixel regions AR1, AR2. As described with reference to FIG. 1, the subject OBJ1 on the image IMG1 and the subject OBJ2 on the image IMG2 are displaced in the left-right direction because the subject OBJ is imaged through the lenses LEN1 and LEN2 arranged at different positions. Caused by.

視差算出部10cは、例えば、図8に示した視差算出部10bと同様に、マクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10cは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行する。そして、視差算出部10cは、処理対象のマクロブロックMBbと各マクロブロックMBaとにおける一致の度合いを示すSAD値を算出する。視差算出部10bは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。図13では、視差算出部10cは、画像IMG2のうち画素領域AR1のマクロブロックMBb14が処理対象の場合、画像IMG1の画素領域AR1におけるマクロブロックMBa12で最小のSAD値を算出する。すなわち、図13に示したマクロブロックMBa12の被写体OBJ1aは、マクロブロックMBb14の被写体OBJ2aに対応することを示す。   For example, the parallax calculation unit 10c smoothes the pixel values of the images IMG1 and IMG2 for each of the macroblocks MBa and MBb, similarly to the parallax calculation unit 10b illustrated in FIG. The parallax calculation unit 10c generates a template between the macroblock MBb to be processed in the smoothed image IMG2 and each macroblock MBa in the pixel area AR that includes the macroblock MBb to be processed in the smoothed image IMG1. Image processing such as matching is executed. Then, the parallax calculation unit 10c calculates an SAD value indicating the degree of matching between the macro block MBb to be processed and each macro block MBa. The parallax calculation unit 10b extracts the macroblock MBa of the image IMG1 indicating the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). In FIG. 13, when the macro block MBb14 in the pixel area AR1 of the image IMG2 is the processing target, the parallax calculation unit 10c calculates the minimum SAD value in the macro block MBa12 in the pixel area AR1 of the image IMG1. That is, the subject OBJ1a of the macroblock MBa12 shown in FIG. 13 corresponds to the subject OBJ2a of the macroblock MBb14.

また、視差算出部10cは、画像IMG2のうち画素領域AR2のマクロブロックMBb24が処理対象の場合、画像IMG1の画素領域AR2におけるマクロブロックMBa22で最小のSAD値を算出する。すなわち、図13に示したマクロブロックMBa22の被写体OBJ1bは、マクロブロックMBb24の被写体OBJ2bに対応する。そして、視差算出部10cは、処理対象のマクロブロックMBbの位置と、処理対象のマクロブロックMBbに対応するマクロブロックMBaの位置との差から、被写体OBJの視差DPFを算出する。視差算出部10cは、画像IMG2のマクロブロックMBb毎に算出した視差DPFをメモリMEM2に出力する。   In addition, when the macro block MBb24 in the pixel area AR2 of the image IMG2 is the processing target, the parallax calculation unit 10c calculates the minimum SAD value in the macro block MBa22 in the pixel area AR2 of the image IMG1. That is, the subject OBJ1b of the macroblock MBa22 shown in FIG. 13 corresponds to the subject OBJ2b of the macroblock MBb24. Then, the parallax calculation unit 10c calculates the parallax DPF of the subject OBJ from the difference between the position of the processing target macroblock MBb and the position of the macroblock MBa corresponding to the processing target macroblock MBb. The parallax calculation unit 10c outputs the parallax DPF calculated for each macroblock MBb of the image IMG2 to the memory MEM2.

なお、視差算出部10cがマクロブロックMBa、MBb毎に画像IMG1、IMG2を平滑化するため、視差DPFの精度は、マクロブロックMBa、MBbの大きさ程度である。そこで、視差算出部10cは、視差DPFの精度を上げる処理を実行してもよい。視差算出部10cは、例えば、処理対象のマクロブロックMBbおよび処理対象のマクロブロックMBbに対応するマクロブロックMBaにおいて、行方向(図13の横方向)における輝度の変化から被写体OBJ1、OBJ2のエッジを検出する。視差算出部10cは、検出した被写体OBJ1、OBJ2のエッジの位置の差を算出し、算出した位置の差で視差DPFを補正する。マクロブロックMBa、MBb内の被写体OBJ1、OBJ2のエッジの位置に基づいて視差DPFを補正することで、補正した視差DPFは画素単位の精度を有する。   Since the parallax calculation unit 10c smoothes the images IMG1 and IMG2 for each of the macro blocks MBa and MBb, the accuracy of the parallax DPF is about the size of the macro blocks MBa and MBb. Therefore, the parallax calculation unit 10c may execute processing for increasing the accuracy of the parallax DPF. For example, in the macro block MBa corresponding to the processing target macro block MBb and the processing target macro block MBb, the parallax calculation unit 10c detects the edges of the subjects OBJ1 and OBJ2 from the luminance change in the row direction (the horizontal direction in FIG. 13). To detect. The parallax calculation unit 10c calculates the difference between the positions of the detected edges of the subjects OBJ1 and OBJ2, and corrects the parallax DPF with the calculated difference between the positions. By correcting the parallax DPF based on the positions of the edges of the subjects OBJ1 and OBJ2 in the macroblocks MBa and MBb, the corrected parallax DPF has accuracy in units of pixels.

また、図13に示すように、被写体OBJ1が画素領域AR1、AR2に跨るため、画像IMG1のマクロブロックMBa12、MBa22は互いに被写体OBJ1の一部が欠ける。このため、例えば、図8に示した歪み算出部20bは、式(7)を用い画像IMG2の処理対象のマクロブロックMBb14、MBb24それぞれに拡縮処理を実行しても、被写体OBJ1、OBJ2の形状を互いに一致またはほぼ一致させることが困難となる。すなわち、図8に示した歪み算出部20bは、最小のSAD値を算出することが困難となり、歪み情報INFを算出することが困難となる。   As shown in FIG. 13, since the subject OBJ1 extends over the pixel areas AR1 and AR2, the macro blocks MBa12 and MBa22 of the image IMG1 lack a part of the subject OBJ1. Therefore, for example, even if the distortion calculation unit 20b illustrated in FIG. 8 performs the enlargement / reduction processing on each of the macroblocks MBb14 and MBb24 that are the processing target of the image IMG2 using Expression (7), the shapes of the subjects OBJ1 and OBJ2 are changed. It becomes difficult to match or almost match each other. That is, it becomes difficult for the distortion calculation unit 20b illustrated in FIG. 8 to calculate the minimum SAD value and to calculate the distortion information INF.

図14は、図12に示した歪み算出部20cにおける演算処理の一例を示す。図14(a)は、図13に示した画像IMG2のマクロブロックMBb14の被写体OBJ2aを示す。図14(b)は、図13に示した画像IMG1のマクロブロックMBa12の被写体OBJ1aを示す。すなわち、図14に示した例では、歪み算出部20cは、処理対象のマクロブロックMBb14とマクロブロックMBb14に対応するマクロブロックMBa12とを用い、被写体OBJ1、OBJ2の形状の差異を示す歪み情報INFを算出する。なお、歪み算出部20cは、画像IMG2のマクロブロックMBb14以外の他のマクロブロックMBbに対しても、マクロブロックMBb14と同一あるいは同様の演算処理を実行する。   FIG. 14 shows an example of calculation processing in the distortion calculation unit 20c shown in FIG. FIG. 14A shows the subject OBJ2a of the macro block MBb14 of the image IMG2 shown in FIG. FIG. 14B shows the subject OBJ1a of the macroblock MBa12 of the image IMG1 shown in FIG. That is, in the example shown in FIG. 14, the distortion calculation unit 20c uses the macroblock MBb14 to be processed and the macroblock MBa12 corresponding to the macroblock MBb14 to obtain distortion information INF indicating the difference in shape between the subjects OBJ1 and OBJ2. calculate. Note that the distortion calculation unit 20c performs the same or similar calculation process as that of the macroblock MBb14 on the macroblock MBb other than the macroblock MBb14 of the image IMG2.

例えば、歪み算出部20cは、画像IMG1のマクロブロックMBa12および画像IMG2のマクロブロックMBb14の各々の輝度分布に基づいて、行の配列方向における輝度の変化から被写体OBJ1、OBJ2のエッジをそれぞれ検出する。例えば、図14(a)に示した画像IMG2のマクロブロックMBb14では、被写体OBJ2aが行EG2a、EG2b間に存在することから、行EG2a、EG2bの位置で画像IMG2の輝度が所定値より大きく変化する。すなわち、歪み算出部20cは、行EG2a、EG2bの位置における所定値より大きい輝度の変化から被写体OBJ2aのエッジを検出する。また、図14(b)に示した画像IMG1のマクロブロックMBa12では、被写体OBJ1aが行EG1より下側の行に存在することから、行EG1の位置で画像IMG1の輝度が所定値より大きく変化する。歪み算出部20cは、行EG1の位置における所定値より大きい輝度の変化から被写体OBJ1aのエッジを検出する。なお、歪み算出部20cが画像IMG1のマクロブロックMBa12から被写体OBJ1aのエッジを2つ検出しないのは、図13に示すように、被写体OBJ1が画素領域AR1、AR2に跨っているためである。   For example, the distortion calculation unit 20c detects the edges of the subjects OBJ1 and OBJ2 from the luminance change in the row arrangement direction based on the luminance distributions of the macroblock MBa12 of the image IMG1 and the macroblock MBb14 of the image IMG2. For example, in the macro block MBb14 of the image IMG2 shown in FIG. 14A, since the subject OBJ2a exists between the rows EG2a and EG2b, the luminance of the image IMG2 changes more than a predetermined value at the positions of the rows EG2a and EG2b. . That is, the distortion calculation unit 20c detects the edge of the subject OBJ2a from the change in luminance greater than a predetermined value at the positions of the rows EG2a and EG2b. Further, in the macro block MBa12 of the image IMG1 shown in FIG. 14B, since the subject OBJ1a exists in the row below the row EG1, the luminance of the image IMG1 changes more than a predetermined value at the position of the row EG1. . The distortion calculation unit 20c detects the edge of the subject OBJ1a from a change in luminance greater than a predetermined value at the position of the row EG1. The reason why the distortion calculation unit 20c does not detect two edges of the subject OBJ1a from the macroblock MBa12 of the image IMG1 is that the subject OBJ1 straddles the pixel areas AR1 and AR2, as shown in FIG.

歪み算出部20cは、行の配列方向における輝度の変化に基づいて、検出した被写体OBJ1aのエッジ(行EG1)と被写体OBJ2aのエッジ(行EG2a、EG2b)とのうち、互いに対応するエッジを抽出する。例えば、図14に示すように、被写体OBJ1aの行EG1および被写体OBJ2aの行EG2aより下側に被写体OBJ1a、OBJ2aがそれぞれ存在する。このことから、行EG1および行EG2aの位置における行の配列方向の輝度は、互いに同一あるいは同様の変化を示す。歪み算出部20cは、被写体OBJ1aの行EG1と被写体OBJ2aの行EG2aとを互いに対応するエッジとして抽出する。歪み算出部20cは、被写体OBJ1aのエッジの位置を示す行EG1、被写体OBJ2aのエッジの位置を示す行EG2a、EG2b、および被写体OBJ1a、OBJ2a間で互いに対応するエッジを、歪み情報INFとして算出する。歪み算出部20cは、算出した歪み情報INFをメモリMEM2に出力する。   The distortion calculation unit 20c extracts edges corresponding to each other among the detected edge of the subject OBJ1a (row EG1) and the edge of the subject OBJ2a (rows EG2a and EG2b) based on the change in luminance in the row arrangement direction. . For example, as shown in FIG. 14, the subjects OBJ1a and OBJ2a exist below the row EG1 of the subject OBJ1a and the row EG2a of the subject OBJ2a, respectively. Therefore, the luminance in the row arrangement direction at the positions of the row EG1 and the row EG2a shows the same or similar changes. The distortion calculation unit 20c extracts the row EG1 of the subject OBJ1a and the row EG2a of the subject OBJ2a as corresponding edges. The distortion calculation unit 20c calculates, as distortion information INF, a line EG1 indicating the position of the edge of the subject OBJ1a, a line EG2a and EG2b indicating the position of the edge of the subject OBJ2a, and an edge corresponding to each other between the subjects OBJ1a and OBJ2a. The distortion calculation unit 20c outputs the calculated distortion information INF to the memory MEM2.

速度算出部30cは、視差算出部10cにより算出された視差DPF、歪み算出部20cにより算出された歪み情報INFおよび読み出し時間情報TINFを用い、実空間における被写体OBJの速度VLを算出する。例えば、図14では、被写体OBJ1aの行EG1のエッジが被写体OBJ2aの行EG2aのエッジに対応することから、式(11)−(14)の関係が成り立つ。   The speed calculation unit 30c calculates the speed VL of the subject OBJ in real space using the parallax DPF calculated by the parallax calculation unit 10c, the distortion information INF calculated by the distortion calculation unit 20c, and the readout time information TINF. For example, in FIG. 14, since the edge of the row EG1 of the subject OBJ1a corresponds to the edge of the row EG2a of the subject OBJ2a, the relationship of Expressions (11) to (14) is established.

Y0+V0×T1=Vsr×T1 …(11)
Y0+V0×T1=EG1 …(12)
Y0+V0×T2=k−Vsr×T2 …(13)
Y0+V0×T2=EG2a …(14)
変数Y0は、撮像素子ISEN1、ISEN2が露光を開始した時刻t0における被写体OBJの行の配列方向の位置を示す。変数T1は、撮像素子ISEN1がマクロブロックMBa12内の画素信号を読み出す行が行EG1である時刻を示す。変数T2は、撮像素子ISEN2がマクロブロックMBb14の画素信号を読み出す行が行EG2aである時刻を示す。変数kは、マクロブロックMBa12、MBb14の行数(行の配列方向の画素数)を示す。
Y0 + V0 × T1 = Vsr × T1 (11)
Y0 + V0 × T1 = EG1 (12)
Y0 + V0 × T2 = k−Vsr × T2 (13)
Y0 + V0 × T2 = EG2a (14)
The variable Y0 indicates the position of the row of the subject OBJ in the arrangement direction at time t0 when the image sensors ISEN1 and ISEN2 start exposure. The variable T1 indicates the time at which the row from which the image sensor ISEN1 reads the pixel signal in the macro block MBa12 is the row EG1. The variable T2 indicates the time when the row from which the image sensor ISEN2 reads the pixel signal of the macroblock MBb14 is the row EG2a. The variable k indicates the number of rows of the macroblocks MBa12 and MBb14 (the number of pixels in the row arrangement direction).

式(11)および式(12)は、時刻T1において、撮像素子ISEN1上における被写体OBJ1aのエッジが、マクロブロックMBa12の行EG1に位置することを示す。式(13)および式(14)は、時刻T2において、撮像素子ISEN2上における被写体OBJ2aのエッジが、マクロブロックMBb14の行EG2aに位置することを示す。式(11)−式(14)から、撮像素子ISEN1上を移動する被写体OBJの速度V0を算出する式(15)が導かれる。なお、式(15)の行EG1、EG2aには、処理対象のマクロブロックMBbの被写体OBJ2と処理対象のマクロブロックMBbに対応するマクロブロックMBaの被写体OBJ1との間で互いに対応するエッジを示す行が代入される。   Expressions (11) and (12) indicate that the edge of the subject OBJ1a on the image sensor ISEN1 is located in the row EG1 of the macroblock MBa12 at time T1. Expressions (13) and (14) indicate that the edge of the subject OBJ2a on the image sensor ISEN2 is located in the row EG2a of the macroblock MBb14 at time T2. From Expression (11) -Expression (14), Expression (15) for calculating the speed V0 of the subject OBJ moving on the image sensor ISEN1 is derived. Note that rows EG1 and EG2a in Expression (15) indicate edges corresponding to each other between the subject OBJ2 of the processing target macroblock MBb and the subject OBJ1 of the macroblock MBa corresponding to the processing target macroblock MBb. Is substituted.

Figure 0006477193
Figure 0006477193

速度算出部30cは、歪み情報INF、読み出し時間情報TINFを用い、式(10)、式(15)から撮像素子ISEN1上を移動する被写体OBJの速度V0を算出する。速度算出部30cは、撮像素子ISEN1上を移動する被写体OBJの速度V0、視差DPF、レンズLEN1とレンズLEN2との光軸間の距離B、およびレンズLEN1の焦点距離fを用い、式(6)から実空間における被写体OBJの速度VLを算出する。そして、速度算出部30bは、算出した速度VLを、画像IMG1、IMG2とともに記録部RECおよび表示部DIPに出力する。   The speed calculation unit 30c uses the distortion information INF and the readout time information TINF to calculate the speed V0 of the subject OBJ that moves on the image sensor ISEN1 from Expressions (10) and (15). The speed calculation unit 30c uses the speed V0, the parallax DPF, the distance B between the optical axes of the lens LEN1 and the lens LEN2, and the focal length f of the lens LEN1 using the speed V0 of the subject OBJ that moves on the image sensor ISEN1 and the focal length f of the lens LEN1. To calculate the speed VL of the subject OBJ in real space. Then, the speed calculation unit 30b outputs the calculated speed VL to the recording unit REC and the display unit DIP together with the images IMG1 and IMG2.

図15は、図12に示した画像処理装置100Cにおける画像処理の一例を示す。図15に示した処理は、制御部CNTLが画像処理プログラムを実行することにより実現される。なお、図15に示したステップの動作のうち、図11に示したステップと同一または同様の処理を示すものについては、同一のステップ番号を付し、詳細な説明を省略する。   FIG. 15 shows an example of image processing in the image processing apparatus 100C shown in FIG. The processing shown in FIG. 15 is realized by the control unit CNTL executing an image processing program. Note that among the operations of the steps shown in FIG. 15, those showing the same or similar processing as the steps shown in FIG. 11 are given the same step numbers, and detailed descriptions thereof are omitted.

また、図15に示した処理は、画像処理装置100Cに設けられるハードウェアにより実行されてもよい。この場合、図12に示した視差算出部10c、歪み算出部20cおよび速度算出部30cは、画像処理装置100C内に配置される回路により実現される。   Further, the process illustrated in FIG. 15 may be executed by hardware provided in the image processing apparatus 100C. In this case, the parallax calculation unit 10c, the distortion calculation unit 20c, and the speed calculation unit 30c illustrated in FIG. 12 are realized by a circuit arranged in the image processing apparatus 100C.

画像処理装置100Cは、図15に示したステップS100およびステップS110の処理を実行した後、ステップS120aの処理を実行する。   The image processing apparatus 100C executes the processing of step S120a after executing the processing of step S100 and step S110 shown in FIG.

ステップS120aでは、視差算出部10cは、ステップS110で算出した視差DPFを補正する。例えば、視差算出部10cは、処理対象のマクロブロックMBbおよび処理対象のマクロブロックMBbに対応するマクロブロックMBaにおいて、行方向における輝度の変化から被写体OBJ1、OBJ2のエッジを検出する。視差算出部10cは、検出した被写体OBJ1、OBJ2のエッジの位置の差を算出し、算出した位置の差で視差DPFを補正する。視差算出部10cは、補正した視差DPFをメモリMEM2に出力する。なお、視差DPFを補正するステップS120aの処理は、省略されてもよい。   In step S120a, the parallax calculation unit 10c corrects the parallax DPF calculated in step S110. For example, the parallax calculation unit 10c detects the edges of the subjects OBJ1 and OBJ2 from the change in luminance in the row direction in the processing target macroblock MBb and the macroblock MBa corresponding to the processing target macroblock MBb. The parallax calculation unit 10c calculates the difference between the positions of the detected edges of the subjects OBJ1 and OBJ2, and corrects the parallax DPF with the calculated difference between the positions. The parallax calculation unit 10c outputs the corrected parallax DPF to the memory MEM2. Note that the process of step S120a for correcting the parallax DPF may be omitted.

ステップS145では、歪み算出部20cは、画像IMG2の処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaとから、被写体OBJ1、OBJ2のエッジを検出し歪み情報INFを算出する。例えば、歪み算出部20cは、画像IMG2の処理対象のマクロブロックMBbの輝度分布に基づいて、行の配列方向における輝度の変化から被写体OBJ2のエッジを検出する。歪み算出部20cは、処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaの輝度分布に基づいて、行の配列方向における輝度の変化から被写体OBJ1のエッジを検出する。そして、歪み算出部20cは、行の配列方向における輝度の変化に基づいて、検出された被写体OBJ1のエッジと被写体OBJ2のエッジとのうち、互いに対応するエッジを抽出する。歪み算出部20cは、検出した被写体OBJ1、OBJ2のエッジおよび抽出した被写体OBJ1、OBJ2間で互いに対応するエッジを歪み情報INFとして算出する。歪み算出部20cは、算出した歪み情報INFをメモリMEM2に出力する。   In step S145, the distortion calculation unit 20c detects the edges of the subjects OBJ1 and OBJ2 from the macroblock MBb to be processed of the image IMG2 and the macroblock MBa of the image IMG1 corresponding to the macroblock MBb to be processed, and distortion information INF. Is calculated. For example, the distortion calculation unit 20c detects the edge of the subject OBJ2 from the change in luminance in the row arrangement direction based on the luminance distribution of the processing target macroblock MBb of the image IMG2. The distortion calculation unit 20c detects the edge of the subject OBJ1 from the change in luminance in the row arrangement direction based on the luminance distribution of the macroblock MBa of the image IMG1 corresponding to the processing target macroblock MBb. Then, the distortion calculation unit 20c extracts edges corresponding to each other from the detected edge of the subject OBJ1 and the edge of the subject OBJ2 based on the luminance change in the row arrangement direction. The distortion calculation unit 20c calculates the detected edges of the objects OBJ1 and OBJ2 and the edges corresponding to each other between the extracted objects OBJ1 and OBJ2 as distortion information INF. The distortion calculation unit 20c outputs the calculated distortion information INF to the memory MEM2.

ステップS155では、歪み算出部20cは、ステップS145において被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されたか否かを判定する。例えば、歪み算出部20cは、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されなかった場合、実空間における被写体OBJの速度VLを算出することが困難と判定する。この場合、画像処理装置100Cの処理は、ステップS180に移る。一方、歪み算出部20cが、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出された場合、画像処理装置100Cの処理は、ステップS170bに移る。   In step S155, the distortion calculation unit 20c determines whether or not corresponding edges are extracted between the subjects OBJ1 and OBJ2 in step S145. For example, when the corresponding edges are not extracted between the subjects OBJ1 and OBJ2, the distortion calculation unit 20c determines that it is difficult to calculate the speed VL of the subject OBJ in the real space. In this case, the process of the image processing apparatus 100C moves to step S180. On the other hand, when the distortion calculation unit 20c extracts corresponding edges between the subjects OBJ1 and OBJ2, the process of the image processing apparatus 100C proceeds to step S170b.

ステップS170bでは、速度算出部30cは、ステップS120aで補正された視差DPFおよびステップS145で算出された歪み情報INF等を用い、式(6)、式(10)、式(15)から実空間における被写体OBJの速度VLを算出する。   In step S170b, the speed calculation unit 30c uses the parallax DPF corrected in step S120a, the distortion information INF calculated in step S145, and the like in the real space from Expression (6), Expression (10), and Expression (15). The speed VL of the subject OBJ is calculated.

画像処理装置100Cは、ステップS170bの処理を実行した後、ステップS180の処理を実行する。   The image processing apparatus 100C performs the process of step S180 after executing the process of step S170b.

以上、図12から図15に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きを画素領域AR毎に互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、画素領域AR毎に互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100Cは、マクロブロックMBa、MBbにおける輝度分布に基づいて、被写体OBJ1、OBJ2のエッジを検出し、被写体OBJ1a、OBJ2間で互いに対応するエッジを抽出することで、歪み情報INFを算出する。画像処理装置100Cは、視差DPF、歪み情報INFおよび読み出し時間情報TINF等を用いて、実空間における被写体OBJの速度VLを算出する。   As described above, in the embodiment shown in FIGS. 12 to 15, the reading of the pixel signals from the imaging elements ISEN1 and ISEN2 is executed with the scanning directions in the row arrangement direction reversed for each pixel area AR. Accordingly, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 have different shapes (rolling shutter distortion) for each pixel area AR. Therefore, the image processing apparatus 100C detects the edges of the subjects OBJ1 and OBJ2 based on the luminance distribution in the macroblocks MBa and MBb, and extracts the corresponding edges between the subjects OBJ1a and OBJ2, thereby obtaining the distortion information INF. calculate. The image processing apparatus 100C calculates the speed VL of the subject OBJ in the real space using the parallax DPF, the distortion information INF, the readout time information TINF, and the like.

これにより、画像処理装置100Cは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)から、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Cは、実空間における被写体OBJの速度VLを算出するために、撮像装置CAM2に2回以上撮影させなくてもよい。そして、画像処理装置100Cは、実空間における被写体OBJの速度を算出する演算量を、従来と比べて削減できる。   Thereby, the image processing apparatus 100C can calculate the speed VL of the subject OBJ in the real space from two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. . That is, the image processing apparatus 100C does not have to cause the imaging device CAM2 to capture images twice or more in order to calculate the speed VL of the subject OBJ in the real space. Then, the image processing apparatus 100C can reduce the amount of calculation for calculating the speed of the subject OBJ in the real space as compared with the conventional case.

また、画像処理装置100Cは、マクロブロックMBa、MBbにおける輝度分布に基づいて、被写体OBJ1、OBJ2のエッジを検出し、被写体OBJ1a、OBJ2間で互いに対応するエッジを抽出する。これにより、画像処理装置100Cは、被写体OBJ1、OBJ2が複数の画素領域ARを跨ぐ場合でも実空間における被写体OBJの速度VLを算出できる。   Further, the image processing apparatus 100C detects the edges of the subjects OBJ1 and OBJ2 based on the luminance distribution in the macro blocks MBa and MBb, and extracts corresponding edges between the subjects OBJ1a and OBJ2. Thereby, the image processing apparatus 100C can calculate the speed VL of the subject OBJ in the real space even when the subjects OBJ1 and OBJ2 straddle the plurality of pixel regions AR.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離DISを算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100Cと同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance DIS between the imaging device and the subject OBJ from the two frames taken by one imaging device, the speed of the subject OBJ in real space is the same as or similar to that of the image processing device 100C. It is difficult to calculate with.

図16は、画像処理装置および画像処理方法の別の実施形態を示す。図8および図12で説明した要素と同一または同様の要素については、同一または同様の符号を付し、これ等については、詳細な説明を省略する。図16の破線の矢印は、信号等の情報の流れを示す。   FIG. 16 shows another embodiment of the image processing apparatus and the image processing method. The same or similar elements as those described in FIGS. 8 and 12 are denoted by the same or similar reference numerals, and detailed description thereof will be omitted. The dashed arrows in FIG. 16 indicate the flow of information such as signals.

画像処理装置100Dは、制御部CNTL、算出部CAL、記録部REC、表示部DIP、メモリMEM1、MEM2およびバスBUSを有する。制御部CNTL、算出部CAL、記録部REC、表示部DIPおよびメモリMEM1、MEM2は、バスBUSに接続される。   The image processing apparatus 100D includes a control unit CNTL, a calculation unit CAL, a recording unit REC, a display unit DIP, memories MEM1, MEM2, and a bus BUS. The control unit CNTL, the calculation unit CAL, the recording unit REC, the display unit DIP, and the memories MEM1 and MEM2 are connected to the bus BUS.

算出部CALは、図8に示した視差算出部10b、歪み算出部20b、速度算出部30bと図12に示した視差算出部10c、歪み算出部20c、速度算出部30cとを有する。すなわち、画像処理装置100Dは、図8に示した画像処理装置100Bが有する機能と図12に示した画像処理装置100Cが有する機能とを有する。   The calculation unit CAL includes the parallax calculation unit 10b, the distortion calculation unit 20b, and the speed calculation unit 30b illustrated in FIG. 8, and the parallax calculation unit 10c, the distortion calculation unit 20c, and the speed calculation unit 30c illustrated in FIG. That is, the image processing apparatus 100D has the functions of the image processing apparatus 100B shown in FIG. 8 and the functions of the image processing apparatus 100C shown in FIG.

図17および図18は、図16に示した画像処理装置100Dにおける画像処理の一例を示す。図17および図18に示した処理は、制御部CNTLが画像処理プログラムを実行することにより実現される。なお、図17および図18に示した処理は、画像処理装置100Dに設けられるハードウェアにより実行されてもよい。この場合、図16に示した算出部CALは、画像処理装置100D内に配置される回路により実現される。   17 and 18 show an example of image processing in the image processing apparatus 100D shown in FIG. The processing illustrated in FIGS. 17 and 18 is realized by the control unit CNTL executing an image processing program. Note that the processing illustrated in FIGS. 17 and 18 may be executed by hardware provided in the image processing apparatus 100D. In this case, the calculation unit CAL illustrated in FIG. 16 is realized by a circuit arranged in the image processing apparatus 100D.

ステップS200では、視差算出部10cは、撮像装置CAM2で撮影された画像IMG1、IMG2をメモリMEM1から取得する。   In step S200, the parallax calculation unit 10c acquires images IMG1 and IMG2 captured by the imaging device CAM2 from the memory MEM1.

ステップS210では、視差算出部10cは、画像IMG2のマクロブロックMBbのうち処理対象のマクロブロックMBbと、処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaとの位置の差から視差DPFを算出する。例えば、視差算出部10cは、マクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10cは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbを選択する。視差算出部10cは、選択した処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。視差算出部10cは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。そして、視差算出部10aは、処理対象のマクロブロックMBbの位置と抽出したマクロブロックMBaの位置との差から、被写体OBJの視差DPFを算出する。視差算出部10aは、マクロブロックMBb毎に算出した視差DPFをメモリMEM2に出力する。   In step S210, the disparity calculating unit 10c calculates the disparity DPF from the difference in position between the macro block MBb to be processed in the macro block MBb of the image IMG2 and the macro block MBa of the image IMG1 corresponding to the macro block MBb to be processed. calculate. For example, the parallax calculation unit 10c smoothes the pixel values of the images IMG1 and IMG2 for each of the macroblocks MBa and MBb. The parallax calculation unit 10c selects the macro block MBb to be processed from the smoothed image IMG2. The parallax calculation unit 10c performs image processing such as template matching between the selected processing target macroblock MBb and each macroblock MBa of the pixel area AR in which the processing target macroblock MBb is included in the smoothed image IMG1. To calculate the SAD value. The parallax calculation unit 10c extracts the macroblock MBa of the image IMG1 indicating the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). Then, the parallax calculation unit 10a calculates the parallax DPF of the subject OBJ from the difference between the position of the macro block MBb to be processed and the position of the extracted macro block MBa. The parallax calculation unit 10a outputs the parallax DPF calculated for each macroblock MBb to the memory MEM2.

ステップS220では、視差算出部10cは、ステップS210で算出した視差DPFを補正する。例えば、視差算出部10cは、処理対象のマクロブロックMBbおよび処理対象のマクロブロックMBbに対応するマクロブロックMBaにおいて、行方向における輝度の変化から被写体OBJ1、OBJ2のエッジを検出する。視差算出部10cは、検出した被写体OBJ1、OBJ2のエッジの位置の差を算出し、算出した位置の差で視差DPFを補正する。視差算出部10cは、補正した視差DPFをメモリMEM2に出力する。   In step S220, the parallax calculation unit 10c corrects the parallax DPF calculated in step S210. For example, the parallax calculation unit 10c detects the edges of the subjects OBJ1 and OBJ2 from the change in luminance in the row direction in the processing target macroblock MBb and the macroblock MBa corresponding to the processing target macroblock MBb. The parallax calculation unit 10c calculates the difference between the positions of the detected edges of the subjects OBJ1 and OBJ2, and corrects the parallax DPF with the calculated difference between the positions. The parallax calculation unit 10c outputs the corrected parallax DPF to the memory MEM2.

ステップS230では、歪み算出部20cは、処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとにおける輝度分布に基づいて、行の配列方向における被写体OBJ1、OBJ2のエッジを検出する。   In step S230, the distortion calculation unit 20c detects the edges of the subjects OBJ1 and OBJ2 in the row arrangement direction based on the luminance distribution in the processing target macroblock MBb and the macroblock MBa corresponding to the processing target macroblock MBb. To do.

ステップS240では、歪み算出部20cは、ステップS230で検出した被写体OBJ1、OBJ2のエッジの数が互いに一致するか否かを判定する。歪み算出部20cは、エッジの数が互いに一致する場合、例えば図10に示すように、被写体OBJ1、OBJ2が1つのマクロブロック内にそれぞれ収まっていると判定する。この場合、画像処理装置100Dの処理は、ステップS280に移る。一方、歪み算出部20cは、エッジの数が互いに一致しない場合、例えば図14に示すように、少なくとも被写体OBJ1、OBJ2のいずれかが複数のマクロブロックを跨いでいると判定する。この場合、画像処理装置100Dの処理は、ステップS250に移る。   In step S240, the distortion calculation unit 20c determines whether or not the numbers of edges of the subjects OBJ1 and OBJ2 detected in step S230 match each other. When the number of edges matches each other, the distortion calculation unit 20c determines that the subjects OBJ1 and OBJ2 are within one macroblock, for example, as illustrated in FIG. In this case, the process of the image processing apparatus 100D moves to step S280. On the other hand, when the number of edges does not match each other, the distortion calculation unit 20c determines that at least one of the subjects OBJ1 and OBJ2 straddles a plurality of macroblocks, for example, as illustrated in FIG. In this case, the process of the image processing apparatus 100D moves to step S250.

ステップS250では、歪み算出部20cは、ステップS230で検出した被写体OBJ1、OBJ2のエッジを用い歪み情報INFを算出する。例えば、歪み算出部20cは、処理対象のマクロブロックMBbと対応するマクロブロックMBaとにおける行の配列方向の輝度の変化に基づいて、ステップS230で検出した被写体OBJ1と被写体OBJ2とのエッジのうち互いに対応するエッジを抽出する。歪み算出部20cは、検出した被写体OBJ1、OBJ2のエッジおよび抽出した被写体OBJ1、OBJ2間で互いに対応するエッジを歪み情報INFとして算出する。歪み算出部20cは、算出した歪み情報INFをメモリMEM2に出力する。   In step S250, the distortion calculation unit 20c calculates distortion information INF using the edges of the subjects OBJ1 and OBJ2 detected in step S230. For example, the distortion calculation unit 20c, based on the change in luminance in the row arrangement direction between the macro block MBb to be processed and the corresponding macro block MBa, out of the edges of the subject OBJ1 and the subject OBJ2 detected in step S230. Extract corresponding edges. The distortion calculation unit 20c calculates the detected edges of the objects OBJ1 and OBJ2 and the edges corresponding to each other between the extracted objects OBJ1 and OBJ2 as distortion information INF. The distortion calculation unit 20c outputs the calculated distortion information INF to the memory MEM2.

ステップS260では、歪み算出部20cは、ステップS250において被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されたか否かを判定する。例えば、歪み算出部20cは、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されなかった場合、実空間における被写体OBJの速度VLを算出することが困難と判定する。この場合、画像処理装置100Dの処理は、ステップS370に移る。一方、歪み算出部20cが、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出された場合、画像処理装置100Dの処理は、ステップS270に移る。   In step S260, the distortion calculation unit 20c determines whether or not corresponding edges are extracted between the subjects OBJ1 and OBJ2 in step S250. For example, when the corresponding edges are not extracted between the subjects OBJ1 and OBJ2, the distortion calculation unit 20c determines that it is difficult to calculate the speed VL of the subject OBJ in the real space. In this case, the process of the image processing apparatus 100D moves to step S370. On the other hand, when the distortion calculation unit 20c extracts corresponding edges between the subjects OBJ1 and OBJ2, the process of the image processing apparatus 100D proceeds to step S270.

ステップS270では、速度算出部30cは、ステップS220で補正された視差DPFおよびステップS250で算出された歪み情報INF等を用い、式(6)、式(10)、式(15)から実空間における被写体OBJの速度VLを算出する。   In step S270, the speed calculation unit 30c uses the parallax DPF corrected in step S220, the distortion information INF calculated in step S250, and the like in the real space from the equations (6), (10), and (15). The speed VL of the subject OBJ is calculated.

ステップS280では、歪み算出部20bは、ステップS220で補正された視差DPFを用いて、画像IMG2の処理対象のマクロブロックMBbの位置を、処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaの位置に合わせる。   In step S280, the distortion calculation unit 20b uses the parallax DPF corrected in step S220 to set the position of the processing target macroblock MBb of the image IMG2 to the macroblock MBa of the image IMG1 corresponding to the processing target macroblock MBb. Adjust to the position of.

ステップS290では、歪み算出部20bは、画像IMG2の処理対象のマクロブロックMBbに変形処理を実行し歪み情報INFを算出する。例えば、歪み算出部20bは、被写体OBJ2の形状をステップS210で抽出されたマクロブロックMBaの被写体OBJ1の形状に一致させるように、式(7)の拡縮率βおよび変数Tyを変化させて処理対象のマクロブロックMBbに拡縮処理を実行する。歪み算出部20bは、拡縮処理した処理対象のマクロブロックMBbとステップS210で抽出されたマクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20bは、SAD値が最小値を示す場合、拡縮された被写体OBJ2の形状が被写体OBJ1の形状に最も一致すると判定する。そして、歪み算出部20bは、SAD値が最小値を示す際の拡縮率βを歪み情報INFとして算出し、算出した歪み情報INFをメモリMEM2に出力する。   In step S290, the distortion calculation unit 20b performs a deformation process on the processing target macroblock MBb of the image IMG2 to calculate distortion information INF. For example, the distortion calculation unit 20b changes the enlargement / reduction ratio β and the variable Ty in Expression (7) so that the shape of the subject OBJ2 matches the shape of the subject OBJ1 of the macroblock MBa extracted in step S210. The enlargement / reduction processing is executed on the macro block MBb. The distortion calculation unit 20b performs image processing such as template matching between the macroblock MBb to be processed that has been enlarged / reduced and the macroblock MBa extracted in step S210, and calculates an SAD value. When the SAD value indicates the minimum value, the distortion calculation unit 20b determines that the shape of the scaled subject OBJ2 most closely matches the shape of the subject OBJ1. Then, the distortion calculation unit 20b calculates the expansion / contraction rate β when the SAD value shows the minimum value as the distortion information INF, and outputs the calculated distortion information INF to the memory MEM2.

図18に示したステップS300では、歪み算出部20bは、ステップS290で算出した歪み情報INFの拡縮率βが1か否かを判定する。例えば、歪み算出部20bは、拡縮率βが1(すなわち被写体OBJのローリングシャッタ歪みがない)の場合、被写体OBJは動いていない(すなわち実空間上の速度VLが0)と判定する。この場合、画像処理装置100Dの処理は、ステップS330に移る。一方、歪み算出部20bが、拡縮率βが1でない(すなわち被写体OBJのローリングシャッタ歪みがある)と判定する場合、画像処理装置100Dの処理は、ステップS310に移る。   In step S300 illustrated in FIG. 18, the distortion calculation unit 20b determines whether the expansion / contraction rate β of the distortion information INF calculated in step S290 is 1. For example, when the enlargement / reduction ratio β is 1 (that is, there is no rolling shutter distortion of the subject OBJ), the distortion calculation unit 20b determines that the subject OBJ is not moving (that is, the speed VL in real space is 0). In this case, the process of the image processing apparatus 100D moves to step S330. On the other hand, when the distortion calculation unit 20b determines that the enlargement / reduction ratio β is not 1 (that is, there is a rolling shutter distortion of the subject OBJ), the processing of the image processing device 100D proceeds to step S310.

ステップS310では、視差算出部10bは、ステップS290で算出された歪み情報INFを用い視差DPFを再算出する。視差算出部10bは、例えば、ステップS290で算出された拡縮率βを用い処理対象のマクロブロックMBbに対して拡縮処理を実行する。視差算出部10bは、拡縮した処理対象のマクロブロックMBbの被写体OBJ2の形状を、処理対象のマクロブロックMBbに対応するマクロブロックMBaの被写体OBJ1の形状に合わせる。視差算出部10bは、拡縮した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの間でテンプレートマッチングを実行し、SAD値を算出する。視差算出部10bは、SAD値が最小値を示す場合、拡縮した処理対象のマクロブロックMBbと処理対象のマクロブロックMBbに対応するマクロブロックMBaとの位置の差から、被写体OBJの視差DPFを再算出する。視差算出部10bは、再算出した視差DPFをメモリMEM2に出力する。   In step S310, the parallax calculation unit 10b recalculates the parallax DPF using the distortion information INF calculated in step S290. For example, the parallax calculation unit 10b performs an enlargement / reduction process on the macro block MBb to be processed using the enlargement / reduction ratio β calculated in step S290. The parallax calculation unit 10b matches the shape of the subject OBJ2 of the macro block MBb to be scaled up and down with the shape of the subject OBJ1 of the macro block MBa corresponding to the macro block MBb to be processed. The parallax calculation unit 10b performs template matching between the enlarged / reduced macro block MBb to be processed and the macro block MBa corresponding to the macro block MBb to be processed, and calculates an SAD value. When the SAD value indicates the minimum value, the parallax calculation unit 10b re-analyzes the parallax DPF of the subject OBJ from the position difference between the enlarged / reduced macro block MBb and the macro block MBa corresponding to the macro block MBb to be processed. calculate. The parallax calculation unit 10b outputs the recalculated parallax DPF to the memory MEM2.

ステップS320では、速度算出部30bは、ステップS310で再算出された視差DPFおよびステップS290で算出された歪み情報INF等を用い、式(6)、式(9)、式(10)から実空間における被写体OBJの速度VLを算出する。   In step S320, the speed calculation unit 30b uses the parallax DPF recalculated in step S310, the distortion information INF calculated in step S290, and the like to calculate the real space from the equations (6), (9), and (10). The speed VL of the subject OBJ at is calculated.

ステップS330では、歪み算出部20cは、ステップS230で検出した被写体OBJ1、OBJ2のエッジを用い歪み情報INFを算出する。例えば、歪み算出部20cは、処理対象のマクロブロックMBbと対応するマクロブロックMBaとにおける行の配列方向の輝度の変化に基づいて、ステップS230で検出した被写体OBJ1と被写体OBJ2とのエッジのうち互いに対応するエッジを抽出する。歪み算出部20cは、検出した被写体OBJ1、OBJ2のエッジおよび抽出した被写体OBJ1、OBJ2間で互いに対応するエッジを歪み情報INFとして算出する。歪み算出部20cは、算出した歪み情報INFをメモリMEM2に出力する。   In step S330, the distortion calculation unit 20c calculates distortion information INF using the edges of the subjects OBJ1 and OBJ2 detected in step S230. For example, the distortion calculation unit 20c, based on the change in luminance in the row arrangement direction between the macro block MBb to be processed and the corresponding macro block MBa, out of the edges of the subject OBJ1 and the subject OBJ2 detected in step S230. Extract corresponding edges. The distortion calculation unit 20c calculates the detected edges of the objects OBJ1 and OBJ2 and the edges corresponding to each other between the extracted objects OBJ1 and OBJ2 as distortion information INF. The distortion calculation unit 20c outputs the calculated distortion information INF to the memory MEM2.

ステップS340では、歪み算出部20cは、ステップS330において被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されたか否かを判定する。例えば、歪み算出部20cは、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出されなかった場合、実空間における被写体OBJの速度VLを算出することが困難と判定する。この場合、画像処理装置100Dの処理は、ステップS360に移る。一方、歪み算出部20cが、被写体OBJ1、OBJ2間で互いに対応するエッジが抽出された場合、画像処理装置100Dの処理は、ステップS350に移る。   In step S340, the distortion calculation unit 20c determines whether or not corresponding edges are extracted between the subjects OBJ1 and OBJ2 in step S330. For example, when the corresponding edges are not extracted between the subjects OBJ1 and OBJ2, the distortion calculation unit 20c determines that it is difficult to calculate the speed VL of the subject OBJ in the real space. In this case, the process of the image processing apparatus 100D moves to step S360. On the other hand, when the distortion calculation unit 20c extracts corresponding edges between the subjects OBJ1 and OBJ2, the process of the image processing apparatus 100D proceeds to step S350.

ステップS350では、速度算出部30cは、式(6)、式(10)、式(15)から実空間における被写体OBJの速度VLを算出する。なお、速度算出部30cは、実空間における被写体OBJの速度VLを算出するために、ステップS220で補正された視差DPFあるいはステップS310で再算出された視差DPF、およびステップS330で算出された歪み情報INF等を用いる。   In step S350, the speed calculation unit 30c calculates the speed VL of the subject OBJ in the real space from Expression (6), Expression (10), and Expression (15). The speed calculation unit 30c calculates the speed VL of the subject OBJ in real space, the parallax DPF corrected in step S220 or the parallax DPF recalculated in step S310, and the distortion information calculated in step S330. INF or the like is used.

ステップS360では、算出部CALは、ステップS320およびステップS350でそれぞれ算出された速度VLの平均値を、実空間における被写体OBJの速度VLとして算出する。算出部CALは、算出した実空間における被写体OBJの速度VLをメモリMEM2に出力する。なお、ステップS350の処理が飛ばされた場合、算出部CALは、ステップS320で算出された速度VLを、実空間における被写体OBJの速度VLとする。   In step S360, the calculation unit CAL calculates the average value of the speeds VL calculated in steps S320 and S350 as the speed VL of the subject OBJ in the real space. The calculation unit CAL outputs the calculated speed VL of the subject OBJ in the real space to the memory MEM2. When the process of step S350 is skipped, the calculation unit CAL sets the speed VL calculated in step S320 as the speed VL of the subject OBJ in real space.

ステップS370では、制御部CNTLは、画像IMG2において次のマクロブロックMBbがあるか否かを判定する。制御部CNTLが次の処理対象となるマクロブロックMBbがあると判定した場合、画像処理装置100Dの処理は、ステップS210に移る。一方、制御部CNTLが次の処理対象となるマクロブロックMBbがないと判定した場合、画像処理装置100Dの処理は終了する。   In step S370, the control unit CNTL determines whether or not there is a next macroblock MBb in the image IMG2. When the control unit CNTL determines that there is a macroblock MBb to be processed next, the processing of the image processing apparatus 100D proceeds to step S210. On the other hand, when the control unit CNTL determines that there is no macro block MBb to be processed next, the processing of the image processing apparatus 100D ends.

以上、図16から図18に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きを画素領域AR毎に互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、画素領域AR毎に互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100Dは、マクロブロックMBa、MBbにおける輝度分布に基づいて被写体OBJ1、OBJ2のエッジを検出し、検出されたエッジの数に応じて実空間における被写体OBJの速度VLを算出する処理を切り替える。   As described above, in the embodiments shown in FIGS. 16 to 18, the reading of the pixel signals from the imaging elements ISEN <b> 1 and ISEN <b> 2 is performed with the scanning directions in the row arrangement direction reversed for each pixel area AR. Accordingly, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 have different shapes (rolling shutter distortion) for each pixel area AR. Therefore, the image processing apparatus 100D detects the edges of the subjects OBJ1 and OBJ2 based on the luminance distribution in the macroblocks MBa and MBb, and calculates the speed VL of the subject OBJ in the real space according to the number of detected edges. Switch.

すなわち、画像処理装置100Dは、被写体OBJ1、OBJ2のエッジの数が互いに一致する場合、図8に示した画像処理装置100Bおよび図12に示した画像処理装置100Cの画像処理と同一または同様の処理をそれぞれ実行し、被写体OBJの速度VLをそれぞれ算出する。そして、画像処理装置100Dは、それぞれの画像処理から算出した速度VLの平均値を、実空間における被写体OBJの速度VLとする。一方、画像処理装置100Dは、被写体OBJ1、OBJ2のエッジの数が互いに一致しない場合、図12に示した画像処理装置100Cにおける画像処理と同一または同様の処理を実行し、実空間における被写体OBJの速度VLを算出する。   That is, the image processing device 100D performs the same or similar processing as the image processing of the image processing device 100B shown in FIG. 8 and the image processing device 100C shown in FIG. 12 when the numbers of edges of the subjects OBJ1 and OBJ2 match each other. To calculate the speed VL of the subject OBJ. Then, the image processing apparatus 100D sets the average value of the speeds VL calculated from the respective image processes as the speed VL of the subject OBJ in the real space. On the other hand, when the numbers of edges of the subjects OBJ1 and OBJ2 do not match each other, the image processing device 100D executes the same or similar processing as the image processing in the image processing device 100C shown in FIG. The speed VL is calculated.

これにより、画像処理装置100Dは、マクロブロックMBa、MBbにおける被写体OBJ1、OBJ2の状態に応じて、実空間における被写体OBJの速度VLを確実に算出できる。   Thereby, the image processing apparatus 100D can reliably calculate the speed VL of the subject OBJ in the real space according to the states of the subjects OBJ1 and OBJ2 in the macro blocks MBa and MBb.

また、画像処理装置100Dは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)から、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Dは、走査の向きが互いに同じ撮像素子を2つ有するステレオカメラが撮像した少なくとも4つのフレームを用いる場合と比べて、メモリMEM1に記憶される画像のデータ量を削減できる。   Further, the image processing apparatus 100D can calculate the speed VL of the subject OBJ in real space from two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. That is, the image processing apparatus 100D can reduce the data amount of the image stored in the memory MEM1 as compared to the case where at least four frames captured by a stereo camera having two imaging elements having the same scanning direction are used.

また、画像処理装置100Dは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの画像IMG1、IMG2を用いて、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Dは、実空間における被写体OBJの速度VLを算出するために、撮像装置CAM2に2回以上撮影させなくてもよい。そして、画像処理装置100Dは、実空間における被写体OBJの速度を算出する演算量を、従来と比べて削減できる。   Further, the image processing apparatus 100D can calculate the speed VL of the subject OBJ in the real space using the two images IMG1 and IMG2 obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. In other words, the image processing apparatus 100D does not have to cause the imaging apparatus CAM2 to capture images twice or more in order to calculate the speed VL of the subject OBJ in the real space. Then, the image processing apparatus 100D can reduce the amount of calculation for calculating the speed of the subject OBJ in the real space compared to the conventional case.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離DISを算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100Dと同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance DIS between the imaging device and the subject OBJ from the two frames taken by one imaging device, the speed of the subject OBJ in real space is the same or similar to that of the image processing device 100D. It is difficult to calculate with.

図19は、画像処理装置および画像処理方法の別の実施形態を示す。図2および図8で説明した要素と同一または同様の要素については、同一または同様の符号を付し、これ等については、詳細な説明を省略する。図19の破線の矢印は、信号等の情報の流れを示す。   FIG. 19 shows another embodiment of the image processing apparatus and the image processing method. The same or similar elements as those described in FIGS. 2 and 8 are denoted by the same or similar reference numerals, and detailed description thereof will be omitted. The dashed arrows in FIG. 19 indicate the flow of information such as signals.

画像処理装置100Eは、制御部CNTL、視差算出部10d、歪み算出部20d、速度算出部30d、記録部REC、表示部DIP、メモリMEM1、MEM2およびバスBUSを有する。制御部CNTL、視差算出部10d、歪み算出部20d、速度算出部30d、記録部REC、表示部DIPおよびメモリMEM1、MEM2は、バスBUSに接続される。   The image processing apparatus 100E includes a control unit CNTL, a parallax calculation unit 10d, a distortion calculation unit 20d, a speed calculation unit 30d, a recording unit REC, a display unit DIP, memories MEM1, MEM2, and a bus BUS. The control unit CNTL, the parallax calculation unit 10d, the distortion calculation unit 20d, the speed calculation unit 30d, the recording unit REC, the display unit DIP, and the memories MEM1 and MEM2 are connected to the bus BUS.

視差算出部10dは、撮像素子ISEN1、ISEN2で撮像された画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。視差算出部10dは、画像IMG1上の被写体OBJ1の位置と画像IMG2上の被写体OBJ2の位置との差を示す視差DPFを、画像IMG2のマクロブロックMBb毎に算出する。視差算出部10dは、第1の算出部の一例である。視差算出部10dの動作については、図20で説明する。   The parallax calculation unit 10d receives images IMG1 and IMG2 captured by the imaging elements ISEN1 and ISEN2 from the memory MEM1 via the bus BUS. The parallax calculation unit 10d calculates a parallax DPF indicating the difference between the position of the subject OBJ1 on the image IMG1 and the position of the subject OBJ2 on the image IMG2 for each macroblock MBb of the image IMG2. The parallax calculation unit 10d is an example of a first calculation unit. The operation of the parallax calculation unit 10d will be described with reference to FIG.

歪み算出部20dは、画像IMG1、IMG2をバスBUSを介してメモリMEM1から受ける。歪み算出部20dは、撮像素子ISEN1、ISEN2で走査の向きが互いに逆のために生じた画像IMG1の被写体OBJ1と画像IMG2の被写体OBJ2との形状の差異を示す歪み情報INFを、画像IMG2のマクロブロックMBb毎に算出する。歪み算出部20dは、第2の算出部の一例である。歪み算出部20dは、算出した歪み情報INFをメモリMEM2に出力する。歪み算出部20dの動作については、図21で説明する。   The distortion calculation unit 20d receives the images IMG1 and IMG2 from the memory MEM1 via the bus BUS. The distortion calculation unit 20d generates distortion information INF indicating the difference in shape between the subject OBJ1 of the image IMG1 and the subject OBJ2 of the image IMG2 generated by the imaging elements ISEN1 and ISEN2 because the scanning directions are opposite to each other. Calculated for each block MBb. The distortion calculation unit 20d is an example of a second calculation unit. The distortion calculation unit 20d outputs the calculated distortion information INF to the memory MEM2. The operation of the distortion calculation unit 20d will be described with reference to FIG.

速度算出部30dは、視差DPF、歪み情報INF、読み出し時間情報TINF等をバスBUSを介してメモリMEM2から受け、実空間における被写体OBJの速度VLを算出する第3の算出部の一例である。速度算出部30dは、算出した速度VLを記録部RECおよび表示部DIPに出力する。速度算出部30dの動作については、図21で説明する。   The speed calculation unit 30d is an example of a third calculation unit that receives parallax DPF, distortion information INF, readout time information TINF, and the like from the memory MEM2 via the bus BUS and calculates the speed VL of the subject OBJ in real space. The speed calculation unit 30d outputs the calculated speed VL to the recording unit REC and the display unit DIP. The operation of the speed calculation unit 30d will be described with reference to FIG.

図20は、図19に示した撮像素子ISEN1、ISEN2が図3に示したタイミング図に基づいて撮影した画像IMG1、IMG2の一例を示す。図20では、被写体OBJは、例えば、画角内を斜めの方向OD(すなわち行の配列方向OD1および行方向OD2)に移動する。以下、行の配列方向OD1は、列方向OD1とも称される。また、図20では、図を見やすくするために、図4と同様に、画素領域ARは3つ(n=3)とする。さらに、画像IMG1、IMG2は、図5と同様に、視差算出部10dにより各画素領域ARを行方向(図20の横方向)にk列毎に分割される。すなわち、画像IMG1は、画像領域MBa(MBa11−MBa15、MBa21−MBa25、MBa31−MBa35)に区分けされる。画像IMG2は、画像領域MBb(MBb11−MBb15、MBb21−MBb25、MBb31−MBb35)に区分けされる。   FIG. 20 shows an example of images IMG1 and IMG2 taken by the imaging elements ISEN1 and ISEN2 shown in FIG. 19 based on the timing chart shown in FIG. In FIG. 20, the subject OBJ moves, for example, in an oblique direction OD (that is, the row arrangement direction OD1 and the row direction OD2) within the angle of view. Hereinafter, the row arrangement direction OD1 is also referred to as a column direction OD1. Further, in FIG. 20, in order to make the drawing easier to see, the number of pixel regions AR is three (n = 3) as in FIG. Furthermore, in the images IMG1 and IMG2, as in FIG. 5, the parallax calculation unit 10d divides each pixel area AR into k columns in the row direction (horizontal direction in FIG. 20). That is, the image IMG1 is divided into image areas MBa (MBa11-MBa15, MBa21-MBa25, MBa31-MBa35). The image IMG2 is divided into image areas MBb (MBb11-MBb15, MBb21-MBb25, MBb31-MBb35).

図20では、被写体OBJが行方向OD2に移動するため、画像IMG1上の被写体OBJ1は、図1と同様に画角の下に向かうほど、破線の矩形で示す本来の形状に対して右側にずれる。一方、画像IMG2上の被写体OBJ2は、画角の上に向かうほど、破線の矩形で示す本来の形状に対して右側にずれる。また、図20では、被写体OBJが列方向OD1に移動するため、画像IMG1上の被写体OBJ1は、図9と同様に破線の矩形で示す本来の形状に対して下方向に伸びた形状を示す。一方、画像IMG2上の被写体OBJ2は、破線の矩形で示す本来の形状に対して上下方向に縮んだ形状を示す。なお、図1で説明したように、画像IMG1上の被写体OBJ1と画像IMG2上の被写体OBJ2の左右方向のずれは、互いに異なる位置に配置されたレンズLEN1、LEN2を介して被写体OBJを撮像したことにより生じる。   In FIG. 20, since the subject OBJ moves in the row direction OD2, the subject OBJ1 on the image IMG1 shifts to the right with respect to the original shape indicated by the dashed rectangle as it goes below the angle of view as in FIG. . On the other hand, the subject OBJ2 on the image IMG2 shifts to the right side with respect to the original shape indicated by a broken-line rectangle as it goes above the angle of view. In FIG. 20, since the subject OBJ moves in the column direction OD1, the subject OBJ1 on the image IMG1 has a shape extending downward with respect to the original shape indicated by a broken-line rectangle as in FIG. On the other hand, the subject OBJ2 on the image IMG2 shows a shape contracted in the vertical direction with respect to the original shape indicated by a broken-line rectangle. As described with reference to FIG. 1, the subject OBJ1 on the image IMG1 and the subject OBJ2 on the image IMG2 are displaced in the left-right direction because the subject OBJ is imaged through the lenses LEN1 and LEN2 arranged at different positions. Caused by.

例えば、視差算出部10dは、例えば、マクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10dは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行する。そして、視差算出部10dは、処理対象のマクロブロックMBbと各マクロブロックMBaとにおける一致の度合いを示すSAD値を算出する。視差算出部10dは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。図20では、視差算出部10dは、画像IMG2のうち画素領域AR1のマクロブロックMBb14が処理対象の場合、画像IMG1の画素領域AR1におけるマクロブロックMBa12で最小のSAD値を算出する。視差算出部10dは、マクロブロックMBa12を抽出する。すなわち、図20に示したマクロブロックMBa12の被写体OBJ1は、マクロブロックMBb14の被写体OBJ2に対応することを示す。   For example, the parallax calculation unit 10d smoothes the pixel values of the images IMG1 and IMG2 for each macroblock MBa and MBb, for example. The parallax calculation unit 10d generates a template between the macroblock MBb to be processed in the smoothed image IMG2 and each macroblock MBa in the pixel area AR that includes the macroblock MBb to be processed in the smoothed image IMG1. Image processing such as matching is executed. Then, the parallax calculation unit 10d calculates an SAD value indicating the degree of coincidence between the processing target macroblock MBb and each macroblock MBa. The parallax calculation unit 10d extracts the macroblock MBa of the image IMG1 that indicates the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2). In FIG. 20, when the macro block MBb14 in the pixel area AR1 in the image IMG2 is the processing target, the parallax calculation unit 10d calculates the minimum SAD value in the macro block MBa12 in the pixel area AR1 in the image IMG1. The parallax calculation unit 10d extracts the macroblock MBa12. That is, the subject OBJ1 of the macroblock MBa12 shown in FIG. 20 corresponds to the subject OBJ2 of the macroblock MBb14.

図21は、図19に示した歪み算出部20dにおける演算処理の一例を示す。図21に示した例では、歪み算出部20dは、図20に示した画像IMG2のマクロブロックMBb14とマクロブロックMBb14に対応する画像IMG1のマクロブロックMBa12とを用い、被写体OBJ1、OBJ2の形状の差異を示す歪み情報INFを算出する。なお、歪み算出部20dは、マクロブロックMBb14以外の他のマクロブロックMBbに対しても、マクロブロックMBb14と同一あるいは同様の演算処理を実行する。   FIG. 21 shows an example of calculation processing in the distortion calculation unit 20d shown in FIG. In the example illustrated in FIG. 21, the distortion calculation unit 20d uses the macroblock MBb14 of the image IMG2 illustrated in FIG. 20 and the macroblock MBa12 of the image IMG1 corresponding to the macroblock MBb14, and the difference in the shapes of the subjects OBJ1 and OBJ2 Is calculated. Note that the distortion calculation unit 20d performs the same or similar calculation process as that of the macroblock MBb14 on other macroblocks MBb other than the macroblock MBb14.

歪み算出部20dは、例えば、網掛けで示した被写体OBJ2を、マクロブロックMBa12の被写体OBJ1の形状に一致させるように、マクロブロックMBb14にせん断変形および拡縮する変形処理を実行する。例えば、歪み算出部20dは、アフィン変換の行列を含む式(16)を用いてマクロブロックMBb14にせん断変形および拡縮の変形処理を実行し、変形処理された破線で示すマクロブロックMBeを得る。   For example, the distortion calculation unit 20d executes a deformation process in which the macroblock MBb14 is subjected to shear deformation and expansion / contraction so that the shaded subject OBJ2 matches the shape of the subject OBJ1 of the macroblock MBa12. For example, the distortion calculation unit 20d performs shear deformation and expansion / contraction deformation processing on the macroblock MBb14 using Expression (16) including an affine transformation matrix, and obtains the macroblock MBe indicated by the broken line subjected to the deformation processing.

Figure 0006477193
Figure 0006477193

(x,y)は、マクロブロックMBb14の画素の位置を示し、(xa,ya)は変形処理されたマクロブロックMBeの画素の位置を示す。すなわち、式(16)は、せん断変形を示す式(1)と拡縮処理を示す式(7)とを合わせたものである。 (X, y) indicates the pixel position of the macroblock MBb14, and (xa, ya) indicates the pixel position of the transformed macroblock MBe. That is, Expression (16) is a combination of Expression (1) indicating shear deformation and Expression (7) indicating expansion / contraction processing.

歪み算出部20dは、例えば、せん断率α、拡縮率β、変数Tx、Tyをそれぞれ変化させて変形処理したマクロブロックMBeとマクロブロックMBa12とのテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20dは、SAD値が最小値を示す場合、変形処理した被写体OBJ2の形状が被写体OBJ1の形状に最も一致すると判定する。そして、歪み算出部20dは、SAD値が最小値を示す際のせん断率αおよび拡縮率βを歪み情報INFとして算出する。また、視差算出部10dは、SAD値が最小値を示す際の変数Txを視差DPFとする。   The strain calculation unit 20d executes, for example, image processing such as template matching between the macroblock MBe and the macroblock MBa12 that are deformed by changing the shear rate α, the expansion / contraction rate β, and the variables Tx and Ty, and the SAD value is calculated. calculate. When the SAD value indicates the minimum value, the distortion calculation unit 20d determines that the shape of the subject OBJ2 subjected to the deformation process most closely matches the shape of the subject OBJ1. Then, the strain calculation unit 20d calculates, as strain information INF, the shear rate α and the expansion / contraction rate β when the SAD value shows the minimum value. Also, the parallax calculation unit 10d sets the variable Tx when the SAD value indicates the minimum value as the parallax DPF.

なお、歪み算出部20dは、式(2)を用いて式(16)の変数Txをせん断率αに置き換え、式(16)の変形処理で変化させる変数の数を削減してもよい。この場合、歪み算出部20dは、変形処理における演算量を削減できる。   Note that the strain calculation unit 20d may replace the variable Tx in Expression (16) with the shear rate α using Expression (2) to reduce the number of variables to be changed in the deformation process in Expression (16). In this case, the distortion calculation unit 20d can reduce the amount of calculation in the deformation process.

あるいは、歪み算出部20dは、図12に示した歪み算出部20cと同様に、マクロブロックMBa、MBbの行の配列方向における輝度の変化から被写体OBJ1、OBJ2のエッジそれぞれを予め検出してもよい。この場合、歪み算出部20dは、検出した被写体OBJ1、OBJ2における行の配列方向のエッジ間の距離の比から拡縮率βを算出することで、式(16)を用いた変形処理で変化させる変数の数を削減でき、変形処理における演算量を削減できる。   Alternatively, similarly to the distortion calculation unit 20c illustrated in FIG. 12, the distortion calculation unit 20d may detect the edges of the subjects OBJ1 and OBJ2 in advance from changes in luminance in the arrangement direction of the rows of the macroblocks MBa and MBb. . In this case, the distortion calculation unit 20d calculates the expansion / contraction ratio β from the ratio of the distances between the edges in the row arrangement direction of the detected subjects OBJ1 and OBJ2, thereby changing the variable to be changed by the deformation process using Expression (16). And the amount of calculation in the deformation process can be reduced.

速度算出部30dは、視差算出部10dにより算出された視差DPF、歪み算出部20dにより算出された歪み情報INFおよび読み出し時間情報TINFを用い、実空間における被写体OBJの速度VLを算出する。例えば、速度算出部30dは、被写体OBJの速度VLを列方向OD1と行方向OD2との成分に分けて算出する。すなわち、速度算出部30dは、視差DPF、せん断率αおよび読み出し時間情報TINFを用い、式(3)−式(6)から速度VLのうち列方向OD1の成分を算出する。また、速度算出部30dは、視差DPF、拡縮率βおよび読み出し時間情報TINFを用い、式(6)、式(9)、式(10)から速度VLのうち行方向OD2の成分を算出する。そして、速度算出部30dは、算出した列方向OD1および行方向OD2の成分をベクトル合成し、実空間における被写体OBJの速度VLを算出する。   The speed calculation unit 30d calculates the speed VL of the subject OBJ in real space using the parallax DPF calculated by the parallax calculation unit 10d, the distortion information INF calculated by the distortion calculation unit 20d, and the readout time information TINF. For example, the speed calculation unit 30d calculates the speed VL of the subject OBJ by dividing it into components of the column direction OD1 and the row direction OD2. That is, the speed calculation unit 30d calculates the component in the column direction OD1 of the speed VL from the equations (3) to (6) using the parallax DPF, the shear rate α, and the readout time information TINF. Further, the speed calculation unit 30d calculates a component in the row direction OD2 of the speed VL from the expressions (6), (9), and (10) using the parallax DPF, the expansion / contraction rate β, and the readout time information TINF. Then, the speed calculation unit 30d performs vector synthesis on the calculated components in the column direction OD1 and the row direction OD2, and calculates the speed VL of the subject OBJ in the real space.

なお、速度算出部30dは、歪み算出部20dが被写体OBJ1、OBJ2のエッジを検出する場合、図12に示した速度算出部30cと同様に、式(15)から被写体OBJの速度VLのうち列方向OD1の成分を算出してもよい。この場合、画像処理装置100Dは、式(16)における拡縮率βを算出する演算量を削減できる。   Note that when the distortion calculation unit 20d detects the edges of the subjects OBJ1 and OBJ2, the speed calculation unit 30d uses the column of the speeds VL of the subject OBJ from Equation (15) as in the case of the speed calculation unit 30c illustrated in FIG. A component in the direction OD1 may be calculated. In this case, the image processing apparatus 100D can reduce the amount of calculation for calculating the enlargement / reduction ratio β in Expression (16).

図22は、図19に示した画像処理装置100Eにおける画像処理の一例を示す。図22に示した処理は、制御部CNTLが画像処理プログラムを実行することにより実現される。また、図22に示した処理は、画像処理装置100Eに設けられるハードウェアにより実行されてもよい。この場合、図19に示した視差算出部10d、歪み算出部20dおよび速度算出部30dは、画像処理装置100E内に配置される回路により実現される。   FIG. 22 shows an example of image processing in the image processing apparatus 100E shown in FIG. The processing shown in FIG. 22 is realized by the control unit CNTL executing an image processing program. Further, the processing illustrated in FIG. 22 may be executed by hardware provided in the image processing apparatus 100E. In this case, the parallax calculation unit 10d, the distortion calculation unit 20d, and the speed calculation unit 30d illustrated in FIG. 19 are realized by a circuit arranged in the image processing apparatus 100E.

ステップS400では、視差算出部10dは、撮像装置CAM2で撮影された画像IMG1、IMG2をメモリMEM1から取得する。   In step S400, the parallax calculation unit 10d acquires images IMG1 and IMG2 captured by the imaging device CAM2 from the memory MEM1.

ステップS410では、視差算出部10dは、画像IMG2の処理対象のマクロブロックMBbに対応する画像IMG1のマクロブロックMBaを抽出する。例えば、視差算出部10dはマクロブロックMBa、MBb毎に画像IMG1、IMG2の画素の値を平滑化する。視差算出部10dは、平滑化した画像IMG2のうち処理対象のマクロブロックMBbを選択する。視差算出部10aは、選択した処理対象のマクロブロックMBbと、平滑化した画像IMG1のうち処理対象のマクロブロックMBbが含まれる画素領域ARの各マクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。視差算出部10dは、最小のSAD値を示す画像IMG1のマクロブロックMBa(すなわち画像IMG2の処理対象のマクロブロックMBbと最も一致する画像領域)を抽出する。   In step S410, the parallax calculation unit 10d extracts the macro block MBa of the image IMG1 corresponding to the processing target macro block MBb of the image IMG2. For example, the parallax calculation unit 10d smoothes the pixel values of the images IMG1 and IMG2 for each of the macroblocks MBa and MBb. The parallax calculation unit 10d selects the macro block MBb to be processed from the smoothed image IMG2. The parallax calculation unit 10a performs image processing such as template matching between the selected processing target macroblock MBb and each macroblock MBa in the pixel area AR in which the processing target macroblock MBb is included in the smoothed image IMG1. To calculate the SAD value. The parallax calculation unit 10d extracts the macroblock MBa of the image IMG1 that indicates the minimum SAD value (that is, the image region that most closely matches the processing target macroblock MBb of the image IMG2).

ステップS420では、歪み算出部20dは、画像IMG2の処理対象のマクロブロックMBbに変形処理を実行し歪み情報INFを算出する。例えば、歪み算出部20dは、被写体OBJ2の形状をステップS410で抽出されたマクロブロックMBaの被写体OBJ1の形状に一致させるように、式(16)のせん断率α及び拡縮率β等を変化させて処理対象のマクロブロックMBbに変形処理を実行する。歪み算出部20dは、変形処理した処理対象のマクロブロックMBbとステップS410で抽出されたマクロブロックMBaとの間でテンプレートマッチング等の画像処理を実行し、SAD値を算出する。歪み算出部20dは、SAD値が最小値を示す場合、変形処理した被写体OBJ2の形状が被写体OBJ1の形状に最も一致すると判定する。そして、歪み算出部20dは、SAD値が最小値を示す際のせん断率αおよび拡縮率βを歪み情報INFとして算出する。歪み算出部20dは、算出した歪み情報INFをメモリMEM2に出力する。また、視差算出部10dは、SAD値が最小値を示す際の変数Txを視差DPFとし、視差DPFをメモリMEM2に出力する。   In step S420, the distortion calculation unit 20d calculates a distortion information INF by performing a deformation process on the processing target macroblock MBb of the image IMG2. For example, the distortion calculation unit 20d changes the shear rate α and the expansion / contraction rate β in Equation (16) so that the shape of the subject OBJ2 matches the shape of the subject OBJ1 of the macroblock MBa extracted in step S410. The transformation process is executed on the macro block MBb to be processed. The distortion calculation unit 20d performs image processing such as template matching between the macro block MBb to be processed and the macro block MBa extracted in step S410, and calculates the SAD value. When the SAD value indicates the minimum value, the distortion calculation unit 20d determines that the shape of the subject OBJ2 subjected to the deformation process most closely matches the shape of the subject OBJ1. Then, the strain calculation unit 20d calculates, as strain information INF, the shear rate α and the expansion / contraction rate β when the SAD value shows the minimum value. The distortion calculation unit 20d outputs the calculated distortion information INF to the memory MEM2. Further, the parallax calculation unit 10d uses the variable Tx when the SAD value indicates the minimum value as the parallax DPF, and outputs the parallax DPF to the memory MEM2.

ステップS430では、速度算出部30dは、ステップS420で算出された視差DPFおよび歪み情報INFと読み出し時間情報TINFとを用い、式(3)−式(6)から実空間における被写体OBJ1の速度VLのうち列方向OD1の成分を算出する。   In step S430, the speed calculation unit 30d uses the parallax DPF, the distortion information INF, and the readout time information TINF calculated in step S420 to calculate the speed VL of the subject OBJ1 in the real space from Expression (3) -Expression (6). Of these, the component in the column direction OD1 is calculated.

ステップS440では、速度算出部30dは、ステップS420で算出された視差DPFおよび歪み情報INFと読み出し時間情報TINFとを用い、式(6)、式(9)、式(10)から実空間における被写体OBJ1の速度VLのうち行方向OD2の成分を算出する。   In step S440, the speed calculation unit 30d uses the parallax DPF, the distortion information INF, and the readout time information TINF calculated in step S420, and the subject in the real space from the expressions (6), (9), and (10). Of the speed VL of OBJ1, the component in the row direction OD2 is calculated.

ステップS450では、速度算出部30dは、ステップS430で算出した列方向OD1の成分とS440で算出した行方向OD2の成分とをベクトル合成し、実空間における被写体OBJの速度VLを算出する。   In step S450, the speed calculation unit 30d performs vector synthesis of the component in the column direction OD1 calculated in step S430 and the component in the row direction OD2 calculated in step S440, and calculates the speed VL of the subject OBJ in real space.

ステップS460では、制御部CNTLは、画像IMG2において次のマクロブロックMBbがあるか否かを判定する。制御部CNTLが次の処理対象となるマクロブロックMBbがあると判定した場合、画像処理装置100Eの処理は、ステップS410に移る。一方、制御部CNTLが次の処理対象となるマクロブロックMBbがないと判定した場合、画像処理装置100Eの処理は終了する。   In step S460, control unit CNTL determines whether or not next macroblock MBb is present in image IMG2. When the control unit CNTL determines that there is a macroblock MBb to be processed next, the processing of the image processing device 100E proceeds to step S410. On the other hand, when the control unit CNTL determines that there is no macro block MBb to be processed next, the processing of the image processing apparatus 100E ends.

以上、図19から図22に示す実施形態では、撮像素子ISEN1、ISEN2からの画素信号の読み出しは、行の配列方向の走査の向きを画素領域AR毎に互いに逆にして実行される。これにより、撮像素子ISEN1で撮影された画像IMG1上の被写体OBJ1と、撮像素子ISEN2で撮影された画像IMG2上の被写体OBJ2とは、画素領域AR毎に互いに異なる形状(ローリングシャッタ歪み)を示す。そこで、画像処理装置100Eは、画像IMG2上の被写体OBJ2に対してマクロブロックMBb毎にせん断変形および拡縮処理を合わせて実行し、被写体OBJ2の形状を被写体OBJ1の形状に合わせ込むことで、視差DPFおよび歪み情報INFを算出する。画像処理装置100Eは、算出した視差DPFおよび歪み情報INFと読み出し時間情報TINFとを用いて、実空間における被写体OBJの速度VLを算出する。   As described above, in the embodiment shown in FIGS. 19 to 22, the reading of the pixel signals from the imaging elements ISEN1 and ISEN2 is executed with the scanning directions in the row arrangement direction reversed for each pixel area AR. Accordingly, the subject OBJ1 on the image IMG1 photographed by the image sensor ISEN1 and the subject OBJ2 on the image IMG2 photographed by the image sensor ISEN2 have different shapes (rolling shutter distortion) for each pixel area AR. Accordingly, the image processing apparatus 100E executes shear deformation and enlargement / reduction processing for each macroblock MBb on the subject OBJ2 on the image IMG2, and matches the shape of the subject OBJ2 to the shape of the subject OBJ1, thereby disparity DPF And distortion information INF is calculated. The image processing apparatus 100E calculates the speed VL of the subject OBJ in the real space using the calculated parallax DPF, distortion information INF, and readout time information TINF.

これにより、画像処理装置100Eは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの静止画像(画像IMG1、IMG2)から、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Eは、走査の向きが互いに同じ撮像素子を2つ有するステレオカメラが撮像した少なくとも4つのフレームを用いる場合と比べて、メモリMEM1に記憶される画像のデータ量を削減できる。   Thereby, the image processing apparatus 100E can calculate the speed VL of the subject OBJ in the real space from two still images (images IMG1 and IMG2) obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. . That is, the image processing apparatus 100E can reduce the amount of image data stored in the memory MEM1 as compared to the case where at least four frames captured by a stereo camera having two imaging elements having the same scanning direction are used.

また、画像処理装置100Eは、撮像装置CAM2における撮像素子ISEN1、ISEN2により1回の撮影で得られた2つの画像IMG1、IMG2を用いて、実空間における被写体OBJの速度VLを算出できる。すなわち、画像処理装置100Eは、実空間における被写体OBJの速度VLを算出するために、撮像装置CAM2に2回以上撮影させなくてもよい。そして、画像処理装置100Eは、実空間における被写体OBJの速度を算出する演算量を、従来と比べて削減できる。   Further, the image processing apparatus 100E can calculate the speed VL of the subject OBJ in the real space by using the two images IMG1 and IMG2 obtained by one imaging by the imaging elements ISEN1 and ISEN2 in the imaging apparatus CAM2. That is, the image processing apparatus 100E does not have to cause the imaging device CAM2 to capture images twice or more in order to calculate the speed VL of the subject OBJ in the real space. Then, the image processing apparatus 100E can reduce the amount of calculation for calculating the speed of the subject OBJ in the real space compared to the conventional case.

なお、1つの撮像素子を有する1つの撮像装置が撮像した動画の2フレームを用いる場合でも、被写体OBJの速度を算出できることがある。しかしながら、1つの撮像装置が撮像した2フレームから撮像装置と被写体OBJとの間の距離DISを算出することは困難なため、実空間における被写体OBJの速度を画像処理装置100Eと同一あるいは同様の精度で算出することは困難である。   Note that the speed of the subject OBJ may be calculated even when two frames of a moving image captured by one imaging device having one imaging element are used. However, since it is difficult to calculate the distance DIS between the imaging device and the subject OBJ from the two frames taken by one imaging device, the speed of the subject OBJ in real space is the same as or similar to that of the image processing device 100E. It is difficult to calculate with.

以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲がその精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずである。したがって、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物に拠ることも可能である。   From the above detailed description, features and advantages of the embodiments will become apparent. This is intended to cover the features and advantages of the embodiments described above without departing from the spirit and scope of the claims. Also, any improvement and modification should be readily conceivable by those having ordinary knowledge in the art. Therefore, there is no intention to limit the scope of the inventive embodiments to those described above, and appropriate modifications and equivalents included in the scope disclosed in the embodiments can be used.

以上の実施形態に関し、さらに以下の付記を開示する。
(付記1)
行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、前記複数の行の読み出しが前記第1の撮像素子および前記第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理装置において、
前記第1の撮像素子から読み出された第1の画像および前記第2の撮像素子から読み出された第2の画像を用いて、前記第1の画像上の被写体である第1の被写体の位置と前記第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出する第1の算出部と、
前記第1の被写体と前記第2の被写体との形状の差異である歪み情報を算出する第2の算出部と、
前記視差および前記歪み情報を用い、前記被写体の速度を算出する第3の算出部と
を備えていることを特徴とする画像処理装置。
(付記2)
付記1に記載の画像処理装置において、
前記第1の撮像素子が有する前記複数の画素および前記第2の撮像素子が有する前記複数の画素を前記行の配列方向に複数の画素領域に分割し、前記画素領域毎に前記画素信号を行毎に順番に読み出す走査の向きを前記第1の撮像素子と前記第2の撮像素子とで互いに逆にする駆動処理を、前記撮像装置に実行させる制御部を備えることを特徴とする画像処理装置。
(付記3)
付記2に記載の画像処理装置において、
前記第1の算出部は、前記各画素領域を行方向に分割して得られる前記第2の画像上の第2の画像領域と前記第2の画像領域に対応する前記第1の画像上の第1の画像領域との位置の差を、前記視差として前記第2の画像領域毎に算出し、
前記第2の算出部は、前記第2の被写体の形状を前記第1の被写体の形状に一致させるように変形する変形処理を実行することで、前記歪み情報を前記第2の画像領域毎に算出し、
前記第3の算出部は、前記視差および前記歪み情報を用い、前記被写体の速度を前記第2の画像領域毎に算出する
ことを特徴とする画像処理装置。
(付記4)
付記3に記載の画像処理装置において、
前記第2の算出部は、前記変形処理としてせん断変形を前記第2の被写体に実行し、前記せん断変形による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理装置。
(付記5)
付記3または付記4に記載の画像処理装置において、
前記第2の算出部は、前記変形処理として前記第2の被写体を拡大あるいは縮小させる拡縮処理を実行し、前記拡縮処理による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理装置。
(付記6)
行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、前記複数の行の読み出しが前記第1の撮像素子および前記第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理方法において、
前記第1の撮像素子から読み出された第1の画像および前記第2の撮像素子から読み出された第2の画像を用いて、前記第1の画像上の被写体である第1の被写体の位置と前記第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出し、
前記第1の被写体と前記第2の被写体との形状の差異である歪み情報を算出し、
前記視差および前記歪み情報を用い、前記被写体の速度を算出する
ことを特徴とする画像処理方法。
(付記7)
付記6に記載の画像処理方法において、
前記第1の撮像素子が有する前記複数の画素および前記第2の撮像素子が有する前記複数の画素を前記行の配列方向に複数の画素領域に分割し、前記画素領域毎に前記画素信号を行毎に順番に読み出す走査の向きを前記第1の撮像素子と前記第2の撮像素子とで互いに逆にする駆動処理を、前記撮像装置に実行させることを特徴とする画像処理方法。
(付記8)
付記7に記載の画像処理方法において、
前記視差を算出する処理は、前記各画素領域を行方向に分割して得られる前記第2の画像上の第2の画像領域と前記第2の画像領域に対応する前記第1の画像上の第1の画像領域との位置の差を、前記視差として前記第2の画像領域毎に算出し、
前記歪み情報を算出する処理は、前記第2の被写体の形状を前記第1の被写体の形状に一致させるように変形する変形処理を実行することで、前記歪み情報を前記第2の画像領域毎に算出し、
前記被写体の速度を算出する処理は、前記視差および前記歪み情報を用い、前記被写体の速度を前記第2の画像領域毎に算出する
ことを特徴とする画像処理方法。
(付記9)
付記8に記載の画像処理方法において、
前記歪み情報を算出する処理は、前記変形処理としてせん断変形を前記第2の被写体に実行し、前記せん断変形による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理方法。
(付記10)
付記8または付記9に記載の画像処理装置において、
前記歪み情報を算出する処理は、前記変形処理として前記第2の被写体を拡大あるいは縮小させる拡縮処理を実行し、前記拡縮処理による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理装置。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
The first imaging device includes a first imaging device and a second imaging device in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted, and the readout of the plurality of rows is the first imaging device. In an image processing device that calculates the speed of a subject from an image captured by an imaging device that is opposite to each other by an element and the second imaging device,
Using the first image read from the first image sensor and the second image read from the second image sensor, the first subject that is the subject on the first image A first calculator that calculates a parallax indicating a difference between a position and a position of a second subject that is a subject on the second image;
A second calculation unit that calculates distortion information that is a difference in shape between the first subject and the second subject;
An image processing apparatus comprising: a third calculation unit that calculates the speed of the subject using the parallax and the distortion information.
(Appendix 2)
In the image processing apparatus according to attachment 1,
The plurality of pixels included in the first image sensor and the plurality of pixels included in the second image sensor are divided into a plurality of pixel regions in the row arrangement direction, and the pixel signal is transmitted for each pixel region. An image processing apparatus comprising: a control unit that causes the imaging apparatus to execute a driving process in which the first imaging element and the second imaging element reverse scanning directions that are sequentially read out each time. .
(Appendix 3)
In the image processing device according to attachment 2,
The first calculation unit includes a second image area on the second image obtained by dividing each pixel area in a row direction, and an area on the first image corresponding to the second image area. Calculating the difference in position from the first image region for each second image region as the parallax;
The second calculation unit performs a deformation process for deforming the second subject so that the shape of the second subject matches the shape of the first subject, thereby obtaining the distortion information for each second image region. Calculate
The third calculation unit uses the parallax and the distortion information to calculate the speed of the subject for each second image region.
(Appendix 4)
In the image processing device according to attachment 3,
The second calculation unit executes shear deformation on the second subject as the deformation processing, and calculates a deformation amount of the second subject due to the shear deformation as the distortion information. apparatus.
(Appendix 5)
In the image processing apparatus according to appendix 3 or appendix 4,
The second calculation unit performs an enlargement / reduction process for enlarging or reducing the second subject as the deformation process, and calculates a deformation amount of the second object by the enlargement / reduction process as the distortion information. An image processing apparatus.
(Appendix 6)
The first imaging device includes a first imaging device and a second imaging device in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted, and the readout of the plurality of rows is the first imaging device. In an image processing method for calculating a speed of a subject from an image captured by an imaging device that is opposite to each other by an element and the second imaging element,
Using the first image read from the first image sensor and the second image read from the second image sensor, the first subject that is the subject on the first image Calculating a parallax indicating a difference between a position and a position of a second subject which is a subject on the second image;
Calculating distortion information which is a difference in shape between the first subject and the second subject;
An image processing method, wherein the speed of the subject is calculated using the parallax and the distortion information.
(Appendix 7)
In the image processing method according to attachment 6,
The plurality of pixels included in the first image sensor and the plurality of pixels included in the second image sensor are divided into a plurality of pixel regions in the row arrangement direction, and the pixel signal is transmitted for each pixel region. An image processing method, comprising: causing the imaging apparatus to execute a driving process in which the first imaging element and the second imaging element have opposite scanning directions sequentially read each time.
(Appendix 8)
In the image processing method according to attachment 7,
The process of calculating the parallax is performed on the first image corresponding to the second image area on the second image and the second image area obtained by dividing each pixel area in the row direction. Calculating the difference in position from the first image region for each second image region as the parallax;
The process of calculating the distortion information is performed by performing a deformation process for deforming the second subject so that the shape of the second subject matches the shape of the first subject. To
The process for calculating the speed of the subject uses the parallax and the distortion information, and calculates the speed of the subject for each second image region.
(Appendix 9)
In the image processing method according to attachment 8,
The processing for calculating the strain information is performed by performing shear deformation on the second subject as the deformation processing, and calculating a deformation amount of the second subject due to the shear deformation as the strain information. Processing method.
(Appendix 10)
In the image processing apparatus according to appendix 8 or appendix 9,
The process of calculating the distortion information includes performing an enlargement / reduction process for enlarging or reducing the second subject as the deformation process, and calculating a deformation amount of the second subject by the enlargement / reduction process as the distortion information. A featured image processing apparatus.

10,10a,10b,10c,10d…視差算出部;20,20a,20b,20c,20d…歪み算出部;30,30a,30b,30c,30d…速度算出部;100,100A,100B,100C,100D,100E…画像処理装置;AR1−ARn…画素領域;CAM,CAM2…撮像装置;BUS…バス;CAL…算出部;CNTL…制御部;DIP…表示部;DPF…視差;DRV…駆動部;IMG1,IMG2…画像;INF…歪み情報;ISEN1,ISEN2…撮像素子;LEN1,LEN2…レンズ;MBa11−MBa15,MBa21−MBa25,MBa31−MBa35,MBb11−MBb15,MBb21−MBb25,MBb31−MBb35,MBc,MBd,MBe…マクロブロック;MEM…記憶部;MEM1,MEM2…メモリ;OBJ,OBJ1,OBJ1a,OBJ1b、OBJ2,OBJ2a,OBJ2b,OBJ2c…被写体;REC…記録部;TINF…読み出し時間情報 10, 10a, 10b, 10c, 10d ... parallax calculation unit; 20, 20a, 20b, 20c, 20d ... distortion calculation unit; 30, 30a, 30b, 30c, 30d ... speed calculation unit; 100, 100A, 100B, 100C, 100D, 100E: Image processing device; AR1-ARn: Pixel region; CAM, CAM2: Imaging device; BUS ... Bus; CAL ... Calculation unit; CNTL ... Control unit; DIP ... Display unit; DPF ... Parallax; IMG1, IMG2 ... image; INF ... distortion information; ISEN1, ISEN2 ... imaging element; LEN1, LEN2 ... lens; MBa11-MBa15, MBa21-MBa25, MBa31-MBa35, MBb11-MBb15, MBb21-MBb25, MBb31-MBb35, MBc, MBd, MBe ... Macroblock; MEM Storage unit; MEM1, MEM2 ... memory; OBJ, OBJ1, OBJ1a, OBJ1b, OBJ2, OBJ2a, OBJ2b, OBJ2c ... subject; REC ... recording unit; TINF ... read time information

Claims (6)

行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、前記複数の行の読み出しが前記第1の撮像素子および前記第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理装置において、
前記第1の撮像素子から読み出された第1の画像および前記第2の撮像素子から読み出された第2の画像を用いて、前記第1の画像上の被写体である第1の被写体の位置と前記第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出する第1の算出部と、
前記第1の被写体と前記第2の被写体との形状の差異である歪み情報を算出する第2の算出部と、
前記視差および前記歪み情報を用い、前記被写体の速度を算出する第3の算出部と
を備えていることを特徴とする画像処理装置。
The first imaging device includes a first imaging device and a second imaging device in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted, and the readout of the plurality of rows is the first imaging device. In an image processing device that calculates the speed of a subject from an image captured by an imaging device that is opposite to each other by an element and the second imaging device,
Using the first image read from the first image sensor and the second image read from the second image sensor, the first subject that is the subject on the first image A first calculator that calculates a parallax indicating a difference between a position and a position of a second subject that is a subject on the second image;
A second calculation unit that calculates distortion information that is a difference in shape between the first subject and the second subject;
An image processing apparatus comprising: a third calculation unit that calculates the speed of the subject using the parallax and the distortion information.
請求項1に記載の画像処理装置において、
前記第1の撮像素子が有する前記複数の画素および前記第2の撮像素子が有する前記複数の画素を前記行の配列方向に複数の画素領域に分割し、前記画素領域毎に前記画素信号を行毎に順番に読み出す走査の向きを前記第1の撮像素子と前記第2の撮像素子とで互いに逆にする駆動処理を、前記撮像装置に実行させる制御部を備えることを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The plurality of pixels included in the first image sensor and the plurality of pixels included in the second image sensor are divided into a plurality of pixel regions in the row arrangement direction, and the pixel signal is transmitted for each pixel region. An image processing apparatus comprising: a control unit that causes the imaging apparatus to execute a driving process in which the first imaging element and the second imaging element reverse scanning directions that are sequentially read out each time. .
請求項2に記載の画像処理装置において、
前記第1の算出部は、前記各画素領域を行方向に分割して得られる前記第2の画像上の第2の画像領域と前記第2の画像領域に対応する前記第1の画像上の第1の画像領域との位置の差を、前記視差として前記第2の画像領域毎に算出し、
前記第2の算出部は、前記第2の被写体の形状を前記第1の被写体の形状に一致させるように変形する変形処理を実行することで、前記歪み情報を前記第2の画像領域毎に算出し、
前記第3の算出部は、前記視差および前記歪み情報を用い、前記被写体の速度を前記第2の画像領域毎に算出する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 2,
The first calculation unit includes a second image area on the second image obtained by dividing each pixel area in a row direction, and an area on the first image corresponding to the second image area. Calculating the difference in position from the first image region for each second image region as the parallax;
The second calculation unit performs a deformation process for deforming the second subject so that the shape of the second subject matches the shape of the first subject, thereby obtaining the distortion information for each second image region. Calculate
The third calculation unit uses the parallax and the distortion information to calculate the speed of the subject for each second image region.
請求項3に記載の画像処理装置において、
前記第2の算出部は、前記変形処理としてせん断変形を前記第2の被写体に実行し、前記せん断変形による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理装置。
The image processing apparatus according to claim 3.
The second calculation unit executes shear deformation on the second subject as the deformation processing, and calculates a deformation amount of the second subject due to the shear deformation as the distortion information. apparatus.
請求項3または請求項4に記載の画像処理装置において、
前記第2の算出部は、前記変形処理として前記第2の被写体を拡大あるいは縮小させる拡縮処理を実行し、前記拡縮処理による前記第2の被写体の変形量を前記歪み情報として算出することを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
The second calculation unit performs an enlargement / reduction process for enlarging or reducing the second subject as the deformation process, and calculates a deformation amount of the second object by the enlargement / reduction process as the distortion information. An image processing apparatus.
行列状に配置された複数の画素を含む画素アレイの複数の行の読み出しを順次にずらした第1の撮像素子および第2の撮像素子を含み、前記複数の行の読み出しが前記第1の撮像素子および前記第2の撮像素子で互いに逆である撮像装置で撮影された画像から被写体の速度を算出する画像処理方法において、
前記第1の撮像素子から読み出された第1の画像および前記第2の撮像素子から読み出された第2の画像を用いて、前記第1の画像上の被写体である第1の被写体の位置と前記第2の画像上の被写体である第2の被写体の位置との差を示す視差を算出し、
前記第1の被写体と前記第2の被写体との形状の差異である歪み情報を算出し、
前記視差および前記歪み情報を用い、前記被写体の速度を算出する
ことを特徴とする画像処理方法。
The first imaging device includes a first imaging device and a second imaging device in which readout of a plurality of rows of a pixel array including a plurality of pixels arranged in a matrix is sequentially shifted, and the readout of the plurality of rows is the first imaging device. In an image processing method for calculating a speed of a subject from an image captured by an imaging device that is opposite to each other by an element and the second imaging element,
Using the first image read from the first image sensor and the second image read from the second image sensor, the first subject that is the subject on the first image Calculating a parallax indicating a difference between a position and a position of a second subject which is a subject on the second image;
Calculating distortion information which is a difference in shape between the first subject and the second subject;
An image processing method, wherein the speed of the subject is calculated using the parallax and the distortion information.
JP2015085856A 2015-04-20 2015-04-20 Image processing apparatus and image processing method Active JP6477193B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015085856A JP6477193B2 (en) 2015-04-20 2015-04-20 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015085856A JP6477193B2 (en) 2015-04-20 2015-04-20 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2016208178A JP2016208178A (en) 2016-12-08
JP6477193B2 true JP6477193B2 (en) 2019-03-06

Family

ID=57487336

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015085856A Active JP6477193B2 (en) 2015-04-20 2015-04-20 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP6477193B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6645949B2 (en) * 2016-11-01 2020-02-14 株式会社ソニー・インタラクティブエンタテインメント Information processing apparatus, information processing system, and information processing method
KR102378216B1 (en) * 2018-11-29 2022-03-25 주식회사 케이티앤씨 Apparatus and method for object speed detection using rolling shutter
CN114026436B (en) * 2019-06-25 2024-05-24 索尼集团公司 Image processing device, image processing method, and program
CN111885309A (en) * 2020-08-31 2020-11-03 深圳市圆周率软件科技有限责任公司 Panoramic image acquisition method and panoramic camera
CN114422691A (en) * 2021-12-17 2022-04-29 润博全景文旅科技有限公司 Panoramic image synchronous shooting method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005214914A (en) * 2004-02-02 2005-08-11 Fuji Heavy Ind Ltd Moving speed detecting device and moving speed detecting method
JP4609092B2 (en) * 2005-02-03 2011-01-12 ソニー株式会社 Physical information acquisition method and physical information acquisition device
JP5406768B2 (en) * 2010-03-24 2014-02-05 富士フイルム株式会社 Imaging apparatus and control method thereof

Also Published As

Publication number Publication date
JP2016208178A (en) 2016-12-08

Similar Documents

Publication Publication Date Title
JP4509917B2 (en) Image processing apparatus and camera system
CN1332556C (en) Image processor
JP6477193B2 (en) Image processing apparatus and image processing method
JP5794705B2 (en) Imaging apparatus, control method thereof, and program
CN103842878B (en) Solid-state image capturing element, image-capturing apparatus and focusing controlling method
US8005271B2 (en) Face detection method and digital camera
JP6711612B2 (en) Image processing apparatus, image processing method, and imaging apparatus
EP2713610B1 (en) Method and device for processing captured-image signals
JP6372983B2 (en) FOCUS DETECTION DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
JP6656035B2 (en) Image processing apparatus, imaging apparatus, and control method for image processing apparatus
WO2017154423A1 (en) Image processing device, image processing method, and program
US11206348B2 (en) Image apparatus to generate a combined image, control method for controlling an apparatus to generate a combined image, and storage medium
JP6557499B2 (en) FOCUS DETECTION DEVICE, ITS CONTROL METHOD, IMAGING DEVICE, PROGRAM, AND STORAGE MEDIUM
JP2009135713A (en) Method and apparatus for correcting image distortion caused by camera shake
EP4002830B1 (en) Image pick up apparatus, image pick up method, and storage medium
KR20120069543A (en) Device for processing image, method thereof and imaging device
US20230066494A1 (en) Apparatus to perform alignment to images, image processing method to perform alignment to images, and computer readable non-transitory memory to perform alignment to images
JP7309451B2 (en) Imaging device and control method
JP6439412B2 (en) Image processing apparatus and image processing method
JP6375131B2 (en) Imaging apparatus, image processing method, and control program
JP2014131177A (en) Image processing device, camera, image processing method, and image processing program
US8379933B2 (en) Method of determining shift between two images
JP5251684B2 (en) Image processing device
JP2019149602A (en) Imaging apparatus
JP7346021B2 (en) Image processing device, image processing method, imaging device, program and recording medium

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7426

Effective date: 20180209

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20180209

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20180209

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180308

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181210

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190121

R150 Certificate of patent or registration of utility model

Ref document number: 6477193

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150