JP5979046B2 - Focus position detection device, focus position detection method, and computer program for focus position detection - Google Patents

Focus position detection device, focus position detection method, and computer program for focus position detection Download PDF

Info

Publication number
JP5979046B2
JP5979046B2 JP2013056167A JP2013056167A JP5979046B2 JP 5979046 B2 JP5979046 B2 JP 5979046B2 JP 2013056167 A JP2013056167 A JP 2013056167A JP 2013056167 A JP2013056167 A JP 2013056167A JP 5979046 B2 JP5979046 B2 JP 5979046B2
Authority
JP
Japan
Prior art keywords
focus position
range
image
focus
moving object
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.)
Expired - Fee Related
Application number
JP2013056167A
Other languages
Japanese (ja)
Other versions
JP2014182248A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013056167A priority Critical patent/JP5979046B2/en
Publication of JP2014182248A publication Critical patent/JP2014182248A/en
Application granted granted Critical
Publication of JP5979046B2 publication Critical patent/JP5979046B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Focusing (AREA)
  • Lens Barrels (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)
  • Traffic Control Systems (AREA)

Description

本発明は、カメラの合焦位置を検出する合焦位置検出装置、合焦位置検出方法及び合焦位置検出用コンピュータプログラムに関する。   The present invention relates to an in-focus position detecting device, an in-focus position detecting method, and an in-focus position detecting computer program for detecting an in-focus position of a camera.

近年、駐車場等に設置されているナンバープレート読み取り装置のように、屋外または屋内に設置されたカメラにより撮影された画像に基づいて、そのカメラの監視範囲を通過する移動物体に関する情報を収集するシステムが利用されている。このようなシステムにおいて、画像に写っている移動物体の情報を正確に取得するためには、画像上で、監視範囲内にいる物体が鮮鋭に写っていることが好ましい。そのためには、検知対象の移動物体に対してカメラの焦点が合っていることが求められる。そこで、被写体が移動している場合でも、常に結像光学系を合焦状態に保つことができる技術が提案されている(例えば、特許文献1を参照)。   In recent years, based on images taken by cameras installed outdoors or indoors, such as license plate readers installed in parking lots, etc., information on moving objects passing through the monitoring range of the camera is collected. The system is being used. In such a system, in order to accurately acquire the information of the moving object shown in the image, it is preferable that the object in the monitoring range is clearly shown on the image. For this purpose, the camera is required to be focused on the moving object to be detected. Therefore, a technique has been proposed that can keep the imaging optical system always in focus even when the subject is moving (see, for example, Patent Document 1).

特許文献1に記載された技術では、被写体となる移動物体が一つであることが前提となっている。しかし、上記のようなシステムでは、監視範囲内に、それぞれ独立に移動する複数の移動物体が写ることがある。このような場合、特許文献1に記載の技術では、複数の移動物体のうちの何れか一つについて合焦状態を保つように結像光学系が駆動されると、他の移動物体には焦点が合わず、その結果として、画像上で他の移動物体が不鮮明になってしまうおそれがある。画像に写っている監視範囲内の全ての移動物体について情報を得るには、監視範囲全体について、画像から移動物体を認識できる程度にカメラの焦点が合っていることが求められる。また、被写体となる移動物体が一つであっても、その移動物体の速度が速ければ、一旦撮影された画像に基づいてカメラの焦点位置を調節している間にその移動物体が他の位置へ移動してしまう。そのため、次に撮影された画像でも、その移動物体に焦点が合わなくなることがある。このような場合についても、監視範囲全体について、画像から移動物体を認識できる程度にカメラの焦点が合っていることが求められる。   The technique described in Patent Document 1 is based on the premise that there is one moving object as a subject. However, in the system as described above, a plurality of moving objects that move independently from each other may be captured within the monitoring range. In such a case, according to the technique described in Patent Document 1, when the imaging optical system is driven so as to maintain a focused state for any one of a plurality of moving objects, the other moving objects are focused on. As a result, other moving objects may become unclear on the image. In order to obtain information about all the moving objects in the monitoring range shown in the image, it is required that the camera is in focus so that the moving object can be recognized from the image for the entire monitoring range. Even if there is only one moving object as the subject, if the moving object is fast, the moving object may move to another position while adjusting the focal position of the camera based on the captured image. Will move to. Therefore, the moving object may not be focused even in the next image taken. Even in such a case, it is required that the camera is focused on the entire monitoring range to such an extent that a moving object can be recognized from the image.

そこで、上記のようなシステムでは、例えば、カメラの設置時に、監視範囲全体に焦点が合うように、カメラの合焦位置が調節される。しかし、カメラの周囲の環境条件の変化、例えば、気温または湿度の変化、あるいは何らかの外的な衝撃などによって合焦位置がずれることがある。一方、温度変化による焦点面の移動を的確に補正する撮像装置に関する技術が提案されている(例えば、特許文献2を参照)。この技術では、フォーカスレンズをあらかじめ設定された位置に移動させた後の温度変化による焦点面のずれを補正する際に、撮像装置は、所定の範囲内でフォーカスレンズを駆動させて自動焦点調節動作を行う。   Therefore, in the system as described above, for example, when the camera is installed, the focusing position of the camera is adjusted so that the entire monitoring range is in focus. However, the focus position may be shifted due to a change in environmental conditions around the camera, for example, a change in temperature or humidity, or some external impact. On the other hand, a technique relating to an imaging apparatus that accurately corrects the movement of the focal plane due to a temperature change has been proposed (see, for example, Patent Document 2). In this technology, when correcting a focal plane shift due to a temperature change after the focus lens is moved to a preset position, the image pickup device drives the focus lens within a predetermined range to perform an automatic focus adjustment operation. I do.

特開平7−92381号公報JP-A-7-92381 特開平11−231206号公報JP-A-11-231206

しかし、特許文献2に開示された技術では、自動焦点調節動作を行う際に、フォーカスレンズの駆動範囲内で焦点が合う被写体の位置によって合焦位置が左右される。そのため、この技術を上記のようなシステムに適用しても、自動焦点調節後における合焦範囲が、必ずしも監視範囲と一致するとは限らない。そのため、カメラの合焦位置を適切な位置に調節するためには、その調節前の状態でカメラの合焦位置を検出できることが好ましい。   However, in the technique disclosed in Patent Document 2, the focus position depends on the position of the subject that is in focus within the drive range of the focus lens when performing the automatic focus adjustment operation. Therefore, even if this technique is applied to the system as described above, the in-focus range after the automatic focus adjustment does not always coincide with the monitoring range. Therefore, in order to adjust the in-focus position of the camera to an appropriate position, it is preferable that the in-focus position of the camera can be detected before the adjustment.

一つの側面において、本発明は、撮像部により撮影された、移動物体が写った画像からその撮像部の合焦位置を検出可能な合焦位置検出装置を提供することを目的とする。   In one aspect, an object of the present invention is to provide an in-focus position detection device capable of detecting an in-focus position of an imaging unit from an image taken by an imaging unit and showing a moving object.

一つの実施形態によれば、合焦位置検出装置が提供される。この合焦位置検出装置は、撮像部により生成された画像を取得する度に、その画像に写っている移動物体を検出する検出部と、複数の画像にわたって移動物体を追跡することで、画像上での移動物体の位置の遷移を表す追跡情報を更新するトラッキング部と、複数の追跡情報を記憶する記憶部と、複数の追跡情報のそれぞれについて、その追跡情報に示された画像上での移動物体の各位置のボケ度合いを表す指標を算出するボケ指標算出部と、複数の追跡情報のそれぞれについて、その追跡情報に示された画像上での移動物体の各位置における指標を比較し、その比較結果と画像上の各位置に対応する撮像部からの距離に応じて、撮像部の合焦位置が含まれる第1の範囲を推定する個別合焦範囲推定部と、複数の追跡情報のそれぞれについて推定された第1の範囲が一致する第1の部分を求め、その第1の部分内で合焦位置を推定する合焦位置推定部とを有する。   According to one embodiment, an in-focus position detection device is provided. Each time the in-focus position detection device acquires an image generated by an imaging unit, the detection unit detects a moving object reflected in the image, and tracks the moving object over a plurality of images. The tracking unit that updates the tracking information indicating the transition of the position of the moving object at the storage unit, the storage unit that stores the plurality of tracking information, and the movement of the plurality of tracking information on the image indicated in the tracking information A blur index calculation unit that calculates an index indicating the degree of blur at each position of the object, and for each of a plurality of tracking information, the index at each position of the moving object on the image indicated by the tracking information is compared, According to the comparison result and the distance from the imaging unit corresponding to each position on the image, the individual focusing range estimation unit that estimates the first range including the focusing position of the imaging unit, and each of the plurality of tracking information about It obtains a first portion where the first range is a constant match, and a focus position estimation unit for estimating a focus position at its first portion.

本発明の目的及び利点は、請求項において特に指摘されたエレメント及び組み合わせにより実現され、かつ達成される。
上記の一般的な記述及び下記の詳細な記述の何れも、例示的かつ説明的なものであり、請求項のように、本発明を限定するものではないことを理解されたい。
The objects and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the appended claims.
It should be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention as claimed.

本明細書に開示された合焦位置検出装置は、撮像部により撮影された、移動物体が写った画像からその撮像部の合焦位置を検出できる。   The in-focus position detection device disclosed in this specification can detect the in-focus position of the imaging unit from an image captured by the imaging unit and showing a moving object.

(a)及び(b)は、それぞれ、監視範囲とカメラの合焦範囲の関係の一例を示す図である。(A) And (b) is a figure which shows an example of the relationship between the monitoring range and the focusing range of a camera, respectively. (a)及び(b)は、それぞれ、図1(a)及び図1(b)に対応する、カメラ2により生成された画像上での合焦範囲に対応する領域を示す図である。(A) And (b) is a figure which shows the area | region corresponding to the focusing range on the image produced | generated by the camera 2 corresponding to Fig.1 (a) and FIG.1 (b), respectively. 一つの実施形態による合焦位置検出装置の概略構成図である。It is a schematic block diagram of the focus position detection apparatus by one Embodiment. 制御部の機能ブロック図である。It is a functional block diagram of a control part. カメラからの距離とボケ指標の関係の一例を示す図である。It is a figure which shows an example of the relationship between the distance from a camera, and a blur parameter | index. (a)〜(c)は、それぞれ、同一のナンバープレートが二つの画像で検出された場合の、そのナンバープレートについてのそれぞれの画像でのボケ指標とカメラの合焦位置との関係を示す図である。(A)-(c) is a figure which shows the relationship between the blur parameter | index in each image about the number plate, and the focus position of a camera, when the same number plate is detected by two images, respectively. It is. (a)〜(d)は、それぞれ、同一のナンバープレートが三つの画像で検出された場合の、そのナンバープレートについてのそれぞれの画像でのボケ指標とカメラ2の合焦位置との関係を示す図である。(A)-(d) shows the relationship between the blurring index in each image about the license plate and the in-focus position of the camera 2 when the same license plate is detected in three images. FIG. 追跡情報ごとに推定された合焦位置を含む範囲と、最終的に絞り込まれた合焦位置を含む範囲の関係の一例を示す図である。It is a figure which shows an example of the relationship between the range containing the focus position estimated for every tracking information, and the range containing the focus position finally narrowed down. 合焦位置検出処理の動作フローチャートである。It is an operation | movement flowchart of a focus position detection process.

以下、図を参照しつつ、一つの実施形態による、合焦位置検出装置について説明する。なお、本実施形態では、カメラは、道路を通過する移動物体についての情報を収集するために、道路上に設定された監視範囲を撮影し、その監視範囲の画像を生成するものとする。また、検出対象となる移動物体は、車両に付されたナンバープレートである。ただし、検出対象となる移動物体は、ナンバープレートに限られず、車両そのもの、あるいは、人であってもよい。また、カメラは、屋内の通路を通る人を撮影するものであってもよい。   Hereinafter, an in-focus position detection device according to one embodiment will be described with reference to the drawings. In this embodiment, in order to collect information about moving objects passing through the road, the camera captures a monitoring range set on the road and generates an image of the monitoring range. The moving object to be detected is a license plate attached to the vehicle. However, the moving object to be detected is not limited to the license plate, and may be the vehicle itself or a person. Further, the camera may take a picture of a person passing through an indoor passage.

図1(a)及び図1(b)は、それぞれ、監視範囲とカメラの合焦範囲の関係の一例を示す図である。図1(a)に示される例では、カメラ2の合焦範囲101が、監視範囲100の略中央に設定されている。一方、図1(b)に示される例では、カメラ2の合焦範囲101が、監視範囲100の中心よりも後方、すなわち、カメラ2から離れる方向へずれている。なお、本明細書において、合焦範囲は、カメラ2により生成された画像から検出対象となる移動物体を検出できる程度に、その移動物体が鮮明に写る被写体側の範囲をいう。また、合焦位置は、最も焦点が合った被写体側の位置をいう。   FIGS. 1A and 1B are diagrams illustrating an example of a relationship between a monitoring range and a focusing range of a camera, respectively. In the example shown in FIG. 1A, the focusing range 101 of the camera 2 is set at the approximate center of the monitoring range 100. On the other hand, in the example shown in FIG. 1B, the focusing range 101 of the camera 2 is shifted rearward from the center of the monitoring range 100, that is, away from the camera 2. In this specification, the in-focus range refers to a range on the subject side where the moving object can be clearly detected so that the moving object to be detected can be detected from the image generated by the camera 2. The in-focus position refers to the position on the subject side that is most focused.

一般に、カメラ2の焦点が合っている位置にいる被写体は、そのカメラにより撮影された画像上で鮮明に写り、カメラの焦点が合っていない位置にいる被写体はそのカメラにより撮影された画像上でぼけて写る。そのため、被写体に焦点が合っていれば、画像上でその被写体のエッジの強度は最も高くなる。そして、焦点が合う位置から被写体が離れるほど、画像上では、その被写体のエッジの強度は低下する。そのため、図1(a)に示される例では、監視範囲100の前端近傍、すなわち、カメラ2に近い方の端部近傍、及び監視範囲100の後端近傍の何れに移動物体がいたとしても、合焦範囲101からそれほど外れていない。そのため、移動物体が監視範囲100内にいる限り、その移動物体のエッジの強度は、カメラ2により生成された画像上で比較的高くなる。   In general, a subject at a position where the camera 2 is in focus is clearly displayed on an image taken by the camera, and a subject at a position where the camera is not in focus is shown on an image taken by the camera. It is blurred. Therefore, if the subject is in focus, the edge strength of the subject is the highest on the image. As the subject moves away from the in-focus position, the strength of the edge of the subject decreases on the image. Therefore, in the example shown in FIG. 1A, even if there is a moving object in the vicinity of the front end of the monitoring range 100, that is, the vicinity of the end closer to the camera 2 and the vicinity of the rear end of the monitoring range 100, It is not so far from the focus range 101. Therefore, as long as the moving object is within the monitoring range 100, the intensity of the edge of the moving object is relatively high on the image generated by the camera 2.

一方、図1(b)に示される例では、監視範囲100の後方は合焦範囲101に含まれているので、監視範囲100の後方にいる移動物体のエッジは、カメラ2により生成された画像上で鮮鋭になる。しかし、監視範囲100の前端近傍、例えば、点線で囲まれた領域102は、合焦範囲101から大きく外れている。そのため、移動物体がその範囲102内にいると、その移動物体のエッジは、カメラ2により生成された画像上で不鮮明となる。   On the other hand, in the example shown in FIG. 1B, since the rear of the monitoring range 100 is included in the focusing range 101, the edge of the moving object behind the monitoring range 100 is an image generated by the camera 2. Sharpen up. However, the vicinity of the front end of the monitoring range 100, for example, the region 102 surrounded by a dotted line is greatly deviated from the focusing range 101. Therefore, when the moving object is in the range 102, the edge of the moving object becomes unclear on the image generated by the camera 2.

また、カメラ2が監視範囲100内の道路の延伸方向に対して斜め方向を向くように取り付けられている場合、道路上の位置とカメラ2により生成された画像上の位置とは1対1に対応する。例えば、カメラ2が、その光軸が斜め下方を向くように、道路上方に取り付けられている場合、画像の上端に近い位置ほど、監視範囲100の後端に近い位置に対応し、画像の下端に近い位置ほど、監視範囲100の前端に近い位置に対応する。   In addition, when the camera 2 is mounted so as to be directed obliquely with respect to the extending direction of the road within the monitoring range 100, the position on the road and the position on the image generated by the camera 2 are in a one-to-one relationship. Correspond. For example, when the camera 2 is mounted above the road so that its optical axis is directed obliquely downward, the position closer to the upper end of the image corresponds to the position closer to the rear end of the monitoring range 100 and the lower end of the image. The position closer to the position corresponds to the position closer to the front end of the monitoring range 100.

図2(a)及び図2(b)は、それぞれ、図1(a)及び図1(b)に対応する、カメラ2により生成された画像上での合焦範囲に対応する領域を示す図である。なお、この例では、説明の簡単化のために、監視範囲全体が画像に写るものとした。
図1(a)では、監視範囲100の略中央に合焦範囲101が位置していたので、図2(a)に示されるように、画像200上でも、合焦範囲101に対応する領域201は画像200の略中央に位置する。一方、図1(b)では、合焦範囲101は、監視範囲100の後方にずれていたので、図2(b)に示されるように、画像200上では、合焦範囲101に対応する領域201は画像200の上端側に位置している。そのため、その領域201内に写っている移動物体210は鮮鋭であるが、画像200の下端側、すなわち、監視範囲100の前側端近傍(例えば、図1(b)の領域102内)に位置している移動物体211はボケている。このように、画像上でエッジが鮮鋭になっているところとエッジが不鮮明になっているところが分かれば、カメラ2の合焦位置はある程度推定できる。
2 (a) and 2 (b) are diagrams showing regions corresponding to the in-focus range on the image generated by the camera 2 corresponding to FIGS. 1 (a) and 1 (b), respectively. It is. In this example, for the sake of simplicity of explanation, the entire monitoring range is shown in the image.
In FIG. 1A, since the focusing range 101 is located at substantially the center of the monitoring range 100, an area 201 corresponding to the focusing range 101 is displayed on the image 200 as shown in FIG. Is located approximately in the center of the image 200. On the other hand, in FIG. 1B, since the focusing range 101 is shifted to the rear of the monitoring range 100, an area corresponding to the focusing range 101 is displayed on the image 200 as shown in FIG. 201 is located on the upper end side of the image 200. Therefore, the moving object 210 shown in the area 201 is sharp, but is located at the lower end side of the image 200, that is, in the vicinity of the front end of the monitoring range 100 (for example, in the area 102 in FIG. 1B). The moving object 211 is blurred. Thus, if it is known where the edge is sharp and the edge is not clear on the image, the in-focus position of the camera 2 can be estimated to some extent.

しかし、全ての移動物体が同じ形状をしているわけではないので、移動物体によっても、画像上でのその移動物体のエッジの強度は異なる。
そこで、本実施形態による合焦位置検出装置は、一定の周期で監視範囲を撮影するカメラから、その撮影ごとの画像を取得して、各画像を解析することにより、複数の画像にわたって写っている移動物体を検出する。そして合焦位置検出装置は、移動物体ごとに、画像上に写っている位置とエッジ強度の関係から、合焦位置が含まれる範囲を推定する。そしてこの合焦位置検出装置は、複数の移動物体のそれぞれごとに推定された合焦位置が含まれる範囲を重ね合わせて合焦位置が含まれる範囲を絞り込むことで、撮像部の合焦位置を推定する。
However, since not all moving objects have the same shape, the strength of the edge of the moving object on the image varies depending on the moving object.
Therefore, the in-focus position detection apparatus according to the present embodiment captures images over a plurality of images by acquiring images for each photographing from a camera that photographs the monitoring range at a constant period and analyzing each image. Detect moving objects. Then, the in-focus position detecting apparatus estimates a range including the in-focus position from the relationship between the position in the image and the edge intensity for each moving object. Then, the in-focus position detection device narrows down the range including the in-focus position by overlapping the in-focus range estimated for each of the plurality of moving objects, thereby reducing the in-focus position of the imaging unit. presume.

図3は、一つの実施形態による合焦位置検出装置の概略構成図である。合焦位置検出装置1は、カメラインターフェース部11と、記憶部12と、制御部13とを有する。そして合焦位置検出装置1は、カメラインターフェース部11を介して、カメラ2と接続される。なお、合焦位置検出装置1は、カメラ2により撮影された画像から検出した移動物体についての情報を収集するシステムに組み込まれていてもよく、あるいは、そのシステムと別個に設けられてもよい。   FIG. 3 is a schematic configuration diagram of a focus position detection apparatus according to one embodiment. The focus position detection device 1 includes a camera interface unit 11, a storage unit 12, and a control unit 13. The focus position detection device 1 is connected to the camera 2 via the camera interface unit 11. The in-focus position detection apparatus 1 may be incorporated in a system that collects information about a moving object detected from an image captured by the camera 2 or may be provided separately from the system.

本実施形態では、カメラ2は、撮像部の一例であり、例えば、固体撮像素子のイメージセンサと、そのイメージセンサ上に監視範囲の像を結像する結像光学系と、カメラ2の合焦位置を調節するために結像光学系を駆動するフォーカシング機構とを有する。カメラ2は、例えば、道路を跨ぐように設けられたゲート状の構造物、あるいは、道路の脇に設置された支柱に、その道路を走行する車両よりも高い位置に取り付けられる。そして道路上の一部がカメラ2の撮影範囲、すなわち監視範囲となるように、カメラ2は道路上へ向けて設置される。なお、カメラ2は、例えば、交通状況を把握するなどの目的で設置された既存のカメラであってもよい。   In the present embodiment, the camera 2 is an example of an imaging unit. For example, an image sensor of a solid-state imaging device, an imaging optical system that forms an image of a monitoring range on the image sensor, and the focus of the camera 2 And a focusing mechanism for driving the imaging optical system to adjust the position. The camera 2 is attached to, for example, a gate-like structure provided so as to straddle the road, or a column installed on the side of the road at a position higher than a vehicle traveling on the road. Then, the camera 2 is installed on the road so that a part of the road is a shooting range of the camera 2, that is, a monitoring range. The camera 2 may be an existing camera installed for the purpose of grasping traffic conditions, for example.

カメラ2は、所定の撮影周期(例えば、33msec)ごとに監視範囲を撮影し、その監視範囲が写った画像を生成する。そしてカメラ2は、画像を生成する度に、その画像を合焦位置検出装置1へ出力する。   The camera 2 captures a monitoring range at every predetermined imaging cycle (for example, 33 msec), and generates an image showing the monitoring range. Each time the camera 2 generates an image, the camera 2 outputs the image to the in-focus position detection device 1.

さらに、カメラ2は、合焦位置検出装置1から受け取ったフォーカシング信号に従って、合焦位置を調節する。   Further, the camera 2 adjusts the focus position according to the focusing signal received from the focus position detection device 1.

カメラインターフェース部11は、カメラ2を合焦位置検出装置1に接続するためのインターフェース回路を有する。このインターフェース回路は、例えば、RS-232Cまたはユニバーサルシリアルバスといったシリアル通信規格に準拠した回路とすることができる。そしてカメラインターフェース部11は、カメラ2から画像を受け取る度に、その画像を制御部13へ渡す。またカメラインターフェース部11は、制御部13からフォーカシング信号を受け取ると、そのフォーカシング信号をカメラ2へ出力する。   The camera interface unit 11 has an interface circuit for connecting the camera 2 to the in-focus position detection device 1. The interface circuit may be a circuit that conforms to a serial communication standard such as RS-232C or universal serial bus. The camera interface unit 11 passes the image to the control unit 13 every time an image is received from the camera 2. When the camera interface unit 11 receives the focusing signal from the control unit 13, the camera interface unit 11 outputs the focusing signal to the camera 2.

記憶部12は、例えば、読み書き可能な揮発性の半導体メモリ回路と、読み出し専用の不揮発性の半導体メモリ回路とを有する。そして記憶部12は、カメラ2の合焦位置を検出するために用いられ、制御部13上で動作するコンピュータプログラムを記憶する。また記憶部12は、合焦位置を検出するために用いられる様々なデータ、例えば、カメラ2から受け取った画像、及びその画像から検出された移動物体の画像上の位置の遷移などを記録する追跡情報を記憶する。   The storage unit 12 includes, for example, a readable / writable volatile semiconductor memory circuit and a read-only nonvolatile semiconductor memory circuit. The storage unit 12 is used to detect the in-focus position of the camera 2 and stores a computer program that operates on the control unit 13. The storage unit 12 also tracks various data used to detect the in-focus position, for example, an image received from the camera 2 and a transition of a position on the image of a moving object detected from the image. Store information.

制御部13は、合焦位置検出装置1全体を制御する。また制御部13は、カメラ2から受け取った画像に基づいて、カメラ2の合焦位置を検出し、その検出結果に応じて、カメラ2の合焦位置を調節するためのフォーカシング信号を生成する。そのために、制御部13は、少なくとも一つのプロセッサ及び周辺回路を有する。   The control unit 13 controls the in-focus position detection device 1 as a whole. Further, the control unit 13 detects the in-focus position of the camera 2 based on the image received from the camera 2 and generates a focusing signal for adjusting the in-focus position of the camera 2 according to the detection result. For this purpose, the control unit 13 includes at least one processor and peripheral circuits.

図4は、制御部13の機能ブロック図である。制御部13は、検出部21と、トラッキング部22と、ボケ指標算出部23と、個別合焦範囲推定部24と、合焦位置推定部25と、フォーカシング調整部26とを有する。制御部13が有するこれらの各部は、制御部13が有するプロセッサ上で実行されるコンピュータプログラムによって実現される機能モジュールである。あるいは、制御部13が有するこれらの各部は、各部の機能を実現するデジタル信号プロセッサとして合焦位置検出装置1に実装されてもよい。   FIG. 4 is a functional block diagram of the control unit 13. The control unit 13 includes a detection unit 21, a tracking unit 22, a blur index calculation unit 23, an individual focus range estimation unit 24, a focus position estimation unit 25, and a focusing adjustment unit 26. Each of these units included in the control unit 13 is a functional module realized by a computer program executed on a processor included in the control unit 13. Or these each part which the control part 13 has may be mounted in the focusing position detection apparatus 1 as a digital signal processor which implement | achieves the function of each part.

検出部21は、制御部13がカメラ2から画像を受け取る度に、その画像に写っている移動物体を検出する。上述したように、本実施形態では、検出対象となる移動物体は、車両に付されたナンバープレートである。   Each time the control unit 13 receives an image from the camera 2, the detection unit 21 detects a moving object shown in the image. As described above, in this embodiment, the moving object to be detected is a license plate attached to the vehicle.

検出部21は、例えば、予め記憶部12に記憶されたナンバープレートのテンプレートと画像との間でテンプレートマッチングを行うことにより、ナンバープレートを検出する。あるいは、検出部21は、ナンバープレートに記載される数字などの文字に相当するテンプレートを用いてテンプレートマッチングを行ってもよい。あるいはまた、検出部21は、ナンバープレート検出用に予め学習された識別器を用いて、画像からナンバープレートを検出してもよい。検出部21は、そのような識別器として、例えば、adaBoost識別器またはサポートベクトルマシンを利用できる。   For example, the detection unit 21 detects the license plate by performing template matching between the template and the image of the license plate stored in the storage unit 12 in advance. Alternatively, the detection unit 21 may perform template matching using a template corresponding to characters such as numbers described on the license plate. Alternatively, the detection unit 21 may detect a license plate from an image using a discriminator previously learned for license plate detection. The detection unit 21 can use, for example, an adaBoost classifier or a support vector machine as such a classifier.

なお、検出部21は、画像上でナンバープレートが検出された領域内で、文字に相当するテンプレートを用いたテンプレートマッチングを行ったり、あるいはその他の文字認識手法を利用して、ナンバープレートに記載された車両番号を認識してもよい。   In addition, the detection part 21 performs template matching using the template corresponding to a character in the area | region where the license plate was detected on the image, or utilizes other character recognition methods, and is described in a license plate. The vehicle number may be recognized.

検出部21は、画像上のナンバープレートが検出された位置、例えば、ナンバープレートが検出された領域の重心を、トラッキング部22へ通知する。また検出部21は、車両番号を認識した場合には、その車両番号も、ナンバープレートが検出された位置とともにトラッキング部22へ通知してもよい。   The detection unit 21 notifies the tracking unit 22 of the position where the license plate is detected on the image, for example, the center of gravity of the area where the license plate is detected. When the detection unit 21 recognizes the vehicle number, the detection unit 21 may also notify the tracking unit 22 of the vehicle number together with the position where the license plate is detected.

トラッキング部22は、制御部13がカメラ2から得た複数の画像にわたってそれらの画像から検出されたナンバープレートを追跡することで、画像上でのナンバープレートの
位置の遷移を表す追跡情報を更新する。
そのために、トラッキング部22は、例えば、ナンバープレートが検出された画像上の領域内での特徴点を検出し、その特徴点に基づいてオプティカルフローなどのトラッキング手法を適用することにより、画像間で同一のナンバープレート同士を対応付ける。なお、特徴点は、例えば、Harrisオペレータといったコーナー検出器により検出されるコーナーとすることができる。あるいは、トラッキング部22は、他の様々なトラッキング手法の何れかを利用して、複数の画像にわたって、それら画像から検出されたナンバープレートを追跡してもよい。
また、検出部21によって車両番号が認識されている場合には、トラッキング部22は、同一の車両番号に対応するナンバープレート同士を対応付けることで、ナンバープレートを追跡してもよい。
The tracking unit 22 updates the tracking information representing the transition of the position of the license plate on the image by tracking the license plate detected from these images over the plurality of images obtained from the camera 2 by the control unit 13. .
For this purpose, the tracking unit 22 detects, for example, a feature point in an area on the image where the license plate is detected, and applies a tracking method such as an optical flow based on the feature point, thereby, between images. Match the same license plates. The feature points can be corners detected by a corner detector such as a Harris operator, for example. Alternatively, the tracking unit 22 may track the license plate detected from the images over a plurality of images using any of various other tracking methods.
Moreover, when the vehicle number is recognized by the detection part 21, the tracking part 22 may track a number plate by matching the number plates corresponding to the same vehicle number.

トラッキング部22は、最新の画像から検出されたナンバープレートごとに、そのナンバープレートの画像上の位置を、そのナンバープレートに対応する追跡情報に追加することで追跡情報を更新する。そしてトラッキング部22は、更新された追跡情報を記憶部12に記憶する。
なお、トラッキング部22は、最新の画像から検出されたナンバープレートのうち、過去の画像から検出されたナンバープレートの何れにも対応しないナンバープレートについては、新たに検出されたものとして、追跡情報も新たに生成する。
For each license plate detected from the latest image, the tracking unit 22 updates the tracking information by adding the position of the license plate on the image to the tracking information corresponding to the license plate. The tracking unit 22 stores the updated tracking information in the storage unit 12.
In addition, the tracking unit 22 detects that the license plate detected from the latest image does not correspond to any of the license plates detected from the past image, and the tracking information is also newly detected. Create a new one.

ボケ指標算出部23は、画像からナンバープレートが検出される度に、そのナンバープレートが写っている領域内でカメラ2の焦点がボケている度合いを表すボケ指標を算出する。
ボケ指標算出部23は、ボケ指標として、例えば、ナンバープレート内の文字が写っている前景画素と、前景画素に隣接する文字が写っていない背景画素間の輝度値差の絶対値の平均値あるいは中央値を算出する。なお、ボケ指標算出部23は、例えば、ナンバープレートが写っている領域内の各画素の輝度値を2値化閾値と比較し、2値化閾値以上の輝度値を持つ画素を前景画素、2値化閾値未満の輝度値を持つ画素を背景画素としてもよい。2値化閾値は、例えば、ナンバープレートが写っている領域内の各画素の輝度値の平均値であってもよく、あるいは、判別分析法によって定められてもよい。
Each time a license plate is detected from an image, the blur index calculation unit 23 calculates a blur index that represents the degree of blurring of the focus of the camera 2 in the area where the license plate is reflected.
The blur index calculation unit 23 uses, as the blur index, for example, an average value of absolute values of luminance value differences between foreground pixels in which characters in the license plate are captured and background pixels in which characters adjacent to the foreground pixels are not captured or Calculate the median. Note that the blur index calculation unit 23 compares, for example, the luminance value of each pixel in the area where the license plate is captured with a binarization threshold, and determines pixels having a luminance value equal to or higher than the binarization threshold as the foreground pixel, 2 A pixel having a luminance value less than the threshold value may be used as the background pixel. The binarization threshold value may be, for example, the average value of the luminance values of each pixel in the region where the license plate is shown, or may be determined by a discriminant analysis method.

また、ボケ指標算出部23は、ナンバープレートが検出された領域内の各画素について、sobelフィルタなどのエッジ検出フィルタ処理を行ってエッジ強度を算出し、そのエッジ強度の平均値をボケ指標としてもよい。あるいは、ボケ指標算出部23は、ナンバープレートが検出された領域内のエッジ強度の累積ヒストグラムを算出し、その累積ヒストグラムに基づいて、エッジ強度が大きい方から順に所定割合(例えば、10%〜20%)となるエッジ強度をボケ指標としてもよい。あるいは、ボケ指標算出部23は、ナンバープレートが検出された領域に対してフーリエ変換処理をおこなってその領域内の周波数スペクトルを算出し、所定の周波数よりも高い周波数成分が周波数スペクトル全体に占める割合をボケ指標としてもよい。これらの例では、ボケ指標の値が小さいほどエッジが不鮮明となっており、逆にボケ指標の値が大きいほどエッジが鮮鋭になっていることを表す。なお、ボケ指標算出部23は、エッジが不鮮明なほどボケ指標の値も大きくなるようなボケ指標を求めてもよい。   Also, the blur index calculation unit 23 performs edge detection filter processing such as a sobel filter on each pixel in the area where the license plate is detected, calculates edge strength, and uses the average value of the edge strength as the blur index. Good. Alternatively, the blur index calculation unit 23 calculates a cumulative histogram of edge strength in the area where the license plate is detected, and based on the cumulative histogram, a predetermined ratio (for example, 10% to 20%) in order from the largest edge strength. %) May be used as a blur index. Alternatively, the blur index calculation unit 23 performs a Fourier transform process on the area where the license plate is detected, calculates a frequency spectrum in the area, and the ratio of frequency components higher than a predetermined frequency to the entire frequency spectrum May be used as a blur index. In these examples, the smaller the value of the blur index is, the more blurred the edge is. On the contrary, the larger the value of the blur index is, the sharper the edge is. Note that the blur index calculation unit 23 may obtain a blur index such that the blur index value increases as the edge becomes unclear.

ボケ指標算出部23は、追跡情報に格納されたナンバープレートの位置に、その位置のボケ指標を対応付けるように、そのボケ指標を追加する。   The blur index calculation unit 23 adds the blur index so that the position of the license plate stored in the tracking information is associated with the blur index at the position.

個別合焦範囲推定部24は、追跡情報ごとに、その追跡情報に含まれるナンバープレートが検出された画像上の各位置のボケ指標の比較結果とその各位置に対応するカメラ2からの距離に応じて、合焦位置が含まれる範囲と合焦範囲が含まれる範囲を推定する。   For each tracking information, the individual focus range estimation unit 24 determines the distance from the camera 2 corresponding to each position and the comparison result of the blur index at each position on the image where the license plate included in the tracking information is detected. Accordingly, the range including the in-focus position and the range including the in-focus range are estimated.

図5は、カメラ2からの距離とボケ指標の関係の一例を示す図である。図5において、横軸はカメラ2からの距離を表し、縦軸はボケ指標を表す。この例では、上記のように、ボケ指標の値が大きいほど、エッジが鮮鋭であることを表す。そしてグラフ500は、距離とボケ指標の関係を表す。   FIG. 5 is a diagram illustrating an example of the relationship between the distance from the camera 2 and the blur index. In FIG. 5, the horizontal axis represents the distance from the camera 2, and the vertical axis represents the blur index. In this example, as described above, the larger the blur index value, the sharper the edge. A graph 500 represents the relationship between the distance and the blur index.

グラフ500に示されるように、ボケ指標の値は、カメラ2の焦点が最も合っている位置(すなわち、合焦位置)において最も高くなり、合焦位置から離れるほど、ボケ指標の値は低下する。簡単化のために、合焦位置の前後におけるボケ指標の低下の度合いが同一であるとする。そうすると、二つの距離の中点に合焦位置があるときに、それら二つの距離におけるボケ指標は等しくなる。そのため、グラフ500に示されるように、例えば、距離x1、x2におけるボケ指標の値が算出されており、距離x1でのボケ指標の値u1が、距離x2でのボケ指標u2よりも高ければ、カメラ2の合焦位置は、距離x1と距離x2の中点よりも距離x1に近い方にある。また、少なくとも、距離x2では距離x1よりもボケ指標が低下しているので、合焦範囲は、距離x2よりもカメラ2側にあると推定される。   As shown in the graph 500, the value of the blur index is the highest at the position where the camera 2 is most focused (that is, the focus position), and the value of the blur index decreases as the distance from the focus position increases. . For simplification, it is assumed that the degree of reduction of the blur index before and after the in-focus position is the same. Then, when the in-focus position is at the midpoint between the two distances, the blur index at the two distances is equal. Therefore, as shown in the graph 500, for example, the values of the blur index at the distances x1 and x2 are calculated, and if the blur index value u1 at the distance x1 is higher than the blur index u2 at the distance x2, The in-focus position of the camera 2 is closer to the distance x1 than the midpoint between the distance x1 and the distance x2. In addition, at least at the distance x2, the blur index is lower than the distance x1, so it is estimated that the focusing range is closer to the camera 2 than the distance x2.

ボケ指標とカメラ2の合焦位置の関係について、さらに幾つかの例を挙げて説明する。
図6(a)〜図6(c)は、それぞれ、同一のナンバープレートが二つの画像で検出された場合の、そのナンバープレートについてのそれぞれの画像でのボケ指標とカメラ2の合焦位置との関係を示す図である。図6(a)〜図6(c)において、横軸はカメラ2からの距離を表す。また黒丸601は、二つの画像からそれぞれ算出されたボケ指標のうち、相対的に低い方のボケ指標を表し、白丸602は、相対的に高い方のボケ指標を表す。さらに、四角603は、二つの画像からそれぞれ算出されたボケ指標が同程度である場合のボケ指標を表す。
The relationship between the blur index and the in-focus position of the camera 2 will be described with some examples.
FIG. 6A to FIG. 6C show the blur index in each image and the in-focus position of the camera 2 when the same license plate is detected in two images. It is a figure which shows the relationship. 6A to 6C, the horizontal axis represents the distance from the camera 2. A black circle 601 represents a relatively lower blur index among the blur indices calculated from the two images, and a white circle 602 represents a relatively higher blur index. Further, a square 603 represents a blur index when the blur indices calculated from the two images are approximately the same.

図6(a)に示されるように、カメラ2に近い方の距離x1におけるボケ指標よりも、カメラ2から遠い方の距離x2におけるボケ指標の方が高ければ、カメラ2の合焦位置は、カメラ2から距離(x1+x2)/2よりも遠い位置にあると推定される。また、カメラ2の合焦範囲の手前側(すなわち、カメラ2側)の境界は、距離x1よりも遠いと推定される。逆に、図6(b)に示されるように、カメラ2から遠い方の距離x2におけるボケ指標よりも、カメラ2に近い方の距離x1におけるボケ指標の方が高ければ、カメラ2からその合焦位置までの距離は、距離(x1+x2)/2よりも近いと推定される。また、カメラ2の合焦範囲の奥側(すなわち、カメラ2から離れた側)の境界は、距離x2よりも近いと推定される。ただし、図6(c)に示されるように、距離x1におけるボケ指標と距離x2におけるボケ指標が同程度であり、ある程度以上焦点があっている場合には、どちら側に合焦位置がずれているかを推定することは困難である。   As shown in FIG. 6A, if the blur index at a distance x2 farther from the camera 2 is higher than the blur index at a distance x1 closer to the camera 2, the in-focus position of the camera 2 is It is estimated that the camera is at a position farther than the distance (x1 + x2) / 2 from the camera 2. Further, the boundary on the near side of the focusing range of the camera 2 (that is, the camera 2 side) is estimated to be farther than the distance x1. On the other hand, as shown in FIG. 6B, if the blur index at the distance x1 closer to the camera 2 is higher than the blur index at the distance x2 far from the camera 2, the result from the camera 2 The distance to the focal position is estimated to be shorter than the distance (x1 + x2) / 2. Further, it is estimated that the boundary on the far side of the focusing range of the camera 2 (that is, the side away from the camera 2) is closer than the distance x2. However, as shown in FIG. 6C, when the blur index at the distance x1 is the same as the blur index at the distance x2, and the focus is more than a certain degree, the focus position is shifted to which side. It is difficult to estimate whether or not.

図7(a)〜図7(d)は、それぞれ、同一のナンバープレートが三つの画像で検出された場合の、そのナンバープレートについてのそれぞれの画像でのボケ指標とカメラ2の合焦位置との関係を示す図である。図7(a)〜図7(d)において、横軸はカメラ2からの距離を表す。また黒丸701は、二つの画像からそれぞれ算出されたボケ指標のうち、相対的に低い方のボケ指標を表し、白丸702は、相対的に高い方のボケ指標を表す。さらに、四角703は、二つの画像からそれぞれ算出されたボケ指標が同程度である場合のボケ指標を表す。   FIG. 7A to FIG. 7D respectively show the blur index in each image and the in-focus position of the camera 2 when the same license plate is detected in three images. It is a figure which shows the relationship. 7A to 7D, the horizontal axis represents the distance from the camera 2. A black circle 701 represents a lower blur index among the blur indices calculated from the two images, and a white circle 702 represents a higher blur index. Furthermore, a square 703 represents a blur index when the blur indices calculated from the two images are approximately the same.

図7(a)に示されるように、距離x1、x2、x3のそれぞれのボケ指標のうち、中間の距離x2におけるボケ指標が最も高い場合、カメラ2の合焦位置は、カメラ2からの距離が(x1+x2)/2〜(x2+x3)/2の間にあると推定される。また、カメラ2の合焦範囲の手前側の境界は、距離x1よりも遠く、合焦範囲の奥側の境界は、距離x3よりも近いと推定される。これに対して、図7(b)に示されるように、カメラ2に最も近い距離x1におけるボケ指標が最も高ければ、合焦位置は、距離(x1+x2)/2よりもカメラ2に近いと推定される。また、カメラ2の合焦範囲の奥側の境界は、距離x2よりも近いと推定される。逆に、カメラ2から最も離れた距離x3におけるボケ指標が最も高ければ、合焦位置は、距離(x2+x3)/2よりもカメラ2から遠いと推定される。また、カメラ2の合焦範囲の手前側の境界は、距離x2よりも遠いと推定される。さらに、図7(c)に示されるように、距離x1、距離x2におけるボケ指標が同程度に高く、距離x3におけるボケ指標が最も低ければ、合焦位置は、(x2+x3)/2よりもカメラ2に近いと推定される。また、カメラ2の合焦範囲の奥側の境界は、距離x3よりも近いと推定される。逆に、距離x2、距離x3におけるボケ指標が同程度に高く、距離x1におけるボケ指標が最も低ければ、合焦位置は、(x1+x2)/2よりもカメラ2から離れていると推定される。また、カメラ2の合焦範囲の手前側の境界は、距離x1よりも遠いと推定される。一方、図7(d)に示されるように、距離x1〜x3のそれぞれにおけるボケ指標が同程度であり、ある程度以上焦点があっている場合には、どちら側に合焦位置がずれているかを推定することは困難である。   As shown in FIG. 7A, when the blur index at the intermediate distance x2 is the highest among the blur indices at the distances x1, x2, and x3, the in-focus position of the camera 2 is the distance from the camera 2 Is estimated to be between (x1 + x2) / 2 and (x2 + x3) / 2. Further, it is estimated that the boundary on the near side of the focusing range of the camera 2 is farther than the distance x1, and the boundary on the far side of the focusing range is closer than the distance x3. On the other hand, as shown in FIG. 7B, if the blur index at the distance x1 closest to the camera 2 is the highest, the in-focus position is closer to the camera 2 than the distance (x1 + x2) / 2. It is estimated to be. In addition, it is estimated that the inner boundary of the focusing range of the camera 2 is closer than the distance x2. Conversely, if the blur index at the distance x3 farthest from the camera 2 is the highest, the in-focus position is estimated to be farther from the camera 2 than the distance (x2 + x3) / 2. In addition, the front boundary of the focusing range of the camera 2 is estimated to be farther than the distance x2. Further, as shown in FIG. 7C, when the blur index at the distance x1 and the distance x2 is substantially the same and the blur index at the distance x3 is the lowest, the in-focus position is from (x2 + x3) / 2. Is also estimated to be close to the camera 2. Further, it is estimated that the inner boundary of the focusing range of the camera 2 is closer than the distance x3. Conversely, if the blur index at the distance x2 and the distance x3 is about the same and the blur index at the distance x1 is the lowest, the in-focus position is estimated to be farther from the camera 2 than (x1 + x2) / 2. The In addition, the front boundary of the focusing range of the camera 2 is estimated to be farther than the distance x1. On the other hand, as shown in FIG. 7 (d), when the blur index at each of the distances x1 to x3 is approximately the same and the focus is more than a certain degree, which side the in-focus position is shifted is determined. It is difficult to estimate.

個別合焦範囲推定部24は、一定の周期(例えば、1日〜1週間)ごとに、あるいは予め設定された日時になると、記憶部12に記憶されている各追跡情報を読み込む。そして個別合焦範囲推定部24は、各追跡情報のうち、ナンバープレートの位置が複数含まれる追跡情報を抽出する。そして個別合焦範囲推定部24は、抽出された追跡情報のそれぞれについて、画像上のナンバープレートの位置ごとに、その位置に対応するカメラ2からの距離を求める。画像上の位置とカメラ2からの距離の関係は、カメラ2の設置条件(例えば、路面からカメラ2までの高さ、カメラ2の光軸方向)及びカメラ2の仕様(例えば、画素数、画角)に基づいて予め求めることができる。そこで、例えば、画像上の位置とカメラ2からの距離の関係を表す参照テーブルが予め作成され、記憶部12に記憶される。そして個別合焦範囲推定部24は、その参照テーブルを参照することにより、ナンバープレートの画像上の位置に対応するカメラ2からの距離を求めることができる。   The individual focus range estimation unit 24 reads each piece of tracking information stored in the storage unit 12 at a certain period (for example, one day to one week) or at a preset date and time. Then, the individual focus range estimation unit 24 extracts tracking information including a plurality of license plate positions from the tracking information. Then, the individual focus range estimation unit 24 obtains the distance from the camera 2 corresponding to the position of each license plate on the image for each of the extracted tracking information. The relationship between the position on the image and the distance from the camera 2 depends on the installation conditions of the camera 2 (for example, the height from the road surface to the camera 2 and the optical axis direction of the camera 2) and the specifications of the camera 2 (for example, the number of pixels, image Can be obtained in advance based on the angle. Therefore, for example, a reference table representing the relationship between the position on the image and the distance from the camera 2 is created in advance and stored in the storage unit 12. The individual focus range estimation unit 24 can obtain the distance from the camera 2 corresponding to the position of the license plate on the image by referring to the reference table.

個別合焦範囲推定部24は、抽出された追跡情報ごとに、すなわちナンバープレートごとに、上記の図6、図7について説明した規則に従って、カメラ2の合焦位置が含まれると推定される範囲と合焦範囲が含まれると推定される範囲を求める。そして個別合焦範囲推定部24は、それらの範囲を追跡情報に追加する。   The individual focus range estimation unit 24 is a range in which the focus position of the camera 2 is estimated to be included for each extracted tracking information, that is, for each license plate, according to the rules described with reference to FIGS. And a range estimated to include the in-focus range. Then, the individual focus range estimation unit 24 adds those ranges to the tracking information.

すなわち、個別合焦範囲推定部24は、抽出された追跡情報のそれぞれについて、時間的に連続する2枚の画像から算出された、カメラ2からナンバープレートまでの距離の組み合わせごとに、その二つの距離のそれぞれにおけるボケ指標の差の絶対値を算出する。そして個別合焦範囲推定部24は、ボケ指標の差の絶対値が最大となる二つの距離を特定する。個別合焦範囲推定部24は、ボケ指標の差の絶対値の最大値を所定の閾値と比較する。そして個別合焦範囲推定部24は、その最大値が閾値よりも大きければ、その二つの距離の中点よりも、ボケ指標の値が大きい方に合焦位置があると推定する。また、個別合焦範囲推定部24は、その最大値に対応する二つの距離のうち、ボケ指標の値が高い方の距離を含み、かつ、ボケ指標の値が低い方の距離を境界とする範囲に、合焦範囲が含まれると推定する。なお、個別合焦範囲推定部24は、合焦位置が含まれると判定された側で、再度連続する2枚の画像から算出された距離間のボケ指標の差の最大値を算出してもよい。そして個別合焦範囲推定部24は、その最大値に基づいて上記の処理と同様の処理を行うことで、合焦位置及び合焦範囲が含まれる範囲のもう一方の境界を決定してもよい。   In other words, the individual focus range estimation unit 24 calculates two of the extracted tracking information for each combination of distances from the camera 2 to the license plate calculated from two temporally continuous images. The absolute value of the difference in blur index at each distance is calculated. Then, the individual focus range estimation unit 24 specifies two distances at which the absolute value of the difference between the blur indices is maximized. The individual focus range estimation unit 24 compares the maximum absolute value of the difference between the blur indices with a predetermined threshold value. If the maximum value is greater than the threshold value, the individual focus range estimation unit 24 estimates that the focus position is located on the side where the blur index value is larger than the midpoint between the two distances. In addition, the individual focus range estimation unit 24 includes a distance having a higher blur index value and a distance having a lower blur index value among the two distances corresponding to the maximum value as a boundary. It is estimated that the in-focus range is included in the range. Note that the individual focus range estimation unit 24 may calculate the maximum value of the difference in blur index between the distances calculated from the two consecutive images again on the side determined to include the focus position. Good. Then, the individual focus range estimation unit 24 may determine the other boundary of the range including the focus position and the focus range by performing the same process as the above process based on the maximum value. .

一方、個別合焦範囲推定部24は、ボケ指標の差の絶対値の最大値が閾値以下であれば、そのナンバープレートについては、合焦位置を推定できないと判定する。なお、閾値は、例えば、目視にてエッジのボケ度合いが識別できるボケ指標の差の最小値に設定される。   On the other hand, the individual focus range estimation unit 24 determines that the focus position cannot be estimated for the license plate if the maximum absolute value of the difference between the blur indices is equal to or less than the threshold value. Note that the threshold value is set to, for example, the minimum value of the difference between the blur indexes that can visually identify the degree of edge blur.

個別合焦範囲推定部24は、合焦位置を含む範囲及び合焦範囲を含む範囲を推定できた追跡情報に、その推定した合焦位置を含む範囲及び合焦範囲を含む範囲を追加して、その追跡情報を記憶部12に記憶する。   The individual focus range estimation unit 24 adds the range including the focus position and the range including the focus range to the tracking information in which the range including the focus position and the range including the focus range can be estimated. The tracking information is stored in the storage unit 12.

合焦位置推定部25は、記憶部12に記憶されている、複数の追跡情報のそれぞれについて求められた合焦位置を含む範囲同士、及び合焦範囲を含む範囲同士を重ね合わせて合焦位置が含まれる範囲をより精密に特定することで、合焦位置を推定する。   The in-focus position estimating unit 25 superimposes the ranges including the in-focus positions calculated for each of the plurality of pieces of tracking information and the in-focus ranges stored in the storage unit 12. The in-focus position is estimated by more precisely specifying the range in which is included.

図8は、追跡情報ごとに推定された合焦位置を含む範囲と、最終的に絞り込まれた合焦位置を含む範囲の関係の一例を示す図である。図8において、横軸はカメラ2からの距離を表す。また、個々の線分801は、それぞれ、一つの追跡情報における、ナンバープレートの検出位置と個々の検出位置におけるボケ指標の相対的な大きさの関係を表す。そして、個々の線分801に付された白丸、黒丸及び四角といった記号は、それぞれ、その記号が付された位置でのボケ指標の相対的な大きさを表す。白丸は、相対的にボケ指標が大きい、すなわち、相対的にエッジが鮮鋭であることを表し、黒丸は、相対的にボケ指標が小さい、すなわち、相対的にエッジが不鮮明であることを表す。そして四角は、その追跡情報に含まれるナンバープレートの検出位置のそれぞれにおけるボケ指標がほぼ同じであることを表す。さらに、個々の線分801に付された実線の矢印802は、その矢印の基点を境界とする、矢印の方向に、カメラ2の合焦位置が含まれると推定された範囲があることを表す。また、個々の線分801に付された点線の矢印803は、その矢印の基点を境界として、矢印の方向にカメラ2の合焦範囲があると推定されたことを表す。   FIG. 8 is a diagram illustrating an example of a relationship between a range including a focus position estimated for each tracking information and a range including a focus position finally narrowed down. In FIG. 8, the horizontal axis represents the distance from the camera 2. Each line segment 801 represents the relationship between the detection position of the license plate and the relative size of the blur index at each detection position in one piece of tracking information. Symbols such as white circles, black circles, and squares attached to individual line segments 801 represent the relative sizes of the blur indices at the positions where the symbols are attached. A white circle indicates that the blur index is relatively large, that is, the edge is relatively sharp, and a black circle indicates that the blur index is relatively small, that is, the edge is relatively unclear. The square represents that the blur index at each of the detection positions of the license plate included in the tracking information is substantially the same. Furthermore, a solid arrow 802 attached to each line segment 801 indicates that there is a range in which the in-focus position of the camera 2 is included in the direction of the arrow, with the base point of the arrow as a boundary. . A dotted line arrow 803 attached to each line segment 801 indicates that the in-focus range of the camera 2 is estimated in the direction of the arrow with the base point of the arrow as a boundary.

各追跡情報について合焦位置を含むと推定された範囲を重ね合わせて一致する部分を特定することで、最終的に絞り込まれた、合焦位置を含むと推定される範囲が得られる。また、各追跡情報について合焦範囲を含むと推定された範囲を重ね合わせて一致する部分を特定することで、最終的に絞り込まれた、合焦範囲を含むと推定される範囲が得られる。   For each tracking information, a range that is estimated to include the in-focus position is overlapped to identify a matching portion, thereby obtaining a finally estimated range that includes the in-focus position. In addition, by identifying the matching portions by overlapping the ranges estimated to include the focus range for each tracking information, a range that is finally narrowed down and estimated to include the focus range is obtained.

具体的には、合焦位置推定部25は、各追跡情報について求められた、合焦位置を含む推定範囲のうち、その推定範囲のカメラ2側の境界が求められているものの中から、カメラ2から最も離れた境界を特定する。同様に、合焦位置推定部25は、各追跡情報について求められた、合焦位置を含む推定範囲のうち、その推定範囲のカメラ2から遠い側の境界が求められているものの中から、カメラ2から最も近い境界を特定する。そして合焦位置推定部25は、特定された二つの境界で挟まれた範囲を、最終的に絞り込まれた合焦位置を含む範囲とする。例えば、図8に示された例では、矢印811の基点が、合焦位置を含むと推定された範囲のカメラ2側の境界のうち、カメラ2から最も離れた境界となる。また、矢印812の基点が、合焦位置を含むと推定された範囲のカメラ2から遠い方の境界のうち、カメラ2に最も近い境界となる。そのため、矢印811の基点と矢印812の基点で挟まれた範囲804が、最終的に絞り込まれた、合焦位置を含むと推定される範囲となる。   Specifically, the in-focus position estimation unit 25 calculates the camera from the estimation ranges including the in-focus position obtained for each piece of tracking information, for which the boundary on the camera 2 side of the estimation range is obtained. The boundary farthest from 2 is identified. Similarly, the in-focus position estimation unit 25 calculates the camera from the estimation ranges including the in-focus position obtained for each piece of tracking information from which the boundary of the estimation range far from the camera 2 is obtained. The nearest boundary from 2 is specified. Then, the focus position estimation unit 25 sets a range between the two specified boundaries as a range including the finally focused position. For example, in the example shown in FIG. 8, the base point of the arrow 811 is the boundary farthest from the camera 2 among the boundaries on the camera 2 side in the range estimated to include the in-focus position. Also, the base point of the arrow 812 is the boundary closest to the camera 2 among the boundaries far from the camera 2 in the range estimated to include the in-focus position. Therefore, a range 804 sandwiched between the base point of the arrow 811 and the base point of the arrow 812 is a range estimated to include the in-focus position finally narrowed down.

同様に、合焦位置推定部25は、各追跡情報について求められた、合焦範囲を含む推定範囲のうち、その推定範囲のカメラ2側の境界が求められているものの中から、カメラ2から最も離れた境界を特定する。また合焦位置推定部25は、各追跡情報について求められた、合焦範囲を含む推定範囲のうち、その推定範囲のカメラ2から遠い側の境界が求められているものの中から、カメラ2から最も近い境界を特定する。そして合焦位置推定部25は、特定された二つの境界で挟まれた範囲を、最終的に推定される、合焦範囲を含む範囲とする。例えば、図8に示された例では、矢印821の基点が、合焦範囲を含むと推定された範囲のカメラ2側の境界のうち、カメラ2から最も離れた境界となる。また、矢印822の基点が、合焦範囲を含むと推定された範囲のカメラ2から遠い方の境界のうち、カメラ2に最も近い境界となる。そのため、矢印821の基点と矢印822の基点で挟まれた範囲805が、最終的に絞り込まれた、合焦範囲を含むと推定される範囲となる。   Similarly, the in-focus position estimating unit 25 determines from the camera 2 out of the estimated ranges obtained for each tracking information, including the in-focus range, where the boundary of the estimated range on the camera 2 side is obtained. Identify the farthest boundaries. In addition, the focus position estimation unit 25 determines from the camera 2 out of the estimation ranges obtained for each piece of tracking information, including the focus range, where the boundary of the estimation range far from the camera 2 is obtained. Identify the nearest boundary. Then, the focus position estimation unit 25 sets a range between the two specified boundaries as a range including the focus range that is finally estimated. For example, in the example shown in FIG. 8, the base point of the arrow 821 is the boundary farthest from the camera 2 among the boundaries on the camera 2 side of the range estimated to include the in-focus range. In addition, the base point of the arrow 822 is the boundary closest to the camera 2 among the boundaries far from the camera 2 in the range estimated to include the focus range. Therefore, a range 805 sandwiched between the base point of the arrow 821 and the base point of the arrow 822 is a range that is finally narrowed down and estimated to include the focusing range.

絞り込んだ合焦位置の範囲の幅がP1であり、実際の合焦位置がその範囲内に含まれるとすると、その合焦位置の範囲の中点と実際の合焦位置との誤差は最大でP1/2となる。また、合焦範囲が含まれる推定範囲の幅がL1であり、実際の合焦範囲がその推定範囲に含まれるとすると、推定範囲の中心と実際の合焦範囲の中心との誤差は最大で|L1-L0|/2となる。ただし、L0は、実際の合焦範囲の幅を表す。そこで、合焦位置の最大誤差P1/2及び合焦範囲の最大誤差|L1-L0|/2のうち、小さい方が予め設定された許容範囲内であれば、合焦位置推定部25は、合焦位置が十分に絞り込めたと判定する。そして合焦位置推定部25は、合焦位置の推定範囲の中点及び合焦範囲の推定範囲の中点のうち、対応する最大誤差が小さい方を、推定した合焦位置として、フォーカシング調整部26へ渡す。
一方、合焦位置の最大誤差P1/2及び合焦範囲の最大誤差|L1-L0|/2のうち、小さい方が予め設定された許容範囲外であれば、合焦位置推定部25は、合焦位置が十分に絞り込めていないと判定する。そして合焦位置推定部25は、所定期間の間、追跡情報が追加で蓄積されるのを待つ。そして所定期間が経過した後に、合焦位置推定部25は、所定期間の開始前に求められていた追跡情報だけでなく、所定期間中に追加された追跡情報も利用して、再度、合焦位置及び合焦範囲を絞り込む。
If the narrowed focus position range is P 1 and the actual focus position is within that range, the error between the midpoint of the focus position range and the actual focus position is the maximum. It becomes P 1/2 . Also, if the estimated range that includes the focus range is L 1 and the actual focus range is included in the estimated range, the error between the center of the estimated range and the center of the actual focus range is the maximum. Thus | L 1 -L 0 | / 2. However, L 0 represents the width of the actual focusing range. Therefore, the maximum error of the maximum error P 1/2 and the focusing range of the focus position | L 1 -L 0 | / 2 of, if it is within tolerance smaller is preset focus position estimation unit No. 25 determines that the in-focus position is sufficiently narrowed down. Then, the focusing position estimation unit 25 sets a focusing adjustment unit as the estimated focusing position with the smaller corresponding maximum error among the midpoint of the focusing range estimation range and the midpoint of the focusing range estimation range. 26.
On the other hand, the maximum error of the maximum error P 1/2 and the focusing range of the focus position | L 1 -L 0 | / 2 of, if unacceptable that smaller is preset focus position estimation unit No. 25 determines that the in-focus position is not sufficiently narrowed down. Then, the in-focus position estimation unit 25 waits for additional tracking information to be accumulated for a predetermined period. After the lapse of the predetermined period, the in-focus position estimation unit 25 uses the tracking information added before the start of the predetermined period as well as the tracking information added during the predetermined period to focus again. Narrow the position and focus range.

なお、許容範囲は、例えば、カメラ2により撮影された画像から認識対象となる移動物体(この例では、ナンバープレート)を認識する際の認識精度が予め設定された仕様を満たせるように合焦位置を設定できる最大誤差に設定される。
例えば、合焦位置の推定範囲の中点または合焦範囲が含まれる推定範囲の中点をxとして、その点xから実際の合焦位置までの誤差の最大値をd(=min(P1/2, |L1-L0|/2))とする。そして、所望の合焦位置をyとする。上記の推定結果により、実際の合焦位置zは、x-d≦z≦x+dを満たす範囲内にある。ここで、フォーカシング調整により、推定された合焦位置xから合焦位置をyに移動させるよう、合焦位置が(y-x)だけ調整されるとする。この場合、調整後の実際の合焦位置wは、y-d≦w≦y+dを満たす範囲にある。ここで、認識精度が仕様を満たせる合焦位置の誤差の最大値がcであるとすると、d≦cであれば、y-c≦w≦y+cとなるので、認識精度が仕様を満たせる。そこで許容範囲は、認識精度が仕様を満たせる合焦位置の誤差の最大値cに設定される。
The permissible range is, for example, a focus position so that the recognition accuracy when recognizing a moving object (a license plate in this example) to be recognized from an image taken by the camera 2 can satisfy a preset specification. Is set to the maximum error that can be set.
For example, let x be the midpoint of the estimation range of the focus position or the midpoint of the estimation range that includes the focus range, and let d (= min (P 1 / 2, | L 1 -L 0 | / 2)). A desired in-focus position is y. From the above estimation result, the actual in-focus position z is in a range satisfying xd ≦ z ≦ x + d. Here, it is assumed that the focusing position is adjusted by (yx) so that the focusing position is moved to y from the estimated focusing position x by focusing adjustment. In this case, the actual in-focus position w after adjustment is in a range satisfying yd ≦ w ≦ y + d. Here, assuming that the maximum value of the in-focus position error at which the recognition accuracy can satisfy the specification is c, if d ≦ c, yc ≦ w ≦ y + c, so that the recognition accuracy can satisfy the specification. Therefore, the allowable range is set to the maximum value c of the focus position error that allows the recognition accuracy to meet the specifications.

あるいは、許容範囲は、推定された合焦位置に基づいて修正された合焦位置と所望の合焦位置間の誤差が、修正前の実際の合焦位置と所望の合焦位置間の誤差以下となるように設定されてもよい。
例えば、合焦位置の推定範囲の中点または合焦範囲が含まれる推定範囲の中点をxとして、その点xから実際の合焦位置までの誤差の最大値をd(=min(P1/2, |L1-L0|/2))とする。そして、所望の合焦位置をyとする。上記の推定結果により、実際の合焦位置zは、x-d≦z≦x+dを満たす範囲内にある。ここで、x<yであるとすると、所望の合焦位置から実際の合焦位置までのずれ量aは、次式で表される。
y-x-d < a < y-x+d (ただし、x+d<y) (1)
0 ≦ a < y-x+d (ただし、x+d≧y) (2)
フォーカシング調整により、推定された合焦位置xから合焦位置をyに移動させるよう、合焦位置が(y-x)だけ調整されるとする。この場合、調整後の実際の合焦位置wは、y-d≦w≦y+dを満たす範囲にある。そのため、所望の合焦位置から修正後の合焦位置までのずれ量bは、0 < b < dの範囲に含まれる。したがって、上記の(2)式の場合には、a < bとなり得るので、合焦位置の絞り込みは十分でない。一方、(1)式の場合には、b ≦ aとなるためには、d ≦y-x-dとなる必要がある。したがって、d ≦ (y-x)/2であれば、修正後の合焦位置の方が修正前の合焦位置よりも所望の合焦位置から離れることはない。なお、x>yの場合も、同じ結果となる。そこで許容範囲は、合焦位置の修正量の1/2に設定される。
Alternatively, the allowable range is that the error between the focus position corrected based on the estimated focus position and the desired focus position is less than the error between the actual focus position before correction and the desired focus position. May be set to be.
For example, let x be the midpoint of the estimation range of the focus position or the midpoint of the estimation range that includes the focus range, and let d (= min (P 1 / 2, | L 1 -L 0 | / 2)). A desired in-focus position is y. From the above estimation result, the actual in-focus position z is in a range satisfying xd ≦ z ≦ x + d. Here, assuming that x <y, the shift amount a from the desired in-focus position to the actual in-focus position is expressed by the following equation.
yxd <a <y-x + d (where x + d <y) (1)
0 ≤ a <y-x + d (where x + d ≥ y) (2)
Assume that the focusing position is adjusted by (yx) so that the focusing position is moved from the estimated focusing position x to y by focusing adjustment. In this case, the actual in-focus position w after adjustment is in a range satisfying yd ≦ w ≦ y + d. Therefore, the shift amount b from the desired in-focus position to the corrected in-focus position is included in the range of 0 <b <d. Therefore, in the case of the above formula (2), since a <b can be satisfied, the focusing position is not sufficiently narrowed down. On the other hand, in the case of equation (1), in order to satisfy b ≦ a, it is necessary that d ≦ yxd. Therefore, if d ≦ (yx) / 2, the focused position after correction is not far from the desired focused position than the focused position before correction. The same result is obtained when x> y. Therefore, the allowable range is set to ½ of the correction amount of the focus position.

フォーカシング調整部26は、所望の合焦位置と推定された合焦位置間のずれ量を、合焦位置の調整が必要か否かを判定する閾値と比較する。そしてそのずれ量が閾値以上であれば、フォーカシング調整部26は、そのずれ量を打ち消すだけ合焦位置を移動させるフォーカシング信号を生成する。なお、所望の合焦位置は、例えば、監視範囲の中心に設定される。あるいは、所望の合焦位置は、監視範囲の中心よりも、カメラ2に近い位置に設定されてもよい。これは、合焦位置からカメラ2側の被写界深度は、合焦位置からカメラ2よりも遠い側の被写界深度よりも短いことによる。すなわち、上記のように所望の合焦位置を設定することで、合焦位置検出装置1は、監視範囲と合焦範囲とをより適切に一致させることができる。また、ずれ量及び推定された合焦位置と、カメラ2の結像光学系の移動量、すなわち、フォーカシング調整量との関係を表す参照テーブルが予め記憶部12に記憶される。そしてフォーカシング調整部26は、その参照テーブルを参照することにより、ずれ量及び推定された合焦位置に対応するフォーカシング調整量を求めればよい。そしてフォーカシング調整部26は、フォーカシング信号を、カメラインターフェース部11を介してカメラ2へ出力する。   The focusing adjustment unit 26 compares the deviation amount between the desired in-focus position and the estimated in-focus position with a threshold value for determining whether the in-focus position needs to be adjusted. If the deviation amount is equal to or larger than the threshold value, the focusing adjustment unit 26 generates a focusing signal that moves the in-focus position by canceling the deviation amount. Note that the desired in-focus position is set at the center of the monitoring range, for example. Alternatively, the desired focus position may be set closer to the camera 2 than the center of the monitoring range. This is because the depth of field on the camera 2 side from the in-focus position is shorter than the depth of field on the side farther than the camera 2 from the in-focus position. That is, by setting a desired focus position as described above, the focus position detection device 1 can more appropriately match the monitoring range and the focus range. In addition, a reference table that represents the relationship between the shift amount and the estimated in-focus position and the movement amount of the imaging optical system of the camera 2, that is, the focusing adjustment amount, is stored in the storage unit 12 in advance. Then, the focusing adjustment unit 26 may obtain the focusing adjustment amount corresponding to the shift amount and the estimated in-focus position by referring to the reference table. The focusing adjusting unit 26 outputs a focusing signal to the camera 2 via the camera interface unit 11.

なお、閾値は、例えば、カメラ2により撮影された画像から検出対象となる移動物体を検出する際の検出精度の条件(例えば、仕様にて規定される検出精度の最低値)を満たせる合焦位置のずれ量の最大値に設定される。
例えば、推定された合焦位置をxとして、その点xから実際の合焦位置までの誤差の最大値をd(=min(P1/2, |L1-L0|/2))とする。そして、所望の合焦位置をyとする。上記の推定結果により、実際の合焦位置zは、x-d≦z≦x+dを満たす範囲内にある。ここで、x<yであるとすると、所望の合焦位置から実際の合焦位置までのずれ量aは、a < y-x+dを満たす。ここで、認識精度が仕様を満たせる合焦位置のずれ量の最大値がcであるとすると、a≦cとなためには、y-x+d < cとなる必要がある。なお、y ≦ xの場合も、同様である。そこで閾値は、認識精度が仕様を満たせる合焦位置のずれ量の最大値cから、誤差の最大値dを減じた値に設定される。
なお、カメラ2に近いほど、被写界深度は狭くなるので、推定された合焦位置がカメラ2に近いほど、フォーカシング調整部26は、合焦位置を調整するか否かを判定するための閾値を小さくしてもよい。
The threshold value is, for example, an in-focus position that can satisfy a detection accuracy condition (for example, the minimum detection accuracy defined in the specification) when detecting a moving object to be detected from an image captured by the camera 2. Is set to the maximum deviation amount.
For example, the estimated focus position as x, the maximum value of the error from the point x to the actual focus position d (= min (P 1/ 2, | L 1 -L 0 | / 2)) and To do. A desired in-focus position is y. From the above estimation result, the actual in-focus position z is in a range satisfying xd ≦ z ≦ x + d. Here, assuming that x <y, the shift amount a from the desired in-focus position to the actual in-focus position satisfies a <y−x + d. Here, assuming that the maximum value of the in-focus position shift amount at which the recognition accuracy satisfies the specification is c, in order to satisfy a ≦ c, it is necessary to satisfy y−x + d <c. The same applies when y ≦ x. Therefore, the threshold value is set to a value obtained by subtracting the maximum error value d from the maximum value c of the in-focus position shift amount at which the recognition accuracy satisfies the specification.
Note that the closer to the camera 2, the narrower the depth of field, so that the closer the estimated focus position is to the camera 2, the focusing adjustment unit 26 determines whether to adjust the focus position. The threshold may be reduced.

図9は、制御部13により実行される合焦位置検出処理の動作フローチャートである。
制御部13は、カメラ2から画像を取得する(ステップS101)。以下では、説明の便宜上、カメラ2から得られた最新の画像を現画像と呼ぶ。そして制御部13の検出部21は、現画像から認識対象の移動物体を検出する(ステップS102)。そして制御部13のトラッキング部22は、現画像に基づいて検出された移動物体の位置と、過去の画像に基づいて検出された画像の位置などを用いて、移動物体ごとの追跡情報を更新する(ステップS103)。
また、制御部13のボケ指標算出部23は、現画像から検出された移動物体に基づいて、カメラ2からその移動物体までの距離に対応する画像上の位置でのボケ指標を算出する(ステップS104)。そしてボケ指標算出部23は、そのボケ指標を対応する追跡情報に追加する。
FIG. 9 is an operation flowchart of the focus position detection process executed by the control unit 13.
The control unit 13 acquires an image from the camera 2 (step S101). Hereinafter, for convenience of explanation, the latest image obtained from the camera 2 is referred to as a current image. Then, the detection unit 21 of the control unit 13 detects a moving object to be recognized from the current image (step S102). Then, the tracking unit 22 of the control unit 13 updates the tracking information for each moving object using the position of the moving object detected based on the current image and the position of the image detected based on the past image. (Step S103).
Further, the blur index calculation unit 23 of the control unit 13 calculates a blur index at a position on the image corresponding to the distance from the camera 2 to the moving object based on the moving object detected from the current image (step). S104). Then, the blur index calculation unit 23 adds the blur index to the corresponding tracking information.

制御部13は、合焦位置検出処理が開始されてから所定期間が経過したか否か判定する(ステップS105)。所定期間が経過していなければ(ステップS105−No)、制御部13は、ステップS101以降の処理を繰り返す。   The control unit 13 determines whether or not a predetermined period has elapsed since the in-focus position detection process was started (step S105). If the predetermined period has not elapsed (No at Step S105), the control unit 13 repeats the processes after Step S101.

一方、所定期間が経過していれば(ステップS105−Yes)、制御部13の個別合焦範囲推定部24は、追跡情報ごとに、距離ごとのボケ指標を比較することで、合焦位置が含まれる範囲及び合焦範囲が含まれる範囲を推定する(ステップS106)。そして制御部13の合焦位置推定部25は、追跡情報ごとに推定された合焦位置が含まれる範囲及び合焦範囲が含まれる範囲を重ね合わせて一致する部分を求めることで、合焦位置の推定位置を絞り込む(ステップS107)。合焦位置推定部25は、一致する部分の幅から算出される合焦位置の誤差の最大値が許容範囲内か否か判定する(ステップS108)。その誤差の最大値が許容範囲よりも広ければ(ステップS108−No)、制御部13は、ステップS101以降の処理を繰り返す。
一方、その一致する部分の幅が許容範囲以内であれば(ステップS108−Yes)、合焦位置推定部25は、その一致する部分の中点を推定された合焦位置として、制御部13のフォーカシング調整部26へ通知する。
On the other hand, if the predetermined period has elapsed (step S105-Yes), the individual focus range estimation unit 24 of the control unit 13 compares the blur index for each distance for each tracking information, so that the focus position is determined. A range including the included range and the in-focus range is estimated (step S106). And the focus position estimation part 25 of the control part 13 calculates | requires the focus position by calculating | requiring the part which overlap | superposes the range containing the focus position estimated for every tracking information, and the range containing the focus range. The estimated position is narrowed down (step S107). The in-focus position estimating unit 25 determines whether or not the maximum value of the in-focus position error calculated from the width of the matching part is within an allowable range (step S108). If the maximum value of the error is wider than the allowable range (step S108—No), the control unit 13 repeats the processing after step S101.
On the other hand, if the width of the matching portion is within the allowable range (step S108—Yes), the focus position estimation unit 25 sets the midpoint of the matching portion as the estimated focus position of the control unit 13. Notify the focusing adjustment unit 26.

フォーカシング調整部26は、所望の合焦位置から推定された合焦位置のずれ量が所定の閾値より大きいか否か判定する(ステップS109)。そのずれ量が閾値より大きければ(ステップS109−Yes)、フォーカシング調整部26は、推定された合焦位置と所望の合焦位置のずれ量を打ち消すフォーカシング調整量を含むフォーカシング信号を生成する(ステップS110)。そしてフォーカシング調整部26は、そのフォーカシング信号を、カメラインターフェース部11を介してカメラ2へ出力し、カメラ2に、推定された合焦位置と所望の合焦位置間のずれを補正するよう、合焦位置を修正させる。
ステップS110の後、あるいは、ステップS109にてずれ量が閾値以下のとき(ステップS109−No)、制御部13は、合焦位置検出処理を終了する。
The focusing adjustment unit 26 determines whether or not the shift amount of the focus position estimated from the desired focus position is larger than a predetermined threshold (step S109). If the deviation amount is larger than the threshold value (step S109-Yes), the focusing adjustment unit 26 generates a focusing signal including a focusing adjustment amount that cancels the deviation amount between the estimated in-focus position and the desired in-focus position (step S109). S110). Then, the focusing adjustment unit 26 outputs the focusing signal to the camera 2 via the camera interface unit 11, and causes the camera 2 to adjust the deviation between the estimated in-focus position and the desired in-focus position. Correct the focal position.
After step S110 or when the deviation amount is equal to or smaller than the threshold value in step S109 (step S109-No), the control unit 13 ends the focus position detection process.

以上に説明してきたように、この合焦位置検出装置は、同一の移動物体ごとに複数の位置で算出されたボケ指標を比較することで、大雑把ではあるが正確に合焦位置が含まれる範囲を推定できる。そしてこの合焦位置検出装置は、複数の移動物体のそれぞれについて求められた合焦位置が含まれる範囲を重ね合わせて、合焦位置が含まれる範囲を絞り込むので、精度よく合焦位置を推定できる。   As described above, this in-focus position detection device compares the blur indices calculated at a plurality of positions for the same moving object, so that the range in which the in-focus position is included roughly but accurately. Can be estimated. And this focus position detection apparatus can estimate the focus position with high accuracy by overlapping the ranges including the focus positions obtained for each of the plurality of moving objects and narrowing the range including the focus positions. .

なお、本発明は上記の実施形態に限定されるものではない。一つの変形例によれば、カメラ2は、Time of Flight方式のカメラでもよい。この場合には、カメラ2は、カメラ2により生成された画像の画素ごとに、カメラ2からその画素に写っている被写体までの距離を測定できる。そのため、制御部13は、検出対象となる移動物体が写っている領域に含まれる画素について、カメラ2からその画素に写っている移動物体までの距離の情報を取得して、移動物体の位置情報として利用してもよい。   In addition, this invention is not limited to said embodiment. According to one modification, the camera 2 may be a Time of Flight camera. In this case, the camera 2 can measure the distance from the camera 2 to the subject shown in the pixel for each pixel of the image generated by the camera 2. Therefore, the control unit 13 acquires information on the distance from the camera 2 to the moving object shown in the pixel for the pixel included in the region where the moving object to be detected is shown, and the position information of the moving object It may be used as

また、個別合焦範囲推定部24は、演算量の軽減のため、合焦位置が含まれる範囲及び合焦範囲が含まれる範囲の何れか一方のみを推定してもよい。この場合、合焦位置推定部25は、推定された方の範囲の中点を、合焦位置の推定位置とすればよい。   Further, the individual focus range estimation unit 24 may estimate only one of the range including the focus position and the range including the focus range in order to reduce the calculation amount. In this case, the focus position estimation unit 25 may use the estimated midpoint of the range as the estimated position of the focus position.

また、上記の実施形態または変形例による制御部の機能をコンピュータに実現させる命令を有するコンピュータプログラムは、磁気記録媒体、光記録媒体あるいは不揮発性の半導体メモリといった、記録媒体に記録された形で提供されてもよい。   A computer program having instructions for causing a computer to realize the functions of the control unit according to the above-described embodiment or modification is provided in a form recorded on a recording medium such as a magnetic recording medium, an optical recording medium, or a nonvolatile semiconductor memory. May be.

ここに挙げられた全ての例及び特定の用語は、読者が、本発明及び当該技術の促進に対する本発明者により寄与された概念を理解することを助ける、教示的な目的において意図されたものであり、本発明の優位性及び劣等性を示すことに関する、本明細書の如何なる例の構成、そのような特定の挙げられた例及び条件に限定しないように解釈されるべきものである。本発明の実施形態は詳細に説明されているが、本発明の精神及び範囲から外れることなく、様々な変更、置換及び修正をこれに加えることが可能であることを理解されたい。   All examples and specific terms listed herein are intended for instructional purposes to help the reader understand the concepts contributed by the inventor to the present invention and the promotion of the technology. It should be construed that it is not limited to the construction of any example herein, such specific examples and conditions, with respect to showing the superiority and inferiority of the present invention. Although embodiments of the present invention have been described in detail, it should be understood that various changes, substitutions and modifications can be made thereto without departing from the spirit and scope of the present invention.

1 合焦位置検出装置
2 カメラ(撮像部)
11 カメラインターフェース部
12 記憶部
13 制御部
21 検出部
22 トラッキング部
23 ボケ指標算出部
24 個別合焦範囲推定部
25 合焦位置推定部
26 フォーカシング調整部
1 In-focus position detector 2 Camera (imaging unit)
DESCRIPTION OF SYMBOLS 11 Camera interface part 12 Memory | storage part 13 Control part 21 Detection part 22 Tracking part 23 Blur parameter | index calculation part 24 Individual focus range estimation part 25 Focus position estimation part 26 Focusing adjustment part

Claims (10)

撮像部により生成された画像を取得する度に、該画像に写っている移動物体を検出する検出部と、
複数の前記画像にわたって前記移動物体を追跡することで、前記画像上での前記移動物体の位置の遷移を表す追跡情報を更新するトラッキング部と、
複数の前記追跡情報を記憶する記憶部と、
前記複数の追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置のボケ度合いを表す指標を算出するボケ指標算出部と、
前記複数の追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置における前記指標を比較し、該比較結果と前記画像上の各位置に対応する前記撮像部からの距離に応じて、前記撮像部の合焦位置が含まれる第1の範囲を推定する個別合焦範囲推定部と、
複数の前記追跡情報のそれぞれについて推定された前記第1の範囲が一致する第1の部分を求め、当該第1の部分内で前記合焦位置を推定する合焦位置推定部と、
を有する合焦位置検出装置。
A detection unit that detects a moving object reflected in the image each time an image generated by the imaging unit is acquired;
A tracking unit that tracks the moving object across a plurality of the images to update tracking information representing a transition of the position of the moving object on the image;
A storage unit for storing a plurality of the tracking information;
For each of the plurality of tracking information, a blur index calculation unit that calculates an index representing the degree of blur at each position of the moving object on the image indicated in the tracking information;
For each of the plurality of tracking information, the index at each position of the moving object on the image indicated in the tracking information is compared, and the comparison result and the imaging unit corresponding to each position on the image An individual focus range estimation unit that estimates a first range including a focus position of the imaging unit according to a distance from
A focus position estimation unit that obtains a first portion in which the first range estimated for each of the plurality of tracking information matches, and estimates the focus position within the first portion;
An in-focus position detecting device.
所望の合焦位置から前記推定された合焦位置までのずれ量を算出し、当該ずれ量が所定量よりも大きい場合に、当該ずれ量を打ち消すフォーカシングの調整量を求めるフォーカシング調整部と、
前記フォーカシングの調整量を前記撮像部へ出力するインターフェース部とをさらに有する、請求項1に記載の合焦位置検出装置。
A focusing adjustment unit that calculates a deviation amount from a desired in-focus position to the estimated in-focus position, and when the deviation amount is larger than a predetermined amount, obtains a focusing adjustment amount that cancels the deviation amount; and
The in-focus position detection apparatus according to claim 1, further comprising an interface unit that outputs the focusing adjustment amount to the imaging unit.
前記所定量は、前記撮像部により生成された画像から検出対象となる移動物体を検出する際の検出精度の条件を満たせる前記ずれ量の最大値である、請求項2に記載の合焦位置検出装置。   The in-focus position detection according to claim 2, wherein the predetermined amount is a maximum value of the shift amount that can satisfy a condition of detection accuracy when detecting a moving object to be detected from an image generated by the imaging unit. apparatus. 前記個別合焦範囲推定部は、前記追跡情報に含まれる、前記画像上の移動物体の位置に対応する前記撮像部から前記移動物体までの距離のうち、時間的に連続する二つの画像のそれぞれから得られた距離についての前記指標間の差の絶対値を求め、当該差の絶対値の最大値に対応する二つの距離の中点を境界とし、かつ、当該二つの距離のうちのボケ度合いが小さい方の前記指標の値に対応する距離を含むように、前記第1の範囲を設定する、請求項1〜3の何れか一項に記載の合焦位置検出装置。   The individual focus range estimation unit includes two images that are temporally continuous among the distances from the imaging unit to the moving object corresponding to the position of the moving object on the image, which are included in the tracking information. The absolute value of the difference between the indicators for the distance obtained from the above is obtained, the midpoint between the two distances corresponding to the maximum absolute value of the difference is the boundary, and the degree of blur of the two distances The in-focus position detection apparatus according to any one of claims 1 to 3, wherein the first range is set so as to include a distance corresponding to a value of the index with a smaller value. 前記個別合焦範囲推定部は、前記撮像部の焦点が合っている範囲である合焦範囲が、時間的に連続する二つの画像のそれぞれから得られた前記画像上の移動物体の位置に対応する前記撮像部から前記移動物体までの距離についての前記指標間の差の絶対値の最大値に対応する二つの距離のうち、ボケ度合いが大きい方の前記指標の値に対応する距離を境界とし、かつ、他方の距離を含む第2の範囲に含まれると判定する、請求項1〜4の何れか一項に記載の合焦位置検出装置。   The individual focus range estimation unit corresponds to the position of a moving object on the image obtained from each of two temporally continuous images, where the focus range is a range where the imaging unit is in focus. Of the two distances corresponding to the maximum absolute value of the difference between the indices regarding the distance from the imaging unit to the moving object, the distance corresponding to the index value with the larger degree of blur is used as a boundary. And the focus position detection apparatus as described in any one of Claims 1-4 determined to be contained in the 2nd range containing the other distance. 前記合焦位置推定部は、複数の前記追跡情報のそれぞれについて推定された前記第2の範囲が一致する第2の部分を求め、当該第2の部分内に前記合焦範囲が含まれると推定する、請求項5に記載の合焦位置検出装置。   The in-focus position estimating unit obtains a second portion in which the second range estimated for each of the plurality of tracking information matches, and estimates that the in-focus range is included in the second portion. The in-focus position detection device according to claim 5. 前記合焦位置推定部は、前記第1の部分の幅の半分を前記合焦位置の誤差の最大値とし、当該最大値が所定の閾値よりも大きい場合、当該第1の部分の決定後の所定期間内に取得された複数の画像から検出された移動物体について生成された追加の追跡情報を利用して、再度前記第1の部分を求める、請求項1〜3の何れか一項に記載の合焦位置検出装置。   The in-focus position estimating unit sets the half of the width of the first part as the maximum value of the error in the in-focus position, and when the maximum value is larger than a predetermined threshold, The said 1st part is calculated | required again using the additional tracking information produced | generated about the moving object detected from the several image acquired within the predetermined period. In-focus position detection device. 前記合焦位置推定部は、前記第1の部分の幅の半分と、前記第2の部分の幅と前記合焦範囲の差の半分とのうちの小さい方を、前記合焦位置の誤差の最大値とし、当該最大値が所定の閾値よりも大きい場合、当該第1及び第2の部分の決定後の所定期間内に取得された複数の画像から検出された移動物体について生成された追加の追跡情報を利用して、再度前記第1及び第2の部分を求める、請求項6に記載の合焦位置検出装置。   The in-focus position estimation unit calculates a smaller one of the half of the width of the first part and the half of the difference between the width of the second part and the in-focus range as the error of the in-focus position. If the maximum value is greater than a predetermined threshold, the additional value generated for the moving object detected from the plurality of images acquired within the predetermined period after the determination of the first and second portions The in-focus position detection apparatus according to claim 6, wherein the first and second portions are obtained again using tracking information. 撮像部により生成された画像を取得する度に、該画像に写っている移動物体を検出し、
複数の前記画像にわたって前記移動物体を追跡することで、前記画像上での前記移動物体の位置の遷移を表す追跡情報を更新して記憶部に記憶し、
前記記憶部に記憶された複数の前記追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置のボケ度合いを表す指標を算出し、
前記記憶部に記憶された複数の前記追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置における前記指標を比較し、該比較結果と前記画像上の各位置に対応する前記撮像部からの距離に応じて、前記撮像部の合焦位置が含まれる第1の範囲を推定し、
複数の前記追跡情報のそれぞれについて推定された前記第1の範囲が一致する第1の部分を求め、当該第1の部分内で前記合焦位置を推定する、
ことを含む合焦位置検出方法。
Each time an image generated by the imaging unit is acquired, a moving object reflected in the image is detected,
By tracking the moving object across a plurality of the images, the tracking information representing the transition of the position of the moving object on the image is updated and stored in the storage unit,
For each of the plurality of tracking information stored in the storage unit, calculate an index representing the degree of blur of each position of the moving object on the image indicated in the tracking information,
For each of the plurality of tracking information stored in the storage unit, the index at each position of the moving object on the image indicated in the tracking information is compared, and the comparison result and each on the image Estimating a first range including a focus position of the imaging unit according to a distance from the imaging unit corresponding to the position;
Obtaining a first portion in which the first range estimated for each of the plurality of tracking information matches, and estimating the in-focus position within the first portion;
In-focus position detection method.
撮像部により生成された画像を取得する度に、該画像に写っている移動物体を検出し、
複数の前記画像にわたって前記移動物体を追跡することで、前記画像上での前記移動物体の位置の遷移を表す追跡情報を更新して記憶部に記憶し、
前記記憶部に記憶された複数の前記追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置のボケ度合いを表す指標を算出し、
前記記憶部に記憶された複数の前記追跡情報のそれぞれについて、当該追跡情報に示された前記画像上での前記移動物体の各位置における前記指標を比較し、該比較結果と前記画像上の各位置に対応する前記撮像部からの距離に応じて、前記撮像部の合焦位置が含まれる第1の範囲を推定し、
複数の前記追跡情報のそれぞれについて推定された前記第1の範囲が一致する第1の部分を求め、当該第1の部分内で前記合焦位置を推定する、
ことをコンピュータに実行させるための合焦位置検出用コンピュータプログラム。
Each time an image generated by the imaging unit is acquired, a moving object reflected in the image is detected,
By tracking the moving object across a plurality of the images, the tracking information representing the transition of the position of the moving object on the image is updated and stored in the storage unit,
For each of the plurality of tracking information stored in the storage unit, calculate an index representing the degree of blur of each position of the moving object on the image indicated in the tracking information,
For each of the plurality of tracking information stored in the storage unit, the index at each position of the moving object on the image indicated in the tracking information is compared, and the comparison result and each on the image Estimating a first range including a focus position of the imaging unit according to a distance from the imaging unit corresponding to the position;
Obtaining a first portion in which the first range estimated for each of the plurality of tracking information matches, and estimating the in-focus position within the first portion;
A computer program for in-focus position detection for causing a computer to execute this.
JP2013056167A 2013-03-19 2013-03-19 Focus position detection device, focus position detection method, and computer program for focus position detection Expired - Fee Related JP5979046B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013056167A JP5979046B2 (en) 2013-03-19 2013-03-19 Focus position detection device, focus position detection method, and computer program for focus position detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013056167A JP5979046B2 (en) 2013-03-19 2013-03-19 Focus position detection device, focus position detection method, and computer program for focus position detection

Publications (2)

Publication Number Publication Date
JP2014182248A JP2014182248A (en) 2014-09-29
JP5979046B2 true JP5979046B2 (en) 2016-08-24

Family

ID=51701015

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013056167A Expired - Fee Related JP5979046B2 (en) 2013-03-19 2013-03-19 Focus position detection device, focus position detection method, and computer program for focus position detection

Country Status (1)

Country Link
JP (1) JP5979046B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6201798B2 (en) * 2014-02-12 2017-09-27 富士通株式会社 System, information processing apparatus, information processing method, and information processing program
US11935307B2 (en) * 2018-03-12 2024-03-19 Hitachi Automotive Systems, Ltd. Vehicle control apparatus
JP2019161462A (en) * 2018-03-13 2019-09-19 キヤノン株式会社 Control device, image processing system, control method, and program
JP6828719B2 (en) 2018-06-27 2021-02-10 トヨタ自動車株式会社 In-vehicle device and control method
JP7297515B2 (en) * 2019-04-25 2023-06-26 キヤノン株式会社 Information processing device, information processing method and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4279790B2 (en) * 2005-02-24 2009-06-17 株式会社日立製作所 Car number recognition device
JP5664078B2 (en) * 2010-09-27 2015-02-04 富士通株式会社 Imaging apparatus, image evaluation method, and focus adjustment control program

Also Published As

Publication number Publication date
JP2014182248A (en) 2014-09-29

Similar Documents

Publication Publication Date Title
US7929042B2 (en) Imaging apparatus, control method of imaging apparatus, and computer program
JP5979046B2 (en) Focus position detection device, focus position detection method, and computer program for focus position detection
US8687896B2 (en) Picture image processor, method for processing picture image and method for processing picture image
US10659676B2 (en) Method and apparatus for tracking a moving subject image based on reliability of the tracking state
JP4930046B2 (en) Road surface discrimination method and road surface discrimination device
JP5789091B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
KR20170056698A (en) Autofocus method, device and electronic apparatus
TWI471677B (en) Auto focus method and auto focus apparatus
CN105629628A (en) Automatic focusing method and device
CN107111764B (en) Events triggered by the depth of an object in the field of view of an imaging device
JP5834933B2 (en) Vehicle position calculation device
CN113572958B (en) Method and equipment for automatically triggering camera to focus
JP2007232389A (en) Three-dimensional shape detection apparatus
US20210192250A1 (en) Object recognition device
JP2011033594A (en) Distance calculation device for vehicle
JP6833483B2 (en) Subject tracking device, its control method, control program, and imaging device
JP6701905B2 (en) Detection device, parallax value derivation device, object recognition device, device control system, and program
US8179471B2 (en) Focusing device and image pickup apparatus
JP2015207090A (en) Image processor, and control method thereof
JP2010286995A (en) Image processing system for vehicle
JP4996568B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP2021096638A (en) Camera system
JP2006012013A (en) Mobile object tracking device
JP6459745B2 (en) Self-position calculation device and self-position calculation method
JP2021047073A (en) Subject position calculation device, imaging apparatus, subject position calculation method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151007

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160616

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160711

R150 Certificate of patent or registration of utility model

Ref document number: 5979046

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees