JP6273921B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP6273921B2
JP6273921B2 JP2014046847A JP2014046847A JP6273921B2 JP 6273921 B2 JP6273921 B2 JP 6273921B2 JP 2014046847 A JP2014046847 A JP 2014046847A JP 2014046847 A JP2014046847 A JP 2014046847A JP 6273921 B2 JP6273921 B2 JP 6273921B2
Authority
JP
Japan
Prior art keywords
image
luminance
edge
unit
blur amount
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
JP2014046847A
Other languages
Japanese (ja)
Other versions
JP2015170306A (en
Inventor
睦 永見
睦 永見
Original Assignee
サクサ株式会社
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 サクサ株式会社 filed Critical サクサ株式会社
Priority to JP2014046847A priority Critical patent/JP6273921B2/en
Publication of JP2015170306A publication Critical patent/JP2015170306A/en
Application granted granted Critical
Publication of JP6273921B2 publication Critical patent/JP6273921B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Image Analysis (AREA)

Description

本発明は、監視システムに用いて好適な画像処理装置に関する。   The present invention relates to an image processing apparatus suitable for use in a monitoring system.

近年、道路における交通量の計測、走行車両の特定、走行車両の速度計測、或いは所定の敷地内へ侵入した物体の特定等を目的として、テレビカメラに代表される撮像装置を用いた監視システムが提案されている。   In recent years, a monitoring system using an imaging device typified by a television camera has been developed for the purpose of measuring traffic on a road, identifying a traveling vehicle, measuring the speed of a traveling vehicle, or identifying an object that has entered a predetermined site. Proposed.

このような監視システムにおいて、検出対象物体と背景画像を含む入力画像から、背景画像を引くことにより検出対象物体の像を得る背景差分法や、現在入力されている画像フレームと前回入力された画像フレームとの差分を計算し、差分値の大きい領域(変化領域)を移動物体として検知するフレーム間差分法など、画像の変化に基づいて物体を検知する手法を用いて、物体を検知するものがある。また、撮像装置から検知された物体までの距離を測定することで侵入した物体を特定するものがある。   In such a monitoring system, a background subtraction method that obtains an image of a detection target object by subtracting a background image from an input image including the detection target object and a background image, or a currently input image frame and a previously input image What detects an object using a method that detects an object based on a change in an image, such as an inter-frame difference method that calculates a difference from a frame and detects an area (change area) having a large difference value as a moving object. is there. In addition, there is one that specifies an intruding object by measuring a distance from the imaging device to the detected object.

従来、撮像装置からの画像を処理して被写体までの距離を測定する方法として広く知られているのはステレオ法である。これは測距対象となる被写体を複数の撮像装置で撮像し、撮像装置間の距離(基線長)と画像上での差異(視差)を用い、三角測距の原理で距離を測定するものである。   Conventionally, a stereo method is widely known as a method for measuring an image from an imaging apparatus and measuring a distance to a subject. In this method, a subject to be distance-measured is imaged by a plurality of imaging devices, and the distance is measured by the principle of triangulation using the distance (baseline length) between the imaging devices and the difference (parallax) on the image. is there.

また、他の方法としてDFD(Depth from Defocus)法がある。これは画像のボケ量と被写体距離との相関情報から距離を測定するものであり、単眼カメラで実現できるため、システムの小型化に有利である。   Another method is a DFD (Depth from Defocus) method. This measures the distance from the correlation information between the blur amount of the image and the subject distance, and can be realized with a monocular camera, which is advantageous for downsizing of the system.

また、画像のボケ量を推定する手法として、画像の対数振幅スペクトル上に現れる暗い円環の半径から、ボケの特性を表現するPSF(Point Spread Function:点像分布関数)の推定を行う手法(非特許文献1)、画像の対数振幅スペクトル上の輝度こう配のベクトル分布を用いてボケの特性を表現し、PSFの推定を行う手法(非特許文献2)がある。   In addition, as a technique for estimating the amount of blur of an image, a technique of estimating a PSF (Point Spread Function) that expresses the characteristic of the blur from the radius of a dark circle appearing on the logarithmic amplitude spectrum of the image ( Non-Patent Document 1) and a technique (Non-Patent Document 2) for expressing a blur characteristic using a luminance gradient vector distribution on a logarithmic amplitude spectrum of an image and estimating a PSF (Non-Patent Document 2).

しかし、これらの手法は画像の周波数解析を伴うため、処理の負荷が重く、処理に時間がかかるという問題がある。   However, since these methods involve image frequency analysis, there is a problem that the processing load is heavy and the processing takes time.

D.B.Gennery,“Determination of optical transfer function by inspection of frequency-domain plot,”Journal of the Optical Society of America,vol.63,pp.1571-1577,1973.D. B. Gennery, “Determination of optical transfer function by inspection of frequency-domain plot,” Journal of the Optical Society of America, vol. 63, pp. 1571-1577, 1973. 電子情報通信学会論文誌 D Vol. J90-D,No.10,pp.2848-2857「対数振幅スペクトル上の輝度こう配ベクトル分布を利用したノイズに頑健な焦点ずれPSF推定」,坂野盛彦、末竹規哲、内野英治IEICE Transactions D Vol. J90-D, No.10, pp.2848-2857 “Noise robust defocus PSF estimation using luminance gradient vector distribution on logarithmic amplitude spectrum”, Morihiko Sakano, Suetake Noriaki, Eiji Uchino

本発明は、上記従来の問題を解決するためになされたものであって、その目的は、画像のボケ量の推定を、周波数解析を伴わない単純な処理で実現することである。   The present invention has been made to solve the above-described conventional problems, and an object of the present invention is to realize estimation of an image blur amount by a simple process without frequency analysis.

本発明に係る画像処理装置は、画像のエッジを抽出するエッジ抽出手段と、該エッジ抽出手段により抽出されたエッジの両側の直近に位置する一対の画素の画素値の差と、該一対の画素の両側に位置する少なくとも一対の画素の画素値の差とに基づいて、前記エッジのボケ量を算出するボケ量算出手段と、を有する画像処理装置である。   An image processing apparatus according to the present invention includes an edge extracting unit that extracts an edge of an image, a difference between pixel values of a pair of pixels located immediately on both sides of the edge extracted by the edge extracting unit, and the pair of pixels A blur amount calculation unit that calculates a blur amount of the edge based on a difference between pixel values of at least a pair of pixels located on both sides of the image processing apparatus.

本発明によれば、画像のボケ量の推定を、周波数解析を伴わない単純な処理で行うことができる。   According to the present invention, the blur amount of an image can be estimated by a simple process that does not involve frequency analysis.

本発明の実施形態に係る画像処理装置を含む監視システムを示す図である。It is a figure which shows the monitoring system containing the image processing apparatus which concerns on embodiment of this invention. 図1におけるボケ量推定手段の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the blur amount estimation means in FIG. 図2における輝度差算出手段及びボケ量算出手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the brightness | luminance difference calculation means and the blur amount calculation means in FIG. エッジ部及びその両側の画素の輝度とボケ量との関係を示す図である。It is a figure which shows the relationship between the brightness | luminance of a pixel of an edge part and its both sides, and a blur amount. 図1におけるボケ量推定手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the blur amount estimation means in FIG. 図1における距離測定手段の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the distance measurement means in FIG. ボケ量/距離テーブルの作成手順について説明するための図である。It is a figure for demonstrating the preparation procedure of a blurring amount / distance table. 図1における距離測定手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the distance measurement means in FIG. 図6における輝度画像抽出手段及び輝度画像合成手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the brightness | luminance image extraction means and brightness | luminance image synthetic | combination means in FIG. 図1における距離測定手段の測定対象の例を示す図である。It is a figure which shows the example of the measuring object of the distance measurement means in FIG. 図1における物体検知手段の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the object detection means in FIG. 図1における物体検知手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the object detection means in FIG. 図1における物体検知手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the object detection means in FIG. 図1における影除去手段の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the shadow removal means in FIG. 図1における影除去手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the shadow removal means in FIG. 図1における影除去手段の動作を説明するための図である。It is a figure for demonstrating operation | movement of the shadow removal means in FIG. 図1における速度測定手段の測定原理を説明するための図である。It is a figure for demonstrating the measurement principle of the speed measurement means in FIG. 移動ボケが発生した画像における輝度とボケ量との対応関係を示す特性曲線のグラフである。It is a graph of the characteristic curve which shows the correspondence of the brightness | luminance and the amount of blurs in the image which the movement blur generate | occur | produced. 図1における速度測定手段の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the speed measurement means in FIG. 図1における速度測定手段の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the speed measurement means in FIG.

以下、本発明の実施形態について、図面を参照して説明する。
〈画像処理装置を含む監視システム〉
図1は本発明の実施形態に係る画像処理装置を含む監視システムを示す図である。この監視システムは、PC(パーソナルコンピュータ)1と、それぞれがPC1に接続されたカメラ2、キーボード3、マウス4、及びモニタ5を備えている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
<Monitoring system including image processing device>
FIG. 1 is a diagram showing a monitoring system including an image processing apparatus according to an embodiment of the present invention. This monitoring system includes a PC (personal computer) 1, a camera 2, a keyboard 3, a mouse 4, and a monitor 5 each connected to the PC 1.

ここで、PC1が、本発明の実施形態に係る画像処理装置であり、カメラ2からの画像データを処理することで、各種画像処理(詳細については後述)を行う。   Here, the PC 1 is an image processing apparatus according to an embodiment of the present invention, and performs various image processing (details will be described later) by processing the image data from the camera 2.

カメラ2は、監視エリアを撮像するように配置された撮像装置である。本実施形態では、カラーカメラを採用したが、モノクロカメラを用いることもできる。   The camera 2 is an imaging device arranged so as to image a monitoring area. In this embodiment, a color camera is used, but a monochrome camera can also be used.

キーボード3及びマウス4は、ユーザがPC1に種々の指示を与えるための入力装置であり、モニタ5はカメラ2が監視エリアを撮像して生成した画像などを表示する出力装置である。   The keyboard 3 and the mouse 4 are input devices for the user to give various instructions to the PC 1, and the monitor 5 is an output device for displaying an image generated by the camera 2 imaging the monitoring area.

PC1は、CPU(Central Processing Unit)11と、それぞれがCPU11に接続された入力部12、カメラ制御部13、ROM(Read Only Memory)14、RAM(Random Access Memory)15、ストレージ16、及び出力部17を備えている。   The PC 1 includes a CPU (Central Processing Unit) 11, an input unit 12, a camera control unit 13, a ROM (Read Only Memory) 14, a RAM (Random Access Memory) 15, a storage 16, and an output unit each connected to the CPU 11. 17 is provided.

入力部12は、カメラ2、キーボード3、及びマウス4と通信を行うためのインタフェースであり、出力部17はモニタ5と通信を行うためのインタフェースである。また、カメラ制御部13は、カメラの焦点距離、絞り、シャッター速度などを制御するためのインタフェースである。   The input unit 12 is an interface for communicating with the camera 2, the keyboard 3, and the mouse 4, and the output unit 17 is an interface for communicating with the monitor 5. The camera control unit 13 is an interface for controlling the focal length, aperture, shutter speed, and the like of the camera.

CPU11はPC1全体の動作を制御するプロセッサである。ROM14は、CPU11が実行するプログラムや固定データ(後述する各種テーブルなど)を記憶するメモリ(書き換え可能なものを含む)であり、RAM15は、CPU11のワークエリアとなるメモリである。ストレージ16は、ハードディスクなどの大容量記憶装置からなり、カメラ2で生成され、CPU11で画像処理を受けた画像データ、CPU11が生成したデータ、監視動作に関するアプリケーションプログラムなどが格納される。   The CPU 11 is a processor that controls the operation of the entire PC 1. The ROM 14 is a memory (including rewritable ones) that stores programs executed by the CPU 11 and fixed data (such as various tables described later). The RAM 15 is a memory that serves as a work area for the CPU 11. The storage 16 is composed of a large-capacity storage device such as a hard disk, and stores image data generated by the camera 2 and subjected to image processing by the CPU 11, data generated by the CPU 11, application programs related to monitoring operations, and the like.

CPU11は、ROM14やストレージ16に格納されたプログラムを実行することにより実現される機能ブロックとして、ボケ量推定手段21、距離測定手段22、物体検知手段23、影除去手段24、及び速度測定手段25を備えている。   The CPU 11 functions as a function block realized by executing a program stored in the ROM 14 or the storage 16, as a blur amount estimation unit 21, a distance measurement unit 22, an object detection unit 23, a shadow removal unit 24, and a speed measurement unit 25. It has.

ボケ量推定手段21は、カメラ2が監視エリアを撮像して生成した画像のボケ量を推定する。距離測定手段22は、カメラ2が監視エリアを撮像して生成した画像のボケ量を推定し、ボケ量とカメラ2の焦点位置と被写体までの距離との対応関係を示すデータに基づいて、カメラ2から被写体までの距離を測定(推定)する。   The blur amount estimation unit 21 estimates the blur amount of an image generated by the camera 2 imaging the monitoring area. The distance measuring unit 22 estimates a blur amount of an image generated by the camera 2 capturing an image of the monitoring area, and based on data indicating a correspondence relationship between the blur amount, the focal position of the camera 2, and the distance to the subject. Measure (estimate) the distance from 2 to the subject.

物体検知手段23は、カメラ2が監視エリアを撮像して生成した画像の背景差分画像のボケ量を推定し、そのボケ量が予め設定した監視エリアの被写体を撮像した場合のボケ量であるか否かに基づいて、監視エリアへ侵入した物体を検知する。   The object detection unit 23 estimates the amount of blur of the background difference image of the image generated by the camera 2 imaging the monitoring area, and whether the amount of blur is the amount of blur when the subject in the monitoring area set in advance is imaged. Based on whether or not, an object that has entered the monitoring area is detected.

影除去手段24は、カメラ2が監視エリアを撮像して生成した画像のボケ量を推定し、そのボケ量と影との対応関係を示すデータに基づいて、画像中の影の部分を識別し、画像中の影の部分を除去する。   The shadow removing unit 24 estimates the blur amount of the image generated by the camera 2 imaging the monitoring area, and identifies the shadow portion in the image based on the data indicating the correspondence between the blur amount and the shadow. , Remove the shadow part in the image.

速度測定手段25は、カメラ2が監視エリアを撮像して生成した物体の画像の移動ボケ量(ブレ量)を推定し、その移動ボケ量と移動速度との対応関係を示すデータに基づいて、物体の移動速度を測定(推定)する。   The speed measuring means 25 estimates the movement blur amount (blur amount) of the image of the object generated by the camera 2 imaging the monitoring area, and based on the data indicating the correspondence between the movement blur amount and the movement speed, Measure (estimate) the moving speed of the object.

〈ボケ量推定手段の機能ブロック図〉
図2は、図1におけるボケ量推定手段21の機能構成を示すブロック図である。図示のように、ボケ量推定手段21は、画像取得手段211、モノクロ変換手段212、ノイズ除去手段213、エッジベクトル算出手段214、エッジ判定手段215、輝度差算出手段216、及びボケ量算出手段217を備えている。エッジベクトル算出手段214とエッジ判定手段215がエッジ抽出手段を構成する。
<Functional block diagram of blur amount estimation means>
FIG. 2 is a block diagram showing a functional configuration of the blur amount estimation means 21 in FIG. As illustrated, the blur amount estimation unit 21 includes an image acquisition unit 211, a monochrome conversion unit 212, a noise removal unit 213, an edge vector calculation unit 214, an edge determination unit 215, a luminance difference calculation unit 216, and a blur amount calculation unit 217. It has. The edge vector calculation means 214 and the edge determination means 215 constitute an edge extraction means.

画像取得手段211は、カメラ2が監視エリアを撮像して生成した画像を入力部12を介して受け取ることで、カメラ2からの画像を取得する手段である。このとき、カメラ2の光学系は、カメラ制御部13による焦点距離及び絞りの制御により、被写界深度の浅い状態、換言すればピントの合う範囲の狭い状態に設定されている。   The image acquisition unit 211 is a unit that acquires an image from the camera 2 by receiving an image generated by the camera 2 imaging the monitoring area via the input unit 12. At this time, the optical system of the camera 2 is set to a state where the depth of field is shallow, in other words, a state where the focusing range is narrow, by the control of the focal length and the diaphragm by the camera control unit 13.

モノクロ変換手段212は、画像取得手段211が取得した画像であるカラー画像をモノクロ画像に変換する。この変換は、カラー画像の各色成分の合成による輝度(Y)成分の生成、又は任意の色成分(例.G)の抽出として行う。   The monochrome conversion unit 212 converts a color image that is an image acquired by the image acquisition unit 211 into a monochrome image. This conversion is performed as generation of a luminance (Y) component by combining each color component of a color image, or extraction of an arbitrary color component (eg, G).

ノイズ除去手段213は、メディアンフィルタやガウシアンフィルタからなり、モノクロ変換手段212からのモノクロ画像のピクセルノイズを除去する。カメラ2としてモノクロカメラを用いた場合は、モノクロ変換手段212は不要である。   The noise removing unit 213 includes a median filter and a Gaussian filter, and removes pixel noise of the monochrome image from the monochrome conversion unit 212. When a monochrome camera is used as the camera 2, the monochrome conversion means 212 is not necessary.

エッジベクトル算出手段214は、3×3のSobel(ソーベル)フィルタやCanny(キャニー)フィルタからなり、ノイズ除去されたモノクロ画像の各画素のエッジベクトル(エッジ強度及びエッジ方向)を算出する。   The edge vector calculation means 214 is composed of a 3 × 3 Sobel filter or a Canny filter, and calculates an edge vector (edge intensity and edge direction) of each pixel of the monochrome image from which noise has been removed.

即ち、画像の横方向(x方向)の3×3のSobelフィルタSxの出力をfx、画像の縦方向(y方向)の3×3のSobelフィルタSyの出力をfyとすると、下記の式〔1〕、式〔2〕により、エッジ強度及びエッジ方向を算出する。
エッジ強度=√(fx+fy) …式〔1〕
エッジ方向=tan−1(fy/fx) …式〔2〕
That is, assuming that the output of the 3 × 3 Sobel filter Sx in the horizontal direction (x direction) of the image is fx and the output of the 3 × 3 Sobel filter Sy in the vertical direction (y direction) of the image is fy, the following formula [ 1] and edge strength and edge direction are calculated by equation [2].
Edge strength = √ (fx 2 + fy 2 ) (1)
Edge direction = tan −1 (fy / fx) (2)

エッジ判定手段215は、エッジベクトル算出手段214により算出された各画素(注目画像)のエッジベクトルの強度(エッジ強度)のうち、その両側の画素のエッジベクトルの強度と比べて大きい、即ち差又は比が所定の閾値を超える注目画像をエッジ部画素と判定することでエッジを抽出する。   The edge determination means 215 is larger than the edge vector strengths of the pixels on both sides of the edge vector strength (edge strength) of each pixel (target image) calculated by the edge vector calculation means 214, that is, a difference or An edge is extracted by determining an image of interest whose ratio exceeds a predetermined threshold value as an edge portion pixel.

輝度差算出手段216は、エッジ部画素のエッジベクトル方向の両側に位置する所定数の画素の画素値としての輝度の差を算出する。即ち、例えばエッジ部画素の両隣のさらに両隣に位置する1対の画素の輝度差を算出する。   The luminance difference calculating unit 216 calculates a luminance difference as pixel values of a predetermined number of pixels located on both sides of the edge portion pixel in the edge vector direction. That is, for example, the luminance difference between a pair of pixels located on both sides of the edge portion pixel is calculated.

ボケ量算出手段217は、エッジベクトル算出手段214により抽出されたエッジ部画素のエッジ強度と、輝度差算出手段216により算出された輝度差とから、エッジのボケ量を算出する。   The blur amount calculation unit 217 calculates an edge blur amount from the edge intensity of the edge pixel extracted by the edge vector calculation unit 214 and the luminance difference calculated by the luminance difference calculation unit 216.

〈エッジ部の輝度差及びボケ量算出〉
図3は、図2における輝度差算出手段216及びボケ量算出手段217の動作を説明するための図である。この図において、横軸は画素、縦軸は輝度を表す。
<Calculation of luminance difference and blur amount at edge>
FIG. 3 is a diagram for explaining the operations of the luminance difference calculation unit 216 and the blur amount calculation unit 217 in FIG. In this figure, the horizontal axis represents pixels and the vertical axis represents luminance.

図3において、画素Peはエッジ部画素である。画素Pe+1、画素Pe-1は、画素Peのエッジベクトル方向の両隣(両側の直近)の一対の画素であり、その輝度差:Aは、エッジベクトル算出手段214により、画素Peのエッジ強度として算出される。画素Pe+2、画素Pe-2は、画素Pe+1、画素Pe-1の両隣の一対の画素であり、その輝度差:Bは、輝度差算出手段216により算出される。   In FIG. 3, a pixel Pe is an edge portion pixel. The pixel Pe + 1 and the pixel Pe-1 are a pair of pixels adjacent to each other in the edge vector direction of the pixel Pe (immediately on both sides), and the luminance difference: A is determined by the edge vector calculation means 214 by the edge intensity of the pixel Pe. Is calculated as The pixel Pe + 2 and the pixel Pe-2 are a pair of pixels adjacent to both the pixel Pe + 1 and the pixel Pe-1, and the luminance difference B is calculated by the luminance difference calculating means 216.

ボケ量算出手段217は下記の式〔3〕により、輝度差:Bと輝度差:2Aとを比較することで、エッジのボケ量を算出する。
ボケ量=B÷2A …式〔3〕
The blur amount calculating means 217 calculates the blur amount of the edge by comparing the luminance difference: B and the luminance difference: 2A by the following equation [3].
Bokeh amount = B ÷ 2A Formula [3]

また、図3において、画素Pe+2と画素Pe+1との輝度差をB1、画素Pe-2と画素Pe-1との輝度差をB2とすると、式〔3〕に代えて、下記の式〔4〕によりボケ量を算出することもできる。
ボケ量=(A+B1+B2)÷2A …式〔4〕
In FIG. 3, when the luminance difference between the pixel Pe + 2 and the pixel Pe + 1 is B1, and the luminance difference between the pixel Pe-2 and the pixel Pe-1 is B2, The blur amount can also be calculated by the equation [4].
Bokeh amount = (A + B1 + B2) ÷ 2A (4)

〈エッジ部付近の画素の輝度とボケ量との関係〉
図4は、エッジ部及びその両側の画素の輝度とボケ量との関係を示す図である。この図を用いて、エッジ部付近の画素の輝度とボケ量との関係について説明する。
<Relationship between brightness of pixel near edge and amount of blur>
FIG. 4 is a diagram illustrating the relationship between the luminance of the edge portion and pixels on both sides thereof and the amount of blur. The relationship between the brightness of the pixels near the edge and the amount of blur will be described using this figure.

この図の横軸は画素の位置であり、9番目の画素がエッジ部画素である。また、図の縦軸は画素の輝度である。また、σはガウス分布(正規分布)における分散値の平方根であり、その数値はガウシアンフィルタのパラメータとして用いられる値である。即ち、この図に示すエッジ部及びその両側の画素の輝度とボケ量との関係は、σをパラメータとした輝度対画素位置特性である。   The horizontal axis of this figure is the pixel position, and the ninth pixel is the edge portion pixel. Also, the vertical axis in the figure is the luminance of the pixel. Further, σ is the square root of the variance value in the Gaussian distribution (normal distribution), and the numerical value is a value used as a parameter of the Gaussian filter. That is, the relationship between the brightness and the amount of blur of the edge portion and the pixels on both sides of the edge portion shown in this figure is the brightness versus pixel position characteristic using σ as a parameter.

この特性は、18個の画素の輝度値の総数を256としたガウス分布の累積分布関数をσをパラメータとして算出したものである。現実の撮像画像のボケ量はガウス分布となることが知られているので、この特性はボケ量を数値化したものと言える。また、σの値はボケ量に関連し、σが大きい程ボケ量が大きい。   This characteristic is obtained by calculating a cumulative distribution function of a Gaussian distribution with the total number of luminance values of 18 pixels being 256, using σ as a parameter. Since it is known that the blur amount of an actual captured image has a Gaussian distribution, this characteristic can be said to be a numerical value of the blur amount. The value of σ is related to the amount of blur, and the larger the σ, the larger the amount of blur.

即ち、例えばσ=0の場合、図3における画素Peに対応する9番目の画素の輝度が128、画素Pe+1、画素Pe-1に対応する10番目、8番目の画素の輝度がそれぞれ256、0であるから、A=256である。また、画素Pe+2、画素Pe-2に対応する11番目、7番目の画素の輝度はそれぞれ256、0であるから、B=256(B1=0、B2=0)である。従って、式〔3〕により、σ=0の場合のボケ量を算出すると、「B÷2A=256÷512=0.5」となる。この値がボケ量の最小値である。   That is, for example, when σ = 0, the luminance of the ninth pixel corresponding to the pixel Pe in FIG. 3 is 128, and the luminances of the tenth and eighth pixels corresponding to the pixel Pe + 1 and the pixel Pe-1 are 256, respectively. , 0, A = 256. Since the eleventh and seventh pixels corresponding to the pixel Pe + 2 and the pixel Pe-2 are 256 and 0, respectively, B = 256 (B1 = 0, B2 = 0). Accordingly, when the blur amount when σ = 0 is calculated by the equation [3], “B ÷ 2A = 256 ÷ 512 = 0.5” is obtained. This value is the minimum amount of blur.

そして、σの値が大きくなるにつれて、特性曲線の傾斜が緩くなるため、Aの値が減少し、B1、B2の値が増加し、Bと2Aが等しい傾斜に収束する。この場合、ボケ量は最大値の1となる。   As the value of σ increases, the slope of the characteristic curve becomes gentle, so the value of A decreases, the values of B1 and B2 increase, and B and 2A converge to the same slope. In this case, the blur amount is 1 which is the maximum value.

〈ボケ量推定手段の動作〉
図5は、図1におけるボケ量推定手段21の動作を示すフローチャートである。
まず画像取得手段211が被写界深度の浅い状態に設定されているカメラ2からの画像を取得する(ステップS1)。この画像はカラー画像である。
<Operation of blur amount estimation means>
FIG. 5 is a flowchart showing the operation of the blur amount estimating means 21 in FIG.
First, the image acquisition unit 211 acquires an image from the camera 2 set in a state where the depth of field is shallow (step S1). This image is a color image.

次にモノクロ変換手段212がカラー画像をモノクロ画像に変換し(ステップS2)、ノイズ除去手段213がモノクロ画像中のノイズを除去する(ステップS3)。   Next, the monochrome conversion means 212 converts the color image into a monochrome image (step S2), and the noise removal means 213 removes noise in the monochrome image (step S3).

次に、エッジベクトル算出手段214がノイズ除去されたモノクロ画像の各画素のエッジベクトルを算出し(ステップS4)、エッジ判定手段215がエッジベクトルの強度を基にエッジを抽出する(ステップS5)。ステップS4を実行する過程で図3におけるAの値が算出される。   Next, the edge vector calculation unit 214 calculates an edge vector of each pixel of the monochrome image from which noise has been removed (step S4), and the edge determination unit 215 extracts an edge based on the strength of the edge vector (step S5). In the process of executing step S4, the value A in FIG. 3 is calculated.

次いで、輝度差算出手段216が、エッジ判定手段215により抽出されたエッジを構成するエッジ部画素のエッジベクトル方向の両側の所定数の画素、例えばエッジ部画素の両隣のさらに両隣の1対の画素の輝度差を算出する(ステップS6)。このステップにより、図3におけるBの値が算出される。最後に、ボケ量算出手段217が式〔3〕を用いてボケ量を算出する(ステップS7)。   Next, the luminance difference calculation unit 216 has a predetermined number of pixels on both sides in the edge vector direction of the edge pixel constituting the edge extracted by the edge determination unit 215, for example, a pair of pixels on both sides of the edge unit pixel. Is calculated (step S6). By this step, the value B in FIG. 3 is calculated. Finally, the blur amount calculation unit 217 calculates the blur amount using the equation [3] (step S7).

このように、本発明の実施形態のボケ量推定手段によれば、周波数解析を伴わない単純な処理で画像のボケ量を推定することができる。なお、以上説明した実施形態では、式〔3〕によりボケ量を算出しているが、式〔3〕の分母の2Aに代えて、5×5のSobelフィルタの出力とすることもできる。この場合、画素Pe+2、画素Pe-2の両隣の一対の画素の画素値もボケ量に反映される。   As described above, according to the blur amount estimation unit of the embodiment of the present invention, the blur amount of an image can be estimated by a simple process without frequency analysis. In the embodiment described above, the amount of blur is calculated by the equation [3]. However, instead of 2A of the denominator of the equation [3], an output of a 5 × 5 Sobel filter may be used. In this case, the pixel values of a pair of pixels on both sides of the pixel Pe + 2 and the pixel Pe-2 are also reflected in the blur amount.

〈距離測定手段の機能ブロック図〉
図6は、図1における距離測定手段22の機能構成を示すブロック図である。
図示のように、距離測定手段22は、画像取得手段221、モノクロ変換手段222、ノイズ除去手段223、エッジベクトル算出手段224、エッジ判定手段225、輝度差算出手段226、及びボケ量算出手段227を備えている。これらの手段の構成は、ボケ量推定手段21における同名の手段と同じである。
<Functional block diagram of distance measuring means>
FIG. 6 is a block diagram showing a functional configuration of the distance measuring means 22 in FIG.
As illustrated, the distance measurement unit 22 includes an image acquisition unit 221, a monochrome conversion unit 222, a noise removal unit 223, an edge vector calculation unit 224, an edge determination unit 225, a luminance difference calculation unit 226, and a blur amount calculation unit 227. I have. The configuration of these means is the same as the means of the same name in the blur amount estimation means 21.

また、距離測定手段22は、ボケ量/輝度画像生成手段228、輝度閾値設定手段229、輝度画像抽出手段22a、及び輝度画像合成手段22bを備えている。   The distance measuring unit 22 includes a blur amount / luminance image generating unit 228, a luminance threshold setting unit 229, a luminance image extracting unit 22a, and a luminance image synthesizing unit 22b.

距離画像生成手段としてのボケ量/輝度画像生成手段228は、カメラ2で撮像した画像のボケ量と、カメラ2の焦点と被写体との間の距離との対応関係を示すデータ(相関情報)を有するテーブル(以下、ボケ量/距離テーブル)を用いて、ボケ量算出手段227で算出されたエッジのボケ量から、距離画像としてのボケ量/輝度画像を生成する。   The blur amount / luminance image generation unit 228 as the distance image generation unit generates data (correlation information) indicating the correspondence between the blur amount of the image captured by the camera 2 and the distance between the focus of the camera 2 and the subject. A blur amount / luminance image as a distance image is generated from the blur amount of the edge calculated by the blur amount calculation means 227 using a table (hereinafter referred to as a blur amount / distance table).

ボケ量/輝度画像は、カメラ2の焦点から画像のエッジに対応する被写体の位置までの距離を表す輝度を有する画像である。本実施形態では、焦点から近い程、輝度を高くする。ここで、ボケ量/距離テーブルは予め作成され、相関情報の記憶部としてのストレージ16に保存されている。ボケ量/距離テーブルの内容及び作成手順については後述する。   The blur amount / luminance image is an image having a luminance representing the distance from the focus of the camera 2 to the position of the subject corresponding to the edge of the image. In the present embodiment, the closer to the focal point, the higher the luminance. Here, the blur amount / distance table is created in advance and stored in the storage 16 as a storage unit of correlation information. The contents and creation procedure of the blur amount / distance table will be described later.

輝度閾値設定手段229は、ユーザがキーボード3及びマウス4を用いて、測定したい距離を入力したとき、その距離に対応するボケ量/輝度画像の輝度の閾値をRAM15に設定する手段である。本実施形態では、距離として、焦点から1m以内、2m以内、3m以内などが設定される。この輝度閾値は、例えば焦点から1m以内の場合、ボケ量/輝度画像生成手段228により生成された輝度画像において、焦点から1mに位置する被写体のボケ量を表す輝度となる。   When the user inputs a distance to be measured using the keyboard 3 and the mouse 4, the luminance threshold setting unit 229 is a unit that sets a blur amount / luminance image luminance threshold corresponding to the distance in the RAM 15. In the present embodiment, the distance is set within 1 m, within 2 m, within 3 m, etc. from the focal point. For example, when the brightness threshold is within 1 m from the focal point, the luminance threshold is a luminance representing the blur amount of the subject located 1 m from the focal point in the luminance image generated by the blur amount / luminance image generating unit 228.

輝度画像抽出手段22aは、ボケ量/輝度画像生成手段228で生成された画像の画素のうち、その輝度が輝度閾値設定手段229で設定された輝度閾値を超える画素を抽出する。これにより、輝度閾値を超える画素の輝度値はそのままとなり、輝度閾値以下の画素の輝度値は“0”となる。ここでは、焦点から1m以内、2m以内、3m以内に位置する被写体の画像のエッジが個別に抽出される。なお、輝度閾値を超える輝度の画素の輝度値を“1”などの一定値にしてもよい。   The luminance image extraction unit 22 a extracts pixels whose luminance exceeds the luminance threshold set by the luminance threshold setting unit 229 from the pixels of the image generated by the blur amount / luminance image generation unit 228. As a result, the luminance value of the pixel exceeding the luminance threshold value remains unchanged, and the luminance value of the pixel equal to or lower than the luminance threshold value is “0”. Here, the edges of the image of the subject located within 1 m, within 2 m, and within 3 m from the focus are individually extracted. Note that the luminance value of a pixel having a luminance exceeding the luminance threshold may be a constant value such as “1”.

輝度画像合成手段22bは、輝度画像抽出手段22aで抽出された3つの輝度画像を合成する。この合成により、例えば、焦点から1m以内、2m以内、3m以内の被写体のエッジを表す画像が生成される。ここで、焦点から3m以内は2m以内及び1m以内を含み、2m以内は1m以内を含むので、重複する範囲の輝度値は加算しない。ただし、輝度閾値を超える輝度の画素の輝度値を“1”などに固定した場合は、加算することで、焦点から1m以内が“3”、1mを超え、2m以内が“2”、2mを超え、3m以内が“1”、3mを超える範囲が“0”とする。   The luminance image synthesizing unit 22b synthesizes the three luminance images extracted by the luminance image extracting unit 22a. By this synthesis, for example, an image representing the edge of the subject within 1 m, within 2 m, and within 3 m from the focal point is generated. Here, within 3 m from the focal point includes within 2 m and within 1 m, and within 2 m includes within 1 m, so luminance values in overlapping ranges are not added. However, when the luminance value of a pixel having a luminance exceeding the luminance threshold is fixed to “1” or the like, by adding, “1” within 1 m from the focal point exceeds “3”, 1 m is exceeded, and “2” within 2 m is “2”. Exceeding and within 3 m is “1”, and exceeding 3 m is “0”.

〈ボケ量/距離テーブルの作成手順〉
図7は、ボケ量/距離テーブルの作成手順について説明するための図である。ここで、図7Aは、直径は50mmのレンズのピントをレンズから10mの距離に合わせた状態でのレンズからの距離と錯乱円の大きさ(直径)との関係を示すグラフである。このデータはカメラメーカが公開しているものである。また、図7Bは、ガウシアンフィルタでぼかした画像のボケ量を式〔3〕で算出したボケ量推定値を示すグラフである。
<Bokeh amount / distance table creation procedure>
FIG. 7 is a diagram for explaining a procedure for creating a blur amount / distance table. Here, FIG. 7A is a graph showing the relationship between the distance from the lens and the size (diameter) of the circle of confusion when the focus of the lens having a diameter of 50 mm is matched with the distance of 10 m from the lens. This data is published by the camera manufacturer. FIG. 7B is a graph showing a blur amount estimated value obtained by calculating the blur amount of the image blurred by the Gaussian filter by the equation [3].

図7Aに示すように、レンズからの距離と錯乱円の大きさとの間には対応関係がある。錯乱円の大きさとボケ量にも対応関係があることは知られているから、ボケ量と錯乱円との対応関係を示すデータを作成すれば、ボケ量とレンズからの距離との対応関係を示すデータ、即ちボケ量/距離テーブルを作成することができる。   As shown in FIG. 7A, there is a correspondence between the distance from the lens and the size of the circle of confusion. It is known that there is a correspondence between the size of the circle of confusion and the amount of blur, so if you create data that shows the correspondence between the amount of blur and the circle of confusion, you can see the correspondence between the amount of blur and the distance from the lens. Data to be shown, that is, a blur amount / distance table can be created.

そこで、図7Aに示す特性を有するカメラで取得したボケのない画像をガウシアンフィルタで処理してボケ画像を生成し、そのボケ量を式〔3〕で算出することで、図7Bに示すデータを作成する。   Therefore, the blur-free image obtained by the camera having the characteristics shown in FIG. 7A is processed by a Gaussian filter to generate a blur image, and the blur amount is calculated by Equation [3], whereby the data shown in FIG. 7B is obtained. create.

この図において、横軸のガウシアンフィルタによるボケ量の数値はガウシアンフィルタのサイズを表しており、サイズn(n=1〜11)は、(2n+1)×(2n+1)を意味する。また、縦軸のボケ量推定値は、式〔3〕による算出値の2倍を1から減算した値である。なお、網掛けを付した部分は影除去手段24が影と判定する範囲である。   In this figure, the numerical value of the blur amount by the Gaussian filter on the horizontal axis represents the size of the Gaussian filter, and the size n (n = 1 to 11) means (2n + 1) × (2n + 1). Also, the blur amount estimated value on the vertical axis is a value obtained by subtracting 1 from 2 times the value calculated by the equation [3]. The shaded portion is a range that the shadow removing unit 24 determines as a shadow.

ここで、(2n+1)×(2n+1)のガウシアンフィルタによるボケ量は、ボケのない画像の1画素を(2n+1)画素にぼかしたことを意味する。そこで、(2n+1)画素と図7Aにおける錯乱円の大きさとの対応関係を示すデータを取得することで、図7Aの縦軸の値を画素数に変換したデータを作成することができ、さらに図7Bに示すデータを用いることで、図7Aの縦軸の値を図7Bの縦軸に示すボケ量推定値としたデータ、即ちボケ量/距離テーブルを作成することができる。このボケ量/距離テーブルは、焦点距離又は絞りの値(F値)の少なくとも一方をパラメータとして複数設けておくことが好適である。なお、(2n+1)画素と図7Aにおける錯乱円の大きさとの対応関係を示すデータは、撮像素子の画素数など、カメラの諸元から取得することができる。   Here, the amount of blur by the (2n + 1) × (2n + 1) Gaussian filter means that one pixel of an image without blur is blurred to (2n + 1) pixels. Therefore, by acquiring data indicating the correspondence between (2n + 1) pixels and the size of the circle of confusion in FIG. 7A, data in which the value on the vertical axis in FIG. 7A is converted into the number of pixels can be created. By using the data shown in FIG. 7B, data in which the vertical axis value in FIG. 7A is the blur amount estimation value shown in the vertical axis in FIG. 7B, that is, the blur amount / distance table can be created. It is preferable that a plurality of blur amount / distance tables are provided using at least one of the focal length and the aperture value (F value) as a parameter. Note that data indicating the correspondence between (2n + 1) pixels and the size of the circle of confusion in FIG. 7A can be acquired from the specifications of the camera, such as the number of pixels of the image sensor.

〈距離測定手段の動作〉
図8は、図1における距離測定手段22の動作を示すフローチャートである。この図において、ステップS11のボケ量推定処理は、図5に示すフローチャートの全体(ステップS1〜S7)と同じであるから説明を省略する。
<Operation of distance measuring means>
FIG. 8 is a flowchart showing the operation of the distance measuring means 22 in FIG. In this figure, the blur amount estimation processing in step S11 is the same as the entire flowchart (steps S1 to S7) shown in FIG.

次のステップS12では、ボケ量/輝度画像生成手段228がボケ量を表す輝度画像、即ちその輝度がボケ量に対応する画像を生成する。ここでは、ボケ量が小さい、換言すれば焦点からの距離が近い被写体の画像程、輝度の高い画像を生成する。   In the next step S12, the blur amount / luminance image generation unit 228 generates a luminance image representing the blur amount, that is, an image whose luminance corresponds to the blur amount. Here, an image having a higher luminance is generated for an image of a subject having a smaller blur amount, in other words, a subject closer to the focal point.

次に輝度閾値設定手段229が、ユーザによる距離測定範囲の設定情報、即ち、ユーザがキーボード3及びマウス4を用いて入力した測定したい距離を示す情報を取得し(ステップS13)、ボケ量/距離テーブルを参照して、ユーザが測定したい距離に対応する輝度閾値を設定する(ステップS14)。   Next, the brightness threshold value setting unit 229 obtains setting information of the distance measurement range by the user, that is, information indicating the distance to be measured that is input by the user using the keyboard 3 and the mouse 4 (step S13). Referring to the table, a luminance threshold value corresponding to the distance that the user wants to measure is set (step S14).

次に輝度画像抽出手段22aが、ボケ量/輝度画像生成手段228で生成された画像の画素のうち、その輝度値が輝度閾値設定手段229によりステップS14で設定された輝度閾値以上の画素を抽出する(ステップS15)。   Next, the luminance image extraction unit 22a extracts pixels whose luminance value is equal to or higher than the luminance threshold set in step S14 by the luminance threshold setting unit 229 from the pixels of the image generated by the blur amount / luminance image generation unit 228. (Step S15).

次に、輝度画像合成手段22bが各設定距離の輝度画像を合成する(ステップS16)。即ち、ステップS15で抽出された各設定距離の輝度に対応する画素を合成する。   Next, the luminance image synthesizing unit 22b synthesizes luminance images at the respective set distances (step S16). That is, the pixels corresponding to the brightness of each set distance extracted in step S15 are synthesized.

〈輝度画像抽出手段及び輝度画像合成手段の動作〉
図9は、図6における輝度画像抽出手段22a及び輝度画像合成手段22bの動作を説明するための図である。
<Operation of Luminance Image Extraction Unit and Luminance Image Synthesis Unit>
FIG. 9 is a diagram for explaining the operation of the luminance image extracting means 22a and the luminance image synthesizing means 22b in FIG.

ここで、図9Aは、エッジ判定手段225で抽出された画像を示す。また、図9B、図9C、図9Dは、それぞれ輝度画像抽出手段22aで抽出された焦点から1m以内、2m以内、3m以内の画像を示す。また、図9Eは、輝度画像合成手段22bで生成された合成画像を示す。なお、実際の画像はグレースケール画像であるが、便宜上、ここでは2値の線画として記載した。また、この合成画像の輝度を線の太さに対応させた。   Here, FIG. 9A shows an image extracted by the edge determination means 225. 9B, FIG. 9C, and FIG. 9D show images within 1 m, within 2 m, and within 3 m from the focal point extracted by the luminance image extracting means 22a, respectively. FIG. 9E shows a composite image generated by the luminance image composition means 22b. Note that although the actual image is a grayscale image, it is described here as a binary line drawing for convenience. In addition, the brightness of this composite image was made to correspond to the thickness of the line.

図9Aに示すように、人物31、建物32、及び樹木33の画像がある。また図9B、図9C、図9Dに示すように、人物31は焦点から1m以内、人物31及び建物32の屋根以外の部分は焦点から2m以内、人物31、建物32、並びに樹木33の葉の下半分及び幹は焦点から3m以内に位置する。   As shown in FIG. 9A, there are images of a person 31, a building 32, and a tree 33. Further, as shown in FIGS. 9B, 9C, and 9D, the person 31 is within 1 m from the focal point, the parts other than the person 31 and the roof of the building 32 are within 2 m from the focal point, the person 31, the building 32, and the leaves of the tree 33 The lower half and the trunk are located within 3 m from the focal point.

そして、図9Eに示すように、人物31が最も高輝度、建物32の屋根以外の部分が中輝度、建物32の屋根並びに樹木33の葉の下半分及び幹が低輝度となり、葉の上半分の輝度値は0となる。   Then, as shown in FIG. 9E, the person 31 has the highest luminance, the portion other than the roof of the building 32 has medium luminance, the roof of the building 32 and the lower half of the leaves of the tree 33 and the trunk have low luminance, and the upper half of the leaves. The luminance value of is 0.

〈距離測定手段の測定対象〉
図10は、図1における距離測定手段22の測定対象の例を示す図である。
カメラ2は、図示されていない保持手段により、監視エリアを上方から撮像するように取り付けてある。カメラ2のレンズの焦点43は、監視エリアの地面41に侵入することが想定される人物42の頭部42aと胴体42bとの間、即ち首の高さに設定されている。また、被写界深度は、頭頂部から胴体中央部の長さに設定されている。
<Measurement target of distance measuring means>
FIG. 10 is a diagram illustrating an example of a measurement target of the distance measuring unit 22 in FIG.
The camera 2 is attached so as to image the monitoring area from above by holding means (not shown). The focal point 43 of the lens of the camera 2 is set between the head 42a and the torso 42b of the person 42 expected to enter the ground 41 in the monitoring area, that is, at the height of the neck. The depth of field is set to the length from the top to the center of the trunk.

このように設定し、図6に示す輝度画像抽出手段22aにより、被写界深度内の輝度画像を抽出することで、地面41に出来る影や、監視エリアに侵入した小動物を人物と誤検知する事態を防止することができる。   By setting the luminance image extraction means 22a shown in FIG. 6 and extracting the luminance image within the depth of field, the shadow formed on the ground 41 or the small animal that has entered the monitoring area is erroneously detected as a person. The situation can be prevented.

本発明の実施形態に係る距離測定手段22によれば、カメラ2で被写体を撮像して生成した被写体の画像のボケ量とカメラ2から被写体までの距離との対応関係を示すデータに基づいて、カメラ2から被写体までの距離を推定するときに、画像のボケ量の推定を、周波数解析を伴わない単純な処理で実現することができる。   According to the distance measuring unit 22 according to the embodiment of the present invention, based on the data indicating the correspondence between the blur amount of the subject image generated by imaging the subject with the camera 2 and the distance from the camera 2 to the subject, When estimating the distance from the camera 2 to the subject, estimation of the blur amount of the image can be realized by a simple process without frequency analysis.

〈物体検知手段の機能ブロック〉
図11は、図1における物体検知手段23の機能構成を示すブロック図である。
図示のように、物体検知手段23は、検知範囲設定手段231、背景距離画像生成手段232、入力距離画像生成手段233、差分画像生成手段234、及び領域認識手段235を備えている。
<Functional block of object detection means>
FIG. 11 is a block diagram showing a functional configuration of the object detection means 23 in FIG.
As illustrated, the object detection unit 23 includes a detection range setting unit 231, a background distance image generation unit 232, an input distance image generation unit 233, a difference image generation unit 234, and an area recognition unit 235.

検知範囲設定手段231は、ユーザによるカメラ2の焦点距離及び絞りの設定に基づいて、監視エリアとしての物体検知範囲を設定する手段である。この物体検知範囲は、図10における被写界深度の部分に相当する。   The detection range setting means 231 is a means for setting an object detection range as a monitoring area based on the user setting of the focal length and the aperture of the camera 2. This object detection range corresponds to the depth of field portion in FIG.

背景距離画像生成手段232は、検知範囲設定手段231で設定した物体検知範囲に検知対象物体が存在しないときに、カメラ2が監視エリアを撮像した生成した画像に対して距離画像生成処理、即ち画像のボケ量から推定される距離に対応する輝度を有する画像を生成することで、背景距離画像を生成する手段である。   The background distance image generation unit 232 performs distance image generation processing on the generated image obtained by imaging the monitoring area when the detection target object does not exist in the object detection range set by the detection range setting unit 231, that is, an image This is a means for generating a background distance image by generating an image having luminance corresponding to the distance estimated from the amount of blur.

背景距離画像の輝度値は、物体検知範囲内の被写体については焦点からの距離に応じたプラスの値、物体検知範囲外の被写体については“0”となる。また、背景距離画像生成処理は図8のステップS11〜S15に示す処理と同様な処理である。   The luminance value of the background distance image is a positive value corresponding to the distance from the focus for a subject within the object detection range, and “0” for a subject outside the object detection range. The background distance image generation process is the same as the process shown in steps S11 to S15 in FIG.

入力距離画像生成手段233は、背景距離画像を生成した後、カメラ2が監視エリアを撮像して生成した画像に距離画像生成処理を施すことで、入力距離画像を生成する手段である。   The input distance image generation means 233 is a means for generating an input distance image by generating a background distance image and then performing a distance image generation process on the image generated by the camera 2 imaging the monitoring area.

入力距離画像の輝度値は、背景距離画像の輝度値と同様、物体検知範囲内の被写体については焦点からの距離に応じたプラスの値、物体検知範囲外の被写体については“0”となる。また、入力距離画像生成処理は図8のステップS11〜S15に示す処理と同様な処理である。   Similar to the luminance value of the background distance image, the luminance value of the input distance image is a positive value corresponding to the distance from the focus for the subject in the object detection range, and “0” for the subject outside the object detection range. The input distance image generation process is the same as the process shown in steps S11 to S15 in FIG.

差分画像生成手段234は、入力距離画像生成手段233で生成された入力距離画像と、背景距離画像生成手段232で生成された背景距離画像の差分をとることで差分画像を生成する手段である。   The difference image generation means 234 is a means for generating a difference image by taking the difference between the input distance image generated by the input distance image generation means 233 and the background distance image generated by the background distance image generation means 232.

差分画像の輝度値は、物体検知範囲内の入力距離画像と背景距離画像とに差分が有る部分については焦点からの距離に応じたプラスの値、差分が無い部分については“0”となる。従って、差分画像の輝度がプラスの値の部分は、物体検知範囲に侵入した物体のエッジを表す。   The luminance value of the difference image is a positive value corresponding to the distance from the focus for a portion where there is a difference between the input distance image and the background distance image within the object detection range, and “0” for a portion where there is no difference. Accordingly, the portion where the luminance of the difference image has a positive value represents the edge of the object that has entered the object detection range.

領域認識手段235は、差分画像生成手段234により生成された差分画像における輝度がプラスの値の部分に外接矩形を付加することで、領域認識を行う手段である。   The region recognition unit 235 is a unit that performs region recognition by adding a circumscribed rectangle to a portion with a positive luminance in the difference image generated by the difference image generation unit 234.

領域認識手段235により囲まれた差分画像の輝度は、カメラ2の焦点からの距離に対応する。また、領域認識手段235により生成された外接矩形のサイズ(縦寸、横寸)は、物体検知範囲に侵入した物体のサイズに対応する。従って、侵入した物体を特定することが可能となる。   The luminance of the difference image surrounded by the area recognition unit 235 corresponds to the distance from the focus of the camera 2. In addition, the size (vertical size, horizontal size) of the circumscribed rectangle generated by the region recognition unit 235 corresponds to the size of the object that has entered the object detection range. Therefore, it is possible to specify the intruding object.

〈物体検知手段の動作〉
図12は、図1における物体検知手段23の動作を示すフローチャートである。
まず検知範囲設定手段231は、ユーザがカメラ2からの画像をモニタ5で見ながら、キーボード3及びマウス4を用いて、カメラ2の焦点距離及び絞りを調整する操作に基づいて物体検知範囲を設定する(ステップS21)。
<Operation of object detection means>
FIG. 12 is a flowchart showing the operation of the object detection means 23 in FIG.
First, the detection range setting unit 231 sets the object detection range based on an operation of adjusting the focal length and the aperture of the camera 2 using the keyboard 3 and the mouse 4 while the user views the image from the camera 2 on the monitor 5. (Step S21).

このとき、監視エリアには人体を模した物体が配置されており、背景画像生成処理と同様の処理により、モニタ5にはカメラ2の焦点からの距離に応じた輝度を有する画像が表示されている。ユーザは、その物体を前後に移動させ、物体の画像の輝度が0から所定の値となるように、焦点距離及び絞りを調整することで、検知範囲の前端(カメラ2から最も近い距離)及び後端(カメラ2から最も遠い距離)を設定することができる。   At this time, an object simulating a human body is arranged in the monitoring area, and an image having a luminance corresponding to the distance from the focus of the camera 2 is displayed on the monitor 5 by the same processing as the background image generation processing. Yes. The user moves the object back and forth and adjusts the focal length and the aperture so that the brightness of the image of the object changes from 0 to a predetermined value, so that the front end of the detection range (the closest distance from the camera 2) and The rear end (the farthest distance from the camera 2) can be set.

検知範囲設定手段231は、この焦点距離と絞りの組み合わせを検知範囲(前端、後端)と対応付けた検知範囲設定情報をROM14に格納しておくことで、以後、物体検知手段23を動作させるときは、その検知範囲設定情報を読み出すことで、自動的な設定が可能となる。また、複数の異なる検知範囲に対応付けて、複数の焦点距離と絞りの組み合わせを格納しておくことで、検知範囲の可変設定が可能となる。この検知範囲設定情報は、前述した距離測定手段22が使用するボケ量/距離テーブルから所要の情報を抽出することで作成される。   The detection range setting unit 231 stores the detection range setting information in which the combination of the focal length and the aperture is associated with the detection range (front end and rear end) in the ROM 14, thereby operating the object detection unit 23 thereafter. When the detection range setting information is read, automatic setting is possible. In addition, by storing a plurality of combinations of focal lengths and apertures in association with a plurality of different detection ranges, the detection range can be variably set. This detection range setting information is created by extracting necessary information from the blur amount / distance table used by the distance measuring means 22 described above.

次に、背景距離画像生成手段232が背景距離画像を生成する(ステップS22)。次いで、入力距離画像生成手段233が入力距離画像を生成する(ステップS23)。   Next, the background distance image generation means 232 generates a background distance image (step S22). Next, the input distance image generation unit 233 generates an input distance image (step S23).

次に、差分画像生成手段234が、入力距離画像及び背景距離画像から差分画像を生成する(ステップS24)。そして、領域認識手段235が、輝度値がプラスの画素に枠を生成することで、物体の領域を認識する(ステップS25)。   Next, the difference image generation means 234 generates a difference image from the input distance image and the background distance image (step S24). Then, the area recognizing unit 235 recognizes the area of the object by generating a frame for the pixel having a positive luminance value (step S25).

〈物体検知手段の動作〉
図13は、図1における物体検知手段23の動作を説明するための図である。ここで、図13A、図13B、図13C、図13D、図13Eは、それぞれ背景画像、入力画像、背景距離画像、入力距離画像、差分画像を示している。また、図13Fは差分画像における物体に外接矩形を付した状態を示している。なお、実際の画像はグレースケール画像であるが、ここでは便宜上、2値画像として記載した。
<Operation of object detection means>
FIG. 13 is a diagram for explaining the operation of the object detection means 23 in FIG. Here, FIGS. 13A, 13B, 13C, 13D, and 13E show a background image, an input image, a background distance image, an input distance image, and a difference image, respectively. FIG. 13F shows a state in which a circumscribed rectangle is attached to the object in the difference image. Note that although the actual image is a grayscale image, it is described here as a binary image for convenience.

図13Aにおいて、斜線を付した領域51は監視エリアの床を示している。即ち、監視エリアの下端は領域51であり、上端は図の画面上端である。   In FIG. 13A, a hatched area 51 indicates the floor of the monitoring area. That is, the lower end of the monitoring area is the area 51, and the upper end is the upper end of the screen in the figure.

図13Bに示すように、入力画像には、物体(ここでは人体)52と、蝶53がある。ここで、物体52は監視エリアに位置し、蝶53は監視エリアの手前、即ちカメラ2と監視エリアとの間に位置するものとする。   As illustrated in FIG. 13B, the input image includes an object (here, a human body) 52 and a butterfly 53. Here, it is assumed that the object 52 is located in the monitoring area and the butterfly 53 is located in front of the monitoring area, that is, between the camera 2 and the monitoring area.

図13Cに示すように、背景距離画像では、図13Aに示す背景画像のうち、監視エリア内の部分のみが抽出される。監視エリア外の部分(破線で表示)が除去されるとも言える。   As illustrated in FIG. 13C, in the background distance image, only the portion within the monitoring area is extracted from the background image illustrated in FIG. 13A. It can also be said that the portion outside the monitoring area (indicated by a broken line) is removed.

図13Dに示すように、入力距離画像では、図13Bに示す入力画像のうち、監視エリア内の部分のみが抽出される。従って、物体の画像61は抽出されるが、蝶の画像は抽出されない。   As illustrated in FIG. 13D, in the input distance image, only a portion within the monitoring area is extracted from the input image illustrated in FIG. 13B. Accordingly, the object image 61 is extracted, but the butterfly image is not extracted.

図13Eに示すように、差分画像は、図13Dに示す入力距離画像と、図13Cに示す背景距離画像の差分であるから、物体の画像71のみとなる。そして、図13Fに示すように、物体の画像71に外接矩形72を付加することで、物体の領域を認識する。   As illustrated in FIG. 13E, the difference image is a difference between the input distance image illustrated in FIG. 13D and the background distance image illustrated in FIG. Then, as shown in FIG. 13F, a circumscribed rectangle 72 is added to the object image 71 to recognize the object region.

このように、物体検知手段23によれば、監視エリアを含む撮像範囲を撮像した画像の変化に基づいて、監視エリアへの物体の侵入を検知するときに、撮像範囲の実空間の奥行を認識した物体検知を簡単な処理で実現することができる。   Thus, according to the object detection means 23, when detecting the intrusion of an object into the monitoring area based on the change in the image obtained by imaging the imaging range including the monitoring area, the depth of the real space of the imaging range is recognized. The detected object can be realized by a simple process.

〈影除去手段の機能ブロック〉
図14は、図1における影除去手段24の機能構成を示すブロック図である。
図示のように、影除去手段24は、画像取得手段241、モノクロ変換手段242、ノイズ除去手段243、エッジベクトル算出手段244、エッジ判定手段245、輝度差算出手段246、ボケ量算出手段247、ボケ量/輝度画像生成手段248、輝度閾値設定手段249、輝度画像抽出手段24aを備えている。
<Functional block of shadow removal means>
FIG. 14 is a block diagram showing a functional configuration of the shadow removing unit 24 in FIG.
As illustrated, the shadow removal unit 24 includes an image acquisition unit 241, a monochrome conversion unit 242, a noise removal unit 243, an edge vector calculation unit 244, an edge determination unit 245, a luminance difference calculation unit 246, a blur amount calculation unit 247, An amount / luminance image generation unit 248, a luminance threshold setting unit 249, and a luminance image extraction unit 24a are provided.

これらの手段は、距離測定手段22における同名の手段と同様に構成されている。ただし、影除去手段24は、光の回折により物体の影の画像がぼけること、及びそのボケ量が物体から遠くなる程、大きくなるという性質を利用して画像中の影を分離・除去するので、画像取得手段241は、カメラ2の被写界深度が深い(ピンボケが発生しにくい)状態で画像を取得することが望ましい。また、被写体の移動によるブレ(移動ボケ)の発生を防止するため、シャッタースピードを高速(露光時間:短)にすることが望ましい。また、画像取得手段241は、カメラ2からの画像の背景差分画像を出力するように構成することが望ましい。   These means are configured similarly to the means of the same name in the distance measuring means 22. However, the shadow removing unit 24 separates and removes shadows in the image using the property that the shadow image of the object is blurred due to light diffraction and that the blur amount becomes larger as the distance from the object increases. It is desirable that the image acquisition unit 241 acquires an image in a state where the depth of field of the camera 2 is deep (defocus is unlikely to occur). It is also desirable to increase the shutter speed (exposure time: short) in order to prevent the occurrence of blurring (movement blur) due to movement of the subject. The image acquisition unit 241 is preferably configured to output a background difference image of the image from the camera 2.

〈影除去手段の動作〉
図15は、図1における影除去手段24の動作を示すフローチャートである。この図において、ステップS31のボケ量推定処理は、図5に示すフローチャートの全体(ステップS1〜S7)と同じである。ただし、ここでは、カメラ2の被写界深度を深く設定した状態で画像を取得する。
<Operation of shadow removal means>
FIG. 15 is a flowchart showing the operation of the shadow removing means 24 in FIG. In this figure, the blur amount estimation process in step S31 is the same as the entire flowchart (steps S1 to S7) shown in FIG. However, here, the image is acquired in a state where the depth of field of the camera 2 is set deep.

次のステップS32では、ボケ量/輝度画像生成手段248がボケ量を表す輝度画像、即ちその輝度がボケ量に対応する画像を生成する。ここでは、ボケ量が大きい程、輝度が低くなる画像を生成する。従って、監視領域に物体が存在するとき、物体の画像よりも影の画像の方が輝度が低くなり、影の画像同士では、物体の下端(人体の場合、足元)から遠くなる程、輝度が低くなる。   In the next step S32, the blur amount / luminance image generation means 248 generates a luminance image representing the blur amount, that is, an image whose luminance corresponds to the blur amount. Here, an image is generated in which the luminance decreases as the blur amount increases. Therefore, when an object exists in the monitoring area, the brightness of the shadow image is lower than that of the object image, and the brightness between the shadow images increases as the distance from the lower end of the object (in the case of a human body) increases. Lower.

次に、輝度画像抽出手段24aが、輝度閾値設定手段249により設定された所定の閾値より低い画素を、ボケ量/輝度画像生成手段248で生成された画像から除去する(ステップS33)。このとき、輝度閾値として、影の画像のボケ量の最大値を設定することで、理論上は影の画像を除去することができる。本実施形態では、図7Bにおけるガウシアンフィルタにより生成した画像のボケ量:4以上(ボケ量推定値:0.36以下)を影として判定する。   Next, the luminance image extraction unit 24a removes pixels lower than the predetermined threshold set by the luminance threshold setting unit 249 from the image generated by the blur amount / luminance image generation unit 248 (step S33). At this time, theoretically, the shadow image can be removed by setting the maximum blur amount of the shadow image as the luminance threshold. In this embodiment, the blur amount of the image generated by the Gaussian filter in FIG. 7B: 4 or more (estimated blur amount value: 0.36 or less) is determined as a shadow.

監視エリアの明るさ、太陽光の照射方向によって、影の画像のボケ量が変化するので、それらの条件に応じて、閾値を動的に変更することが望ましい。そこで、下記(1)、(2)のように動的に閾値を変更する。
(1)エッジ判定手段245により抽出されたエッジに囲まれた領域のサイズ(長さや面積)を算出し、それらの値に応じて、閾値を変化させる。このとき、エッジに囲まれた領域は、物体とその影を合わせたものになるので、その長さや面積が大きい程、影が長い、換言すれば日射角度が低い。影が長いと、影のボケ量が大きくなる(輝度が低くなる)ので、閾値を低くする。
(2)エッジ判定手段245により抽出されたエッジの輝度の平均値を算出し、その値に応じて、閾値を変化させる。平均輝度が高いということは影が明瞭であり、ボケ量の平均値が小さくなる(ボケ量を表す輝度画像の輝度が高くなる)ので、閾値を高くする。
Since the blur amount of the shadow image changes depending on the brightness of the monitoring area and the irradiation direction of sunlight, it is desirable to dynamically change the threshold according to those conditions. Therefore, the threshold value is dynamically changed as in (1) and (2) below.
(1) The size (length or area) of the region surrounded by the edges extracted by the edge determination means 245 is calculated, and the threshold value is changed according to those values. At this time, since the area surrounded by the edge is a combination of the object and its shadow, the larger the length or area, the longer the shadow, in other words, the lower the solar radiation angle. If the shadow is long, the amount of blur of the shadow increases (the brightness decreases), so the threshold value is lowered.
(2) The average value of the brightness of the edges extracted by the edge determination means 245 is calculated, and the threshold value is changed according to the value. When the average brightness is high, the shadow is clear and the average value of the blur amount is small (the brightness of the brightness image representing the blur amount is high), so the threshold value is increased.

〈影除去手段の動作〉
図16は、図1における影除去手段24の動作を説明するための図である。ここで、図16Aはノイズ除去手段243の出力画像、図16Bはボケ量/輝度画像生成手段248の出力画像、図16Cは輝度画像抽出手段24aの出力画像である。
<Operation of shadow removal means>
FIG. 16 is a diagram for explaining the operation of the shadow removing means 24 in FIG. 16A is an output image of the noise removing unit 243, FIG. 16B is an output image of the blur amount / luminance image generating unit 248, and FIG. 16C is an output image of the luminance image extracting unit 24a.

図16Aに示すように、ノイズ除去手段243の出力画像には、人体の画像81と人体の影の画像82がある。なお、便宜上、人体の画像81には縦線、人体の影の画像82には網目を付した。   As shown in FIG. 16A, the output image of the noise removing unit 243 includes a human body image 81 and a human body shadow image 82. For convenience, the human body image 81 has vertical lines, and the human body shadow image 82 has meshes.

図16Bに示すように、ボケ量/輝度画像生成手段248の出力画像では、ボケ量の小さい人体の画像83は輝度が高く、ボケ量の大きい人体の影の画像84は輝度が低い。ここでは、画像83、84のエッジの太さが輝度の高さを表している。   As shown in FIG. 16B, in the output image of the blur amount / luminance image generation means 248, the human body image 83 with a small blur amount has a high luminance, and the human shadow image 84 with a large blur amount has a low luminance. Here, the thickness of the edges of the images 83 and 84 represents the brightness.

図16Cに示すように、輝度画像抽出手段24aの出力画像では、輝度の高い人体の画像83が抽出(輝度の低い人体の影の画像84が除去)されている。   As shown in FIG. 16C, in the output image of the luminance image extracting means 24a, a human body image 83 having a high luminance is extracted (a human shadow image 84 having a low luminance is removed).

このように、影除去手段24によれば、影の画像のエッジがぼけることを利用して影を分離・除去するので、光の照射条件が変化しても、高い精度で影を除去することができる。   As described above, according to the shadow removing unit 24, since the shadow is separated and removed by using the blur of the edge of the shadow image, the shadow can be removed with high accuracy even if the light irradiation condition changes. Can do.

〈速度測定の原理〉
図17は、図1における速度測定手段25の測定原理を説明するための図である。ここで、図17Aは、カメラ2の露光時間内で測定対象の車両が移動する距離について説明するための図であり、図17Bはカメラ2で撮像した車両の画像のブレ(移動ボケ)について説明するための図である。ここで、カメラ2は車両をその側面に直交する方向、即ち車両をその移動方向と直交する方向から撮像するように設置されている。
<Principle of speed measurement>
FIG. 17 is a view for explaining the measurement principle of the speed measuring means 25 in FIG. Here, FIG. 17A is a diagram for explaining the distance traveled by the vehicle to be measured within the exposure time of the camera 2, and FIG. 17B is a diagram for explaining blurring (moving blur) of the vehicle image captured by the camera 2. It is a figure for doing. Here, the camera 2 is installed so as to take an image of the vehicle from a direction orthogonal to the side surface thereof, that is, a direction orthogonal to the moving direction of the vehicle.

図17Aに示すように、車両91の速度をVとすると、カメラ2の露光時間ts(シャッター速度)における車両91の移動距離dは「V×ts」となる。また、図17Bに示すように、このときカメラ2で撮像した車両の画像92のボケ量Bは、移動距離dに対応する水平画素数に対応するから、車両の速度V、露光時間ts、及びカメラ2から車両91までの距離の関数となる。なお、図17Bでは、画像92における縦線についてのみボケを斜線で図示した。   As shown in FIG. 17A, when the speed of the vehicle 91 is V, the moving distance d of the vehicle 91 during the exposure time ts (shutter speed) of the camera 2 is “V × ts”. Also, as shown in FIG. 17B, the blur amount B of the vehicle image 92 captured by the camera 2 at this time corresponds to the number of horizontal pixels corresponding to the moving distance d, and therefore the vehicle speed V, exposure time ts, and This is a function of the distance from the camera 2 to the vehicle 91. In FIG. 17B, only the vertical line in the image 92 is shown by a slanted line.

車両の画像92における縦線(垂直エッジ)の輝度には移動方向に高いグラデーションが発生する。理論上はこのグラデーションはリニアな変化となるが、実画像においては、ピンボケと同様に累積分布曲線に近似した曲線となる。   A high gradation occurs in the movement direction in the luminance of the vertical line (vertical edge) in the vehicle image 92. Theoretically, this gradation is a linear change, but in an actual image, it is a curve that approximates the cumulative distribution curve in the same way as out of focus.

図18は、移動ボケが生じた画像における輝度とボケ量との対応関係を示す特性曲線のグラフ、即ち上記の曲線の一例を示す図である。この図の横軸は画素位置、縦軸は輝度値である。ここで、ボケ量は、図17Bにおけるボケ量(B)に対応する。   FIG. 18 is a graph of a characteristic curve showing a correspondence relationship between the luminance and the amount of blur in an image in which moving blur occurs, that is, a diagram showing an example of the above curve. In this figure, the horizontal axis represents the pixel position, and the vertical axis represents the luminance value. Here, the blur amount corresponds to the blur amount (B) in FIG. 17B.

前述したように、画像のボケ量は、車両の速度V、露光時間ts、及びカメラ2から車両91までの距離の関数となる。また、車両の速度Vは、下記の式〔5〕により算出することができる。
V=「ボケ量(B)に対応する画素数」×「画像における画素単位の距離」÷「露光時間ts」 …式〔5〕
As described above, the image blur amount is a function of the vehicle speed V, the exposure time ts, and the distance from the camera 2 to the vehicle 91. The vehicle speed V can be calculated by the following equation [5].
V = “number of pixels corresponding to the amount of blur (B)” × “distance in pixel units in the image” ÷ “exposure time ts” (5)

この式において、「ボケ量(B)に対応する画素数」は、図18に示す特性曲線から求めることができる。また、「画像における画素単位の距離」は、カメラ2で撮像した所定のサイズの物体の画像の画素数を計測することで求めることができる。この距離は、カメラ2から測定対象が通行する位置までの距離が長い、即ち測定対象が通行する位置がカメラ2から遠い程、長くなる。   In this equation, “the number of pixels corresponding to the blur amount (B)” can be obtained from the characteristic curve shown in FIG. Further, the “distance in pixel units in the image” can be obtained by measuring the number of pixels of an image of an object of a predetermined size captured by the camera 2. This distance becomes longer as the distance from the camera 2 to the position through which the measurement object passes is longer, that is, as the position through which the measurement object passes away from the camera 2.

従って、画像のボケ量から速度を求めるためのテーブル(以下、ボケ量/速度テーブル)を、カメラ2から測定対象までの距離及び露光時間をパラメータとして予め作成しておけば、ボケ量推定手段21と同様にしてボケ量Bを推定し、ボケ量/速度テーブルを参照することで、速度Vを求めることができる。   Therefore, if a table for calculating the speed from the blur amount of the image (hereinafter referred to as a blur amount / speed table) is created in advance using the distance from the camera 2 to the measurement object and the exposure time as parameters, the blur amount estimation means 21. Similarly, the blur amount B is estimated, and the velocity V can be obtained by referring to the blur amount / speed table.

〈速度測定手段の機能ブロック〉
図19は、図1における速度測定手段25の機能構成を示すブロック図である。
図示のように、速度測定手段25は、画像取得手段251、モノクロ変換手段252、ノイズ除去手段253、エッジベクトル算出手段254、エッジ判定手段255、輝度差算出手段256、ボケ量算出手段257、ボケ量/輝度画像生成手段258を備えている。
<Functional block of speed measurement means>
FIG. 19 is a block diagram showing a functional configuration of the speed measuring means 25 in FIG.
As illustrated, the speed measurement unit 25 includes an image acquisition unit 251, a monochrome conversion unit 252, a noise removal unit 253, an edge vector calculation unit 254, an edge determination unit 255, a luminance difference calculation unit 256, a blur amount calculation unit 257, a blur amount calculation unit 257, and the like. A quantity / luminance image generation means 258 is provided.

これらの手段は、距離測定手段22における同名の手段と同様に構成されている。ただし、速度測定手段25は、物体の画像のブレ(移動ボケ)が物体の速度に対応することを利用して、物体の速度を求めるので、画像取得手段251は、カメラ2の被写界深度が深い(ピンボケが発生しにくい)状態で画像を取得することが望ましい。カメラ2の被写界深度を深くすることで、例えば2車線の走行車両の速度測定が可能になる。   These means are configured similarly to the means of the same name in the distance measuring means 22. However, since the speed measurement unit 25 obtains the speed of the object by utilizing the fact that the blur (moving blur) of the object image corresponds to the speed of the object, the image acquisition unit 251 determines the depth of field of the camera 2. It is desirable to acquire an image in a deep state (where it is difficult for out-of-focus). By increasing the depth of field of the camera 2, for example, the speed of a traveling vehicle in two lanes can be measured.

縦線検知手段259は、ボケ量/輝度画像生成手段258により生成されたボケ量に対応する輝度を有する画像中の縦線(縦エッジ)を検知する手段である。本実施形態では、車両91の先端、後端、窓等が縦線として検知される。速度算出手段25aは、予め作成しておいたボケ量/速度テーブルを参照して、縦線を構成する各画素の移動ボケ(ブレ)に対応する速度を算出する。   The vertical line detection unit 259 is a unit that detects a vertical line (vertical edge) in an image having luminance corresponding to the blur amount generated by the blur amount / luminance image generation unit 258. In the present embodiment, the front end, rear end, window, and the like of the vehicle 91 are detected as vertical lines. The speed calculation unit 25a refers to a blur amount / speed table prepared in advance, and calculates a speed corresponding to the movement blur (blur) of each pixel constituting the vertical line.

〈速度測定手段の動作〉
図20は、図1における速度測定手段25の動作を示すフローチャートである。この図において、ステップS41のボケ量推定処理は、図5に示すフローチャートの全体(ステップS1〜S7)と同じである。ただし、ここでは、カメラ2の被写界深度を深く設定した状態で、道路を走行する車両の側面を垂直に撮像して画像を取得する。
<Operation of speed measuring means>
FIG. 20 is a flowchart showing the operation of the speed measuring means 25 in FIG. In this figure, the blur amount estimation processing in step S41 is the same as the entire flowchart (steps S1 to S7) shown in FIG. Here, however, the image is acquired by vertically capturing the side surface of the vehicle traveling on the road in a state where the depth of field of the camera 2 is set deep.

次のステップS42では、ボケ量/輝度画像生成手段258がボケ量を表す輝度画像、即ちその輝度がボケ量に対応する画像を生成する。ここでは、ボケ量が小さい、換言すれば速度の遅い車両の画像程、輝度が高くなる。   In the next step S42, the blur amount / luminance image generation means 258 generates a luminance image representing the blur amount, that is, an image whose luminance corresponds to the blur amount. Here, the smaller the blur amount, in other words, the slower the vehicle image, the higher the luminance.

次に、縦線検知手段259がボケ量を表す輝度画像の縦線を検知する(ステップS43)。これにより、図17Bに示す車両の画像92の場合、ボディの先端及び後端、ドアの先端及び後端などが検知される。   Next, the vertical line detection unit 259 detects the vertical line of the luminance image representing the amount of blur (step S43). Thus, in the case of the vehicle image 92 shown in FIG. 17B, the front and rear ends of the body, the front and rear ends of the door, and the like are detected.

次に、速度算出手段25aが、縦線検知手段259で検知された縦線の画素の輝度に対応する速度をボケ量/速度テーブルから取得することで算出する(ステップS44)。   Next, the speed calculation means 25a calculates the speed corresponding to the brightness of the pixel of the vertical line detected by the vertical line detection means 259 from the blur amount / speed table (step S44).

ここで、理論的(理想的)には、1本の縦線を構成する各画素の輝度は同じである。また、複数の縦線間でも各画素の輝度は同じである。従って、理論的には、1本の縦線の1画素の輝度から速度を求めることが出来る。しかし、実際には、輝度が異なることが考えられるので、縦線毎に輝度の平均値を算出したり、全ての縦線の平均値を算出したりすることが好適である。また、画像の横線(水平エッジ)を検知することで、車両91などの移動物体を検出することができ、上下の横線の間隔を算出することで、移動物体の高さを推定することができる。   Here, theoretically (ideally), the luminance of each pixel constituting one vertical line is the same. In addition, the luminance of each pixel is the same between a plurality of vertical lines. Therefore, theoretically, the speed can be obtained from the luminance of one pixel of one vertical line. However, since it is conceivable that the luminance is actually different, it is preferable to calculate an average value of luminance for each vertical line or to calculate an average value of all the vertical lines. In addition, a moving object such as the vehicle 91 can be detected by detecting a horizontal line (horizontal edge) of the image, and a height of the moving object can be estimated by calculating an interval between the upper and lower horizontal lines. .

21…ボケ量推定手段、214…エッジベクトル算出手段、215…エッジ判定手段、216…輝度差算出手段、217…ボケ量算出手段。
21: blur amount estimating means, 214 ... edge vector calculating means, 215 ... edge determining means, 216 ... luminance difference calculating means, 217 ... blur amount calculating means.

Claims (3)

画像のエッジを抽出するエッジ抽出手段と、
該エッジ抽出手段により抽出されたエッジの両側の直近に位置する一対の画素の画素値の差と、該一対の画素の両側に位置する少なくとも一対の画素の画素値の差とに基づいて、前記エッジのボケ量を算出するボケ量算出手段と、
を有する画像処理装置。
Edge extraction means for extracting the edge of the image;
Based on the difference between the pixel values of a pair of pixels located immediately on both sides of the edge extracted by the edge extraction means, and the difference between the pixel values of at least a pair of pixels located on both sides of the pair of pixels, A blur amount calculating means for calculating the blur amount of the edge;
An image processing apparatus.
請求項1に記載された画像処理装置において、
前記エッジ抽出手段は、画像を構成する各画素のエッジベクトルを算出するエッジベクトル算出手段と、該エッジベクトルの強度と所定の閾値とを比較し、エッジを構成するエッジ部画素を判定するエッジ判定手段と、を有する画像処理装置。
The image processing apparatus according to claim 1,
The edge extraction means compares an edge vector calculation means for calculating an edge vector of each pixel constituting an image with an intensity of the edge vector and a predetermined threshold value, and determines an edge portion pixel constituting the edge. And an image processing apparatus.
請求項2に記載された画像処理装置において、
前記ボケ量算出手段は、前記エッジ抽出手段が前記エッジ部画素のエッジベクトルを算出する過程で算出した、前記エッジ部画素の両隣の一対の画素の画素値の差を、前記エッジの両側の直近に位置する一対の画素の画素値の差とする、画像処理装置。
The image processing apparatus according to claim 2,
The blur amount calculating unit calculates a difference between pixel values of a pair of pixels adjacent to the edge portion pixel, which is calculated in the process of calculating the edge vector of the edge portion pixel by the edge extracting unit. An image processing apparatus having a difference between pixel values of a pair of pixels located at a position.
JP2014046847A 2014-03-10 2014-03-10 Image processing device Active JP6273921B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014046847A JP6273921B2 (en) 2014-03-10 2014-03-10 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014046847A JP6273921B2 (en) 2014-03-10 2014-03-10 Image processing device

Publications (2)

Publication Number Publication Date
JP2015170306A JP2015170306A (en) 2015-09-28
JP6273921B2 true JP6273921B2 (en) 2018-02-07

Family

ID=54202938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014046847A Active JP6273921B2 (en) 2014-03-10 2014-03-10 Image processing device

Country Status (1)

Country Link
JP (1) JP6273921B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6705496B2 (en) * 2016-02-23 2020-06-03 株式会社リコー Image processing device, imaging device, mobile device control system, mobile device, image processing method, and program
JP6737212B2 (en) * 2017-03-14 2020-08-05 オムロン株式会社 Driver state estimating device and driver state estimating method
JP7348754B2 (en) 2019-06-03 2023-09-21 キヤノン株式会社 Image processing device and its control method, program, storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4539318B2 (en) * 2004-12-13 2010-09-08 セイコーエプソン株式会社 Image information evaluation method, image information evaluation program, and image information evaluation apparatus
JP5158202B2 (en) * 2008-08-19 2013-03-06 富士通株式会社 Image correction apparatus and image correction method
JP2012073703A (en) * 2010-09-28 2012-04-12 Nippon Hoso Kyokai <Nhk> Image blur amount calculation device and program for the same

Also Published As

Publication number Publication date
JP2015170306A (en) 2015-09-28

Similar Documents

Publication Publication Date Title
US8754963B2 (en) Processing images having different focus
US7912252B2 (en) Time-of-flight sensor-assisted iris capture system and method
US8203602B2 (en) Depth-aware blur kernel estimation method for iris deblurring
JP6237804B2 (en) Abnormal situation detection method and apparatus
US10762649B2 (en) Methods and systems for providing selective disparity refinement
JP5722414B1 (en) Osteoporosis diagnosis support device
US10452922B2 (en) IR or thermal image enhancement method based on background information for video analysis
TW201127028A (en) Method and apparatus for image stabilization
CN106264537B (en) System and method for measuring human body posture height in image
WO2014045479A1 (en) Object information extraction unit, object information extraction program, and object information extraction method
JP6273921B2 (en) Image processing device
JP6286567B2 (en) Robust autofocus algorithm for multispectral imaging system
Chan et al. An edge detection framework conjoining with IMU data for assisting indoor navigation of visually impaired persons
US9995905B2 (en) Method for creating a camera capture effect from user space in a camera capture system
JP6340837B2 (en) Image processing device
JP6369058B2 (en) Image processing device
KR101648786B1 (en) Method of object recognition
JP6405651B2 (en) Image processing device
JP6327024B2 (en) Image processing device
JP6264107B2 (en) Image processing device
JP5664078B2 (en) Imaging apparatus, image evaluation method, and focus adjustment control program
JP6358084B2 (en) Image processing device
JP2018018425A (en) Image processing device and image processing method
JP6737212B2 (en) Driver state estimating device and driver state estimating method
JP2015175751A (en) Distance image generating device, object detecting device, and object detecting method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170105

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171130

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171225

R150 Certificate of patent or registration of utility model

Ref document number: 6273921

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150