JP4725105B2 - Image processing apparatus and method, program, and recording medium - Google Patents

Image processing apparatus and method, program, and recording medium Download PDF

Info

Publication number
JP4725105B2
JP4725105B2 JP2005000621A JP2005000621A JP4725105B2 JP 4725105 B2 JP4725105 B2 JP 4725105B2 JP 2005000621 A JP2005000621 A JP 2005000621A JP 2005000621 A JP2005000621 A JP 2005000621A JP 4725105 B2 JP4725105 B2 JP 4725105B2
Authority
JP
Japan
Prior art keywords
image
unit
tracking
correction
feature
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
JP2005000621A
Other languages
Japanese (ja)
Other versions
JP2005303983A (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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2005000621A priority Critical patent/JP4725105B2/en
Publication of JP2005303983A publication Critical patent/JP2005303983A/en
Application granted granted Critical
Publication of JP4725105B2 publication Critical patent/JP4725105B2/en
Expired - Fee Related 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 and method, a program, and a recording medium, and in particular, makes it possible to easily display an object that moves in an image and to ensure a desired point in a moving image that changes from moment to moment. The present invention relates to an image processing apparatus and method, a program, and a recording medium that can be tracked.

ホームセキュリティシステムでは、撮像装置から送信される監視画像がモニタTV(Television)に表示される。このようなシステムにおいて、マイクロ波センサと画像センサを組み合わせて監視装置を構成し、侵入者の監視の精度を向上させる方法が提案されている(例えば、特許文献1参照)。   In the home security system, a monitoring image transmitted from the imaging device is displayed on a monitor TV (Television). In such a system, a method has been proposed in which a monitoring device is configured by combining a microwave sensor and an image sensor to improve the accuracy of intruder monitoring (see, for example, Patent Document 1).

また、動画像として表示される画像の中で、移動する(動く)物体を追尾対象とし、その追尾点を、自動的に追尾して画像を表示する方法も提案されている(例えば、特許文献2参照)。   In addition, a method has been proposed in which a moving (moving) object is a tracking target in an image displayed as a moving image, and the tracking point is automatically tracked to display an image (for example, Patent Documents). 2).

また、特許文献3には、追尾対象に関する領域の推定を行い、領域の動きの推定結果に基づいて、領域を追尾することが提案されている。
特開平11−161860号公報 特開平6−143235号公報 特開平5−304065号公報
Japanese Patent Application Laid-Open No. 2004-228620 proposes that a region related to a tracking target is estimated and the region is tracked based on a region motion estimation result.
Japanese Patent Laid-Open No. 11-161860 JP-A-6-143235 JP-A-5-304065

しかしながら、従来の技術では、例えば、不正な侵入者など、画像の中で動く物体(オブジェクト)を検知して、追尾しても、ユーザに対して表示される画像の中で、どの部分が、注目すべきオブジェクトであるのかを明確に表示することができず、その結果、ユーザが注目すべきオブジェクトを発見するのに時間がかかるおそれがあるという課題があった。   However, in the conventional technology, even if an object (object) that moves in an image, such as an unauthorized intruder, is detected and tracked, which part of the image displayed to the user is There is a problem in that it is not possible to clearly display whether the object is a notable object, and as a result, it may take time for the user to find the notable object.

また、特許文献2に記載の技術においては、1つの動きベクトルを用いて追尾を行うようにしているため、比較的ロバスト性に欠ける課題があった。また、追尾対象を含む画像が回転するなどして、追尾対象がユーザから見て見えなくなるような状態になった場合、その後、追尾点が再び見える状態になったとしても、その追尾点をもはや追尾することができなくなる課題があった。   Moreover, in the technique described in Patent Document 2, since tracking is performed using one motion vector, there is a problem of relatively lacking robustness. In addition, when the image including the tracking target is rotated so that the tracking target becomes invisible to the user, even if the tracking point becomes visible again, the tracking point is no longer displayed. There was a problem that could not be tracked.

特許文献3の技術においては、領域が利用される。その結果、ロバスト性が向上する。しかしながら、ロバスト性を向上させるために領域を広くしすぎると、例えば、ホームビデオで撮影した画像の中の子供の顔を追尾してズーム表示したいというような場合に、面積の広い子供の胴体を追尾してズーム表示してしまうという症状が生じる課題があった。   In the technique of Patent Document 3, a region is used. As a result, robustness is improved. However, if the area is too wide to improve robustness, for example, if you want to zoom and display the child's face in the image taken with the home video, There was a problem that a symptom of tracking and zoom display occurred.

また、いずれの技術においても、追尾対象が他の物体により一時的に隠れてしまうオクルージョンが発生したり、あるいはシーンチェンジなどにより追尾対象が一時的に表示されなくなるような場合、ロバストな追尾を行うことが困難である課題があった。   In any technique, robust tracking is performed when the tracking target is temporarily occluded by another object or when the tracking target is temporarily not displayed due to a scene change or the like. There was a problem that was difficult to do.

本発明はこのような状況に鑑みてなされたものであり、画像の中で移動するオブジェクトを発見しやすく表示できるようにするものである。また、物体が回転したり、オクルージョンが発生したり、シーンチェンジが発生したような場合においても、追尾点を確実に追尾することができるようにするものである。   The present invention has been made in view of such a situation, and makes it possible to easily display a moving object in an image and display it. In addition, the tracking point can be reliably tracked even when an object rotates, occlusion occurs, or a scene change occurs.

本発明画像処理装置は、移動するオブジェクトを明確に表示する画像処理装置であって、画像の中の移動するオブジェクトの特徴点を検出する特徴点検出手段と、特徴点検出手段により検出された特徴点に基づいて、画像の中のオブジェクトの移動を追尾する追尾手段と、追尾手段による追尾結果に基づいて、画像の中のオブジェクトの周囲に予め設定された大きさの補正領域を設定する補正領域設定手段と、画像の中の補正領域内の画像を補正する補正手段と、補正領域内が補正手段により補正された画像の表示を制御する表示制御手段とを備える。また、前記補正手段は、前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給手段と、前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出手段と、前記画像のぼけの度合いを表すパラメータと、前記特徴検出手段により出力された特徴コードに対応する係数を記憶する記憶手段と、前記記憶手段から、前記パラメータと前記特徴検出手段により出力された前記特徴コードに対応する係数を読み出す読み出し手段と、前記読み出し手段により読み出された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算手段と、前記積和演算手段による演算結果と前記入力画像の画素の値を選択して出力する選択出力手段とを備え、前記補正領域内の画像のぼけを除去するように補正する。 An image processing apparatus according to the present invention is an image processing apparatus that clearly displays a moving object, and is detected by a feature point detecting unit that detects a feature point of the moving object in the image, and the feature point detecting unit. A tracking unit that tracks the movement of an object in the image based on the feature points, and a correction that sets a correction area of a preset size around the object in the image based on the tracking result by the tracking unit An area setting unit, a correction unit that corrects an image in a correction area in the image, and a display control unit that controls display of an image in which the correction area is corrected by the correction unit . The correction means includes a control signal for specifying an image in the correction area, a supply means for supplying a parameter indicating a degree of blur of the image, and an image in the correction area specified based on the control signal. A feature detection unit that detects a feature and outputs a feature code representing the detected feature; a memory that stores a parameter that represents the degree of blur of the image; and a coefficient that corresponds to the feature code output by the feature detection unit Means for reading out the parameter and the coefficient corresponding to the feature code output by the feature detection means from the storage means, and the pixel of the input image based on the coefficient read by the readout means A product-sum operation means for performing a product-sum operation on the value, and a selection output for selecting and outputting the operation result by the product-sum operation means and the pixel value of the input image. And means to correct so as to eliminate image blurring in the correction area.

前記特徴検出手段は、入力画像の中から、積和演算を行う画素の周囲の、予め設定された第1の領域に含まれる複数の画素を抽出する第1の抽出手段と、第1の領域と、垂直または水平の複数の方向に連続した、複数の第2の領域に含まれる複数の画素を抽出する第2の抽出手段と、第1の抽出手段により抽出された画素と、第2の抽出手段により抽出された画素において、対応する画素の値の差分の絶対値の総和を求めて、複数のブロック差分を演算するブロック差分演算手段と、ブロック差分が、予め設定された閾値より大きいか否かを判定する差分判定手段とを備えるようにすることができる。   The feature detection means includes: a first extraction means for extracting a plurality of pixels included in a preset first area around a pixel on which a product-sum operation is performed; A second extraction means for extracting a plurality of pixels included in a plurality of second regions, which are continuous in a plurality of vertical or horizontal directions, a pixel extracted by the first extraction means, a second In the pixel extracted by the extraction unit, a block difference calculation unit for calculating a plurality of block differences by calculating a sum of absolute values of corresponding pixel values, and whether the block difference is larger than a preset threshold value. Difference determining means for determining whether or not there may be provided.

前記パラメータは、ぼけた画像の画素とぼけていない画像の画素の関係を表すモデル式におけるガウス関数のパラメータであるようにすることができる。   The parameter may be a parameter of a Gaussian function in a model expression representing a relationship between pixels of a blurred image and pixels of a non-blurred image.

前記記憶手段により記憶される係数は、モデル式の逆行列を演算することにより求められた係数であるようにすることができる。   The coefficient stored by the storage means can be a coefficient obtained by calculating an inverse matrix of a model formula.

前記選択出力手段は、積和演算手段により積和演算が行われた複数の画素を抽出する第1の抽出手段と、第1の抽出手段により抽出された複数の画素の分散の度合いを表す分散度を演算する分散演算手段と、分散演算手段により演算された分散度が予め設定された閾値より大きいか否かを判定する分散判定手段とを備えるようにすることができる。   The selection output unit includes a first extraction unit that extracts a plurality of pixels that have been subjected to the product-sum operation by the product-sum operation unit, and a variance that represents a degree of dispersion of the plurality of pixels extracted by the first extraction unit. Dispersion calculating means for calculating the degree and dispersion determining means for determining whether or not the degree of dispersion calculated by the dispersion calculating means is greater than a preset threshold value can be provided.

前記選択出力手段は、分散判定手段の判定結果に基づいて、出力する画素の値を、積和演算手段による演算結果、または入力画像の画素の値のいずれかから選択する画素選択手段をさらに備えるようにすることができる。   The selection output unit further includes a pixel selection unit that selects, based on the determination result of the dispersion determination unit, a pixel value to be output from either a calculation result of the product-sum calculation unit or a pixel value of the input image. Can be.

本発明画像処理方法は、画像の中で、移動するオブジェクトを明確に表示する画像処理装置の画像処理方法であって、画像の中の移動するオブジェクトの特徴点を検出する特徴点検出ステップと、特徴点検出ステップの処理により検出された特徴点に基づいて、画像のオブジェクトの移動を追尾する追尾ステップと、追尾ステップの処理による追尾結果に基づいて、画像の中にオブジェクトの周囲に予め設定された大きさの補正領域を設定する補正領域設定ステップと、画像の中の補正領域内の画像を補正する補正ステップと、補正領域内が補正ステップの処理により補正された画像の表示を制御する表示制御ステップとを含む。また前記補正ステップは、前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給ステップと、前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出ステップと、前記画像のぼけの度合いを表すパラメータと、前記特徴検出ステップの処理により出力された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出ステップの処理により出力された前記特徴コードに対応する係数を読み出す読み出しステップと、前記読み出しステップの処理により読み出された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算ステップと、前記積和演算ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力ステップとを含み、前記補正領域内の画像のぼけを除去するように補正する。 An image processing method of the present invention is an image processing method of an image processing apparatus that clearly displays a moving object in an image, and a feature point detecting step for detecting a feature point of the moving object in the image; Based on the feature points detected by the feature point detection step, a tracking step for tracking the movement of the object in the image, and the surroundings of the object in the image based on the tracking result of the tracking step processing A correction area setting step for setting a correction area of a specified size, a correction step for correcting an image in the correction area in the image, and a display of an image in which the correction area is corrected by the correction step process Display control step . The correction step includes a control signal for specifying an image in the correction area, a supply step for supplying a parameter indicating a degree of blur of the image, and a feature of the image in the correction area specified based on the control signal. And a feature detection step for outputting a feature code representing the detected feature, a parameter representing a degree of blur of the image, and a coefficient corresponding to the feature code output by the processing of the feature detection step. A storage control step for controlling, a reading step for reading out the coefficient corresponding to the feature code output by the processing of the parameter and the feature detection step, the storage of which is controlled by the processing of the storage control step, and the reading step A product-sum operation that performs a product-sum operation on the pixel values of the input image based on the coefficients read by the processing A calculation step, and a selection output step of selecting and outputting a calculation result obtained by the processing of the product-sum calculation step and a pixel value of the input image, and correcting so as to remove the blur of the image in the correction region .

本発明プログラムは、画像の中で、移動するオブジェクトを明確に表示する画像処理装置のプログラムであって、画像の中の移動するオブジェクトの特徴点の検出を制御する特徴点検出制御ステップと、特徴点検出制御ステップの処理により検出された特徴点に基づいて、画像のオブジェクトの移動を追尾するように制御する追尾制御ステップと、追尾制御ステップの処理による追尾結果に基づいて、画像の中にオブジェクトの周囲に予め設定された大きさの補正領域を設定するように制御する補正領域設定制御ステップと、画像の中の補正領域内の画像の補正を制御する補正制御ステップと、補正領域内が補正制御ステップの処理により補正された画像の表示を制御する表示制御ステップとをコンピュータに実行させる。また、前記補正制御ステップは、前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給制御ステップと、前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出制御ステップと、前記画像のぼけの度合いを表すパラメータと、前記特徴検出制御ステップの処理により出力が制御された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出制御ステップの処理により出力が制御された前記特徴コードに対応する係数を読み出す読み出し制御ステップと、前記読み出し制御ステップの処理により読み出しが制御された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算制御ステップと、前記積和演算制御ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力制御ステップとを含み、前記補正領域内の画像のぼけを除去するように補正する。 The program of the present invention is a program for an image processing apparatus that clearly displays a moving object in an image, and a feature point detection control step for controlling detection of a feature point of the moving object in the image; Based on the feature points detected by the process of the feature point detection control step, a tracking control step for controlling the movement of the object of the image is tracked, and the tracking result by the process of the tracking control step is included in the image. A correction area setting control step for controlling to set a correction area having a predetermined size around the object, a correction control step for controlling correction of an image in the correction area in the image, and a correction area. Causing the computer to execute a display control step for controlling the display of the image corrected by the processing of the correction control step . The correction control step includes a control signal for specifying an image in the correction area, a supply control step for supplying a parameter indicating a degree of blur of the image, and a correction signal in the correction area specified based on the control signal. A feature detection control step for detecting a feature of an image and outputting a feature code representing the detected feature, a parameter representing a degree of blur of the image, and a feature code whose output is controlled by the processing of the feature detection control step And a coefficient corresponding to the feature code whose output is controlled by the process of the parameter and the feature detection control step. Based on the read control step for reading out and the coefficient for which the read is controlled by the processing of the read control step. A product-sum operation control step for performing a product-sum operation on the pixel value of the input image, and a selection output for selecting and outputting the operation result by the processing of the product-sum operation control step and the pixel value of the input image And a control step for correcting so as to remove the blur of the image in the correction area.

本発明記録媒体は、画像の中で、移動するオブジェクトを明確に表示する画像処理装置のプログラムが記録される記録媒体であって、画像の中の移動するオブジェクトの特徴点の検出を制御する特徴点検出制御ステップと、特徴点検出制御ステップの処理により検出された特徴点に基づいて、画像のオブジェクトの移動を追尾するように制御する追尾制御ステップと、追尾制御ステップの処理による追尾結果に基づいて、画像の中にオブジェクトの周囲に予め設定された大きさの補正領域を設定するように制御する補正領域設定制御ステップと、画像の中の補正領域内の画像の補正を制御する補正制御ステップと、補正領域内が前記補正制御ステップの処理により補正された画像の表示を制御する表示制御ステップとをコンピュータに実行させるプログラムが記録されている。また、前記補正制御ステップは、前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給制御ステップと、前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出制御ステップと、前記画像のぼけの度合いを表すパラメータと、前記特徴検出制御ステップの処理により出力が制御された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出制御ステップの処理により出力が制御された前記特徴コードに対応する係数を読み出す読み出し制御ステップと、前記読み出し制御ステップの処理により読み出しが制御された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算制御ステップと、前記積和演算制御ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力制御ステップとを含み、前記補正領域内の画像のぼけを除去するように補正する。 The recording medium of the present invention is a recording medium on which a program of an image processing apparatus that clearly displays a moving object in an image is recorded, and controls the detection of feature points of the moving object in the image. Based on the feature point detection control step, the tracking control step for controlling the movement of the object of the image based on the feature point detected by the processing of the feature point detection control step, and the tracking result by the processing of the tracking control step And a correction area setting control step for controlling to set a correction area having a predetermined size around the object in the image, and a correction control for controlling correction of the image in the correction area in the image. And a display control step for controlling display of an image in which the correction area is corrected by the processing of the correction control step. Program that has been recorded. The correction control step includes a control signal for specifying an image in the correction area, a supply control step for supplying a parameter indicating a degree of blur of the image, and a correction signal in the correction area specified based on the control signal. A feature detection control step for detecting a feature of an image and outputting a feature code representing the detected feature, a parameter representing a degree of blur of the image, and a feature code whose output is controlled by the processing of the feature detection control step And a coefficient corresponding to the feature code whose output is controlled by the process of the parameter and the feature detection control step. Based on the read control step for reading out and the coefficient for which the read is controlled by the processing of the read control step. A product-sum operation control step for performing a product-sum operation on the pixel value of the input image, and a selection output for selecting and outputting the operation result by the processing of the product-sum operation control step and the pixel value of the input image And a control step for correcting so as to remove the blur of the image in the correction area.

本発明においては、画像の中の移動するオブジェクトの特徴点が検出され、検出された特徴点に基づいて、画像のオブジェクトの移動が追尾され、その追尾結果に基づいて、画像の中にオブジェクトの周囲に予め設定された大きさの補正領域が設定され、画像の中の補正領域内の画像が補正され、補正領域内が補正された画像の表示が制御される。また補正は、補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータが供給され、制御信号に基づいて特定された補正領域内の画像の特徴が検出され、検出された特徴が表す特徴コードが出力され、画像のぼけの度合いを表すパラメータと、特徴コードに対応する係数が記憶され、パラメータと特徴コードに対応する係数が読み出され、読み出された係数に基づいて、入力画像の画素の値に対して積和演算が行われ、演算結果と入力画像の画素の値が選択されて出力され、補正領域内の画像のぼけが除去されるように補正される。 In the present invention, the feature point of the moving object in the image is detected, the movement of the object of the image is tracked based on the detected feature point, and based on the tracking result, the feature point of the object is detected. A correction area having a preset size is set in the periphery, the image in the correction area in the image is corrected, and display of the image in which the correction area is corrected is controlled. For correction, a control signal for specifying an image in the correction area and a parameter indicating the degree of blur of the image are supplied, and the feature of the image in the correction area specified based on the control signal is detected, and the detected feature is detected. Is output, a parameter representing the degree of blur of the image and a coefficient corresponding to the feature code are stored, a parameter and a coefficient corresponding to the feature code are read, and based on the read coefficient, A product-sum operation is performed on the pixel value of the input image, and the calculation result and the pixel value of the input image are selected and output, and the image is corrected so as to eliminate blur in the correction region.

本発明によれば、注目すべきオブジェクトを発見しやすくすることができる。特に、画像の中で移動するオブジェクトを発見しやすく表示することができる。   According to the present invention, it is possible to easily find a noticeable object. In particular, it is possible to easily display an object that moves in an image.

本発明によれば、画像上の追尾点を追尾することが可能となる。特に、追尾におけるロバスト性を向上させることができる。その結果、対象物が回転して追尾点が一時的に見えなくなったり、オクルージョンやシーンチェンジが発生した場合などにおいても、追尾点を確実に追尾することが可能となる。   According to the present invention, it is possible to track a tracking point on an image. In particular, robustness in tracking can be improved. As a result, the tracking point can be reliably tracked even when the object rotates and the tracking point becomes temporarily invisible or an occlusion or a scene change occurs.

以下、図面を参照して、本発明の実施の形態について説明する。図1は、本発明を監視カメラシステムに適用した場合の構成例を表している。この監視カメラシステム1においては、CCDビデオカメラ等よりなる撮像部21により撮像された画像が画像ディスプレイ23に表示される。追尾対象検出部24は、撮像部21より入力された画像から追尾対象を検出し、検出結果をオブジェクト追尾部26に出力する。   Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a configuration example when the present invention is applied to a surveillance camera system. In the surveillance camera system 1, an image captured by the imaging unit 21 including a CCD video camera is displayed on the image display 23. The tracking target detection unit 24 detects the tracking target from the image input from the imaging unit 21 and outputs the detection result to the object tracking unit 26.

オブジェクト追尾部26は、撮像部21より供給された画像中の、追尾対象検出部24により指定された追尾点を追尾するように動作する。エリア設定部25は、オブジェクト追尾部26からの出力結果に基づいて、撮像部21により撮像された画像の中から、追尾点を含むオブジェクトの周辺の所定の領域(エリア)を設定し、その領域を指定する位置情報を画像補正部22に出力する。画像補正部22は、撮像部21により撮像された画像の中のエリア設定部25により設定された領域について、画像のぼけ(フォーカスぼけ)を除去する補正を行い、画像ディスプレイ23に出力する。カメラ駆動部27は、オブジェクト追尾部26からの制御に基づいて、撮像部21が追尾点を中心とする画像を撮影するように撮像部21を駆動する。   The object tracking unit 26 operates to track the tracking point specified by the tracking target detection unit 24 in the image supplied from the imaging unit 21. Based on the output result from the object tracking unit 26, the area setting unit 25 sets a predetermined area (area) around the object including the tracking point from the image captured by the imaging unit 21, and the area. Is output to the image correction unit 22. The image correction unit 22 performs correction to remove image blur (focus blur) on the area set by the area setting unit 25 in the image captured by the imaging unit 21 and outputs the corrected image to the image display 23. Based on the control from the object tracking unit 26, the camera driving unit 27 drives the imaging unit 21 so that the imaging unit 21 captures an image centered on the tracking point.

制御部27は、例えば、マイクロコンピュータなどにより構成され、各部を制御する。制御部27には、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスクなどにより構成されるリムーバブルメディア28が必要に応じて接続され、プログラム、その他各種のデータが必要に応じて供給される。制御部27は、また、図示せぬ入出力インタフェースを介して、ユーザからの指示(コマンドなど)の入力を受け付ける。   The control unit 27 is configured by, for example, a microcomputer and controls each unit. The control unit 27 is connected to a removable medium 28 composed of a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, or the like as necessary, and a program and other various data are supplied as necessary. The control unit 27 also accepts input of instructions (commands, etc.) from the user via an input / output interface (not shown).

次に、図2のフローチャートを参照して、監視処理の動作について説明する。監視システム1の電源がオンされているとき、撮像部21は監視する領域を撮像し、その撮像して得られた画像を追尾対象検出部24、オブジェクト追尾部26、および画像補正部22を介して画像ディスプレイ23に出力する。追尾対象検出部24は、ステップS1において、撮像部21から入力された画像から追尾対象を検出する処理を実行する。追尾対象検出部24は、例えば、動く物体が検出された場合、その動く物体を追尾対象として検出する。追尾対象検出部24は、追尾対象の中から、例えば、最も輝度の高い点、あるいは追尾対象の中心の点などを追尾点として検出し、オブジェクト追尾部26に出力する。   Next, the operation of the monitoring process will be described with reference to the flowchart of FIG. When the power of the monitoring system 1 is turned on, the imaging unit 21 captures an area to be monitored, and an image obtained by capturing the image via the tracking target detection unit 24, the object tracking unit 26, and the image correction unit 22. To the image display 23. The tracking target detection unit 24 executes processing for detecting a tracking target from the image input from the imaging unit 21 in step S1. For example, when a moving object is detected, the tracking target detection unit 24 detects the moving object as a tracking target. The tracking target detection unit 24 detects, for example, the point with the highest luminance or the center point of the tracking target from the tracking targets, and outputs it to the object tracking unit 26.

ステップS2において、オブジェクト追尾部26は、ステップS1で検出された追尾点を追尾する追尾処理を実行する。追尾処理の詳細については、図6を参照して後述するが、この処理により、撮像部21により撮像された画像の中の追尾対象となるオブジェクト(例えば、人、動物など)の中の追尾点(例えば、目、頭の中心)が追尾され、その追尾位置を表す位置情報がエリア設定部25に出力される。   In step S2, the object tracking unit 26 executes a tracking process for tracking the tracking point detected in step S1. The details of the tracking process will be described later with reference to FIG. 6. With this process, a tracking point in an object (for example, a person, an animal, or the like) to be tracked in an image captured by the imaging unit 21 is obtained. (For example, the center of the eyes and the head) is tracked, and position information indicating the tracking position is output to the area setting unit 25.

ステップS3において、エリア設定部25は、オブジェクト追尾部26からの出力に基づいて、追尾対象のオブジェクトの周辺の所定の領域(例えば、追尾点を中心として、所定の大きさの四角形で表される領域)を補正対象エリアとして設定する。   In step S <b> 3, the area setting unit 25 is represented by a predetermined area around the object to be tracked (for example, a square having a predetermined size centered on the tracking point) based on the output from the object tracking unit 26. Area) is set as the correction target area.

ステップS4において、画像補正部22は、撮像部21により撮像された画像の中で、エリア設定部25により設定された補正対象エリア内の画像を補正する画像補正処理を実行する。画像補正処理の詳細については、図65を参照して後述するが、この処理により、補正対象エリア内の画像について、画像のぼけが除去された鮮明な映像が提供される。   In step S <b> 4, the image correction unit 22 executes image correction processing for correcting an image in the correction target area set by the area setting unit 25 among the images captured by the imaging unit 21. Details of the image correction process will be described later with reference to FIG. 65, but this process provides a clear video from which the blur of the image has been removed for the image in the correction target area.

ステップS5において、画像ディスプレイ23は、ステップS4で補正された画像、すなわち、撮像部21により撮像された画像であって、特に、補正対象エリア内のみが鮮明になるように補正された画像を出力する。   In step S5, the image display 23 outputs the image corrected in step S4, that is, the image captured by the imaging unit 21, and particularly corrected so that only the correction target area is clear. To do.

ステップS6において、オブジェクト追尾部26は、ステップS2の処理による追尾結果に基づいて、オブジェクトの移動を検出し、移動したオブジェクトを撮像できるようにカメラを駆動させるカメラ駆動信号を生成し、カメラ駆動部27に出力する。ステップS7において、カメラ駆動部27はカメラ駆動信号に基づいて撮像部21を駆動する。これにより撮像部21は、追尾点が画面のから外れてしまうことがないようにカメラをパンまたはチルトする。   In step S6, the object tracking unit 26 detects the movement of the object based on the tracking result of the process in step S2, generates a camera driving signal for driving the camera so that the moved object can be imaged, and the camera driving unit. 27. In step S7, the camera drive unit 27 drives the imaging unit 21 based on the camera drive signal. Thereby, the imaging unit 21 pans or tilts the camera so that the tracking point does not deviate from the screen.

ステップS8において、制御部27は、ユーザからの指示に基づいて監視処理を終了するか否かを判定し、ユーザから終了が指示されていない場合には、ステップS1に戻り、それ以降の処理を繰り返し実行する。ユーザから監視処理の終了が指示された場合、ステップS8において終了すると判定され、制御部27は監視処理を終了する。   In step S8, the control unit 27 determines whether or not to end the monitoring process based on an instruction from the user. If the end is not instructed by the user, the control unit 27 returns to step S1 and performs the subsequent processes. Run repeatedly. When the end of the monitoring process is instructed by the user, it is determined to end in step S8, and the control unit 27 ends the monitoring process.

図3A乃至図3Cは、このとき画像ディスプレイ23に表示される画像の例を、時系列に示した図である。図3Aは、撮像部21により、追尾対象となるオブジェクト51が撮像された画像の例であり、この例では、図中左方向に走って移動する人が、オブジェクト51として撮像されている。図3Bでは、オブジェクト51が、図3Aの位置から図中左に移動しており、図3Cでは、オブジェクト51が、図3Bの位置からさらに左に移動している。   3A to 3C are diagrams showing an example of an image displayed on the image display 23 at this time in time series. FIG. 3A is an example of an image in which the object 51 to be tracked is imaged by the imaging unit 21. In this example, a person who runs in the left direction in the figure and moves is imaged as the object 51. In FIG. 3B, the object 51 has moved to the left in the figure from the position of FIG. 3A, and in FIG. 3C, the object 51 has moved further to the left from the position of FIG. 3B.

追尾対象検出部24は、図2のステップS1で、オブジェクト51を検出し、このオブジェクト51(人)の目を、追尾点51Aとしてオブジェクト追尾部26に出力する。ステップS2ではオブジェクト追尾部26により追尾処理が行われ、エリア設定部25により、ステップS3で追尾対象のオブジェクト51(追尾点51A)の周辺の所定領域が補正対象エリア52として設定される。   The tracking target detection unit 24 detects the object 51 in step S1 of FIG. 2, and outputs the eye of the object 51 (person) to the object tracking unit 26 as the tracking point 51A. In step S2, tracking processing is performed by the object tracking unit 26, and a predetermined area around the tracking target object 51 (tracking point 51A) is set as the correction target area 52 by the area setting unit 25 in step S3.

上述したように、オブジェクト追尾部26は、追尾点51Aに基づいて、オブジェクト51を追尾するので、オブジェクト51が移動すると、追尾点51Aも移動し、その追尾結果(位置)がエリア設定部25に出力される。このため、図3A乃至図3Cに示されるように、オブジェクト51が図中左に移動していくと、補正対象エリア52も図中左に移動していく。   As described above, the object tracking unit 26 tracks the object 51 based on the tracking point 51A. Therefore, when the object 51 moves, the tracking point 51A also moves, and the tracking result (position) is sent to the area setting unit 25. Is output. For this reason, as shown in FIGS. 3A to 3C, when the object 51 moves to the left in the figure, the correction target area 52 also moves to the left in the figure.

移動するオブジェクト51(追尾点51A)に対応する補正対象エリア52の設定は、例えば、次のようにして行われる。図4は、補正対象エリアとして、追尾点の周辺に所定の大きさの四角形の領域が設定される例を示す。同図において、最初に補正対象エリア71Aが設定されたものとする。最初の補正対象エリア71Aとしては、例えば、追尾点51Aを基準として、それを中心とする一定の範囲が設定される。勿論、ユーザにより指定された場合には、その指定された範囲が補正対象エリア71Aとして設定される。このときエリア設定部25は、補正対象エリア71Aの左上の角の座標(X,Y)を、内蔵するメモリに記憶する。オブジェクト51の追尾点51Aが移動すると、オブジェクト追尾部26による追尾が行われ、追尾点51Aの、画面上におけるX軸方向(図中左右の方向)、Y軸方向(図中上下方向)の位置(または移動距離)の情報が、追尾結果としてエリア設定部25に供給される。   The correction target area 52 corresponding to the moving object 51 (tracking point 51A) is set as follows, for example. FIG. 4 shows an example in which a rectangular area of a predetermined size is set around the tracking point as the correction target area. In the figure, it is assumed that the correction target area 71A is set first. As the first correction target area 71A, for example, a fixed range centered on the tracking point 51A is set. Of course, when designated by the user, the designated range is set as the correction target area 71A. At this time, the area setting unit 25 stores the coordinates (X, Y) of the upper left corner of the correction target area 71A in the built-in memory. When the tracking point 51A of the object 51 moves, the tracking by the object tracking unit 26 is performed, and the position of the tracking point 51A in the X-axis direction (left-right direction in the figure) and Y-axis direction (up-down direction in the figure) on the screen. Information on (or movement distance) is supplied to the area setting unit 25 as a tracking result.

そして、上述した左上の角の座標に基づいて、補正対象エリアが設定される。例えば、追尾点51Aが画面上で、X軸方向にx、Y軸方向にyだけそれぞれ移動すると、エリア設定部25は、補正対象エリア71Aの左上の座標(X,Y)に、xとyを加算し、座標(X+x,Y+y)を計算し、その座標を新たな補正対象エリア71Bの左上の角の座標として記憶するとともに、補正対象エリア71Bを設定する。追尾点51AがX軸方向にa、Y軸方向にbだけさらに移動すると、エリア設定部25は、補正対象エリア71Aの左上の座標(X+x,Y+y)に、aとbを加算し、座標(X+x+a,Y+y+b)を計算し、その座標を新たな補正対象エリア71Cの左上の角の座標として記憶するとともに、補正対象エリア71Cを設定する。   Then, the correction target area is set based on the coordinates of the upper left corner described above. For example, when the tracking point 51A moves on the screen by x in the X-axis direction and y in the Y-axis direction, the area setting unit 25 sets x and y to the upper left coordinates (X, Y) of the correction target area 71A. Are added, the coordinates (X + x, Y + y) are calculated, the coordinates are stored as the coordinates of the upper left corner of the new correction target area 71B, and the correction target area 71B is set. When the tracking point 51A further moves by a in the X-axis direction and b in the Y-axis direction, the area setting unit 25 adds a and b to the upper left coordinates (X + x, Y + y) of the correction target area 71A. Then, the coordinates (X + x + a, Y + y + b) are calculated, the coordinates are stored as the coordinates of the upper left corner of the new correction target area 71C, and the correction target area 71C is set.

このように、オブジェクト(追尾点)の移動に伴って、補正対象エリアも移動していく。   In this way, the correction target area moves with the movement of the object (tracking point).

また、上述したように、補正対象エリア52内の画像については、画像補正部22による画像補正処理(図2のステップS4)が行われ、画像のぼけが除去されて、画像ディスプレイ23に表示される。従って、図3A乃至Cに示される画像は、補正対象エリア52内が鮮明に表示され、補正対象エリア52の外の領域(背景)である背景53の画像は、補正対象エリア52内の画像と比較すると、相対的に不鮮明に表示される。   Further, as described above, the image in the correction target area 52 is subjected to the image correction processing (step S4 in FIG. 2) by the image correction unit 22, the image blur is removed, and the image is displayed on the image display 23. The 3A to 3C, the inside of the correction target area 52 is clearly displayed, and the image of the background 53 that is an area (background) outside the correction target area 52 is the same as the image in the correction target area 52. When compared, it is displayed relatively unclear.

このようにすることで、画像ディスプレイ23に表示される画像の中で、補正対象エリア52内のオブジェクト51が、常に鮮明に表示されるので、画像ディスプレイ23を観察するユーザは、自然にオブジェクト51を注目するようになり、その結果、例えば不審者の侵入、物体の移動などをより迅速に発見することができる。また、オブジェクト51は、鮮明に表示されるので、移動するオブジェクト(例えば、人物)が何(誰)であるのか、ユーザに、正確に認識させることができる。   By doing so, the object 51 in the correction target area 52 is always clearly displayed in the image displayed on the image display 23. Therefore, the user who observes the image display 23 naturally selects the object 51. As a result, for example, intrusion of a suspicious person, movement of an object, and the like can be detected more quickly. Further, since the object 51 is clearly displayed, it is possible to make the user accurately recognize what (who) the moving object (for example, a person) is.

次に、図1のオブジェクト追尾部26の詳細な構成例と、その動作について説明する。図5はオブジェクト追尾部26の機能的構成例を示すブロック図である。この例では、オブジェクト追尾部26は、テンプレートマッチング部51、動き推定部52、シーンチェンジ検出部53、背景動き推定部54、領域推定関連処理部55、乗り換え候補保持部56、追尾点決定部57、テンプレート保持部58、および制御部59により構成されている。   Next, a detailed configuration example and operation of the object tracking unit 26 in FIG. 1 will be described. FIG. 5 is a block diagram illustrating a functional configuration example of the object tracking unit 26. In this example, the object tracking unit 26 includes a template matching unit 51, a motion estimation unit 52, a scene change detection unit 53, a background motion estimation unit 54, a region estimation related processing unit 55, a transfer candidate holding unit 56, and a tracking point determination unit 57. , A template holding unit 58 and a control unit 59.

テンプレートマッチング部51は、入力画像と、テンプレート保持部58に保持されているテンプレート画像のマッチング処理を行う。動き推定部52は、入力画像の動きを推定し、推定の結果得られた動きベクトルと、その動きベクトルの確度を、シーンチェンジ検出部53、背景動き推定部54、領域推定関連処理部55、および追尾点決定部57に出力する。シーンチェンジ検出部53は、動き推定部52より供給された確度に基づいて、シーンチェンジを検出する。   The template matching unit 51 performs a matching process between the input image and the template image held in the template holding unit 58. The motion estimation unit 52 estimates the motion of the input image, and obtains the motion vector obtained as a result of the estimation and the accuracy of the motion vector, the scene change detection unit 53, the background motion estimation unit 54, the region estimation related processing unit 55, And output to the tracking point determination unit 57. The scene change detection unit 53 detects a scene change based on the accuracy supplied from the motion estimation unit 52.

背景動き推定部54は、動き推定部52より供給された動きベクトルと確度に基づいて背景動きを推定する処理を実行し、推定結果を領域推定関連処理部55に供給する。領域推定関連処理部55は、動き推定部52より供給された動きベクトルと確度、背景動き推定部54より供給された背景動き、並びに追尾点決定部57より供給された追尾点情報に基づいて、領域推定処理を行う。また、領域推定関連処理部55は、入力された情報に基づいて乗り換え候補を生成し、乗り換え候補保持部56へ供給し、保持させる。さらに、領域推定関連処理部55は、入力画像に基づいてテンプレートを作成し、テンプレート保持部58に供給し、保持させる。   The background motion estimation unit 54 executes processing for estimating the background motion based on the motion vector and the accuracy supplied from the motion estimation unit 52, and supplies the estimation result to the region estimation related processing unit 55. The region estimation related processing unit 55 is based on the motion vector and accuracy supplied from the motion estimation unit 52, the background motion supplied from the background motion estimation unit 54, and the tracking point information supplied from the tracking point determination unit 57. Perform region estimation processing. Further, the region estimation related processing unit 55 generates a transfer candidate based on the input information, supplies the transfer candidate to the transfer candidate holding unit 56, and holds it. Further, the region estimation related processing unit 55 creates a template based on the input image, supplies the template to the template holding unit 58, and holds it.

追尾点決定部57は、動き推定部52より供給された動きベクトルと確度、並びに乗り換え候補保持部56より供給された乗り換え候補に基づいて、追尾点を決定し、決定された追尾点に関する情報を領域推定関連処理部55に出力する。   The tracking point determination unit 57 determines a tracking point based on the motion vector and accuracy supplied from the motion estimation unit 52 and the transfer candidate supplied from the transfer candidate holding unit 56, and information on the determined tracking point is obtained. The result is output to the region estimation related processing unit 55.

制御部59は、追尾対象検出部から24から出力された追尾点の情報に基づいて、テンプレートマッチング部51乃至テンプレート保持部58の各部を制御して、検出された追尾対象を追尾させるとともに、画像ディスプレイ23に表示される画面の中に、追尾点が表示されるように(追尾点が画面の外にでないように)、カメラ駆動部27に制御信号を出力し、カメラ(撮像部21)の駆動を制御する。また、制御部59は、追尾点の画面上での位置の情報などの追尾結果を、エリア設定部25、制御部27などに出力する。   The control unit 59 controls each part of the template matching unit 51 to the template holding unit 58 based on the tracking point information output from the tracking target detection unit 24 to track the detected tracking target, and A control signal is output to the camera drive unit 27 so that the tracking point is displayed in the screen displayed on the display 23 (so that the tracking point is not outside the screen), and the camera (imaging unit 21) Control the drive. Further, the control unit 59 outputs a tracking result such as information on the position of the tracking point on the screen to the area setting unit 25, the control unit 27, and the like.

次に、オブジェクト追尾部26の動作について説明する。図6は、図2のステップS2において、オブジェクト追尾部26が実行する追尾処理の詳細を説明するフローチャートである。   Next, the operation of the object tracking unit 26 will be described. FIG. 6 is a flowchart for explaining the details of the tracking process executed by the object tracking unit 26 in step S2 of FIG.

図7に示されるように、オブジェクト追尾部26は、基本的に通常処理と例外処理を実行する。すなわち、ステップS51で通常処理が行われる。この通常処理の詳細は、図10を参照して後述するが、この処理により追尾対象検出部24により指定された追尾点を追尾する処理が実行される。ステップS51の通常処理において追尾点の乗り換えができなくなったとき、ステップS52において、例外処理が実行される。この例外処理の詳細は、図37のフローチャートを参照して後述するが、この例外処理により、追尾点が画像から見えなくなったとき、テンプレートマッチングにより通常処理への復帰処理が実行される。例外処理によって追尾処理を継続することができなくなった(通常処理へ復帰することができなくなった)と判定された場合には処理が終了されるが、テンプレートによる復帰処理の結果、通常処理への復帰が可能と判定された場合には、処理は再びステップS51に戻る。このようにして、ステップS51の通常処理とステップS52の例外処理が、各フレーム毎に順次繰り返し実行される。   As shown in FIG. 7, the object tracking unit 26 basically executes normal processing and exception processing. That is, normal processing is performed in step S51. The details of this normal process will be described later with reference to FIG. 10, but the process of tracking the tracking point specified by the tracking target detection unit 24 is executed by this process. When the tracking point cannot be changed in the normal process of step S51, an exception process is executed in step S52. The details of this exception processing will be described later with reference to the flowchart of FIG. 37. When the tracking point becomes invisible from the image by this exception processing, the return processing to the normal processing is executed by template matching. If it is determined that the tracking process cannot be continued due to the exception process (cannot return to the normal process), the process is terminated. If it is determined that the return is possible, the process returns to step S51 again. In this way, the normal process in step S51 and the exception process in step S52 are sequentially repeated for each frame.

本発明においては、この通常処理と例外処理により、図7乃至図9に示されるように、追尾対象が回転したり、オクルージョンが発生したり、シーンチェンジが発生する等、追尾点が一時的に見えなくなった場合においても、追尾が可能となる。   In the present invention, as shown in FIG. 7 to FIG. 9, the tracking point is temporarily changed by the normal process and the exception process, such as the tracking target is rotated, the occlusion occurs, the scene change occurs, and the like. Even when it becomes invisible, tracking is possible.

すなわち、例えば、図7に示されるように、フレームn−1には追尾対象(オブジェクト)としての人の顔104が表示されており、この人の顔104は、右目102と左目103を有している。ユーザが、このうちの、例えば右目102(正確には、その中の1つの画素)を追尾点101として指定したとする。図7の例においては、次のフレームnにおいて、人が図中左方向に移動しており、さらに次のフレームn+1においては、人の顔104が時計方向に回動している。その結果、今まで見えていた右目102が表示されなくなり、いままでの方法では、追尾ができなくなる。そこで、上述したステップS51の通常処理においては、右目102と同一の対象物としての顔104上の左目103が選択され、追尾点が左目103に乗り換えられる(設定される)。これにより追尾が可能となる。   That is, for example, as shown in FIG. 7, a human face 104 as a tracking target (object) is displayed in the frame n−1, and this human face 104 has a right eye 102 and a left eye 103. ing. It is assumed that the user designates, for example, the right eye 102 (exactly one pixel therein) as the tracking point 101. In the example of FIG. 7, in the next frame n, the person moves to the left in the figure, and in the next frame n + 1, the person's face 104 rotates clockwise. As a result, the right eye 102 that has been visible until now is not displayed, and tracking cannot be performed with the conventional method. Therefore, in the normal process of step S51 described above, the left eye 103 on the face 104 as the same object as the right eye 102 is selected, and the tracking point is switched (set) to the left eye 103. This enables tracking.

図8の表示例では、フレームn−1において、顔104の図中左側からボール121が移動してきて、次のフレームnにおいては、ボール121がちょうど顔104を覆う状態となっている。この状態において、追尾点101として指定されていた右目102を含む顔104が表示されていない。このようなオクルージョンが起きると、対象物としての顔504が表示されていないので、追尾点101に代えて追尾する乗り換え点もなくなり、以後、追尾点を追尾することが困難になる。しかし、本発明においては、追尾点101としての右目102をフレームn−1(実際には時間的にもっと前のフレーム)の画像がテンプレートとして予め保存されており、ボール121がさらに右側に移動し、フレームn+1において、追尾点101として指定された右目102が再び現れると、上述したステップS52の例外処理により、追尾点101としての右目102が再び表示されたことが確認され、右目102が再び追尾点101として追尾されることになる。   In the display example of FIG. 8, in the frame n−1, the ball 121 has moved from the left side of the face 104 in the drawing, and in the next frame n, the ball 121 has just covered the face 104. In this state, the face 104 including the right eye 102 designated as the tracking point 101 is not displayed. When such an occlusion occurs, the face 504 as the object is not displayed, so there is no transfer point to be tracked instead of the tracking point 101, and it becomes difficult to track the tracking point thereafter. However, in the present invention, the image of the frame n−1 (actually the earlier frame in time) is stored in advance as a template for the right eye 102 as the tracking point 101, and the ball 121 moves further to the right. When the right eye 102 designated as the tracking point 101 appears again in frame n + 1, it is confirmed that the right eye 102 as the tracking point 101 is displayed again by the exception processing in step S52 described above, and the right eye 102 is again tracked. The point 101 is tracked.

図9の例では、フレームn−1においては、顔104が表示されているが、次のフレームnにおいては、自動車111が人の顔を含む全体を覆い隠している。すなわち、この場合、シーンチェンジが起きたことになる。本発明では、このようにシーンチェンジが起きて追尾点101が画像から存在しなくなっても、自動車111が移動して、フレームn+1において再び右目102が表示されると、ステップS52の例外処理で、追尾点101としての右目102が再び出現したことがテンプレートに基づいて確認され、この右目102を再び追尾点101として追尾することが可能となる。   In the example of FIG. 9, the face 104 is displayed in the frame n−1, but in the next frame n, the automobile 111 covers and covers the whole including the human face. That is, in this case, a scene change has occurred. In the present invention, even if the scene change occurs and the tracking point 101 no longer exists in the image, if the automobile 111 moves and the right eye 102 is displayed again in the frame n + 1, the exception processing in step S52 It is confirmed based on the template that the right eye 102 as the tracking point 101 has appeared again, and the right eye 102 can be tracked again as the tracking point 101.

次に、図10のフローチャートを参照して、図6のステップS51の通常処理の詳細について説明する。ステップS121において、追尾点決定部57により通常処理の初期化処理が実行される。その詳細は、図11のフローチャートを参照して後述するが、この処理によりユーザから追尾するように指定された追尾点を基準とする領域推定範囲が指定される。この領域推定範囲は、ユーザにより指定された追尾点と同一の対象物(例えば、追尾点が人の目である場合、目と同様の動きをする剛体としての人の顔、または人の体など)に属する点の範囲を推定する際に参照する範囲である。乗り換え点は、この領域推定範囲の中の点から選択される。   Next, the details of the normal processing in step S51 in FIG. 6 will be described with reference to the flowchart in FIG. In step S121, the tracking point determination unit 57 executes initialization processing of normal processing. The details will be described later with reference to the flowchart of FIG. 11, but the region estimation range based on the tracking point designated to be tracked by the user is designated by this processing. This area estimation range is the same object as the tracking point specified by the user (for example, when the tracking point is a human eye, a human face as a rigid body that moves like the eye, a human body, or the like) ) Is a range to be referred to when estimating the range of points belonging to. A transfer point is selected from points in the region estimation range.

次に、ステップS122において、制御部59は、次のフレームの画像の入力を待機するように各部を制御する。ステップS123において、動き推定部52は、追尾点の動きを推定する。すなわち、ユーザにより指定された追尾点を含むフレーム(前フレーム)より時間的に後のフレーム(後フレーム)をステップS122の処理で取り込むことで、結局連続する2フレームの画像が得られたことになるので、ステップS123において、前フレームの追尾点に対応する後フレームの追尾点の位置を推定することで、追尾点の動きが推定される。   Next, in step S122, the control unit 59 controls each unit to wait for input of an image of the next frame. In step S123, the motion estimation unit 52 estimates the tracking point motion. That is, by capturing the frame (following frame) temporally after the frame including the tracking point designated by the user (previous frame) in the process of step S122, an image of two consecutive frames is eventually obtained. Therefore, in step S123, the movement of the tracking point is estimated by estimating the position of the tracking point of the subsequent frame corresponding to the tracking point of the previous frame.

なお、時間的に前とは、処理の順番(入力の順番)をいう。通常、撮像の順番に各フレームの画像が入力されるので、その場合、より時間的に前に撮像されたフレームが前フレームとなるが、時間的に後に撮像されたフレームが先に処理(入力)される場合には、時間的に後に撮像されたフレームが前フレームとなる。   Note that “preceding in time” means the processing order (input order). Normally, images of each frame are input in the order of imaging. In this case, the frame captured earlier in time becomes the previous frame, but the frame captured later in time is processed (input) first. ), The frame imaged later in time becomes the previous frame.

ステップS124において、動き推定部52は、ステップS123の処理の結果、追尾点が推定可能であったか否かを判定する。追尾点が推定可能であったか否かは、例えば、動き推定部52が生成、出力する動きベクトル(後述)の確度の値を、予め設定されている閾値と比較することで判定される。具体的には、動きベクトルの確度が閾値以上であれば推定が可能であり、閾値より小さければ推定が不可能であると判定される。すなわち、ここにおける可能性は比較的厳格に判定され、実際には推定が不可能ではなくても確度が低い場合には、不可能と判定される。これにより、より確実な追尾処理が可能となる。   In step S124, the motion estimation unit 52 determines whether the tracking point can be estimated as a result of the process in step S123. Whether or not the tracking point can be estimated is determined, for example, by comparing the accuracy value of a motion vector (described later) generated and output by the motion estimation unit 52 with a preset threshold value. Specifically, it is possible to estimate if the accuracy of the motion vector is equal to or greater than a threshold, and it is determined that estimation is impossible if the accuracy is smaller than the threshold. In other words, the possibility here is determined relatively strictly, and if the estimation is not actually impossible but the accuracy is low, it is determined as impossible. As a result, more reliable tracking processing can be performed.

なお、ステップS124では、追尾点での動き推定結果と追尾点の近傍の点での動き推定結果が、多数を占める動きと一致する場合には推定可能、一致しない場合には推定不可能と判定するようにすることも可能である。   In step S124, it is determined that the motion estimation result at the tracking point and the motion estimation result at a point near the tracking point can be estimated if they match the motions that occupy the majority, and that they cannot be estimated if they do not match. It is also possible to do so.

追尾点の動きが推定可能であると判定された場合(追尾点が同一対象物上の対応する点上に正しく設定されている確率(右目102が追尾点101として指定された場合、右目102が正しく追尾されている確率)が比較的高い場合)、ステップS125に進み、追尾点決定部57は、ステップS123の処理で得られた推定動き(動きベクトル)の分だけ追尾点をシフトする。すなわち、これにより、前フレームの追尾点の追尾後の後フレームにおける追尾の位置が決定されることになる。   When it is determined that the movement of the tracking point can be estimated (the probability that the tracking point is correctly set on the corresponding point on the same object (if the right eye 102 is designated as the tracking point 101, the right eye 102 If the probability of being correctly tracked is relatively high), the process proceeds to step S125, and the tracking point determination unit 57 shifts the tracking point by the estimated motion (motion vector) obtained in the process of step S123. In other words, this determines the tracking position in the subsequent frame after tracking the tracking point of the previous frame.

ステップS125の処理の後、ステップS126において、領域推定関連処理が実行される。この領域推定関連処理の詳細は、図14を参照して後述するが、この処理により、ステップS121の通常処理の初期化処理で指定された領域推定範囲が更新される。さらに、対象物体が回転するなどして、追尾点が表示されない状態になった場合に、追尾点を乗り換えるべき点としての乗り換え点としての候補(乗り換え候補)が、この状態(まだ追尾が可能な状態)において、予め抽出(作成)される。また、乗り換え候補への乗り換えもできなくなった場合、追尾は一旦中断されるが、再び追尾が可能になった(追尾点が再び出現した)ことを確認するために、テンプレートが予め作成される。   After step S125, region estimation related processing is executed in step S126. The details of the area estimation related process will be described later with reference to FIG. 14. By this process, the area estimation range designated in the initialization process of the normal process in step S121 is updated. Furthermore, if the tracking point is not displayed because the target object rotates, for example, the candidate as a switching point (transfer candidate) as a point to be switched to is the state (can still be tracked). In the state), it is extracted (created) in advance. Further, when the transfer to the transfer candidate cannot be performed, the tracking is temporarily interrupted, but a template is created in advance in order to confirm that the tracking is possible again (the tracking point appears again).

ステップS126の領域推定関連処理が終了した後、処理は再びステップS122に戻り、それ以降の処理が繰り返し実行される。   After the region estimation related process in step S126 is completed, the process returns to step S122 again, and the subsequent processes are repeatedly executed.

すなわち、ユーザから指定された追尾点の動きが推定可能である限り、ステップS122乃至ステップS126の処理がフレーム毎に繰り返し実行され、追尾が行われることになる。   That is, as long as the movement of the tracking point designated by the user can be estimated, the processing from step S122 to step S126 is repeatedly executed for each frame, and tracking is performed.

これに対して、ステップS124において、追尾点の動きが推定可能ではない(不可能である)と判定された場合、すなわち、上述したように、例えば動きベクトルの確度が閾値以下であるような場合、処理はステップS127に進む。ステップS127において、追尾点決定部57は、ステップS126の領域推定関連処理で生成された乗り換え候補が乗り換え候補保持部116に保持されているので、その中から、元の追尾点に最も近い乗り換え候補を1つ選択する。追尾点決定部57は、ステップS128で乗り換え候補が選択できたか否かを判定し、乗り換え候補が選択できた場合には、ステップS129に進み、追尾点をステップS127の処理で選択した乗り換え候補に乗り換える(変更する)。すなわち、乗り換え候補の点が新たな追尾点として設定される。その後、処理はステップS123に戻り、乗り換え候補の中から選ばれた追尾点の動きを推定する処理が実行される。   On the other hand, if it is determined in step S124 that the movement of the tracking point cannot be estimated (that is, impossible), that is, as described above, for example, the accuracy of the motion vector is equal to or less than the threshold value. The process proceeds to step S127. In step S127, since the transfer candidate generated by the region estimation related process in step S126 is held in the transfer candidate holding unit 116, the tracking point determination unit 57 selects the transfer candidate closest to the original tracking point. Select one. The tracking point determination unit 57 determines whether or not a transfer candidate has been selected in step S128. If a transfer candidate has been selected, the tracking point determination unit 57 proceeds to step S129 and sets the tracking point as the transfer candidate selected in the process of step S127. Change (change). That is, the transfer candidate point is set as a new tracking point. Thereafter, the process returns to step S123, and the process of estimating the movement of the tracking point selected from the transfer candidates is executed.

ステップS124において新たに設定された追尾点の動きが推定可能であるか否かが再び判定され、推定可能であれば、ステップS125において追尾点を推定動き分だけシフトする処理が行われ、ステップS126において、領域推定関連処理が実行される。その後、処理は再びステップS122に戻り、それ以降の処理が繰り返し実行される。   In step S124, it is determined again whether or not the movement of the newly set tracking point can be estimated. If it can be estimated, a process of shifting the tracking point by the estimated movement is performed in step S125, and step S126. In, the area estimation related process is executed. Thereafter, the process returns to step S122 again, and the subsequent processes are repeatedly executed.

ステップS124において、新たに設定された追尾点も推定不可能であると判定された場合には、再びステップS127に戻り、乗り換え候補の中から、元の追尾点に次に最も近い乗り換え候補が選択され、ステップS129において、その乗り換え候補が新たな追尾点とされる。その新たな追尾点について、再びステップS123以降の処理が繰り返される。   If it is determined in step S124 that the newly set tracking point cannot be estimated, the process returns to step S127, and the next transfer candidate closest to the original tracking point is selected from the transfer candidates. In step S129, the transfer candidate is set as a new tracking point. The process after step S123 is repeated again for the new tracking point.

用意されているすべての乗り換え候補を新たな追尾点としても、追尾点の動きを推定することができなかった場合には、ステップS128において、乗り換え候補が選択できなかったと判定され、この通常処理は終了される。そして、図6のステップS52の例外処理に処理が進むことになる。   Even when all the prepared transfer candidates are used as new tracking points, if the movement of the tracking point cannot be estimated, it is determined in step S128 that the transfer candidate cannot be selected, and this normal process is performed. Is terminated. Then, the process proceeds to the exception process in step S52 of FIG.

次に、図11のフローチャートを参照して、図10のステップS121の通常処理の初期化処理の詳細について説明する。   Next, details of the initialization process of the normal process in step S121 of FIG. 10 will be described with reference to the flowchart of FIG.

ステップS141において、制御部59は、今の処理は例外処理からの復帰の処理であるのか否かを判定する。すなわち、ステップS52の例外処理を終了した後、再びステップS51の通常処理に戻ってきたのか否かが判定される。最初のフレームの処理においては、まだステップS52の例外処理は実行されていないので、例外処理からの復帰ではないと判定され、処理はステップS142に進む。ステップS142において、追尾点決定部57は、追尾点を追尾点指示の位置に設定する処理を実行する。すなわち、入力画像の中で、例えば、最も輝度の高い点が追尾点として設定される。   In step S141, the control unit 59 determines whether or not the current process is a process for returning from the exception process. That is, after the exception process in step S52 is completed, it is determined whether or not the process has returned to the normal process in step S51. In the process of the first frame, since the exception process of step S52 has not been executed yet, it is determined that the process has not returned from the exception process, and the process proceeds to step S142. In step S142, the tracking point determination unit 57 executes processing for setting the tracking point to the position of the tracking point instruction. That is, for example, the point with the highest luminance in the input image is set as the tracking point.

なお、追尾点は、ユーザによる指定など、他の方法により設定されるようにしてもよい。ユーザによる指定とは、例えば、図示せぬマウス、その他の入力部を操作することで、制御部59に、入力画像の中の所定の点を追尾点として指定することにより行われることである。追尾点決定部57は、設定した追尾点の情報を領域推定関連処理部55に供給する。   The tracking point may be set by other methods such as designation by the user. The designation by the user is performed, for example, by designating a predetermined point in the input image as a tracking point to the control unit 59 by operating a mouse or other input unit (not shown). The tracking point determination unit 57 supplies the set tracking point information to the region estimation related processing unit 55.

ステップS143において、領域推定関連処理部55は、ステップS142の処理で設定された追尾点の位置に基づき、領域推定範囲を設定する。この領域推定範囲は、追尾点と同じ剛体上の点を推定する際の参照範囲であり、予め追尾点と同じ剛体部分が領域推定範囲の大部分を占めるように、より具体的には、追尾点と同じ剛体部分に推定領域範囲の位置や大きさが追随するように設定することで、領域推定範囲の中で最も多数を占める動きを示す部分を追尾点と同じ剛体部分であると推定できるようにするためのものである。ステップS143では初期値として、例えば、追尾点を中心とする予め設定された一定の範囲が領域推定範囲とされる。   In step S143, the region estimation related processing unit 55 sets a region estimation range based on the position of the tracking point set in the processing of step S142. This region estimation range is a reference range when estimating a point on the same rigid body as the tracking point, and more specifically, tracking so that the same rigid body portion as the tracking point occupies most of the region estimation range in advance. By setting the position and size of the estimated area range to follow the same rigid body part as the point, the part that shows the most movement in the estimated area range can be estimated as the same rigid body part as the tracking point It is for doing so. In step S143, as a default value, for example, a predetermined range centered on the tracking point is set as the region estimation range.

その後処理は、図10のステップS122に進むことになる。   Thereafter, the processing proceeds to step S122 in FIG.

一方、ステップS141において、現在の処理が、ステップS52の例外処理からの復帰の処理であると判定された場合、ステップS144に進み、追尾点決定部57は、後述する図37を参照して後述する処理により、テンプレートにマッチした位置に基づき追尾点と領域推定範囲を設定する。例えば、テンプレート上の追尾点とマッチした現フレーム上の点が追尾点とされ、その点から予め設定されている一定の範囲が領域推定範囲とされる。その後、処理は図10のステップS122に進む。   On the other hand, if it is determined in step S141 that the current process is a process for returning from the exception process in step S52, the process proceeds to step S144, and the tracking point determination unit 57 is described later with reference to FIG. By this processing, the tracking point and the area estimation range are set based on the position that matches the template. For example, a point on the current frame that matches the tracking point on the template is set as the tracking point, and a certain range set in advance from the point is set as the region estimation range. Thereafter, the processing proceeds to step S122 in FIG.

以上の処理を図12を参照して説明すると次のようになる。すなわち、図11のステップS142において、例えば、図12に示されるように、フレームn−1の人の目102が追尾点101として指定されると、ステップS143において、追尾点101を含む所定の領域が領域推定範囲133として指定される。ステップS124において、領域推定範囲133の範囲内のサンプル点が次のフレームにおいて推定可能であるか否かが判定される。図12の例の場合、フレームnの次のフレームn+1においては、領域推定範囲133のうち、左目102を含む図中左側半分の領域134がボール121で隠されているため、フレームnの追尾点101の動きを、次のフレームn+1において推定することができない。そこで、このような場合においては、時間的に前のフレームn−1で乗り換え候補として予め用意されていた領域指定範囲133内(右目102を含む剛体としての顔104内)の点の中から1つの点(例えば、顔104に含まれる左目103(正確には、その中の1つの画素))が選択され、その点がフレームn+1における、追尾点とされる。   The above process will be described with reference to FIG. That is, in step S142 of FIG. 11, for example, as shown in FIG. 12, when the human eye 102 of the frame n−1 is designated as the tracking point 101, a predetermined region including the tracking point 101 is specified in step S143. Is designated as the area estimation range 133. In step S124, it is determined whether or not the sample points within the region estimation range 133 can be estimated in the next frame. In the case of the example of FIG. 12, in the frame n + 1 next to the frame n, the left half region 134 in the drawing including the left eye 102 in the region estimation range 133 is hidden by the ball 121. 101 motion cannot be estimated in the next frame n + 1. Therefore, in such a case, one of the points in the area designation range 133 (in the face 104 as a rigid body including the right eye 102) prepared in advance as a transfer candidate in the previous frame n-1 in time is selected. One point (for example, the left eye 103 included in the face 104 (exactly one pixel therein)) is selected, and that point is set as the tracking point in the frame n + 1.

領域推定関連処理部55は、図10のステップS126における領域推定関連処理を実行するために、図13に示されるような構成を有している。すなわち、領域推定関連処理部55の領域推定部161には、動き推定部52より動きベクトルと確度が入力され、背景動き推定部54より背景動きが入力され、そして追尾点決定部57より追尾点の位置情報が入力される。乗り換え候補抽出部162には、動き推定部52より動きベクトルと確度が供給される他、領域推定部161の出力が供給される。テンプレート作成部163には、入力画像が入力される他、領域推定部161の出力が入力される。   The region estimation related processing unit 55 has a configuration as shown in FIG. 13 in order to execute the region estimation related processing in step S126 of FIG. That is, the motion vector and the accuracy are input from the motion estimation unit 52, the background motion is input from the background motion estimation unit 54, and the tracking point from the tracking point determination unit 57 is input to the region estimation unit 161 of the region estimation related processing unit 55. Position information is input. In addition to the motion vector and the accuracy supplied from the motion estimation unit 52, the transfer candidate extraction unit 162 is also supplied with the output of the region estimation unit 161. In addition to the input image being input to the template creation unit 163, the output of the region estimation unit 161 is input.

領域推定部161は、入力に基づいて、追尾点を含む剛体の領域を推定し、推定結果を乗り換え候補抽出部162とテンプレート作成部163に出力する。乗り換え候補抽出部162は入力に基づき乗り換え候補を抽出し、抽出した乗り換え候補を乗り換え候補保持部56へ供給する。テンプレート作成部163は入力に基づきテンプレートを作成し、作成したテンプレートをテンプレート保持部58へ供給する。   The region estimation unit 161 estimates a rigid region including a tracking point based on the input, and outputs an estimation result to the transfer candidate extraction unit 162 and the template creation unit 163. The transfer candidate extraction unit 162 extracts transfer candidates based on the input, and supplies the extracted transfer candidates to the transfer candidate holding unit 56. The template creation unit 163 creates a template based on the input, and supplies the created template to the template holding unit 58.

図14は、領域推定関連処理部55により実行される領域推定関連処理(図10のステップS126の処理)の詳細を表している。最初にステップS161において、領域推定部161により領域推定処理が実行される。その詳細は、図15のフローチャートを参照して後述するが、この処理により、追尾点が属する対象と同一の対象(追尾点と同期した動きをする剛体)に属すると推定される画像上の領域の点が領域推定範囲の点として抽出される。   FIG. 14 shows details of the area estimation related process (the process of step S126 in FIG. 10) executed by the area estimation related processing unit 55. First, in step S161, region estimation processing is executed by the region estimation unit 161. The details thereof will be described later with reference to the flowchart of FIG. 15, but this process allows the region on the image that is estimated to belong to the same object (the rigid body that moves in synchronization with the tracking point) to which the tracking point belongs. Are extracted as points in the region estimation range.

ステップS162において、乗り換え候補抽出部162により乗り換え候補抽出処理が実行される。その処理の詳細は、図27のフローチャート参照して後述するが、領域推定部161により領域推定範囲として推定された範囲の点から乗り換え候補の点が抽出され、乗り換え候補保持部56に保持される。   In step S162, the transfer candidate extraction unit 162 executes a transfer candidate extraction process. The details of the processing will be described later with reference to the flowchart of FIG. 27, but transfer candidate points are extracted from the points of the range estimated by the region estimation unit 161 as the region estimation range and held in the transfer candidate holding unit 56. .

ステップS163においてテンプレート作成部163によりテンプレート作成処理が実行される。その詳細は、図28のフローチャートを参照して後述するが、この処理によりテンプレートが作成される。   In step S163, the template creation unit 163 executes template creation processing. Details thereof will be described later with reference to the flowchart of FIG. 28, and a template is created by this processing.

次に、図15のフローチャートを参照して、図14のステップS161の領域推定処理の詳細について説明する。   Next, details of the region estimation processing in step S161 in FIG. 14 will be described with reference to the flowchart in FIG.

最初に、ステップS181において、領域推定部161は、追尾点と同一の対象に属すると推定される点の候補の点としてのサンプル点を決定する。   First, in step S181, the region estimation unit 161 determines a sample point as a candidate point of a point estimated to belong to the same target as the tracking point.

このサンプル点は、例えば図16に示されるように、図中、白い四角形で示されるフレームの全画面における画素のうち、固定された基準点201を基準として、水平方向および垂直方向に、所定の画素数ずつ離れた位置の画素をサンプル点(図中、黒い四角形で表されている)とすることができる。図16の例においては、各フレームの左上の画素が基準点201とされ(図中基準点201は×印で示されている)、水平方向に5個、並びに垂直方向に5個ずつ離れた位置の画素がサンプル点とされる。すなわち、この例の場合、全画面中に分散した位置の画素がサンプル点とされる。また、この例の場合、基準点は、各フレームn,n+1において固定された同一の位置の点とされる。   For example, as shown in FIG. 16, the sample points are predetermined in the horizontal direction and the vertical direction with reference to the fixed reference point 201 among the pixels in the entire screen of the frame indicated by the white square in the figure. Pixels at positions separated by the number of pixels can be used as sample points (represented by black squares in the figure). In the example of FIG. 16, the upper left pixel of each frame is set as a reference point 201 (the reference point 201 is indicated by a cross in the figure), and is separated by 5 in the horizontal direction and 5 in the vertical direction. The pixel at the position is taken as the sample point. That is, in the case of this example, pixels at positions dispersed throughout the entire screen are taken as sample points. In this example, the reference point is a point at the same position fixed in each frame n, n + 1.

基準点201は、例えば図17に示されるように、各フレームn,n+1毎に異なる位置の点となるように、動的に変化させることもできる。   For example, as shown in FIG. 17, the reference point 201 can be dynamically changed so as to be a point at a different position for each frame n, n + 1.

図16と図17の例においては、サンプル点の間隔が各フレームにおいて固定された値とされているが、例えば図18に示されるように、フレーム毎にサンプル点の間隔を可変とすることもできる。図18の例においては、フレームnにおいては、サンプル点の間隔は5画素とされているのに対し、フレームn+1においては8画素とされている。このときの間隔の基準としては、追尾点と同一の対象に属すると推定される領域の面積を用いることができる。具体的には、領域推定範囲の面積が狭くなれば間隔も短くなる。   In the example of FIGS. 16 and 17, the interval between the sample points is a fixed value in each frame. However, for example, as shown in FIG. 18, the interval between the sample points may be variable for each frame. it can. In the example of FIG. 18, the interval between sample points is 5 pixels in frame n, whereas it is 8 pixels in frame n + 1. As an interval reference at this time, an area of a region estimated to belong to the same object as the tracking point can be used. Specifically, if the area of the region estimation range is narrowed, the interval is also shortened.

あるいはまた、図19に示されるように、1つのフレーム内においてサンプル点の間隔を可変とすることもできる。このときの間隔の基準としては、追尾点からの距離を用いることができる。すなわち、追尾点に近いサンプル点ほど間隔が小さく、追尾点から遠くなるほど間隔が大きくなる。   Alternatively, as shown in FIG. 19, the interval between sample points can be made variable in one frame. The distance from the tracking point can be used as a reference for the interval at this time. That is, the sample point closer to the tracking point has a smaller interval, and the farther from the tracking point, the larger the interval.

以上のようにしてサンプル点が決定されると、次にステップS182において、領域推定部161は、領域推定範囲(図11のステップS143,S144の処理、または、後述する図20のステップS206,S208の処理で決定されている)内のサンプル点の動きを推定する処理を実行する。すなわち、領域推定部161は、動き推定部52より供給された動きベクトルに基づいて、領域推定範囲内のサンプル点に対応する次のフレームの対応する点を抽出する。   When the sample points are determined as described above, in step S182, the region estimation unit 161 then determines the region estimation range (steps S143 and S144 in FIG. 11 or steps S206 and S208 in FIG. 20 described later). The process of estimating the movement of the sample points within (determined in the process of (1)) is executed. That is, the region estimation unit 161 extracts the corresponding point of the next frame corresponding to the sample point within the region estimation range based on the motion vector supplied from the motion estimation unit 52.

ステップS183において、領域推定部161は、ステップS182の処理で推定したサンプル点のうち、確度が予め設定されている閾値より低い動きベクトルに基づく点を対象外とする処理を実行する。この処理に必要な動きベクトルの確度は、動き推定部52より供給される。これにより、領域推定範囲内のサンプル点のうち、確度が高い動きベクトルに基づいて推定された点だけが抽出される。   In step S183, the region estimation unit 161 executes processing for excluding points based on motion vectors whose accuracy is lower than a preset threshold value from the sample points estimated in step S182. The accuracy of the motion vector necessary for this processing is supplied from the motion estimation unit 52. Thereby, only the points estimated based on the motion vector with high accuracy are extracted from the sample points within the region estimation range.

ステップS184において、領域推定部161は、領域推定範囲内の動き推定結果での全画面動きを抽出する。全画面動きとは、同一の動きに対応する領域を考え、その面積が最大となる動きのことを意味する。具体的には、各サンプル点の動きに、そのサンプル点におけるサンプル点間隔に比例する重みを付けて動きのヒストグラムを生成し、この重み付け頻度が最大となる1つの動き(1つの動きベクトル)が全画面動きとして抽出される。なお、ヒストグラムを生成する場合、例えば、動きの代表値を画素精度で準備し、画素精度で1個となる値を持つ動きについてもヒストグラムへの加算を行うようにすることもできる。   In step S184, the region estimation unit 161 extracts the full screen motion in the motion estimation result within the region estimation range. The full screen motion means a motion that takes the area corresponding to the same motion and maximizes the area. Specifically, a motion histogram is generated by assigning a weight proportional to the sample point interval at each sample point to the motion of each sample point, and one motion (one motion vector) having the maximum weighting frequency is generated. Extracted as full screen motion. When generating a histogram, for example, a representative value of motion can be prepared with pixel accuracy, and a motion having a value with one pixel accuracy can be added to the histogram.

ステップS185において、領域推定部161は、全画面動きを持つ領域推定範囲内のサンプル点を領域推定の結果として抽出する。この場合における全画面動きを持つサンプル点としては、全画面動きと同一の動きを持つサンプル点はもちろんのこと、全画面動きとの動きの差が予め設定されている所定の閾値以下である場合には、そのサンプル点もここにおける全画面動きを持つサンプル点とすることも可能である。   In step S185, the region estimation unit 161 extracts sample points within the region estimation range having the full screen motion as a result of region estimation. In this case, the sample points having the full screen motion include not only the sample points having the same motion as the full screen motion but also the difference in motion from the full screen motion is equal to or less than a predetermined threshold value set in advance. The sample point can also be a sample point having full screen motion here.

このようにして、ステップS143,S144,S206,S208の処理で決定された領域推定範囲内のサンプル点のうち、全画面動きを有するサンプル点が、追尾点と同一対象に属すると推定される点として最終的に抽出(生成)される。   In this way, among the sample points within the area estimation range determined by the processing of steps S143, S144, S206, and S208, the sample point having the full screen motion is estimated to belong to the same target as the tracking point. Is finally extracted (generated).

次に、ステップS186において、領域推定部161は、領域推定範囲の更新処理を実行する。その後、処理は、図10のステップS122に進む。   Next, in step S186, the region estimation unit 161 executes a region estimation range update process. Thereafter, the processing proceeds to step S122 in FIG.

図20は、図15のステップS186の領域推定範囲の更新処理の詳細を表している。ステップS201において、領域推定部161は、領域の重心を算出する。この領域とは、図15のステップS185の処理で抽出されたサンプル点で構成される領域(追尾点と同一対象に属すると推定される点で構成される領域)を意味する。すなわち、この領域には1つの動きベクトル(全画面動き)が対応している。例えば、図21Aに示されるように、図中白い四角形で示されるサンプル点のうち、領域推定範囲221内のサンプル点の中から、図15のステップS185の処理で全画面動きを持つサンプル点として、図21Aにおいて黒い四角形で示されるサンプル点が抽出され、そのサンプル点で構成される領域が、領域222として抽出(推定)される。そして、領域222の重心224がさらに算出される。具体的には、各サンプル点にサンプル点間隔の重みを付けたサンプル点重心が領域の重心として求められる。この処理は、現フレームにおける領域の位置を求めるという意味を有する。   FIG. 20 shows details of the region estimation range update processing in step S186 of FIG. In step S201, the region estimation unit 161 calculates the center of gravity of the region. This region means a region composed of sample points extracted in the process of step S185 in FIG. 15 (region composed of points estimated to belong to the same target as the tracking point). That is, one motion vector (full screen motion) corresponds to this area. For example, as shown in FIG. 21A, among sample points indicated by white squares in the figure, sample points having full-screen motion in the process of step S185 in FIG. 21A, sample points indicated by black squares are extracted, and a region constituted by the sample points is extracted (estimated) as a region 222. Then, the center of gravity 224 of the region 222 is further calculated. Specifically, the sample point centroid obtained by assigning the weight of the sample point interval to each sample point is obtained as the centroid of the region. This process has the meaning of obtaining the position of the region in the current frame.

次にステップS202において、領域推定部161は、領域の重心を全画面動きによりシフトする処理を実行する。この処理は、領域推定範囲221を領域の位置の動きに追従させ、次フレームにおける推定位置に移動させるという意味を有する。図21Bに示されるように、現フレームにおける追尾点223が、その動きベクトル238に基づいて次フレームにおいて追尾点233として出現する場合、全画面動きベクトル230が、追尾点の動きベクトル238にほぼ対応しているので、現フレームにおける重心224を動きベクトル230(全画面動き)に基づいてシフトすることで、追尾点233と同一のフレーム(次フレーム)上の点234が求められる。この点234を中心として領域推定範囲231を設定すれば、領域推定範囲221を領域222の位置の動きに追従させて、次のフレームにおける推定位置に移動させることになる。   Next, in step S202, the region estimation unit 161 executes a process of shifting the center of gravity of the region by full screen motion. This process has the meaning of causing the area estimation range 221 to follow the movement of the position of the area and to move to the estimated position in the next frame. As shown in FIG. 21B, when the tracking point 223 in the current frame appears as the tracking point 233 in the next frame based on the motion vector 238, the full-screen motion vector 230 substantially corresponds to the tracking point motion vector 238. Therefore, the point 234 on the same frame (next frame) as the tracking point 233 is obtained by shifting the center of gravity 224 in the current frame based on the motion vector 230 (full screen motion). If the area estimation range 231 is set around the point 234, the area estimation range 221 is moved to the estimated position in the next frame by following the movement of the position of the area 222.

ステップS203において、領域推定部161は、領域推定結果に基づき、次の領域推定範囲の大きさを決定する。具体的には、領域と推定された全てのサンプル点に関するサンプル点の間隔(図21Aにおける領域222の中の黒い四角形で示される点の間隔)の2乗和を領域222の面積と見なし、この面積よりも少し大きめの大きさとなるように、次フレームにおける領域推定範囲231の大きさが決定される。すなわち、領域推定範囲231の大きさは、領域222の中のサンプル点の数が多ければ広くなり、少なければ狭くなる。このようにすることで、領域222の拡大縮小に追従することができるばかりでなく、領域推定範囲221内の全画面領域が追尾対象の周辺領域となるのを防ぐことができる。   In step S203, the region estimation unit 161 determines the size of the next region estimation range based on the region estimation result. Specifically, the sum of squares of sample point intervals (intervals of points indicated by black squares in the region 222 in FIG. 21A) regarding all sample points estimated as the region is regarded as the area of the region 222. The size of the region estimation range 231 in the next frame is determined so that the size is slightly larger than the area. That is, the size of the region estimation range 231 increases when the number of sample points in the region 222 is large and decreases when the number of sample points is small. In this way, not only can the enlargement / reduction of the area 222 be followed, but also the entire screen area within the area estimation range 221 can be prevented from becoming a peripheral area to be tracked.

図15のステップS184で抽出された全画面動きが、背景動きと一致する場合には、動きにより背景と追尾対象を区別することができない。そこで、背景動き推定部54は背景動き推定処理を常に行っており、ステップS204において、領域推定部161は、背景動き推定部54より供給される背景動きと、図15のステップS184の処理で抽出された全画面動きとが一致するか否かを判定する。全画面動きと背景動きが一致する場合には、ステップS205において、領域推定部161は、次の領域推定範囲の大きさを、今の領域推定範囲の大きさが最大となるように制限する。これにより、背景が追尾対象として誤認識され、領域推定範囲の大きさが拡大してしまうようなことが抑制される。   When the full screen motion extracted in step S184 in FIG. 15 matches the background motion, the background and the tracking target cannot be distinguished by the motion. Therefore, the background motion estimation unit 54 always performs the background motion estimation process. In step S204, the region estimation unit 161 extracts the background motion supplied from the background motion estimation unit 54 and the process of step S184 in FIG. It is determined whether or not the full screen motion matches. If the full screen motion matches the background motion, in step S205, the region estimation unit 161 limits the size of the next region estimation range so that the current region estimation range is maximized. Thereby, it is suppressed that the background is erroneously recognized as the tracking target and the size of the area estimation range is enlarged.

ステップS204において、全画面動きと背景動きが一致しないと判定された場合には、ステップS205の処理は必要がないのでスキップされる。   If it is determined in step S204 that the full screen motion and the background motion do not match, the processing in step S205 is not necessary and is skipped.

次に、ステップS206において、領域推定部161は、シフト後の領域重心を中心として次の領域推定範囲の大きさを決定する。これにより、領域推定範囲が、その重心が既に求めたシフト後の領域重心と一致し、かつ、その大きさが領域の広さに比例するように決定される。   Next, in step S <b> 206, the region estimation unit 161 determines the size of the next region estimation range around the shifted region center of gravity. As a result, the area estimation range is determined such that the center of gravity coincides with the already obtained area centroid after the shift, and the size thereof is proportional to the area width.

図21Bの例では、領域推定範囲231が、動きベクトル(全画面動き)230に基づくシフト後の重心234を中心として、領域222の面積に応じた広さに決定されている。   In the example of FIG. 21B, the area estimation range 231 is determined to have a size corresponding to the area 222 area with the shifted center of gravity 234 based on the motion vector (full screen motion) 230 as the center.

領域推定範囲231内での全画面動きを有する領域が追尾対象(例えば、図12の顔104)の領域であることを担保する(確実にする)必要がある。そこで、ステップS207において、領域推定部161は、追尾点が次の領域推定範囲に含まれるか否かを判定し、含まれていない場合には、ステップS208において、追尾点を含むように次の領域推定範囲をシフトする処理を実行する。追尾点が次の領域推定範囲に含まれている場合には、ステップS208の処理は必要がないのでスキップされる。   It is necessary to ensure (ensure) that the region having the full screen motion within the region estimation range 231 is the region of the tracking target (for example, the face 104 in FIG. 12). Therefore, in step S207, the region estimation unit 161 determines whether or not the tracking point is included in the next region estimation range. If the tracking point is not included, in step S208, the region estimation unit 161 determines that the tracking point is included in the next region estimation range. A process for shifting the region estimation range is executed. If the tracking point is included in the next area estimation range, the process of step S208 is not necessary and is skipped.

この場合における具体的なシフトの方法としては、移動距離が最小となるようにする方法、シフト前の領域推定範囲の重心から追尾点に向かうベクトルに沿って追尾点が含まれるようになる最小距離だけ移動する方法などが考えられる。   As a specific method of shifting in this case, a method of minimizing the moving distance, a minimum distance at which the tracking point is included along a vector from the center of gravity of the region estimation range before the shift to the tracking point A way to move only is considered.

なお、追尾のロバスト性を重視するために、領域に追尾点を含むようにするためのシフトを行わない方法も考えられる。   In order to emphasize the robustness of tracking, a method of not performing a shift to include a tracking point in the region is also conceivable.

図21Cの例においては、領域推定範囲231が追尾点233を含んでいないので、領域推定範囲241として示される位置(追尾点233をその左上に含む位置)に領域推定範囲241がシフトされる。   In the example of FIG. 21C, since the area estimation range 231 does not include the tracking point 233, the area estimation range 241 is shifted to a position indicated as the area estimation range 241 (a position including the tracking point 233 at the upper left).

図21A乃至図21Cは、ステップS208のシフト処理が必要な場合を示しているが、図22A乃至図22Cは、ステップS208のシフト処理が必要でない場合(ステップS207において追尾点が次の領域推定範囲に含まれると判定された場合)の例を表している。   21A to 21C show the case where the shift process of step S208 is necessary, but FIGS. 22A to 22C show the case where the shift process of step S208 is not necessary (the tracking point is the next region estimation range in step S207). Example).

図22A乃至図22Cに示されるように、領域推定範囲221内のすべてのサンプル点が領域の点である場合には、図20のステップS208のシフト処理が必要なくなることになる。   As shown in FIGS. 22A to 22C, when all the sample points in the area estimation range 221 are area points, the shift process in step S208 in FIG. 20 is not necessary.

図21A乃至図21Cと図22A乃至図22Cは、領域推定範囲が矩形である例を示したが、図25A乃至図25Cと図26A乃至図26Cに示されるように、領域推定範囲は円形とすることも可能である。図25A乃至図25Cは、図21A乃至図21Cに対応する図であり、ステップS208(図20)のシフト処理が必要である場合を表し、図26A乃至図26Cは図22A乃至図22Cに対応する図であり、ステップS108のシフト処理が必要でない場合を表している。   21A to 21C and FIGS. 22A to 22C show an example in which the region estimation range is rectangular, but the region estimation range is circular as shown in FIGS. 25A to 25C and FIGS. 26A to 26C. It is also possible. FIGS. 25A to 25C are diagrams corresponding to FIGS. 21A to 21C, showing a case where the shift process of step S208 (FIG. 20) is necessary, and FIGS. 26A to 26C correspond to FIGS. 22A to 22C. It is a figure and represents the case where the shift process of step S108 is not required.

以上のようにして、図20(図15のステップS186)の領域推定範囲の更新処理により、次フレームのための領域推定範囲の位置と大きさが追尾点を含むように決定される。   As described above, the position estimation range position and size for the next frame are determined to include the tracking point by the region estimation range update process in FIG. 20 (step S186 in FIG. 15).

図20の領域推定範囲の更新処理においては、領域推定範囲を矩形(または円形)の固定形状としたが、可変形状とすることも可能である。この場合における図15のステップS186における領域推定範囲の更新処理の例について、図25を参照して説明する。   In the update process of the area estimation range in FIG. 20, the area estimation range is a rectangular (or circular) fixed shape, but may be a variable shape. An example of the region estimation range update processing in step S186 in FIG. 15 in this case will be described with reference to FIG.

ステップS231において、領域推定部161は、図15のステップS184の処理で抽出された全画面動きと背景動き推定部164により推定された背景動きとが一致するか否かを判定する。両者の動きが一致しない場合には、ステップS233に進み、領域推定部161は、領域(全画面動きと一致する画素で構成される領域)と推定されたすべての点につき、それぞれに対応する小領域を決定する(1個の点に対して1個の小領域を決定する)。図26Aと図26Bの例においては、領域推定範囲261のうち、図中黒い四角形で示される領域の点に対応する小領域271,272が決定される。図中小領域271は、4つの点に対応する小領域が重なりあった例を示している。小領域の大きさは、例えば、サンプル点の間隔に比例するように決定してもよい。   In step S231, the region estimation unit 161 determines whether or not the full screen motion extracted by the processing in step S184 in FIG. 15 matches the background motion estimated by the background motion estimation unit 164. If the movements of the two do not match, the process proceeds to step S233, where the area estimation unit 161 applies a small value corresponding to each of the points estimated as the area (area composed of pixels that match the full screen movement). A region is determined (one small region is determined for one point). In the example of FIGS. 26A and 26B, small regions 271 and 272 corresponding to the points of the regions indicated by the black squares in the drawing are determined in the region estimation range 261. The small area 271 in the figure shows an example in which small areas corresponding to four points overlap. The size of the small area may be determined so as to be proportional to the interval between the sample points, for example.

次に、ステップS234において、領域推定部161は、ステップS233の処理で決定した各小領域の和の領域を暫定領域推定範囲とする。図26Cの例においては、小領域271と小領域272の和の領域281が暫定領域推定範囲とされる。小領域の和をとった結果、不連続な複数の領域が形成される場合には、その中の最大面積を持つ領域のみを暫定領域推定範囲とすることもできる。   Next, in step S234, the region estimation unit 161 sets the sum of the small regions determined in the process of step S233 as the provisional region estimation range. In the example of FIG. 26C, a region 281 that is the sum of the small region 271 and the small region 272 is set as the provisional region estimation range. When a plurality of discontinuous regions are formed as a result of taking the sum of the small regions, only the region having the largest area among them can be set as the provisional region estimation range.

ステップS231において、全画面動きと背景動きとが一致すると判定された場合には、ステップS232において、領域推定部161は、現在の領域推定範囲を暫定領域推定範囲とする。現在の領域推定範囲を暫定推定領域範囲とするのは、背景動き推定の結果と全画面動きが一致する場合には、動きにより背景と追尾対象を区別することができないので、現在の領域推定範囲を変更しないようにするためである。   If it is determined in step S231 that the full screen motion matches the background motion, in step S232, the region estimation unit 161 sets the current region estimation range as the provisional region estimation range. The current region estimation range is used as the provisional estimation region range because the background and the tracking target cannot be distinguished from each other by the motion when the background motion estimation result matches the full screen motion. This is to prevent changes.

ステップS234またはステップS232の処理の後、ステップS235において領域推定部161は、ステップS234またはステップS232で決定された暫定領域推定範囲の全画面動きによるシフトで、次の領域推定範囲を決定する。図26Dの例においては、暫定領域推定範囲281が全画面動きによる動きベクトル283に基づいてシフトされ、暫定領域推定範囲282とされている。   After the process of step S234 or step S232, in step S235, the region estimation unit 161 determines the next region estimation range by shifting the provisional region estimation range determined in step S234 or step S232 by the full screen motion. In the example of FIG. 26D, the provisional region estimation range 281 is shifted based on the motion vector 283 due to the full screen motion to be a provisional region estimation range 282.

ステップS236において、領域推定部161は、追尾点がステップS235の処理で決定された次の領域推定範囲に含まれるか否かを判定し、含まれない場合には、ステップS237に進み、追尾点を含むように次の領域推定範囲をシフトする。図26Cと図26Dの例においては、領域推定範囲282が追尾点284を含んでいないので、追尾点284を左上に含むようにシフトされ、領域推定範囲291とされている。   In step S236, the region estimation unit 161 determines whether or not the tracking point is included in the next region estimation range determined in the process of step S235. If not included, the processing proceeds to step S237. The next region estimation range is shifted to include. In the example of FIG. 26C and FIG. 26D, the region estimation range 282 does not include the tracking point 284, so that the region estimation range 291 is shifted to include the tracking point 284 in the upper left.

ステップS236において、追尾点が次の領域推定範囲に含まれると判定された場合には、ステップS237のシフト処理は必要ないのでスキップされる。   If it is determined in step S236 that the tracking point is included in the next region estimation range, the shift processing in step S237 is not necessary and is skipped.

次に図14のステップS162における乗り換え候補抽出処理について、図27のフローチャートを参照して説明する。   Next, the transfer candidate extraction process in step S162 of FIG. 14 will be described with reference to the flowchart of FIG.

ステップS261において、乗り換え候補抽出部162は、全画面動きの領域と推定されたすべての点につき、それぞれに対応する推定動きでの点のシフト結果を乗り換え候補として保持する。すなわち、領域推定結果として得られた点をそのまま用いるのではなく、それらを次のフレームでの使用のために、それぞれの動き推定結果に基づきシフトされた結果を抽出する処理が行われ、その抽出された乗り換え候補が、乗り換え候保持部56に供給され、保持される。   In step S261, the transfer candidate extraction unit 162 holds, as transfer candidates, the point shift results of the estimated motion corresponding to each of the points estimated as the full screen motion region. That is, instead of using the points obtained as region estimation results as they are, a process for extracting the results shifted based on the respective motion estimation results is performed for use in the next frame. The changed transfer candidates are supplied to and held in the transfer candidate holding unit 56.

この処理を図12を参照して説明すると、次のようになる。すなわち、図12の例において、フレームn−1,nでは追尾点101が存在するが、フレームn+1においては、図中左側から飛んできたボール121により隠されてしまい、追尾点101が存在しない。そこでフレームn+1において、追尾点を追尾対象としての顔104上の他の点(例えば、左目103(実際には右目102にもっと近接した点))に乗り換える必要が生じる。そこで、乗り換えが実際に必要になる前のフレームで、乗り換え候補を予め用意しておくのである。   This process will be described with reference to FIG. That is, in the example of FIG. 12, the tracking point 101 exists in the frames n−1 and n, but in the frame n + 1, it is hidden by the ball 121 flying from the left side in the drawing, and the tracking point 101 does not exist. Therefore, in frame n + 1, it is necessary to change the tracking point to another point on the face 104 as a tracking target (for example, the left eye 103 (actually closer to the right eye 102)). Therefore, a transfer candidate is prepared in advance in a frame before transfer is actually required.

具体的には、図12の例の場合、フレームnからフレームn+1への領域推定範囲133内での動き推定結果は、領域推定範囲133において乗り換えが必要なことから、正しく推定できない確率が高いことが予想される。すなわち、図12の例では、乗り換えが追尾点と、それと同一の対象物の一部が隠れることに起因して起きる。その結果、フレームnでの領域推定範囲133のうち、フレームn+1で対象が隠れる部分(図12において影を付した部分)134については、動きが正しく推定されず、動きの確度が低いことが推定されるか、または確度が低くないと推定され、かつ、動き推定結果としては意味のないものが得られることになる。   Specifically, in the case of the example in FIG. 12, the motion estimation result in the region estimation range 133 from frame n to frame n + 1 needs to be changed in the region estimation range 133, so that there is a high probability that it cannot be estimated correctly. Is expected. That is, in the example of FIG. 12, the transfer occurs because the tracking point and a part of the same object are hidden. As a result, in the region estimation range 133 in the frame n, regarding the portion 134 where the target is hidden in the frame n + 1 (the shaded portion in FIG. 12) 134, the motion is not estimated correctly, and it is estimated that the accuracy of the motion is low. It is estimated that the accuracy is not low and a motion estimation result is meaningless.

このような場合には、領域推定の際に用いることが可能な動き推定結果が減少する、あるいは誤った動き推定結果が混入するなどの理由で、領域推定が誤る可能性が高まる。一方、このような可能性は、一般的に、より時間的に前のフレームn−1からフレームnの間での領域推定においては、フレームnからフレームn+1での間での推定に比較して低くなることが予想される。   In such a case, there is a high possibility that the region estimation is erroneous due to a decrease in motion estimation results that can be used in region estimation or a mixture of erroneous motion estimation results. On the other hand, such a possibility is generally greater in the region estimation between the previous frame n−1 and the frame n in comparison with the estimation between the frame n and the frame n + 1. Expected to be lower.

そこで、リスク低減のため、領域推定結果をそのまま用いるのではなく、前のフレームn−1(あるいは、時間的にもっと前のフレーム)で求めた領域推定結果を、その次のフレームでの移動先の乗り換え候補として用いるのが性能向上の上で望ましい。   Therefore, in order to reduce the risk, the region estimation result is not used as it is, but the region estimation result obtained in the previous frame n-1 (or a frame earlier in time) is used as the movement destination in the next frame. It is desirable to use as a transfer candidate for improving the performance.

ただし、領域推定結果をそのまま用いることも可能である。この場合の処理については、図42を参照して説明する。   However, the region estimation result can be used as it is. The processing in this case will be described with reference to FIG.

図28は、図14のステップS163におけるテンプレート作成処理の詳細を表している。ステップS281においてテンプレート作成部163は、領域(全画面動きの領域)と推定されたすべての点につき、それぞれに対応する小領域を決定する。図29の例においては、領域の点321に対応して小領域322が決定されている。   FIG. 28 shows details of the template creation processing in step S163 of FIG. In step S <b> 281, the template creation unit 163 determines a small region corresponding to each of the points estimated as the region (region of full screen motion). In the example of FIG. 29, the small area 322 is determined corresponding to the point 321 of the area.

ステップS282において、テンプレート作成部163は、ステップS281の処理で決定された小領域の和の領域をテンプレート範囲に設定する。図29の例においては、小領域322の和の領域がテンプレート範囲331とされている。   In step S282, the template creation unit 163 sets the area of the sum of the small areas determined in the process of step S281 as the template range. In the example of FIG. 29, the sum area of the small areas 322 is the template range 331.

次にステップS283において、テンプレート作成部163は、ステップS282において設定したテンプレート範囲の情報と画像情報からテンプレートを作成し、テンプレート保持部58に供給し、保持させる。具体的には、テンプレート範囲331内の画素データがテンプレートとされる。   In step S283, the template creation unit 163 creates a template from the template range information and image information set in step S282, supplies the template to the template holding unit 58, and holds the template. Specifically, pixel data in the template range 331 is used as a template.

図30は、領域の点321に対応する小領域341が、図29における小領域322に較べてより大きな面積とされている。その結果、小領域341の和の領域のテンプレート範囲351も、図29のテンプレート範囲331に較べてより広くなっている。   In FIG. 30, the small area 341 corresponding to the area point 321 has a larger area than the small area 322 in FIG. As a result, the template range 351 of the sum area of the small areas 341 is also wider than the template range 331 of FIG.

小領域の大きさは、サンプル点の間隔に比例させることが考えられるが、その際の比例定数は、面積がサンプル点間隔の自乗になるように決めることもできるし、それより大きくまたは小さく決めることも可能である。   It is conceivable that the size of the small region is proportional to the interval between the sample points, but the proportionality constant at that time can be determined so that the area becomes the square of the interval between the sample points, or larger or smaller than that. It is also possible.

なお、領域推定結果を用いず、例えば追尾点を中心とする固定の大きさや形状の範囲をテンプレート範囲として用いることも可能である。   For example, a fixed size or shape range centered on the tracking point may be used as the template range without using the region estimation result.

図31は、テンプレートと領域推定範囲の位置関係を表している。テンプレート範囲403には、追尾点405が含まれている。テンプレート範囲403に外接する外接矩形401の図中左上の点がテンプレート基準点404とされている。テンプレート基準点404から追尾点405に向かうベクトル406、並びにテンプレート基準点404から領域推定範囲402の図中左上の基準点408に向かうベクトル407が、テンプレート範囲403の情報とされる。テンプレートは、テンプレート範囲403に含まれる画素で構成される。ベクトル406,407は、テンプレートと同じ画像が検出された際の通常処理への復帰に用いられる。   FIG. 31 shows the positional relationship between the template and the area estimation range. The template range 403 includes a tracking point 405. The upper left point of the circumscribed rectangle 401 circumscribing the template range 403 is a template reference point 404. The vector 406 from the template reference point 404 toward the tracking point 405 and the vector 407 from the template reference point 404 toward the upper left reference point 408 in the region estimation range 402 in the drawing are used as information of the template range 403. The template is composed of pixels included in the template range 403. The vectors 406 and 407 are used for returning to normal processing when the same image as the template is detected.

以上の処理においては、乗り換え候補の場合と異なり、範囲、画素ともに、現フレームに対応するものをテンプレートとする例を説明したが、乗り換え候補の場合と同様に、次フレームでの移動先をテンプレートとして用いることも可能である。   In the above processing, unlike the case of the transfer candidate, the example in which both the range and the pixel correspond to the current frame is used as the template. However, as in the case of the transfer candidate, the destination in the next frame is set as the template. Can also be used.

以上のようにして、追尾点を含む画素データからなるテンプレートが乗り換え候補と同様に、通常処理中に、予め作成される。   As described above, a template made up of pixel data including a tracking point is created in advance during normal processing in the same manner as a transfer candidate.

図10のステップS126における領域推定関連処理は、領域推定関連処理部55を、例えば図32に示されるように構成することで処理することも可能である。   The region estimation related process in step S126 of FIG. 10 can be processed by configuring the region estimation related processing unit 55 as shown in FIG. 32, for example.

この場合においても、領域推定関連処理部55は、図13における場合と同様に、領域推定部161、乗り換え候補抽出部162、およびテンプレート作成部163により構成されるが、この実施の形態の場合、領域推定部161には、追尾点決定部57より追尾点の情報と入力画像が入力される。乗り換え候補抽出部162には、領域推定部161の出力のみが供給されている。テンプレート作成部163には、領域推定部161の出力と入力画像とが供給されている。   Even in this case, the region estimation related processing unit 55 includes the region estimation unit 161, the transfer candidate extraction unit 162, and the template creation unit 163 as in the case of FIG. 13, but in the case of this embodiment, The tracking point information and the input image are input to the region estimation unit 161 from the tracking point determination unit 57. Only the output of the region estimation unit 161 is supplied to the transfer candidate extraction unit 162. The template creation unit 163 is supplied with the output of the region estimation unit 161 and the input image.

この場合においても、基本的な処理は、図14に示される場合と同様に、ステップS161において、領域推定処理が行われ、ステップS162において、乗り換え候補抽出処理が行われ、ステップS163において、テンプレート作成処理が行われる。このうちのステップS163のテンプレート作成処理は、図28に示した場合と同様であるので、ステップS161の領域推定処理と、ステップS162の乗り換え候補抽出処理についてのみ以下に説明する。   Also in this case, as in the case shown in FIG. 14, the basic processing is performed in step S161, in which region estimation processing is performed, in step S162, transfer candidate extraction processing is performed, and in step S163, template creation is performed. Processing is performed. Of these, the template creation process in step S163 is the same as that shown in FIG. 28, and therefore only the region estimation process in step S161 and the transfer candidate extraction process in step S162 will be described below.

最初に、図33のフローチャートを参照して、ステップS161における領域推定処理の詳細について説明する。ステップS301において、図32の領域推定部161は、追尾点と同一対象に属する画像上の領域を推定するためにサンプル点を決定する。この処理は、図15のステップS181の処理と同様の処理である。   First, the details of the region estimation processing in step S161 will be described with reference to the flowchart in FIG. In step S301, the region estimation unit 161 in FIG. 32 determines sample points in order to estimate a region on the image that belongs to the same target as the tracking point. This process is the same as the process of step S181 in FIG.

ただし、このステップS301の処理において対象とされるフレームは、追尾点を求め終わったフレーム(追尾後の追尾点を含むフレーム)であり、この点、図15のステップS181においてサンプル点を求めるフレームが前フレームであるのと異なる。   However, the target frame in the process of step S301 is a frame for which a tracking point has been obtained (a frame including a tracking point after tracking), and this point is a frame for obtaining a sample point in step S181 of FIG. Different from the previous frame.

次に、このステップS302において、領域推定部161は、次フレーム(ステップS301でサンプル点を決定したフレーム)の画像に空間方向のローパスフィルタを施す処理を実行する。すなわちローパスフィルタを施すことにより、高周波成分が除去され、画像が平滑化される。これにより、次のステップS303における同色領域の成長処理が容易になる。   Next, in step S302, the region estimation unit 161 executes a process of applying a spatial low-pass filter to the image of the next frame (the frame whose sample point has been determined in step S301). That is, by applying a low pass filter, the high frequency component is removed and the image is smoothed. This facilitates the same color region growth process in the next step S303.

次に、ステップS303において、領域推定部161は、追尾点を出発点として、画素値の差分が閾値THimg未満であるという条件で、追尾点の同色領域を成長させ、同色領域に含まれるサンプル点を領域の推定結果とする処理を実行する。領域の推定結果としては、成長させた結果の同色領域に含まれるサンプル点が利用される。   Next, in step S303, the area estimation unit 161 grows the same color area of the tracking point from the tracking point as a starting point under the condition that the pixel value difference is less than the threshold THimg, and the sample points included in the same color area A process is executed with the region estimation result as. As the region estimation result, sample points included in the same color region as the growth result are used.

具体的には、例えば図34Aに示されるように、追尾点421に隣接する8個の方向の画素の画素値が読み取られる。すなわち、上方向、右上方向、右方向、右下方向、下方向、左下方向、左方向、および左上方向の8つの方向に隣接する画素の画素値が読み取られる。読み取られた画素値と追尾点421の画素値との差分が演算される。そして、演算された差分値が閾値THimg以上であるか否かが判定される。図34Aの場合、矢印を付して示される方向の画素値、すなわち上方向、右上方向、下方向、左方向、および左上方向の画素値と追尾点321の差分が閾値THimg未満であり、図中矢印を付さずに示されている方向、すなわち右方向、右下方向、および左下方向の画素値と追尾点421の差分が閾値THimg以上であったとされる。   Specifically, for example, as shown in FIG. 34A, pixel values of pixels in eight directions adjacent to the tracking point 421 are read. That is, the pixel values of pixels adjacent to the eight directions of the upper direction, the upper right direction, the right direction, the lower right direction, the lower direction, the lower left direction, the left direction, and the upper left direction are read. The difference between the read pixel value and the pixel value of the tracking point 421 is calculated. Then, it is determined whether or not the calculated difference value is greater than or equal to a threshold value THimg. In the case of FIG. 34A, the pixel value in the direction indicated by the arrow, that is, the difference between the pixel value in the upward direction, the upper right direction, the downward direction, the left direction, and the upper left direction and the tracking point 321 is less than the threshold THimg. It is assumed that the difference between the pixel value in the direction indicated without the middle arrow, that is, the right direction, the lower right direction, and the lower left direction, and the tracking point 421 is greater than or equal to the threshold THimg.

この場合、図34Bに示されるように、差分が閾値THimg未満である画素(図34Aにおいて、追尾点421に対して矢印で示される方向の画素)が追尾点421と同色領域の画素422として登録される。同様の処理が同色領域に登録された各画素422において行われる。図34Bに示される例では、図中左上の白い円で示される画素422とそれに隣接する画素(既に同色領域であるとの判定が行われた画素を除く)の画素値の差分が演算され、その差分が閾値THimg以上であるか否かが判定される。図34Bの例においては、右方向、右下方向、および下方向の画素は、既に同色領域の判定処理が終了している方向なので、上方向、右上方向、左下方向、左方向、および左上方向においての差分が演算される。そして、この例では、上方向、右上方向、および左上方向の3つの方向の差分が閾値THimg未満とされ、図34Cに示されるように、その方向の画素が追尾点421と同色領域の画素として登録される。   In this case, as shown in FIG. 34B, a pixel whose difference is less than the threshold THimg (a pixel in a direction indicated by an arrow with respect to the tracking point 421 in FIG. 34A) is registered as a pixel 422 in the same color area as the tracking point 421. Is done. Similar processing is performed for each pixel 422 registered in the same color area. In the example shown in FIG. 34B, the difference between the pixel values of the pixel 422 indicated by the white circle on the upper left in the figure and the adjacent pixel (excluding the pixel that has already been determined to be the same color area) is calculated. It is determined whether the difference is greater than or equal to a threshold THimg. In the example of FIG. 34B, the pixels in the right direction, the lower right direction, and the lower direction are directions in which the determination process for the same color region has already been completed, so the upper direction, the upper right direction, the lower left direction, the left direction, and the upper left direction The difference at is calculated. In this example, the difference between the three directions of the upper direction, the upper right direction, and the upper left direction is less than the threshold THimg, and as shown in FIG. 34C, the pixels in that direction are pixels in the same color area as the tracking point 421. be registered.

以上のような処理が順次繰り返されることで、図35に示されるように、サンプル点のうち、同色領域431に含まれる点が追尾点421と同一対象物上の点として推定される。   By sequentially repeating the above processing, as shown in FIG. 35, the points included in the same color region 431 among the sample points are estimated as points on the same object as the tracking point 421.

図33に示される領域推定処理(図14のステップS161)に続いて、図32の乗り換え候補抽出部162において実行される図14のステップS162の乗り換え候補抽出処理は、図36のフローチャートに示されるようになる。   Following the region estimation process shown in FIG. 33 (step S161 in FIG. 14), the transfer candidate extraction process in step S162 in FIG. 14 executed in the transfer candidate extraction unit 162 in FIG. 32 is shown in the flowchart in FIG. It becomes like this.

すなわち、ステップS331において、乗り換え候補抽出部162は、領域(同色領域)と推定されたすべての点をそのまま乗り換え候補とし、それを乗り換え候補保持部56に供給し、保持させる。   That is, in step S331, the transfer candidate extraction unit 162 uses all points estimated as regions (same color regions) as transfer candidates as they are, and supplies them to the transfer candidate holding unit 56 for holding.

図32の領域推定関連処理部55において、図33の領域推定処理(図14のステップS161)、図36の乗り換え候補抽出処理(図14のステップS162)に引き続き、図32のテンプレート作成部163で実行される図14のステップS163のテンプレート作成処理は、図28に示される場合と同様であるので、その説明は省略する。   32, following the region estimation process in FIG. 33 (step S161 in FIG. 14) and the transfer candidate extraction process in FIG. 36 (step S162 in FIG. 14), the template creation unit 163 in FIG. The template creation process executed in step S163 in FIG. 14 is the same as in the case shown in FIG. 28, and a description thereof will be omitted.

ただし、この場合においては、追尾点の同色領域をそのままテンプレートの範囲とすることも可能である。   However, in this case, the same color area of the tracking point can be used as the template range as it is.

以上に説明した図6のステップS51の通常処理に続いて行われるステップS52の例外処理の詳細について、図37のフローチャートを参照して説明する。この処理は、上述したように、図10のステップS124において追尾点の動きを推定することが不可能と判定され、さらにステップS128において追尾点を乗り換える乗り換え候補が選択できなかったと判定された場合に実行されることになる。   Details of the exception processing in step S52 performed following the normal processing in step S51 of FIG. 6 described above will be described with reference to the flowchart of FIG. As described above, this process is performed when it is determined in step S124 in FIG. 10 that it is impossible to estimate the movement of the tracking point, and in step S128, it is determined that the transfer candidate for changing the tracking point cannot be selected. Will be executed.

ステップS401において、制御部59は、例外処理の初期化処理を実行する。この処理の詳細は図38のフローチャートに示されている。   In step S401, the control unit 59 executes an exception process initialization process. Details of this processing are shown in the flowchart of FIG.

ステップS321において、制御部59は、追尾点の追尾ができなくなった際(追尾点の動きを推定することが不可能かつ、追尾点を乗り換える乗り換え候補が選択できなかった際)にシーンチェンジが起きていたか否かを判定する。シーンチェンジ検出部53は、動き推定部52の推定結果に基づいてシーンチェンがあったか否かを常に監視しており、制御部59は、そのシーンチェンジ検出部53の検出結果に基づいて、ステップS421の判定を実行する。シーンチェンジ検出部53の具体的処理については、図54と図55を参照して後述する。   In step S321, the control unit 59 causes a scene change when it becomes impossible to track the tracking point (when it is impossible to estimate the movement of the tracking point and a transfer candidate for changing the tracking point cannot be selected). It is determined whether it has been. The scene change detection unit 53 constantly monitors whether or not there is a scene chain based on the estimation result of the motion estimation unit 52, and the control unit 59 performs step S421 based on the detection result of the scene change detection unit 53. Execute the judgment. Specific processing of the scene change detection unit 53 will be described later with reference to FIGS. 54 and 55.

シーンチェンジが起きている場合、追尾ができなくなった理由がシーンチェンジが発生したことによるものと推定して、ステップS422において制御部19は、モードをシーンチェンジに設定する。これに対して、ステップS421においてシーンチェンジが発生していないと判定された場合には、制御部59は、ステップS423においてモードをその他のモードに設定する。   If a scene change has occurred, it is presumed that the reason why tracking has become impossible is due to the occurrence of a scene change, and in step S422, the control unit 19 sets the mode to scene change. In contrast, if it is determined in step S421 that no scene change has occurred, the control unit 59 sets the mode to another mode in step S423.

ステップS422またはステップS423の処理の後、ステップS424においてテンプレートマッチング部51は、時間的に最も古いテンプレートを選択する処理を実行する。具体的には、図39に示されるように、例えばフレームnからフレームn+1に移行するとき、例外処理が実行されるものとすると、フレームn−m+1からフレームnに関して生成され、テンプレート保持部58に保持されているm個のフレームのテンプレートの中から、時間的に最も古いテンプレートであるフレームn−m+1に関して生成されたテンプレートが選択される。   After the process of step S422 or step S423, the template matching unit 51 executes a process of selecting the oldest template in time in step S424. Specifically, as shown in FIG. 39, for example, when transition from frame n to frame n + 1 is performed, if exception processing is to be executed, a frame n−m + 1 is generated for frame n and is stored in the template holding unit 58. A template generated with respect to the frame mn + 1, which is the oldest template in time, is selected from the held m-frame templates.

このように例外処理への移行直前のテンプレート(図39の例の場合フレームnに関して生成されたテンプレート)を用いずに、時間的に少し前のテンプレートを選択するのは、追尾対象のオクルージョンなどで例外処理への移行が発生した場合には、移行の直前には追尾対象が既にかなり隠れており、その時点のテンプレートでは、追尾対象を充分に大きく捉えることができない可能性が高いからである。従って、このように時間的に若干前のフレームにおけるテンプレートを選択することで、確実な追尾が可能となる。   In this way, the template just before the transition to exception processing (the template generated for frame n in the case of the example in FIG. 39) is used in order to select a template a little earlier in time, such as occlusion to be tracked. This is because when the transition to exception processing occurs, the tracking target is already considerably hidden immediately before the transition, and it is highly likely that the tracking target cannot be captured sufficiently large in the template at that time. Therefore, reliable tracking is possible by selecting a template in a frame slightly before in time.

次に、ステップS425において、テンプレートマッチング部51は、テンプレート探索範囲を設定する処理を実行する。テンプレート探索範囲は、例えば、例外処理に移行する直前の追尾点の位置がテンプレート探索範囲の中心となるように設定される。   Next, in step S425, the template matching unit 51 executes processing for setting a template search range. For example, the template search range is set such that the position of the tracking point immediately before the transition to the exception process is the center of the template search range.

すなわち、図40に示されるように、フレームnにおいて被写体の顔104の右目102が追尾点101として指定されている場合において、図中左方向からボール121が飛んできて、フレームn+1において追尾点101を含む顔104が隠れ、フレームn+2において、再び追尾点101が現れる場合を想定する。この場合において、追尾点101(テンプレート範囲411に含まれる)を中心とする領域がテンプレート探索範囲412として設定される。   That is, as shown in FIG. 40, when the right eye 102 of the subject's face 104 is designated as the tracking point 101 in the frame n, the ball 121 flies from the left direction in the figure, and the tracking point 101 in the frame n + 1. Is assumed, and the tracking point 101 appears again in the frame n + 2. In this case, a region centered on the tracking point 101 (included in the template range 411) is set as the template search range 412.

ステップS426において、テンプレートマッチング部51は、例外処理への移行後の経過フレーム数およびシーンチェンジ数を0にリセットする。このフレーム数とシーンチェンジ数は、後述する図37のステップS405における継続判定処理(図41のステップS461,S463,S465,S467)において使用される。   In step S426, the template matching unit 51 resets the number of elapsed frames and the number of scene changes after shifting to exception processing to zero. The number of frames and the number of scene changes are used in a continuation determination process (steps S461, S463, S465, and S467 in FIG. 41) in step S405 in FIG.

以上のようにして、例外処理の初期化処理が終了した後、図37のステップS402において、制御部59は次のフレームを待つ処理を実行する。ステップS403において、テンプレートマッチング部51は、テンプレート探索範囲内においてテンプレートマッチング処理を行う。ステップS404においてテンプレートマッチング部51は、通常処理への復帰が可能であるか否かを判定する。   After the exception process initialization process is completed as described above, in step S402 in FIG. 37, the control unit 59 executes a process of waiting for the next frame. In step S403, the template matching unit 51 performs template matching processing within the template search range. In step S404, the template matching unit 51 determines whether it is possible to return to normal processing.

具体的には、テンプレートマッチング処理により、数フレーム前のテンプレート(図40のテンプレート範囲411内の画素)と、テンプレート探索範囲内のマッチング対象の画素の差分の絶対値和が演算される。より詳細には、テンプレート範囲411内の所定のブロックと、テンプレート探索範囲内の所定のブロックにおけるそれぞれの画素の差分の絶対値和が演算される。ブロックの位置がテンプレート範囲411内で順次移動され、各ブロックの差分の絶対値和が加算され、そのテンプレートの位置における値とされる。そして、テンプレートをテンプレート探索範囲内で順次移動させた場合における差分の絶対値和が最も小さくなる位置とその値が検索される。ステップS404において、最小の差分の絶対値和が、予め設定されている所定の閾値と比較される。差分の絶対値和が閾値以下である場合には、追尾点(テンプレートに含まれている)を含む画像が再び出現したことになるので、通常処理への復帰が可能であると判定され、処理は図6のステップS51の通常処理に戻る。   Specifically, the absolute value sum of the difference between the template several frames before (a pixel in the template range 411 in FIG. 40) and the matching target pixel in the template search range is calculated by the template matching process. More specifically, the sum of absolute values of differences between the pixels in the predetermined block in the template range 411 and the predetermined block in the template search range is calculated. The position of the block is sequentially moved within the template range 411, and the sum of absolute values of the differences of the respective blocks is added to obtain a value at the position of the template. Then, the position where the sum of absolute values of the differences becomes the smallest when the template is sequentially moved within the template search range and its value are searched. In step S404, the absolute sum of the minimum differences is compared with a predetermined threshold value set in advance. If the sum of absolute values of the differences is less than or equal to the threshold value, an image including the tracking point (included in the template) has appeared again, so it is determined that the normal processing can be restored, and the processing Returns to the normal processing of step S51 of FIG.

そして上述したように、図11のステップS141において、例外処理からの復帰であると判定され、ステップS144において、差分絶対値和が最小となる位置をテンプレートのマッチした位置として、このマッチした位置とテンプレートに対応して保持してあったテンプレート位置と追尾点領域推定範囲の位置関係から、追尾点と領域推定範囲の設定が行われる。すなわち、図31を参照して説明したように、追尾点405を基準とするベクトル406,407に基づいて、領域推定範囲402が設定される。   Then, as described above, in step S141 in FIG. 11, it is determined that the return from the exception processing is performed, and in step S144, the position where the difference absolute value sum is minimum is set as the matched position of the template, The tracking point and area estimation range are set based on the positional relationship between the template position and the tracking point area estimation range held corresponding to the template. That is, as described with reference to FIG. 31, the region estimation range 402 is set based on the vectors 406 and 407 with the tracking point 405 as a reference.

ただし、図14のステップS161の領域推定処理において、領域推定範囲を用いない手法を用いる場合(例えば、図33に示される領域推定処理が用いられる場合)には、領域推定範囲の設定は行われない。   However, in the region estimation process in step S161 of FIG. 14, when a method that does not use the region estimation range is used (for example, when the region estimation process shown in FIG. 33 is used), the region estimation range is set. Absent.

図37のステップS404における通常処理への復帰が可能であるか否かの判定は、最小の差分絶対値和をテンプレートのアクティビティで除算して得られる値を閾値と比較することで行うようにしてもよい。この場合におけるアクティビティは、後述する図47のアクティビティ算出部602により、図48のステップS603において算出された値を用いることができる。   The determination as to whether or not it is possible to return to normal processing in step S404 in FIG. 37 is performed by comparing the value obtained by dividing the minimum sum of absolute differences by the activity of the template with a threshold value. Also good. As the activity in this case, the value calculated in step S603 of FIG. 48 by the activity calculation unit 602 of FIG. 47 described later can be used.

あるいはまた、今回の最小の差分絶対値和を1フレーム前における最小の差分絶対値和で除算することで得られた値を所定の閾値と比較することで、通常処理への復帰が可能であるか否かを判定するようにしてもよい。この場合、アクティビティの計算が不要となる。すなわち、ステップS404では、テンプレートとテンプレート探索範囲の相関が演算され、相関値と閾値の比較に基づいて判定が行われる。   Alternatively, it is possible to return to the normal processing by comparing a value obtained by dividing the current minimum absolute difference sum by the minimum absolute difference sum one frame before with a predetermined threshold. It may be determined whether or not. In this case, it is not necessary to calculate the activity. That is, in step S404, the correlation between the template and the template search range is calculated, and determination is performed based on the comparison between the correlation value and the threshold value.

ステップS404において、通常処理への復帰が可能ではないと判定された場合、ステップS405に進み、継続判定処理が実行される。継続判定処理の詳細は、図41のフローチャートを参照して後述するが、これにより、追尾処理が継続可能であるか否かの判定が行われる。   If it is determined in step S404 that it is not possible to return to the normal process, the process proceeds to step S405, and the continuation determination process is executed. The details of the continuation determination process will be described later with reference to the flowchart of FIG. 41, whereby it is determined whether or not the tracking process can be continued.

ステップS406において、制御部59は、追尾点の追尾が継続可能であるか否かを継続判定処理の結果に基づいて(後述する図41のステップS466,S468で設定されたフラグに基づいて)判定する。追尾点の追尾処理が継続可能である場合には、処理はステップS302に戻り、それ以降の処理が繰り返し実行される。すなわち、追尾点が再び出現するまで待機する処理が繰り返し実行される。   In step S406, the control unit 59 determines whether or not tracking of the tracking point can be continued based on the result of the continuation determination process (based on a flag set in steps S466 and S468 of FIG. 41 described later). To do. If the tracking point tracking process can be continued, the process returns to step S302, and the subsequent processes are repeatedly executed. That is, the process of waiting until the tracking point appears again is repeatedly executed.

これに対して、ステップS406において、追尾点の追尾処理が継続可能ではないと判定された場合(後述する図41のステップS465で、追尾点が消失した後の経過フレーム数が閾値THfr以上と判定されるか、または、ステップS467でシーンチェンジ数が閾値THsc以上と判定された場合)、最早、追尾処理は不可能として、追尾処理は終了される。   On the other hand, when it is determined in step S406 that the tracking point tracking process cannot be continued (in step S465 of FIG. 41 described later, it is determined that the number of elapsed frames after the tracking point disappears is greater than or equal to the threshold value THfr. Or when it is determined in step S467 that the number of scene changes is equal to or greater than the threshold value THsc), the tracking process is terminated as the tracking process is no longer possible.

図41は、図37のステップS405における継続判定処理の詳細を表している。ステップS461において、制御部59は、変数としての経過フレーム数に1を加算する処理を実行する。経過フレーム数は、図37のステップS401の例外処理の初期化処理(図38のステップS426)において、予め0にリセットされている。   FIG. 41 shows the details of the continuation determination process in step S405 of FIG. In step S461, the control unit 59 executes a process of adding 1 to the number of elapsed frames as a variable. The number of elapsed frames is previously reset to 0 in the exception process initialization process (step S426 in FIG. 38) in step S401 in FIG.

次にステップS462において、制御部59は、シーンチェンジがあるか否かを判定する。シーンチェンジがあるか否かは、シーンチェンジ検出部53が、常にその検出処理を実行しており、その検出結果に基づいて判定が可能である。シーンチェンジがある場合には、ステップS463に進み、制御部59は変数としてのシーンチェンジ数に1を加算する。このシーンチェンジ数も、図38のステップS426の初期化処理において0にリセットされている。通常処理から例外処理への移行時にシーンチェンジが発生していない場合には、ステップS463の処理はスキップされる。   Next, in step S462, the control unit 59 determines whether there is a scene change. Whether or not there is a scene change can be determined based on the detection result of the scene change detection unit 53 always executing the detection process. If there is a scene change, the process proceeds to step S463, and the control unit 59 adds 1 to the number of scene changes as a variable. The number of scene changes is also reset to 0 in the initialization process of step S426 in FIG. If no scene change has occurred during the transition from the normal process to the exception process, the process of step S463 is skipped.

次に、ステップS464において、制御部59は、現在設定されているモードがシーンチェンジであるか否かを判定する。このモードは、図38のステップS422,S423において設定されたものである。現在設定されているモードがシーンチェンジである場合には、ステップS467に進み、制御部59は、シーンチェンジ数が予め設定されている閾値THscより小さいか否かを判定する。シーンチェンジ数が閾値THscより小さい場合には、ステップS466に進み、制御部59は継続可のフラグを設定し、シーンチェンジ数が閾値THsc以上である場合には、ステップS468に進み、継続不可のフラグを設定する。   Next, in step S464, the control unit 59 determines whether or not the currently set mode is a scene change. This mode is set in steps S422 and S423 in FIG. When the currently set mode is a scene change, the process proceeds to step S467, and the control unit 59 determines whether or not the number of scene changes is smaller than a preset threshold value THsc. If the number of scene changes is smaller than the threshold value THsc, the process proceeds to step S466, and the control unit 59 sets a flag that allows continuation. If the number of scene changes is equal to or greater than the threshold value THsc, the process proceeds to step S468 and cannot be continued. Set the flag.

一方、ステップS464において、モードがシーンチェンジではないと判定された場合(モードがその他であると判定された場合)、ステップS465に進み、制御部59は、経過フレーム数が閾値THfrより小さいか否かを判定する。この経過フレーム数も、図38の例外処理の初期化処理のステップS426において、予め0にリセットされている。経過フレーム数が閾値THfrより小さいと判定された場合には、ステップS466において、継続可のフラグが設定され、経過フレーム数が閾値THfr以上であると判定された場合には、ステップS468において、継続不可のフラグが設定される。   On the other hand, when it is determined in step S464 that the mode is not a scene change (when it is determined that the mode is other), the process proceeds to step S465, and the control unit 59 determines whether or not the number of elapsed frames is smaller than the threshold value THfr. Determine whether. The number of elapsed frames is also reset to 0 in advance in step S426 of the exception process initialization process of FIG. If it is determined that the number of elapsed frames is smaller than the threshold value THfr, a continuation flag is set in step S466, and if it is determined that the number of elapsed frames is greater than or equal to the threshold value THfr, the process continues in step S468. A disabled flag is set.

このように、テンプレートマッチング処理時におけるシーンチェンジ数が閾値THsc以上になるか、または経過フレーム数が閾値THfr以上になった場合には、それ以上の追尾処理は不可能とされる。   As described above, when the number of scene changes during the template matching process is equal to or greater than the threshold value THsc, or when the number of elapsed frames is equal to or greater than the threshold value THfr, no further tracking process is possible.

なお、モードがその他である場合には、シーンチェンジ数が0であるという条件も加えて、継続が可能であるか否かを判定するようにしてもよい。   When the mode is other, a condition that the number of scene changes is 0 may be added to determine whether or not continuation is possible.

以上においては、画像のフレームを処理単位とし、すべてのフレームを用いることを前提としたが、フィールド単位で処理したり、すべてのフレームまたはフィールドを利用するのではなく、所定の間隔で間引いて抽出されたフレームまたはフィールドを用いるようにすることも可能である。   In the above, it is assumed that the frame of the image is used as a processing unit and all frames are used. However, processing is not performed in units of fields or using all frames or fields, but is extracted by thinning out at a predetermined interval. It is also possible to use a modified frame or field.

また、以上においては、乗り換え候補として、推定した領域内の点の移動先を用いるようにしたが、領域内の点をそのまま用いるようにすることも可能である。この場合、図6のステップS51の通常処理は、図10の処理に代えて、図42の処理に変更される。   In the above description, the estimated movement destination of the point in the area is used as the transfer candidate, but it is also possible to use the point in the area as it is. In this case, the normal process of step S51 of FIG. 6 is changed to the process of FIG. 42 instead of the process of FIG.

図42のステップS501乃至ステップS510の処理は、基本的に図10のステップS21乃至ステップS29の処理と同様の処理であるが、図10のステップS122に対応する図42のステップS502の次のフレームを待つ処理の次に、ステップS503の領域推定関連処理が挿入されている点と、図10におけるステップS126における領域推定関連処理に代えて、ステップS507の領域推定範囲の更新処理が実行される点が異なっている。その他の処理は、図10における場合と同様であるので、その説明は省略する。   The processes in steps S501 through S510 in FIG. 42 are basically the same as the processes in steps S21 through S29 in FIG. 10, but the next frame after step S502 in FIG. 42 corresponding to step S122 in FIG. Next to the process of waiting for the process, the area estimation related process in step S503 is inserted, and the area estimation range update process in step S507 is executed instead of the area estimation related process in step S126 in FIG. Is different. The other processes are the same as those in FIG.

図42のステップS503の領域推定関連処理の詳細は、図10を参照して説明した場合と同様となり、ステップS507の領域推定範囲の更新処理は、図16を参照して説明した場合と同様の処理となる。   The details of the area estimation related process in step S503 in FIG. 42 are the same as those described with reference to FIG. 10, and the area estimation range update process in step S507 is the same as in the case described with reference to FIG. It becomes processing.

通常処理を、図42のフローチャートに示されるように実行した場合における、ステップS503の領域推定関連処理(図10の領域推定関連処理)の領域推定処理(図10のステップS161における領域推定処理)は、図43のフローチャートに示されるようになる。   When the normal processing is executed as shown in the flowchart of FIG. 42, the region estimation processing (region estimation processing in step S161 of FIG. 10) of the region estimation related processing of step S503 (region estimation related processing of FIG. 10) is As shown in the flowchart of FIG.

そのステップS531乃至ステップS535の処理は、基本的に図15のステップS181乃至ステップS186の処理と同様の処理となる。ただし、図15のステップS186における領域推定範囲の更新処理が図43においては省略されている。その他の処理は、図15における場合と同様である。すなわち、領域推定範囲の更新処理は、図42のステップS507において実行されるため、図43の領域推定処理では不要とされるのである。   The processing from step S531 to step S535 is basically the same as the processing from step S181 to step S186 in FIG. However, the region estimation range update processing in step S186 in FIG. 15 is omitted in FIG. Other processes are the same as those in FIG. That is, the area estimation range update process is executed in step S507 of FIG. 42, and is thus unnecessary in the area estimation process of FIG.

さらに、図42の通常処理を行う場合におけるステップS503の領域推定関連処理(図16の領域推定関連処理)の乗り換え候補抽出処理(図14のステップS162における乗り換え候補抽出処理)は、図44に示されるようになる。このステップS551の処理は、図27におけるステップS261の乗り換え候補抽出処理と同様の処理となる。   Furthermore, the transfer candidate extraction process (transfer candidate extraction process in step S162 of FIG. 14) of the area estimation related process (area estimation related process of FIG. 16) in step S503 when the normal process of FIG. 42 is performed is shown in FIG. It comes to be. The process in step S551 is the same as the transfer candidate extraction process in step S261 in FIG.

以上のように、通常処理を図42のフローチャートに示されるように行った場合と、図10に示されるように行った場合とにおける処理の違いを説明すると、図45と図46に示されるようになる。   As described above, the difference in processing between the case where the normal processing is performed as shown in the flowchart of FIG. 42 and the case where the normal processing is performed as shown in FIG. 10 will be described as shown in FIGS. 45 and 46. become.

図10のフローチャートに示される通常処理を行った場合には、図45に示されるように、フレームnにおいて、領域推定範囲221内の図中黒い四角形で示される点451により領域222が構成されているとすると、次のフレームn+1において、前のフレームnにおける領域222の各点451をそれぞれの動きベクトル453に基づいてシフトした位置におけるフレームn+1上の点452が乗り換え候補とされる(図23のステップS161の処理)。   When the normal processing shown in the flowchart of FIG. 10 is performed, as shown in FIG. 45, in the frame n, the region 222 is constituted by the points 451 indicated by the black squares in the region estimation range 221. In the next frame n + 1, a point 452 on the frame n + 1 at a position obtained by shifting each point 451 of the region 222 in the previous frame n based on the respective motion vector 453 is set as a transfer candidate (FIG. 23). Step S161).

各点451の動きベクトル453は、全画面動きの動きベクトルと同じになることもあるが、全画面動きと同じ動きとみなす精度によっては各点の推定動きに多少のばらつきがでる。例えば、水平方向、垂直方向とも、±1画素の違いは同じとみなすとすると、(0,0)の動きには、(−1,1)や(1,0)の動きも含まれる。この場合、全画面動きが(0,0)であったとしても、各点451が、(−1,1)、(1,0)等の動きを持っているときは、それぞれの動きの分だけシフトされる。移動先の点をそのまま乗り換え候補として用いるのではなく、予め求められたサンプル点のうち、最も近い点を乗り換え候補とすることも可能である。勿論、処理負荷軽減のため、各点451を、全画面動きの分だけシフトしてもよい。   The motion vector 453 of each point 451 may be the same as the motion vector of the full screen motion, but there are some variations in the estimated motion of each point depending on the accuracy considered as the same motion as the full screen motion. For example, assuming that the difference of ± 1 pixel is the same in both the horizontal direction and the vertical direction, the movement of (0, 0) includes the movement of (-1, 1) and (1, 0). In this case, even if the full screen motion is (0, 0), if each point 451 has a motion such as (-1, 1), (1, 0), etc., Only shifted. Instead of using the destination point as a transfer candidate as it is, it is also possible to set the closest point among sample points obtained in advance as a transfer candidate. Of course, in order to reduce the processing load, each point 451 may be shifted by the amount corresponding to the full screen movement.

これに対して、通常処理を図42のフローチャートに示されるように実行した場合においては、図46に示されるように、フレームnにおける領域推定範囲221内の点461が乗り換え候補とされる。   On the other hand, when the normal process is executed as shown in the flowchart of FIG. 42, as shown in FIG. 46, a point 461 in the region estimation range 221 in the frame n is set as a transfer candidate.

次に、図47を参照して、図5の動き推定部52の構成例について説明する。この実施の形態においては、入力画像が、評価値算出部601、アクティビティ算出部602、および動きベクトル検出部606に供給されている。評価値算出部601は、動きベクトルにより対応付けられる両対象の一致度に関する評価値を算出し、正規化処理部604に供給する。アクティビティ算出部602は、入力画像のアクティビティを算出し、閾値判定部603と正規化処理部604に供給する。動きベクトル検出部606は、入力画像から動きベクトルを検出し、評価値算出部601と統合処理部605に供給する。   Next, a configuration example of the motion estimation unit 52 in FIG. 5 will be described with reference to FIG. In this embodiment, the input image is supplied to the evaluation value calculation unit 601, the activity calculation unit 602, and the motion vector detection unit 606. The evaluation value calculation unit 601 calculates an evaluation value related to the degree of coincidence between the two objects associated by the motion vector, and supplies the evaluation value to the normalization processing unit 604. The activity calculation unit 602 calculates the activity of the input image and supplies it to the threshold value determination unit 603 and the normalization processing unit 604. The motion vector detection unit 606 detects a motion vector from the input image and supplies it to the evaluation value calculation unit 601 and the integration processing unit 605.

正規化処理部604は、評価値算出部601より供給された評価値を、アクティビティ算出部602より供給されたアクティビティに基づいて正規化し、得られた値を統合処理部605に供給する。閾値判定部603は、アクティビティ算出部602より供給されたアクティビティを所定の閾値と比較し、その判定結果を統合処理部605に供給する。統合処理部605は、正規化処理部604から供給された正規化情報と、閾値判定部603より供給された判定結果に基づいて、動きベクトルの確度を演算し、得られた確度を動きベクトル検出部606より供給された動きベクトルとともに出力する。   The normalization processing unit 604 normalizes the evaluation value supplied from the evaluation value calculation unit 601 based on the activity supplied from the activity calculation unit 602, and supplies the obtained value to the integration processing unit 605. The threshold determination unit 603 compares the activity supplied from the activity calculation unit 602 with a predetermined threshold and supplies the determination result to the integration processing unit 605. The integration processing unit 605 calculates the accuracy of the motion vector based on the normalization information supplied from the normalization processing unit 604 and the determination result supplied from the threshold value determination unit 603, and the obtained accuracy is detected by the motion vector detection. This is output together with the motion vector supplied from the unit 606.

次に、図48のフローチャートを参照して、動き推定部52の動き推定処理について説明する。動きベクトルは、点に対するものとして求められているが、その確度は、動きベクトルにより対応付けられる2つの点の近傍の、例えば点を中心とする、小ブロックの画像データを用いて計算される。ステップS601において、動きベクトル検出部606は、入力画像から動きベクトルを検出する。この検出には、例えばブロックマッチング方式や勾配法が用いられる。検出された動きベクトルは、評価値算出部601と統合処理部605に供給される。   Next, the motion estimation process of the motion estimation unit 52 will be described with reference to the flowchart of FIG. Although the motion vector is obtained for a point, the accuracy is calculated using image data of a small block in the vicinity of two points associated by the motion vector, for example, centering on the point. In step S601, the motion vector detection unit 606 detects a motion vector from the input image. For this detection, for example, a block matching method or a gradient method is used. The detected motion vector is supplied to the evaluation value calculation unit 601 and the integration processing unit 605.

ステップS602において、評価値算出部601は評価値を算出する。具体的には、例えば、動きベクトルで対応付けられる2つの点を中心とする2つのブロックの画素値の差分絶対値和が算出される。すなわち、ステップS601で動きベクトル検出部606により検出された動きベクトルV(vx,vy)と、それに基づく時間的に前のフレームの画像Fi上の点P(Xp,Yp)、並びに時間的に後のフレームの画像Fj上の点Q(Xq,Yq)の関係は次式で表される。
Q(Xq,Yq)=P(Xp,Yp)+V(vx,vy) ・・・(1)
In step S602, the evaluation value calculation unit 601 calculates an evaluation value. Specifically, for example, the sum of absolute differences of pixel values of two blocks centered on two points associated with motion vectors is calculated. That is, the motion vector V (vx, vy) detected by the motion vector detection unit 606 in step S601, the point P (Xp, Yp) on the image Fi of the previous frame based on the motion vector V (vx, vy), and the time later The relationship of the point Q (Xq, Yq) on the image Fj of the frame is expressed by the following equation.
Q (Xq, Yq) = P (Xp, Yp) + V (vx, vy) (1)

評価値算出部601は点Pを中心とするブロックと、点Qを中心とするブロックについて、次式に基づいて評価値Eval(P,Q,i,j)を演算する。   The evaluation value calculation unit 601 calculates an evaluation value Eval (P, Q, i, j) for a block centered on the point P and a block centered on the point Q based on the following equation.

Figure 0004725105
Figure 0004725105

各ブロックは、1辺が2L+1画素の正方形とされている。上記式における総和ΣΣは、xが−LからLについて、yが−LからLについて、対応する画素同士で行われる。従って、例えば、L=2である場合、9個の差分が得られ、その絶対値の総和が演算される。評価値は、その値が0に近づくほど、2つのブロックがよく一致していることを表している。   Each block is a square having 2L + 1 pixels on one side. The summation ΣΣ in the above equation is performed between corresponding pixels when x is from −L to L and y is from −L to L. Therefore, for example, when L = 2, nine differences are obtained, and the sum of the absolute values is calculated. The evaluation value indicates that the two blocks match well as the value approaches zero.

評価値算出部601は、生成した評価値を正規化処理部604に供給する。   The evaluation value calculation unit 601 supplies the generated evaluation value to the normalization processing unit 604.

ステップS603において、アクティビティ算出部602は、入力画像からアクティビティを算出する。アクティビティは、画像の複雑さを表す特徴量であり、図49に示されるように、各画素毎に注目画素Y(x,y)と、それに隣接する8画素Y(x+i,y+j)との差分絶対値和の平均値が、注目画素位置のアクティビティActivity(x,y)として次式に基づいて演算される。   In step S603, the activity calculation unit 602 calculates an activity from the input image. The activity is a feature amount representing the complexity of the image, and as shown in FIG. 49, the difference between the pixel of interest Y (x, y) and the adjacent 8 pixels Y (x + i, y + j) for each pixel. The average value of the sum of absolute values is calculated based on the following formula as activity Activity (x, y) at the target pixel position.

Figure 0004725105
Figure 0004725105

図49の例の場合、3×3画素のうち、中央に位置する注目画素Y(x,y)の値は110であり、それに隣接する8個の画素の値は、それぞれ80,70,75,100,100,100,80,80であるから、アクティビティActivity(x,y)は次式で表される。   In the case of the example of FIG. 49, the value of the pixel of interest Y (x, y) located at the center among the 3 × 3 pixels is 110, and the values of the eight pixels adjacent thereto are 80, 70, and 75, respectively. , 100, 100, 100, 80, 80, the activity Activity (x, y) is expressed by the following equation.

Activity(x,y) ={|80−110|+|70−110|+|75−110|+|100−110|+|100−110|+|100−110|+|80−110|+|80−110|}/8 =24.375となる。   Activity (x, y) = {| 80-110 | + | 70-110 | + | 75-110 | + | 100-110 | + | 100-110 | + | 80-110 | + | 80−110 |} /8=24.375.

同様の処理が、そのフレームのすべての画素について実行される。   Similar processing is performed for all pixels in the frame.

ブロック単位で動きベクトル確度を算出するため、次式で表されるブロック内の全画素のアクティビティの総和が、そのブロックのアクティビティ(ブロックアクティビティ)Blockactivity(i,j)と定義される。   In order to calculate the motion vector accuracy in units of blocks, the sum of the activities of all the pixels in the block expressed by the following equation is defined as the activity (block activity) Blockactivity (i, j) of the block.

Figure 0004725105
Figure 0004725105

なお、アクティビティとしては、この他、分散値、ダイナミックレンジなどとすることも可能である。   In addition, the activity may be a variance value, a dynamic range, or the like.

閾値判定部603は、ステップS604において、アクティビティ算出部602により算出されたブロックアクティビティを予め設定されている所定の閾値と比較する。そして、入力されたブロックアクティビティが閾値より大きいか否かを表すフラグを統合処理部605に出力する。   In step S604, the threshold determination unit 603 compares the block activity calculated by the activity calculation unit 602 with a predetermined threshold set in advance. Then, a flag indicating whether or not the input block activity is larger than the threshold value is output to the integration processing unit 605.

具体的には、実験の結果、ブロックアクティビティと評価値は、動きベクトルをパラメータとして、図50に示される関係を有する。図50において、横軸はブロックアクティビティBlockactivity(i,j)を表し、縦軸は評価値Evalを表している。動きが正しく検出されている場合(正しい動きベクトルが与えられている場合)、そのブロックアクティビティと評価値の値は、曲線621より図中下側の領域R1に分布する。これに対して誤った動き(不正解の動きベクトル)が与えられた場合、そのブロックアクティビティと評価値の値は、曲線622より、図中左側の領域R2に分布する(曲線622より上側の領域R2以外の領域と曲線621より下側の領域R1以外の領域には殆ど分布がない)。曲線621と曲線622は、点Pにおいて交差する。この点Pにおけるブロックアクティビティの値が閾値THaとされる。閾値THaは、ブロックアクティビティの値がそれより小さい場合には、対応する動きベクトルが正しくない可能性があることを意味する(この点については後に詳述する)。閾値判定部603は、アクティビティ算出部602より入力されたブロックアクティビティの値が、この閾値THaより大きいか否かを表すフラグを統合処理ブロック605に出力する。   Specifically, as a result of the experiment, the block activity and the evaluation value have the relationship shown in FIG. 50 using the motion vector as a parameter. In FIG. 50, the horizontal axis represents the block activity Blockactivity (i, j), and the vertical axis represents the evaluation value Eval. When the motion is correctly detected (when the correct motion vector is given), the block activity and the value of the evaluation value are distributed in the region R1 below the curve 621 in the figure. On the other hand, if an incorrect motion (incorrect motion vector) is given, the block activity and the evaluation value are distributed in the region R2 on the left side of the figure from the curve 622 (the region above the curve 622). There is almost no distribution in the region other than R2 and the region other than the region R1 below the curve 621). Curves 621 and 622 intersect at point P. The value of the block activity at this point P is set as the threshold value THa. The threshold value THa means that if the value of the block activity is smaller than that, the corresponding motion vector may be incorrect (this will be described in detail later). The threshold determination unit 603 outputs a flag indicating whether the block activity value input from the activity calculation unit 602 is greater than the threshold THa to the integration processing block 605.

ステップS605において、正規化処理部604は、正規化処理を実行する。具体的には、正規化処理部604は、次式に従って動きベクトル確度VCを演算する。   In step S605, the normalization processing unit 604 executes normalization processing. Specifically, the normalization processing unit 604 calculates the motion vector accuracy VC according to the following equation.

VC=1−評価値/ブロックアクティビティ ・・・(5)   VC = 1-evaluation value / block activity (5)

但し、動きベクトル確度VCの値が0未満となる場合にはその値を0に置き換える。動きベクトル確度VCのうち、評価値をブロックアクティビティで割り算して得られた値は、その値によって規定される図50のグラフ上の位置が、原点Oと点Pを結ぶ傾きが1の直線623より、図中下側の領域内であるのか、図中上側の領域内であるのかを表す。すなわち、直線623の傾きは1であり、評価値をブロックアクティビティで割り算して得られた値が1より大きければ、その値に対応する点は、直線623の上側の領域に分布する点であることを意味する。そしてこの値を1から減算して得られる動きベクトル確度VCは、その値が小さい程、対応する点が領域R2に分布する可能性が高いことを意味する。   However, if the value of the motion vector accuracy VC is less than 0, the value is replaced with 0. Of the motion vector accuracy VC, the value obtained by dividing the evaluation value by the block activity is a straight line 623 where the position on the graph of FIG. 50 defined by the value is the slope connecting the origin O and the point P is 1. Therefore, it indicates whether the region is in the lower region or the upper region in the figure. That is, if the slope of the straight line 623 is 1, and the value obtained by dividing the evaluation value by the block activity is larger than 1, the points corresponding to the value are points distributed in the area above the straight line 623. Means that. The motion vector accuracy VC obtained by subtracting this value from 1 means that the smaller the value, the higher the possibility that the corresponding points are distributed in the region R2.

これに対して、評価値をブロックアクティビティで割り算して得られた値が1より小さければ、その値に対応する点は、直線623の図中下側の領域に分布することを意味する。そして、そのときの動きベクトル確度VCは、その値が大きい程(0に近い程)、対応する点が領域R1に分布することを意味する。正規化処理部604は、このようにして演算して得られた動きベクトル確度VCを統合処理部605に出力する。   On the other hand, if the value obtained by dividing the evaluation value by the block activity is smaller than 1, it means that the points corresponding to the value are distributed in the lower area of the straight line 623 in the figure. The motion vector accuracy VC at that time means that the larger the value (closer to 0), the corresponding points are distributed in the region R1. The normalization processing unit 604 outputs the motion vector accuracy VC obtained by the calculation in this way to the integration processing unit 605.

ステップS606において、統合処理部605は、統合処理を実行する。この統合処理の詳細は、図51のフローチャートに示されている。   In step S606, the integration processing unit 605 executes integration processing. Details of this integration processing are shown in the flowchart of FIG.

統合処理部605は、ステップS631において、ブロックアクティビティが閾値THa以下か否かを判定する。この判定は、閾値判定部603より供給されたフラグに基づいて行われる。ブロックアクティビティが閾値THa以下である場合には、ステップS632において統合処理部605は、正規化処理部604が算出した動きベクトル確度VCの値を0に設定する。ステップS631において、アクティビティの値が閾値THaより大きいと判定された場合には、ステップS632の処理はスキップされ、正規化処理部604で生成された動きベクトル確度VCの値が、そのまま動きベクトルとともに出力される。   In step S631, the integration processing unit 605 determines whether the block activity is equal to or less than the threshold value THa. This determination is performed based on the flag supplied from the threshold determination unit 603. If the block activity is equal to or less than the threshold THa, the integration processing unit 605 sets the value of the motion vector accuracy VC calculated by the normalization processing unit 604 to 0 in step S632. If it is determined in step S631 that the activity value is greater than the threshold value THa, the processing in step S632 is skipped, and the value of the motion vector accuracy VC generated by the normalization processing unit 604 is output as it is together with the motion vector. Is done.

これは、正規化処理部604において演算された動きベクトルの確度VCの値が正であったとしても、ブロックアクティビティの値が閾値THaより小さい場合には、正しい動きベクトルが得られていない可能性があるからである。すなわち、図50に示されるように、原点Oと点Pの間においては、曲線622が、曲線621より図中下側に(直線623より下側に)突出することになる。ブロックアクティビティの値が閾値Thaより小さい区間であって、曲線621と曲線622において囲まれる領域R3においては、評価値をブロックアクティビティで割り算して得られる値は、領域R1とR2の両方に分布し、正しい動きベクトルが得られていない可能性が高い。そこで、このような分布状態である場合には、動きベクトルの確度は低いものとして処理するようにする。このため、ステップS632において、動きベクトル確度VCは、その値が正であったとしても、閾値Thaより小さい場合には、0に設定される。このようにすることで、動きベクトル確度VCの値が正である場合には、正しい動きベクトルが得られている場合であることを確実に表すことが可能となる。しかも、動きベクトル確度VCの値が大きい程、正しい動きベクトルが得られている確率が高くなる(分布が領域R1に含まれる確率が高くなる)。   This is because there is a possibility that a correct motion vector is not obtained if the block activity value is smaller than the threshold value THa even if the value of the motion vector accuracy VC calculated by the normalization processing unit 604 is positive. Because there is. That is, as shown in FIG. 50, between the origin O and the point P, the curve 622 protrudes below the curve 621 in the drawing (below the straight line 623). In a region R3 in which the value of the block activity is smaller than the threshold value Tha and surrounded by the curves 621 and 622, the value obtained by dividing the evaluation value by the block activity is distributed in both the regions R1 and R2. There is a high possibility that a correct motion vector is not obtained. Therefore, in such a distribution state, processing is performed assuming that the accuracy of the motion vector is low. For this reason, in step S632, the motion vector accuracy VC is set to 0 if the value is positive even if the value is positive. In this way, when the value of the motion vector accuracy VC is positive, it is possible to reliably represent that the correct motion vector is obtained. In addition, the larger the value of the motion vector accuracy VC, the higher the probability that a correct motion vector is obtained (the probability that the distribution is included in the region R1 increases).

このことは、一般的に、輝度変化が少ない領域(アクティビティが小さい領域)では信頼性が高い動きベクトルを検出することが困難であるとの経験上の法則とも一致する。   This coincides with an empirical rule that, in general, it is difficult to detect a motion vector with high reliability in a region where the luminance change is small (region where the activity is small).

図52は,図5の背景動き推定部54の構成例を表している。この構成例においては、背景動き推定部54は、頻度分布算出部651と背景動き決定部652により構成されている。   FIG. 52 illustrates a configuration example of the background motion estimation unit 54 of FIG. In this configuration example, the background motion estimator 54 includes a frequency distribution calculator 651 and a background motion determiner 652.

頻度分布算出部651は、動きベクトルの頻度分布を算出する。ただし、この頻度には、動き推定部12より供給される動きベクトル確度VCを用いることで、確からしい動きに重みが与えられるように、重み付けが行われる。背景動き決定部652は、頻度分布算出部651により算出された頻度分布に基づいて、頻度が最大となる動きを背景動きとして決定する処理を行い、領域推定関連処理部55へ出力する。   The frequency distribution calculation unit 651 calculates a frequency distribution of motion vectors. However, this frequency is weighted so that a likely motion is weighted by using the motion vector accuracy VC supplied from the motion estimation unit 12. Based on the frequency distribution calculated by the frequency distribution calculation unit 651, the background motion determination unit 652 performs a process of determining a motion with the maximum frequency as a background motion, and outputs the background motion to the region estimation related processing unit 55.

図53を参照して、背景動き推定部54の背景動き推定処理について説明する。   The background motion estimation process of the background motion estimation unit 54 will be described with reference to FIG.

ステップS651において、頻度分布算出部651は、動き頻度分布を算出する。具体的には、頻度分布算出部651は、背景動きの候補としての動きベクトルのx座標とy座標がそれぞれ基準点から±16画素分の範囲で表されるとすると、1089個(=16×2+1)×(16×2+1))の箱、すなわち動きベクトルがとり得る値に対応する座標分の箱を用意し、動きベクトルが発生した場合、その動きベクトルに対応する座標に1を加算する。このようにすることで、動きベクトルの頻度分布を算出することができる。   In step S651, the frequency distribution calculation unit 651 calculates a motion frequency distribution. Specifically, the frequency distribution calculation unit 651 assumes that the x and y coordinates of the motion vector as a background motion candidate are expressed in a range of ± 16 pixels from the reference point, respectively (1089 (= 16 × 2 + 1) × (16 × 2 + 1)), that is, a box for coordinates corresponding to possible values of a motion vector, and when a motion vector is generated, 1 is added to the coordinates corresponding to the motion vector. In this way, the motion vector frequency distribution can be calculated.

ただし、1個の動きベクトルが発生した場合、1を加算していくと、確度が低い動きベクトルの発生頻度が多い場合、その確実性が低い動きベクトルが背景動きとして決定されてしまう恐れがある。そこで、頻度分布算出部651は、動きベクトルが発生した場合、その動きベクトルに対応する箱(座標)に、値1を加算するのではなく、値1に動きベクトル確度VCを乗算した値(=動きベクトル確度VCの値)を加算する。動きベクトル確度VCの値は、0から1の間の値として正規化されており、その値が1に近いほど確度が高い値である。従って、このようにして得られた頻度分布は、動きベクトルをその確度に基づいて重み付けした頻度分布となる。これにより、確度の低い動きが背景動きとして決定される恐れが少なくなる。   However, when one motion vector is generated, if 1 is added, if the frequency of occurrence of a motion vector with low accuracy is high, a motion vector with low certainty may be determined as the background motion. . Therefore, when a motion vector is generated, the frequency distribution calculation unit 651 does not add a value 1 to a box (coordinates) corresponding to the motion vector, but a value obtained by multiplying the value 1 by the motion vector accuracy VC (= Motion vector accuracy VC). The value of the motion vector accuracy VC is normalized as a value between 0 and 1, and the closer the value is to 1, the higher the accuracy. Therefore, the frequency distribution obtained in this way is a frequency distribution obtained by weighting motion vectors based on their accuracy. This reduces the risk that a motion with low accuracy is determined as the background motion.

次に、ステップS652において、頻度分布算出部651は、動き頻度分布を算出する処理を全ブロックについて終了したか否かを判定する。まだ処理していないブロックが存在する場合には、ステップS651に戻り、次のブロックについてステップS651の処理が実行される。   Next, in step S652, the frequency distribution calculation unit 651 determines whether or not the process of calculating the motion frequency distribution has been completed for all blocks. If there is a block that has not yet been processed, the process returns to step S651, and the process of step S651 is executed for the next block.

以上のようにして、全画面に対して動き頻度分布算出処理が行われ、ステップS652において、全ブロックの処理が終了したと判定された場合、ステップS653に進み、背景動き決定部652は、頻度分布の最大値を検索する処理を実行する。すなわち、背景動き決定部652は、頻度分布算出部651により算出された頻度の中から最大の頻度のものを選択し、その頻度に対応する動きベクトルを背景動きの動きベクトルとして決定する。この背景動きの動きベクトルは、領域推定関連処理部55に供給され、例えば、図20のステップS204や図25のステップS231の全画面動きと背景動きが一致するか否かの判定処理に用いられる。   As described above, the motion frequency distribution calculation process is performed on the entire screen, and when it is determined in step S652 that the processing of all blocks has been completed, the process proceeds to step S653, and the background motion determination unit 652 A process for searching for the maximum value of the distribution is executed. That is, the background motion determination unit 652 selects the frequency having the maximum frequency from the frequencies calculated by the frequency distribution calculation unit 651, and determines the motion vector corresponding to the frequency as the motion vector of the background motion. The motion vector of the background motion is supplied to the region estimation related processing unit 55, and is used for, for example, a determination process of whether or not the full screen motion and the background motion in step S204 in FIG. 20 and step S231 in FIG. .

図54は、図5のシーンチェンジ検出部53の詳細な構成例を表している。この例においては、動きベクトル確度平均算出部671と閾値判定部672によりシーンチェンジ検出部53が構成されている。   FIG. 54 shows a detailed configuration example of the scene change detection unit 53 of FIG. In this example, the scene change detection unit 53 is configured by the motion vector accuracy average calculation unit 671 and the threshold determination unit 672.

動きベクトル確度平均算出部671は、動き推定部52より供給された動きベクトル確度VCの全画面の平均値を算出し、閾値判定部672に出力する。閾値判定部672は、動きベクトル確度平均算出部671より供給された平均値を、予め定められている閾値と比較し、その比較結果に基づいて、シーンチェンジであるか否かを判定し、判定結果を制御部59に出力する。   The motion vector accuracy average calculation unit 671 calculates the average value of all the screens of the motion vector accuracy VC supplied from the motion estimation unit 52 and outputs the average value to the threshold determination unit 672. The threshold value determination unit 672 compares the average value supplied from the motion vector accuracy average calculation unit 671 with a predetermined threshold value, and determines whether it is a scene change based on the comparison result. The result is output to the control unit 59.

次に、図55のフローチャートを参照して、シーンチェンジ検出部53の動作について説明する。ステップS681において、動きベクトル確度平均算出部671は、ベクトル確度の総和を算出する。具体的には、動きベクトル確度平均算出部671は、動き推定部52の統合処理部605より出力された各ブロック毎に算出された動きベクトル確度VCの値を加算する処理を実行する。ステップS682において、動きベクトル確度平均算出部671は、ベクトル確度VCの総和を算出する処理が全ブロックについて終了したか否かを判定し、まだ終了していない場合には、ステップS681の処理を繰り返す。この処理を繰り返すことで、1画面分の各ブロックの動きベクトル確度VCの総和が算出される。ステップS682において1画面全部についての動きベクトル確度VCの総和の算出処理が終了したと判定された場合、ステップS683に進み、動きベクトル確度平均算出部671は、ベクトル確度VCの平均値を算出する処理を実行する。具体的には、ステップS681の処理で算出された1画面分のベクトル確度VCの総和を、足し込まれたブロック数で除算して得られた値が平均値として算出される。   Next, the operation of the scene change detection unit 53 will be described with reference to the flowchart of FIG. In step S681, the motion vector accuracy average calculation unit 671 calculates the sum of vector accuracy. Specifically, the motion vector accuracy average calculation unit 671 executes a process of adding the value of the motion vector accuracy VC calculated for each block output from the integration processing unit 605 of the motion estimation unit 52. In step S682, the motion vector accuracy average calculation unit 671 determines whether or not the processing for calculating the sum of the vector accuracy VC has been completed for all the blocks. If the processing has not yet been completed, the processing of step S681 is repeated. . By repeating this process, the sum of motion vector accuracy VC of each block for one screen is calculated. If it is determined in step S682 that the calculation process of the sum of motion vector accuracy VCs for all one screen has been completed, the process advances to step S683, and the motion vector accuracy average calculation unit 671 calculates the average value of the vector accuracy VC. Execute. Specifically, a value obtained by dividing the sum of the vector accuracy VC for one screen calculated in the process of step S681 by the number of added blocks is calculated as an average value.

ステップS684において、閾値判定部672は、ステップS683の処理で動きベクトル確度平均算出部671により算出された動きベクトル確度VCの平均値を、予め設定されている閾値と比較し、閾値より小さいか否かを判定する。一般的に、動画中の時刻が異なる2フレーム間でシーンチェンジが発生すると、対応する画像が存在しないため、動きベクトルを算出しても、その動きベクトルは確からしくないことになる。そこで、ベクトル確度VCの平均値が閾値より小さい場合には、ステップS685において、閾値判定部672はシーンチェンジフラグをオンし、閾値より小さくない場合(閾値以上である場合)、ステップS586において、シーンチェンジフラグをオフにする。シーンチェンジフラグのオンは、シーンチェンジがあったことを表し、そのオフは、シーンチェンジが無いことを表す。   In step S684, the threshold value determination unit 672 compares the average value of the motion vector accuracy VC calculated by the motion vector accuracy average calculation unit 671 in the process of step S683 with a preset threshold value, and whether or not the threshold value is smaller than the threshold value. Determine whether. In general, when a scene change occurs between two frames having different times in a moving image, there is no corresponding image, so even if a motion vector is calculated, the motion vector is not certain. Therefore, if the average value of the vector accuracy VC is smaller than the threshold value, the threshold value determination unit 672 turns on the scene change flag in step S685. If the average value of the vector accuracy VC is not smaller than the threshold value (if it is greater than or equal to the threshold value), in step S586 Turn off the change flag. When the scene change flag is on, it indicates that there is a scene change, and when the scene change flag is off, it indicates that there is no scene change.

このシーンチェンジフラグは、制御部59へ供給され、図38のステップS421におけるシーンチェンジの有無の判定、並びに図41のステップS462のシーンチェンジの有無の判定に利用される。   This scene change flag is supplied to the control unit 59, and is used for determining whether or not there is a scene change in step S421 in FIG. 38 and for determining whether or not there is a scene change in step S462 in FIG.

以上のように、図1のオブジェクト追尾部26を構成することにより、追尾すべきオブジェクト51(図3)が回転したり、オクルージョンが発生したり、あるいはシーンチェンジにより、オブジェクト51の追尾点51Aが一時的に表示されなくなるような場合でも、画像の中で移動するオブジェクト51(追尾点51A)を正確に追尾することができる。   As described above, by configuring the object tracking unit 26 in FIG. 1, the object 51 (FIG. 3) to be tracked rotates, occlusion occurs, or the tracking point 51A of the object 51 is changed by a scene change. Even when the image is temporarily not displayed, the moving object 51 (tracking point 51A) in the image can be accurately tracked.

このようにして追尾されるオブジェクト51の追尾点51Aの位置情報が、図1のオブジェクト追尾部26による追尾結果としてエリア設定部25に出力されることにより、エリア設定部25によって、上述したように補正対象エリア52が設定される。そして、画像補正部22が補正対象エリア52の中の画像のぼけ(フォーカスぼけ)を除去する。   The position information of the tracking point 51A of the object 51 tracked in this way is output to the area setting unit 25 as a tracking result by the object tracking unit 26 in FIG. A correction target area 52 is set. Then, the image correction unit 22 removes the blur (focus blur) of the image in the correction target area 52.

次に、図1の画像補正部22の詳細な構成例と、その動作について説明する。図56は、画像補正部22の詳細な構成例を示すブロック図である。この例では画像補正部22に、エリア設定部25の出力信号に基づいて制御信号を生成し、その制御信号を各部に供給する制御信号生成部741、入力画像の特徴を検出する画像特徴検出部742、制御信号に基づいて、アドレスの演算を行うアドレス演算部743、アドレス演算部743により演算されたアドレスに基づいて、予め記憶された所定の係数を出力する係数ROM744、および入力画像の中の所定の領域に対応する複数の画素を抽出する領域抽出部745が設けられている。   Next, a detailed configuration example and operation of the image correction unit 22 in FIG. 1 will be described. FIG. 56 is a block diagram illustrating a detailed configuration example of the image correction unit 22. In this example, the image correction unit 22 generates a control signal based on the output signal of the area setting unit 25 and supplies the control signal to each unit. The image feature detection unit detects the feature of the input image. 742, an address calculation unit 743 that calculates an address based on the control signal, a coefficient ROM 744 that outputs a predetermined coefficient stored in advance based on the address calculated by the address calculation unit 743, and an input image A region extraction unit 745 that extracts a plurality of pixels corresponding to a predetermined region is provided.

また、領域抽出部745から出力された画素のレベルに対して、係数ROM744から出力された係数に基づく積和演算を行い、新たに修正された画素レベルを出力する積和演算部746、および積和演算部746の出力結果と制御信号に基づいて、補正対象エリア52内の画像と、背景53を合成し、出力する画像合成部747が設けられている。   Also, a product-sum operation unit 746 that performs a product-sum operation based on the coefficient output from the coefficient ROM 744 on the pixel level output from the region extraction unit 745 and outputs a newly corrected pixel level, and a product An image composition unit 747 that synthesizes and outputs the image in the correction target area 52 and the background 53 based on the output result of the sum calculation unit 746 and the control signal is provided.

図57は、制御信号生成部741が生成する制御信号の例を示す図である。制御信号Aは、入力画像の中の修正すべき部分(補正対象エリア52)を特定する信号であり、エリア設定部25の出力に基づいて生成され、領域抽出部745と画像合成部747に供給される。制御信号Bは、後述するぼけの度合いを表すパラメータσを特定する信号であり、アドレス演算部743に供給される。パラメータσの値は、例えば、制御部27を介して行われる、ユーザの指定に基づいて特定されるようにしてもよいし、予め設定されるようにしてもよい。   FIG. 57 is a diagram illustrating an example of a control signal generated by the control signal generation unit 741. The control signal A is a signal that specifies a portion to be corrected (correction target area 52) in the input image, is generated based on the output of the area setting unit 25, and is supplied to the region extraction unit 745 and the image composition unit 747. Is done. The control signal B is a signal that specifies a parameter σ representing the degree of blur described later, and is supplied to the address calculation unit 743. The value of the parameter σ may be specified based on a user's designation performed via the control unit 27, or may be set in advance.

制御信号Cは、後述するぼけのモデル式を解くために用いられる関係式の重みWaの切り替えを指定する信号であり、アドレス演算部743に供給される。制御信号Dは、画像の特徴を検出するとき用いられる閾値の切り替えを指定する信号であり、画像特徴検出部742に供給される。制御信号CとDについては、監視カメラシステム1の特性などを考慮して予め設定されるようにしてもよいし、制御部27を介して行われる、ユーザの指定に基づいて生成されるようにしてもよい。   The control signal C is a signal for designating switching of the weight Wa of the relational expression used for solving a blur model expression described later, and is supplied to the address calculation unit 743. The control signal D is a signal that specifies switching of a threshold value used when detecting the feature of the image, and is supplied to the image feature detection unit 742. The control signals C and D may be set in advance in consideration of the characteristics of the monitoring camera system 1 or the like, or may be generated on the basis of a user's designation performed via the control unit 27. May be.

次に、画像のぼけの原理について説明する。いま、カメラのピントが適正に設定され被写体がフォーカスぼけしていない画像の画素のレベルXを真値とし、カメラのピントが外れて被写体がフォーカスぼけした画像の画素のレベルYを観測値とする。画像を構成する複数の画素を表現するために、画像の水平方向の座標をxであらわし、垂直方向の座標をyで表すと、真値は、X(x,y)で表され、観測値は、Y(x,y)で表すことができる。   Next, the principle of image blur will be described. Now, the pixel level X of the image in which the camera is properly set and the subject is not out of focus is set as a true value, and the pixel level Y of the image in which the subject is out of focus and the subject is out of focus is set as an observation value. . In order to express a plurality of pixels constituting an image, if the horizontal coordinate of the image is represented by x and the vertical coordinate is represented by y, the true value is represented by X (x, y), and the observed value Can be represented by Y (x, y).

本発明では、ぼけのモデル式として、式(6)を適用する。式(6)においては、式(7)に示されるガウス関数を用い、真値X(x,y)にガウス関数を畳み込むことにより観測値Y(x,y)が得られる。   In the present invention, Expression (6) is applied as a blur model expression. In equation (6), the observed value Y (x, y) is obtained by convolution of the Gaussian function with the true value X (x, y) using the Gaussian function shown in equation (7).

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

式(6)において、パラメータσは、ぼけの度合いを表すパラメータである。   In equation (6), the parameter σ is a parameter representing the degree of blur.

式(6)によれば、1つの観測値Y(x,y)は、変数iとj(−r<i<r,−r<j<r)により変化する複数の真値X(x+i,y+j)を係数Wで重みづけすることにより求められる。従って、ぼけのない画像の1つの画素のレベルは、ぼけた画像の複数の画素のレベルに基づいて得られたものとされる。   According to the equation (6), one observation value Y (x, y) is a plurality of true values X (x + i, r) that vary depending on variables i and j (−r <i <r, −r <j <r). y + j) is obtained by weighting with a coefficient W. Therefore, the level of one pixel of the image having no blur is obtained based on the levels of a plurality of pixels of the blurred image.

また、上述したパラメータσの値により画像のぼけの度合いが変化する。パラメータσの値が比較的小さい場合、真値の情報が観測値において広範囲に拡散されておらず、比較的ぼけの小さい画像となる。これに対して、パラメータσの値が比較的大きい場合、真値の情報が観測値において広範囲に拡散され、比較的ぼけの大きい画像となる。   Further, the degree of blurring of the image changes depending on the value of the parameter σ described above. When the value of the parameter σ is relatively small, the true value information is not diffused over a wide range in the observed value, and the image is relatively blurred. On the other hand, when the value of the parameter σ is relatively large, true value information is diffused over a wide range in the observed value, resulting in an image with relatively large blur.

このように、パラメータσの値の変化により、画像のぼけの度合いは変化する。このため、画像のぼけを正確に修正するためには、パラメータσの値を適切に求める必要がある。本発明においては、パラメータσの値をユーザが指定する。あるいは、監視カメラシステム1の特性などが考慮され、最適な値が予め設定されるようにしてもよい。   As described above, the degree of blurring of the image changes due to the change in the value of the parameter σ. For this reason, in order to correct the blur of the image accurately, it is necessary to appropriately obtain the value of the parameter σ. In the present invention, the user specifies the value of the parameter σ. Alternatively, an optimum value may be set in advance in consideration of the characteristics of the monitoring camera system 1 and the like.

図58乃至図61を参照して、画像のぼけの原理についてさらに詳しく説明する。図58Aは、簡単のため、画素が水平方向に一次元に配列されたものとして、ある画像における、真値X0乃至X8を表す図である。図58Cは、図58Aに対応する観測値を表す図である。図58Bは、係数W(i)の大きさを棒グラフ状に表した図である。この例では、変数iが、−2<i<2とされ、中央の棒グラフが、係数W(0)とされ、左端の棒グラフから順番に係数W(-2),W(-1),W(0),W(1),W(2)とされる。   The principle of image blur will be described in more detail with reference to FIGS. FIG. 58A is a diagram showing true values X0 to X8 in an image on the assumption that pixels are arranged one-dimensionally in the horizontal direction for the sake of simplicity. FIG. 58C is a diagram illustrating observation values corresponding to FIG. 58A. FIG. 58B is a graph showing the magnitude of the coefficient W (i) in a bar graph form. In this example, the variable i is set to −2 <i <2, the center bar graph is set to the coefficient W (0), and the coefficients W (−2), W (−1), W in order from the leftmost bar graph. (0), W (1), and W (2).

ここで、式(6)に基づいて、図58Cの観測値Y2を求めると、次のようになる。   Here, based on the equation (6), the observed value Y2 in FIG. 58C is obtained as follows.

Y2=W(-2)X2+W(-1)X3+W(0)X4+W(1)X5+W(2)X6   Y2 = W (-2) X2 + W (-1) X3 + W (0) X4 + W (1) X5 + W (2) X6

同様にして、図58Cの観測値Y0を求める場合、真値の中で、図59の枠790−1で示される部分に基づいて、演算を行うことにより、次のように観測値Y0が求められる。   Similarly, when the observed value Y0 in FIG. 58C is obtained, the observed value Y0 is obtained as follows by performing an operation based on the portion indicated by the frame 790-1 in FIG. 59 in the true value. It is done.

Y0=W(-2)X0+W(-1)X1+W(0)X2+W(1)X3+W(2)X4   Y0 = W (-2) X0 + W (-1) X1 + W (0) X2 + W (1) X3 + W (2) X4

さらに、観測値Y1を求める場合、図59の枠790−2で示される部分に基づいて、演算を行うことにより、次のように観測値Y1が求められる。   Further, when the observed value Y1 is obtained, the observed value Y1 is obtained as follows by performing an operation based on the portion indicated by a frame 790-2 in FIG.

Y1=W(-2)X1+W(-1)X2+W(0)X3+W(1)X4+W(2)X5   Y1 = W (-2) X1 + W (-1) X2 + W (0) X3 + W (1) X4 + W (2) X5

Y3、Y4についても、同様にして求めることができる。   Y3 and Y4 can be similarly determined.

図60と図61は、図58Aと図58Cの関係を2次元で表したものである。すなわち、図60を構成する各画素のレベルは、観測値であり、図61を構成する各画素のレベルを真値として、得られたものである。この場合、図60における画素Aに対応する観測値Y(x,y)は次のようにして求められる。   FIGS. 60 and 61 are two-dimensional representations of the relationship between FIGS. 58A and 58C. That is, the level of each pixel constituting FIG. 60 is an observed value, and the level of each pixel constituting FIG. 61 is obtained as a true value. In this case, the observed value Y (x, y) corresponding to the pixel A in FIG. 60 is obtained as follows.

(Y (x, y) = W(-2,-2)X(x-2, y-2) +W(-1,-2)X(x-1, y-2) +W(0,.2)X(x, y-2). . . +W(2, 2)X(x+2, y+ 2) (Y (x, y) = W (-2, -2) X (x-2, y-2) + W (-1, -2) X (x-1, y-2) + W (0, .2) X (x, y-2) ... + W (2, 2) X (x + 2, y + 2)

すなわち、図60の画素Aに対応する観測値は、図61において画素A'(画素Aに対応する)を中心として枠aで示される25(=5×5)個の画素に対応する真値に基づいて求められる。同様に、図60の画素B(画素Aの図中右隣の画素)に対応する観測値は、図61において、画素B'(画素Bに対応する)を中心とした25個の画素に対応する真値に基づいて求められ、図60の画素Cに対応する観測値は、図61において、画素C'(画素Cに対応する)を中心とした25個の画素に対応する真値に基づいて求められる。図60の画素BとCに対応する観測値Y(x+1,y)とY(x+2,y)を求める式を次に示す。   That is, the observed values corresponding to the pixel A in FIG. 60 are true values corresponding to 25 (= 5 × 5) pixels indicated by the frame a with the pixel A ′ (corresponding to the pixel A) in FIG. 61 as the center. Based on. Similarly, the observation values corresponding to the pixel B in FIG. 60 (the pixel on the right side of the pixel A in the drawing) correspond to 25 pixels centered on the pixel B ′ (corresponding to the pixel B) in FIG. The observed value corresponding to the pixel C in FIG. 60 is based on the true value corresponding to 25 pixels centered on the pixel C ′ (corresponding to the pixel C) in FIG. Is required. Equations for obtaining observed values Y (x + 1, y) and Y (x + 2, y) corresponding to pixels B and C in FIG. 60 are as follows.

Y(x+1, y) = W(-2,-2)X(x-1, y-2) +W(-1,-2)X(x,y-2) +W(0,-2)X(x-1,y-2). . . +W(2,2)X(x+3,y+2) Y (x + 1, y) = W (-2, -2) X (x-1, y-2) + W (-1, -2) X (x, y-2) + W (0,- 2) X (x-1, y-2) ... + W (2,2) X (x + 3, y + 2)

Y(x+2,y) = W(-2,-2)X(x,y-2) +W(-1,-2)X(x+1,y-2) +W(0,-2)X(x+2,y-2). . . +W(2,2)X(x+4,y+2) Y (x + 2, y) = W (-2, -2) X (x, y-2) + W (-1, -2) X (x + 1, y-2) + W (0,- 2) X (x + 2, y-2) ... + W (2,2) X (x + 4, y + 2)

このようにして、図60の各画素に対応する観測値をもとめていくと、式(8)乃至(11)に示されるような行列式が得られる。   In this way, when the observation values corresponding to the respective pixels in FIG. 60 are obtained, determinants as shown in Expressions (8) to (11) are obtained.

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

ここで、式(11)に示した行列式において、行列Wfの逆行列を求めることができれば、観測値Yfに基づいて真値Xfを求めることができる。すなわち、ぼけた画像の画素に基づいて、ぼけのない画像の画素を得ることができ、ぼけた画像を修正することができる。   Here, in the determinant shown in Expression (11), if the inverse matrix of the matrix Wf can be obtained, the true value Xf can be obtained based on the observed value Yf. That is, based on the pixels of the blurred image, the pixels of the image without blur can be obtained, and the blurred image can be corrected.

しかし、式(8)乃至式(11)に示した行列式は、図58乃至図61を参照して上述したように、観測値の画素に対して、真値の画素が多く、このままでは逆行列を求めることができない(例えば、図59の例では、観測値の画素1個に対して真値の画素5個が必要となる。)。   However, as described above with reference to FIGS. 58 to 61, the determinants shown in the equations (8) to (11) have more true value pixels than the observed value pixels. A matrix cannot be obtained (for example, in the example of FIG. 59, five true-value pixels are required for one observed-value pixel).

そこで、式(8)乃至式(11)に加えて、式(12)乃至式(15)に示される関係式を導入する。   Therefore, in addition to the expressions (8) to (11), the relational expressions shown in the expressions (12) to (15) are introduced.

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

Figure 0004725105
Figure 0004725105

式(12)乃至式(15)は、隣接する画素のレベルの差分について限定を加えるものであり、求めるべき真値が、画像の平坦な(隣接する画素のレベルと大きな差がない)部分である場合には矛盾がない。しかし、求めるべき真値がエッジ部分である(隣接する画素のレベルと大きな差がある)場合には矛盾が生じ、修正した画像に劣化が生じる恐れがある。このため、ぼけた画像を適正に修正するためには、式(12)乃至式(15)の4つの関係式を、真値のエッジ部分をまたがないように画素ごとに使い分ける必要がある。   Expressions (12) to (15) limit the difference between the levels of adjacent pixels, and the true value to be obtained is a flat part of the image (no significant difference from the level of adjacent pixels). In some cases there is no contradiction. However, when the true value to be obtained is an edge portion (there is a large difference from the level of adjacent pixels), a contradiction occurs, and the corrected image may be deteriorated. For this reason, in order to appropriately correct a blurred image, it is necessary to properly use the four relational expressions (12) to (15) for each pixel so as not to cross the true edge portion.

そこで、画像特徴検出部742において、入力画像の中のエッジ部分と平坦部分の判定を行い、どの方向(例えば、上下左右)に平坦になっているかを表すコードp2を生成する。なお、画像特徴検出部742の詳細な動作については、図66を参照して後述する。また、本発明では、入力画像(観測値)の中のエッジ部分と平坦部分の判定結果が、真値の中でのエッジ部分と平坦部分の判定結果に等しいと仮定する。   Therefore, the image feature detection unit 742 determines an edge portion and a flat portion in the input image, and generates a code p2 that indicates in which direction (for example, up, down, left, and right) flat. The detailed operation of the image feature detection unit 742 will be described later with reference to FIG. In the present invention, it is assumed that the determination result of the edge portion and the flat portion in the input image (observed value) is equal to the determination result of the edge portion and the flat portion in the true value.

式(12)乃至式(15)において、コードp2の関数である関数W1乃至W4は、重み関数とされる。本発明においては、コードp2に応じてこの重み関数W1乃至W4が制御されることで,画素ごとの関係式の使い分けが行われるようにする。図62にコードp2に対応する重み関数W1乃至W4の値を示す。この重み関数の値が大きい場合、式(12)乃至式(15)において平坦であるという意味合いが強くなり、重み関数の値が小さい場合、その意味合いが弱くなる(エッジである意味合いが強くなる)。   In Expressions (12) to (15), functions W1 to W4 that are functions of the code p2 are weight functions. In the present invention, the weighting functions W1 to W4 are controlled according to the code p2, so that the relational expressions for each pixel are properly used. FIG. 62 shows the values of the weight functions W1 to W4 corresponding to the code p2. When the value of the weight function is large, the meaning of being flat in the equations (12) to (15) is strong, and when the value of the weight function is small, the meaning is weak (meaning that is an edge is strong). .

コードp2は、4ビットにより構成されており、それぞれのビットは、左から順番に、上、右、下または左方向に平坦か否かを示しており、その方向に平坦である場合には、対応するビットが「1」に設定される。例えば、コードp2が「0001」の場合、注目画素の左方向に平坦であり、それ以外の方向は平坦ではない(エッジが存在する)ことを表す。このため、コードp2が「0001」の場合、重み関数W4の値が大きくなり、式(12)乃至式(15)の4つの関係式の中で式(15)の重みが大きくなる。このようにすることで、コードp2により、4つの関係式の重みを変化させることができ、4つの関係式を、エッジをまたがないように画素ごとに使い分けることができる。   The code p2 is composed of 4 bits, and each bit indicates whether it is flat in the upper, right, lower or left direction in order from the left, and when it is flat in that direction, The corresponding bit is set to “1”. For example, when the code p2 is “0001”, it indicates that the pixel is flat in the left direction of the target pixel and the other directions are not flat (there is an edge). For this reason, when the code p2 is “0001”, the value of the weighting function W4 increases, and the weight of Expression (15) among the four relational expressions of Expressions (12) to (15) increases. In this way, the weights of the four relational expressions can be changed by the code p2, and the four relational expressions can be used properly for each pixel so as not to cross the edge.

例えば、図63に示されるように、注目画素Xaの上方向と左方向が平坦であり、右方向と下方向がエッジである場合、コードp2により、式(12)乃至式(15)の4つの関係式の重みを変化させることにより、隣接する画素のレベルの差分について、「Xa−Xb=0」、「Xa―Xc=0」という限定が加えられるが、「Xa−Xd=0」、「Xa―Xe=0」という限定は加えられない。なお、Xb,Xc,Xd,Xeは、それぞれ注目画素Xaの右、下、上、または左に隣接する画素を表す。   For example, as shown in FIG. 63, when the upper direction and the left direction of the target pixel Xa are flat and the right direction and the lower direction are edges, 4 of Expressions (12) to (15) is expressed by the code p2. By changing the weights of two relational expressions, the difference between adjacent pixel levels is limited to “Xa−Xb = 0” and “Xa−Xc = 0”, but “Xa−Xd = 0”, The limitation “Xa−Xe = 0” is not added. Xb, Xc, Xd, and Xe represent pixels adjacent to the right, bottom, top, or left of the target pixel Xa, respectively.

また、式(12)乃至式(15)において、関数Waは、別の重み関数であり、やはりコードp1により重み関数Waの値が変化する。重み関数Waの値を変化させることで、修正された画像の全体のノイズ、ディテールを制御することができる。重み関数Waの値が大きいと、修正された画像においてノイズの影響が小さく感じられ、ノイズ感が減少する。また、重み関数Waの値が小さいと、修正された画像においてディテールが強調されたように感じられ、ディテール感が向上する。なお、重み関数Waの値を変化させるコードp1は、図57の制御信号Cに対応している。   In Expressions (12) to (15), the function Wa is another weight function, and the value of the weight function Wa changes according to the code p1. By changing the value of the weight function Wa, it is possible to control the noise and details of the entire corrected image. When the value of the weight function Wa is large, the influence of noise is felt small in the corrected image, and the noise feeling is reduced. Further, when the value of the weight function Wa is small, it is felt that the detail is emphasized in the corrected image, and the feeling of detail is improved. Note that the code p1 for changing the value of the weight function Wa corresponds to the control signal C in FIG.

このように、式(8)乃至式(11)に加えて、式(12)乃至式(15)に示される関係式を導入する。これにより、式(16)に示されるような逆行列を演算することが可能になり、その結果、観測値に基づいて真値を求めることができる。   Thus, in addition to the equations (8) to (11), the relational expressions shown in the equations (12) to (15) are introduced. Thereby, it becomes possible to calculate an inverse matrix as shown in Expression (16), and as a result, a true value can be obtained based on the observed value.

Figure 0004725105
Figure 0004725105

本発明では、観測値Ysにかかる係数Ws-1が係数ROM744に予め保持され、領域抽出部745により抽出された入力画像に対して、式(16)の行列式の演算(積和演算)が積和演算部746により行われる。このようにすることで、画像の修正を行う都度、逆行列演算を行う必要がなく、積和演算だけでぼけを修正することが可能になる。ただし、入力画像に応じて、パラメータσや、上述した4つの関係式が異なるため、想定しうるそれらの全ての組み合わせでの逆行列演算を予め行っておき、パラメータσ、コードp2などに対応するアドレスを定めて、そのアドレス毎に異なる係数が係数ROM744に格納される。   In the present invention, the coefficient Ws-1 related to the observed value Ys is stored in the coefficient ROM 744 in advance, and the determinant (product-sum) operation of Expression (16) is performed on the input image extracted by the region extracting unit 745. This is performed by the product-sum operation unit 746. By doing so, it is not necessary to perform an inverse matrix operation every time an image is corrected, and it is possible to correct blur only by a product-sum operation. However, since the parameter σ and the above-described four relational expressions are different depending on the input image, inverse matrix calculation is performed in advance for all possible combinations thereof, and the parameter σ, the code p2, and the like are supported. An address is determined, and a coefficient different for each address is stored in the coefficient ROM 744.

しかし、例えば、図61に示される枠(t)内の25(=5×5)個のすべてに画素において、重み関数W1乃至W4の組み合わせを変化させ、4つの関係式を切り替えた場合、15(=図62に示した関数W1乃至W4の組み合わせ)の25(枠(t)内の画素数)乗の組み合わせが存在し、それぞれの組み合わせごとに逆行列演算を行うと、係数の数が膨大になり、係数ROM744の容量には制限があるため、全ての係数を格納しきれなくなるおそれがある。このような場合、枠(t)内の中心画素であるXtのみ、その特徴に基づいて、コードp2を変化させて関係式を切り替え、枠(t)内の画素Xt以外画素の関係式については、例えばコードp2が擬似的に、「1111」に固定されるようにしてもよい。このようにすることで、係数の組み合わせを15通りに限定することができる。   However, for example, when the combination of the weight functions W1 to W4 is changed in all 25 (= 5 × 5) pixels in the frame (t) shown in FIG. (= Combination of functions W1 to W4 shown in FIG. 62) is a combination of 25 (the number of pixels in the frame (t)), and when the inverse matrix operation is performed for each combination, the number of coefficients is enormous. Therefore, since the capacity of the coefficient ROM 744 is limited, all the coefficients may not be stored. In such a case, for only Xt that is the central pixel in the frame (t), the relational expression is switched by changing the code p2 based on the feature, and the relational expression of the pixels other than the pixel Xt in the frame (t) is changed. For example, the code p2 may be fixed to “1111” in a pseudo manner. By doing so, the combinations of coefficients can be limited to 15.

なお以上においては、ぼけの原理(モデル式)を説明するために、ガウス関数の定義域を、-2≦(x,y)≦2 としたが、実際には、パラメータσの値が十分大きくても対応できるような範囲が設定される。また、式(12)乃至式(15)に示した関係式についても,画像の特徴を記述する式であれば,これに限定されるものではない。さらに、係数ROM744の容量に制限がある場合の例として、ぼけの中心位相(Xt)のみに限定して関係式を切り替える例を説明したが、それに限定されるものではなく、係数ROM744の容量に応じて、関係式の切り替え方法を変えてもよい。   In the above, in order to explain the principle of blur (model equation), the domain of the Gaussian function is set to -2≤ (x, y) ≤2, but in reality the value of parameter σ is sufficiently large A range that can be handled is set. In addition, the relational expressions shown in Expressions (12) to (15) are not limited to these as long as they are expressions describing image characteristics. Further, as an example in the case where the capacity of the coefficient ROM 744 is limited, the example in which the relational expression is switched only to the blur center phase (Xt) has been described. However, the present invention is not limited to this, and the capacity of the coefficient ROM 744 is limited. The relational expression switching method may be changed accordingly.

次に図64を参照して、画像補正部22によるぼけ修正処理について説明する。ステップS801において、画像補正部22は、処理対象領域を検出する。この処理対象領域は、ぼけの修正を行うべき領域、すなわち補正対象エリア52であり、エリア設定部25から出力される信号に基づいて検出される。   Next, the blur correction process by the image correction unit 22 will be described with reference to FIG. In step S801, the image correction unit 22 detects a processing target area. This processing target region is a region where correction of blur is to be performed, that is, a correction target area 52, and is detected based on a signal output from the area setting unit 25.

ステップS802において、画像補正部22は、パラメータσの値を取得する。パラメータσは、ユーザにより指定されるようにしてもよいし、予め設定された値が取得されるようにしてもよい。ステップS803において、画像補正部22は、図65を参照して後述する画像補正処理を実行する。これにより、ぼけた画像が修正され、出力される。   In step S802, the image correction unit 22 acquires the value of the parameter σ. The parameter σ may be specified by the user, or a preset value may be acquired. In step S803, the image correction unit 22 performs an image correction process described later with reference to FIG. Thereby, the blurred image is corrected and output.

このようにして、補正対象エリア52内の画像については、画像のぼけが除去されて鮮明な画像となる。   In this way, the image in the correction target area 52 becomes a clear image by removing the blur of the image.

次に、図65を参照して、図64のステップS803の画像補正処理の詳細について説明する。   Next, details of the image correction processing in step S803 in FIG. 64 will be described with reference to FIG.

ステップS821において、画像特徴検出部742は、図66を参照して後述する画像特徴検出処理を実行する。これにより、注目画素に対して、どの方向に平坦なのかが判定され、図62を参照して上述したコードp2が生成され、アドレス演算部743に出力される。   In step S821, the image feature detection unit 742 executes an image feature detection process described later with reference to FIG. Thereby, it is determined in which direction the target pixel is flat, and the code p2 described above with reference to FIG. 62 is generated and output to the address calculation unit 743.

ステップS822において、アドレス演算部743は、係数ROM744のアドレスを演算する。係数ROM744のアドレスは、例えば、コードp2に対応する4ビット(画像特徴検出部742の出力)、パラメータσの値を表す4ビット(図57の制御信号B)、および、上述した4つの関係式の重み関数Waを切り替えるコードp1に対応する2ビット(図57の制御信号C)により構成され、0乃至1023の1024(2の10乗)個アドレスが存在する。アドレス演算部743は、画像特徴検出部742の出力、制御信号B、および制御信号Cに基づいて、対応するアドレスを演算する。   In step S822, the address calculation unit 743 calculates the address of the coefficient ROM 744. The address of the coefficient ROM 744 is, for example, 4 bits corresponding to the code p2 (output of the image feature detecting unit 742), 4 bits indicating the value of the parameter σ (control signal B in FIG. 57), and the above-described four relational expressions. 2 (corresponding to the control signal C in FIG. 57) corresponding to the code p1 for switching the weight function Wa of 1024 (2 to the 10th power) addresses. The address calculation unit 743 calculates a corresponding address based on the output of the image feature detection unit 742, the control signal B, and the control signal C.

ステップS823において、アドレス演算部743は、ステップS822で演算したアドレスに基づいて、係数ROM744から係数を読み出し、積和演算部746に供給する。   In step S823, the address calculation unit 743 reads a coefficient from the coefficient ROM 744 based on the address calculated in step S822 and supplies the coefficient to the product-sum calculation unit 746.

ステップS824において、積和演算部746は、ステップS823で読み出された係数に基づいて、画素毎に積和演算を行い、その結果を後処理部747に出力する。これにより、上述したように、観測値から真値が求められ、ぼけた画像が修正される。   In step S824, the product-sum operation unit 746 performs product-sum operation for each pixel based on the coefficient read in step S823, and outputs the result to the post-processing unit 747. Thereby, as described above, the true value is obtained from the observed value, and the blurred image is corrected.

ステップS825において、画像合成部747は、図69を参照して後述する画像合成処理を実行する。これにより、画素毎に、積和演算部746の処理結果を出力するか、入力画像をそのまま出力するかが判定される。ステップS826において、後処理部747は、補正後処理され、選択された画像を出力する。   In step S825, the image composition unit 747 executes image composition processing described later with reference to FIG. Thus, it is determined for each pixel whether the processing result of the product-sum operation unit 746 is output or the input image is output as it is. In step S826, the post-processing unit 747 performs post-correction processing and outputs the selected image.

次に図66を参照して、図65のステップS821の画像特徴検出処理について説明する。ステップS841において、画像特徴検出部742は、ブロックを抽出し、ステップS842において、ステップS841で抽出されたブロック間の差分を演算する(その詳細は、図68を参照して後述する)。ステップS843において、画像特徴検出部742は、ステップS842で演算されたブロック差分を予め設定されている閾値と比較し、その比較結果に基づいて、ステップS844において、注目画素に対して平坦な方向を表すコードであるコードp2を出力する。   Next, the image feature detection processing in step S821 in FIG. 65 will be described with reference to FIG. In step S841, the image feature detection unit 742 extracts blocks, and in step S842, calculates a difference between the blocks extracted in step S841 (details will be described later with reference to FIG. 68). In step S843, the image feature detection unit 742 compares the block difference calculated in step S842 with a preset threshold, and based on the comparison result, in step S844, sets a flat direction with respect to the target pixel. The code p2 which is the code to represent is output.

図67と図68を参照して、画像特徴検出処理について、さらに詳しく説明する。図67は、画像特徴検出部742の詳細な構成例を示すブロック図である。同図の左側には、入力された画像の中から所定のブロックを抽出するブロック切り出し部841−1乃至841−5が設けられている。ブロック切り出し部841−1乃至841−5は、例えば、図68A乃至図68Eに示されるように、図中黒い丸で示される注目画素(いま修正すべき画素)の周辺の、注目画素を含む9(=3×3)個の画素で構成される5つのブロックを抽出する。   With reference to FIGS. 67 and 68, the image feature detection processing will be described in more detail. FIG. 67 is a block diagram illustrating a detailed configuration example of the image feature detection unit 742. On the left side of the figure, block cutout units 841-1 to 841-5 for extracting predetermined blocks from the input image are provided. For example, as illustrated in FIGS. 68A to 68E, the block cutout units 841-1 to 841-5 include the target pixel around the target pixel (the pixel to be corrected) indicated by a black circle in the drawing. Five blocks composed of (= 3 × 3) pixels are extracted.

図68Aに示されるブロック881は、その中心に注目画素を有する中心ブロックであり、ブロック切り出し部841−5により抽出される。図68Bに示されるブロック882は、ブロック881を画素1個分図中上に移動した上側ブロックであり、ブロック切り出し部841−3により抽出される。図68Cに示されるブロック883は、ブロック881を画素1個分図中左に移動した左側ブロックであり、ブロック切り出し部841−4により抽出される。   A block 881 shown in FIG. 68A is a central block having a target pixel at the center thereof, and is extracted by the block cutout unit 841-5. A block 882 shown in FIG. 68B is an upper block obtained by moving the block 881 upward in the drawing by one pixel, and is extracted by the block cutout unit 841-3. A block 883 shown in FIG. 68C is a left side block obtained by moving the block 881 to the left in the drawing by one pixel, and is extracted by the block cutout unit 841-4.

図68Dに示されるブロック884は、ブロック881を画素1個分図中下に移動した下側ブロックであり、ブロック切り出し部841−1により抽出される。図68Eに示されるブロック885は、ブロック881を画素1個分図中右に移動した右側ブロックであり、ブロック切り出し部841−2により抽出される。ステップS841においては、注目画素毎に、ブロック881乃至885の5つのブロックが抽出される。   A block 884 shown in FIG. 68D is a lower block obtained by moving the block 881 downward in the drawing by one pixel, and is extracted by the block cutout unit 841-1. A block 885 shown in FIG. 68E is a right block obtained by moving the block 881 to the right in the drawing by one pixel, and is extracted by the block cutout unit 841-2. In step S841, five blocks 881 to 885 are extracted for each pixel of interest.

ブロック切り出し部841−1乃至841−5により抽出された各ブロックを構成する画素の情報は、ブロック差分演算部842−1乃至842−4に出力される。ブロック差分演算部842−1乃至842−4は、各ブロックの画素の差分を、例えば、次のようにして演算する。   Information on the pixels constituting each block extracted by the block cutout units 841-1 to 841-5 is output to the block difference calculation units 842-1 to 842-4. The block difference calculation units 842-1 to 842-4 calculate the pixel difference of each block as follows, for example.

いま、ブロック881の9個の画素のうち一番上の行の3個の画素(のレベル)を左からa(881),b(881),c(881)とする。中央の行の3個の画素を左からd(881),e(881),f(881)とする。一番下の行の3個の画素を左からg(881),h(881),i(881)とする。同様に、ブロック884の9個の画素についても、一番上の行の3個の画素(のレベル)を左からa(884),b(884),c(884)とし、中央の行の3個の画素を左からd(884),e(884),f(884)とし、一番上の行の3個の画素を左からg(884),h(884),i(884)とする。ブロック差分演算部842−1は、ブロック差分B(1)を次のように演算する。   Now, the three pixels (levels) in the top row among the nine pixels of the block 881 are a (881), b (881), and c (881) from the left. The three pixels in the center row are d (881), e (881), and f (881) from the left. Let the three pixels in the bottom row be g (881), h (881), and i (881) from the left. Similarly, for the nine pixels in the block 884, the three pixels (levels) in the top row are a (884), b (884), and c (884) from the left, The three pixels are d (884), e (884), f (884) from the left, and the three pixels in the top row are g (884), h (884), i (884) from the left. And The block difference calculation unit 842-1 calculates the block difference B (1) as follows.

B(1)=│a(881)-a(884)│+│b(881)-b(884)│+│c(881)-c(884)│+・・・ +│i(881)-i(884)│   B (1) = │a (881) -a (884) │ + │b (881) -b (884) │ + │c (881) -c (884) │ + ・ ・ ・ + │i (881) -i (884) │

すなわち、ブロック差分B(1)は、ブロック881(中心)とブロック884(下)において対応する各画素のレベルの差分の絶対値の総和である。同様にして、ブロック差分演算部842−2は、ブロック881(中心)とブロック885(右)において対応する各画素のレベルの差分の絶対値の総和を求め、ブロック差分B(2)を演算する。さらに、ブロック差分演算部842−3は、ブロック881(中心)とブロック882(上)について、ブロック差分演算部842−3は、ブロック881(中心)とブロック883(左)について、それぞれ対応する各画素のレベルの差分の絶対値の総和を求め、ブロック差分B(3)とB(4)を演算する。   That is, the block difference B (1) is the sum of absolute values of the difference in level of each corresponding pixel in the block 881 (center) and the block 884 (bottom). Similarly, the block difference calculation unit 842-2 calculates a block difference B (2) by calculating the sum of absolute values of the differences between the levels of the corresponding pixels in the block 881 (center) and the block 885 (right). . Further, the block difference calculation unit 842-3 corresponds to the block 881 (center) and the block 882 (upper), and the block difference calculation unit 842-3 corresponds to each of the block 881 (center) and the block 883 (left). The sum of absolute values of pixel level differences is obtained, and block differences B (3) and B (4) are calculated.

ステップS842においては、このように中心ブロックと上下左右の4方向のブロックとの差分であるブロック差分B(1)乃至B(4)が演算され、その結果は、対応する閾値判定部843−1乃至843−4にそれぞれ出力されると同時に、最小方向判定部844にも供給される。   In step S842, the block differences B (1) to B (4), which are the differences between the central block and the four blocks in the up, down, left, and right directions, are calculated in this way, and the result is the corresponding threshold value determination unit 843-1. To 843-4, and simultaneously supplied to the minimum direction determination unit 844.

閾値判定部843−1乃至843−4は、それぞれブロック差分B(1)乃至B(4)を予め設定された閾値と比較し、その大小を判定する。なお、この閾値は制御信号Dに基づいて切り替えられる。閾値判定部843−1乃至843−4は、それぞれブロック差分B(1)乃至B(4)が予め設定された閾値より大きい場合、その方向はエッジ部分であると判定し、「0」を出力し、閾値より小さい場合、その方向は平坦な部分であると判定し、「1」を出力する。   The threshold value determination units 843-1 to 843-4 compare the block differences B (1) to B (4) with preset threshold values, respectively, and determine their magnitudes. The threshold value is switched based on the control signal D. The threshold value determination units 843-1 to 843-4 determine that the direction is an edge portion and output “0” when the block differences B (1) to B (4) are larger than a preset threshold value, respectively. If it is smaller than the threshold, it is determined that the direction is a flat portion, and “1” is output.

ステップS843おいては、このようにしてブロック差分と閾値の比較が行われる。閾値判定部843−1乃至843−4の出力結果は、4ビットのコードとしてセレクタ845に出力される。例えば、ブロック差分B(1)、B(3)およびB(4)が閾値より小さく、ブロック差分B(2)が閾値より大きい場合、コードとして「1011」が出力される。   In step S843, the block difference is compared with the threshold value in this way. The output results of the threshold determination units 843-1 to 843-4 are output to the selector 845 as a 4-bit code. For example, when the block differences B (1), B (3), and B (4) are smaller than the threshold and the block difference B (2) is larger than the threshold, “1011” is output as the code.

ところで、ブロック差分B(1)乃至B(4)が、全て閾値より大きくなってしまう場合(平坦な部分がない場合)も考えられる。この場合、閾値判定部843−1乃至843−4から、コードとして「0000」が出力される。しかし、図62に示されるように、コードp2が「0000」の場合、対応する重み関数W1乃至W4が特定できない。そこで、セレクタ845は、閾値判定部843−1乃至843−4からの出力結果が「0000」か否かを判定し、閾値判定部843−1乃至843−4からの出力結果が「0000」であると判定された場合、最小方向判定部844からの出力をコードp2として出力する。   By the way, the case where the block differences B (1) to B (4) are all larger than the threshold value (when there is no flat portion) is also conceivable. In this case, “0000” is output as a code from the threshold determination units 843-1 to 843-4. However, as shown in FIG. 62, when the code p2 is “0000”, the corresponding weight functions W1 to W4 cannot be specified. Therefore, the selector 845 determines whether the output results from the threshold determination units 843-1 to 843-4 are “0000”, and the output results from the threshold determination units 843-1 to 843-4 are “0000”. When it is determined that there is, the output from the minimum direction determination unit 844 is output as the code p2.

最小方向判定部844は、ブロック差分B(1)乃至B(4)の中で、最小の値を判定し、判定結果に対応した4ビットのコードを、閾値判定部843−1乃至843−4がコードを出力するのと同じタイミングで、セレクタ845に出力する。例えば、ブロック差分B(1)乃至B(4)の中で、B(1)が最小であると判定された場合、最小方向判定部844は、コードとして「1000」をセレクタ845に出力する。   The minimum direction determination unit 844 determines a minimum value among the block differences B (1) to B (4), and uses a 4-bit code corresponding to the determination result as a threshold determination unit 843-1 to 843-4. Is output to the selector 845 at the same timing as that outputs the code. For example, when it is determined that B (1) is the smallest among the block differences B (1) to B (4), the minimum direction determination unit 844 outputs “1000” as a code to the selector 845.

このようにすることで、閾値判定部843−1乃至843−4からコード「0000」が出力されても、最小方向判定部844から出力されたコード「1000」がコードp2として出力されるようにすることができる。勿論、閾値判定部843−1乃至843−4からの出力結果が「0000」ではない場合は、閾値判定部843−1乃至843−4からの出力結果がコードp2として出力される。ステップS844においては、このようにしてコードp2が生成され、アドレス演算部743に出力される。   In this way, even if the code “0000” is output from the threshold determination units 843-1 to 843-4, the code “1000” output from the minimum direction determination unit 844 is output as the code p2. can do. Of course, when the output results from the threshold determination units 843-1 to 843-4 are not “0000”, the output results from the threshold determination units 843-1 to 843-4 are output as the code p2. In step S844, the code p2 is generated in this way and output to the address calculation unit 743.

次に、図69を参照して、図65のステップS825の画像合成処理について説明する。ステップS861において、画像合成部747は、積和演算部746からの出力結果に基づいて、画素の分散度を演算する。これにより、注目画素の周囲の画素の分散度合いが演算される。ステップS862において、画像合成部747は、ステップS862で演算された分散度は予め設定された閾値より大きいか否かを判定する。   Next, the image composition processing in step S825 in FIG. 65 will be described with reference to FIG. In step S <b> 861, the image composition unit 747 calculates the degree of pixel dispersion based on the output result from the product-sum operation unit 746. Thereby, the degree of dispersion of pixels around the target pixel is calculated. In step S862, the image composition unit 747 determines whether the degree of dispersion calculated in step S862 is greater than a preset threshold value.

ステップS862において、分散度が閾値より大きいと判定された場合、画像合成部747は、ステップS863において、注目画素に対応する入力画像入れ替えフラグをONに設定する。一方、分散度が閾値より大きくないと判定された場合、画像合成部747は、ステップS64において、注目画素に対応する入力画像入れ替えフラグをOFFに設定する。   If it is determined in step S862 that the degree of dispersion is greater than the threshold, the image composition unit 747 sets the input image replacement flag corresponding to the target pixel to ON in step S863. On the other hand, if it is determined that the degree of dispersion is not greater than the threshold, the image composition unit 747 sets the input image replacement flag corresponding to the target pixel to OFF in step S64.

入力画像において、もともとぼけていない部分の画素に対して、積和演算部746により積和演算を行うと、その画素の周囲の画像のアクティビティが大きくなり、かえって画像が劣化してしまう場合がある。ここで、分散度が閾値より大きい場合、その画素は劣化した画素であると判定され、入力画像入れ替えフラグがONに設定される。入力画像入れ替えフラグがONに設定された画素は、出力されるとき、入力画像の画素と入れ替えられて(元の状態に戻されて)出力される。   If the product-sum operation is performed by the product-sum operation unit 746 on a pixel in the input image that is not originally blurred, the activity of the image around the pixel increases, and the image may deteriorate instead. . Here, when the degree of dispersion is larger than the threshold value, it is determined that the pixel is a deteriorated pixel, and the input image replacement flag is set to ON. When the pixel whose input image replacement flag is set to ON is output, it is replaced with the pixel of the input image (returned to the original state) and output.

ステップS865において、画像合成部747は、全ての画素についてチェックしたか否かを判定し、まだ全画素をチェックしていないと判定された場合、ステップS861に戻り、それ以降の処理が繰り返し実行される。ステップS865において、全ての画素についてチェックしたと判定された場合、ステップS866において、画像合成部747は、画像が補正され、ぼけが除去された補正対象エリア52内の画像と、背景53の画像を合成し、画像ディスプレイ23に出力する。   In step S865, the image composition unit 747 determines whether or not all the pixels have been checked. If it is determined that all the pixels have not been checked yet, the process returns to step S861, and the subsequent processing is repeatedly executed. The When it is determined in step S865 that all the pixels have been checked, in step S866, the image composition unit 747 corrects the image in the correction target area 52 from which the image is corrected and the blur is removed, and the image of the background 53. The images are combined and output to the image display 23.

このようにして、画素毎に、積和演算結果を出力するか、または入力画像の画素をそのまま出力するかが判定される。このようにすることで、入力画像の中で、もともとぼけていない部分に対して、画像の修正を行うことにより、かえって画像が劣化してしまうことを防止することができる。   In this way, it is determined for each pixel whether the product-sum operation result is output or the pixel of the input image is output as it is. By doing so, it is possible to prevent the image from being deteriorated by correcting the image with respect to the originally unblurred portion of the input image.

この点について、図70と図71を参照して、さらに詳しく説明する。図70は、画像合成部747の構成例を示すブロック図である。積和演算部746からの出力結果が、ブロック切り出し部901に入力され、ブロック切り出し部901は、図71に示されるように、注目画素a5を中心とした9(=3×3)個の画素a1乃至a9を切り出し、分散演算部802に出力する。分散演算部802は、分散度を次のようにして演算する。   This point will be described in more detail with reference to FIGS. 70 and 71. FIG. FIG. 70 is a block diagram illustrating a configuration example of the image composition unit 747. The output result from the product-sum operation unit 746 is input to the block cutout unit 901, and the block cutout unit 901 has 9 (= 3 × 3) pixels centered on the pixel of interest a5 as shown in FIG. A1 to a9 are cut out and output to the variance calculation unit 802. The variance calculation unit 802 calculates the degree of dispersion as follows.

Figure 0004725105
Figure 0004725105

ここで、mは、ブロック内の9個の画素(のレベル)の平均値を表し、vは、それぞれの画素の平均値との差の2乗の総和であり、ブロック内の画素の分散度を表す。ステップS861においては、このようにして分散度が演算され、演算結果が閾値判定部903に出力される。   Here, m represents an average value of (levels) of nine pixels in the block, v is a sum of squares of differences from the average values of the respective pixels, and the degree of dispersion of the pixels in the block Represents. In step S861, the degree of dispersion is calculated in this way, and the calculation result is output to the threshold value determination unit 903.

閾値判定部903は、分散演算部902からの出力結果(分散度)と予め設定された閾値を比較し、分散度が閾値より大きいと判定された場合、画像合成部747は、注目画素に対応する入力画像入れ替えフラグをONに設定するように選択部904を制御する。分散度が閾値より大きくないと判定された場合、画像合成部747は、注目画素に対応する入力画像入れ替えフラグをOFFに設定するように選択部804を制御する。ステップS862乃至S864においては、このように、分散度が閾値より大きいか否かが判定され、判定結果に基づいて、入力画像入れ替えフラグが設定される。   The threshold determination unit 903 compares the output result (dispersion degree) from the variance calculation unit 902 with a preset threshold value. If it is determined that the dispersion degree is greater than the threshold value, the image composition unit 747 corresponds to the target pixel. The selection unit 904 is controlled to set the input image replacement flag to be turned ON. If it is determined that the degree of dispersion is not greater than the threshold value, the image composition unit 747 controls the selection unit 804 to set the input image replacement flag corresponding to the target pixel to OFF. In steps S862 to S864, in this way, it is determined whether or not the degree of dispersion is greater than the threshold value, and the input image replacement flag is set based on the determination result.

そして、切り替え部905により、選択部904による最終処理結果と、入力画像の画素が切り替えられ、出力される。すなわち補正対象エリア52内の画像の画素は、選択部904による最終処理結果とされ、背景53の画像の画素は、入力画像の画素となるように切り替えられる。   Then, the switching unit 905 switches the final processing result by the selection unit 904 and the pixel of the input image and outputs the result. That is, the pixels of the image in the correction target area 52 are set as the final processing result by the selection unit 904, and the pixels of the image of the background 53 are switched to become the pixels of the input image.

このようにして、オブジェクト51(図3)が追尾され、オブジェクト51が含まれる補正対象エリア52内の画像のみが、画像のぼけが除去されるように修正(補正)され鮮明に表示される。一方、背景53の画像は、画像のぼけが除去されずに表示されるので、自然に、ユーザを、移動するオブジェクト51に注目させることができる。   In this way, the object 51 (FIG. 3) is tracked, and only the image in the correction target area 52 including the object 51 is corrected (corrected) so that the blur of the image is removed and displayed clearly. On the other hand, since the image of the background 53 is displayed without removing the blur of the image, the user can naturally focus on the moving object 51.

以上においては、画像補正部22により、撮像部21により撮像された画像の中の補正対象エリア52内の画像について、画像のぼけが除去されるように、補正される例について説明したが、画像補正部22により、画像のぼけが除去されることなく、補正対象エリア52内の画像について、例えば、画像を構成する各画素の輝度や色などの設定が変更され、単純にハイライト表示されるように、画像が補正されるようにしてもよい。このようにすることで、ユーザがオブジェクト51を正確に視認することができなくなるおそれはあるものの、やはり、自然に、ユーザを、移動するオブジェクト51に注目させることができ、また、画像のぼけが除去されるように補正される場合と比較して、画像補正部22を、より簡単な構成とすることができ、その結果、監視カメラシステム1を、より低コストで実現することができる。   In the above description, the example in which the image correction unit 22 corrects the image in the correction target area 52 in the image captured by the imaging unit 21 so as to remove the image blur has been described. The correction unit 22 does not remove the blur of the image, and for example, the setting of the brightness and color of each pixel constituting the image is changed and the highlight image is simply highlighted for the image in the correction target area 52. As described above, the image may be corrected. By doing so, the user may not be able to visually recognize the object 51 accurately, but still, the user can naturally make the user pay attention to the moving object 51, and the image is blurred. Compared with the case where correction is made so as to be removed, the image correction unit 22 can have a simpler configuration, and as a result, the surveillance camera system 1 can be realized at a lower cost.

次に、上述したオブジェクト追尾装置を応用した画像処理装置についてさらに説明を加える。図72は、オブジェクト追尾装置をテレビジョン受像機1000に応用した場合の例を表している。チューナ1001は、RF信号を入力し、復調して画像信号と音声信号とに分離し、画像信号を画像処理部1002に出力し、音声信号を音声処理部1007に出力する。   Next, the image processing apparatus to which the object tracking apparatus described above is applied will be further described. FIG. 72 shows an example where the object tracking device is applied to the television receiver 1000. The tuner 1001 receives an RF signal, demodulates it and separates it into an image signal and an audio signal, outputs the image signal to the image processing unit 1002, and outputs the audio signal to the audio processing unit 1007.

画像処理部1002は、チューナ1001より入力された画像信号を復調し、オブジェクト追尾部1003、ズーム画像作成部1004、および選択部1005に出力する。オブジェクト追尾部1003は、上述した図5のオブジェクト追尾装置26と実質的に同様の構成とされている。オブジェクト追尾部1003は、入力画像からユーザにより指定されたオブジェクトの追尾点を追尾する処理を実行し、その追尾点に関する座標情報をズーム画像作成部1004に出力する。ズーム画像作成部1004は、追尾点を中心とするズーム画像を作成し、選択部1005に出力する。選択部1005は、画像処理部1002より供給された画像またはズーム画像作成部1004より供給された画像の一方をユーザからの指示に基づいて選択し、画像ディスプレイ1006に出力し、表示させる。   The image processing unit 1002 demodulates the image signal input from the tuner 1001 and outputs the demodulated signal to the object tracking unit 1003, the zoom image creation unit 1004, and the selection unit 1005. The object tracking unit 1003 has substantially the same configuration as the object tracking device 26 in FIG. 5 described above. The object tracking unit 1003 executes processing for tracking the tracking point of the object designated by the user from the input image, and outputs coordinate information regarding the tracking point to the zoom image creation unit 1004. The zoom image creation unit 1004 creates a zoom image centered on the tracking point and outputs it to the selection unit 1005. The selection unit 1005 selects one of the image supplied from the image processing unit 1002 or the image supplied from the zoom image creation unit 1004 based on an instruction from the user, and outputs the selected image to the image display 1006 for display.

音声処理部1007は、チューナ1001より入力された音声信号を復調し、スピーカ1008に出力する。   The audio processing unit 1007 demodulates the audio signal input from the tuner 1001 and outputs it to the speaker 1008.

リモートコントローラ1010は、ユーザにより操作され、その操作に対応する信号を制御部1009に出力する。制御部1009は、例えばマイクロコンピュータなどにより構成され、ユーザの指示に基づいて各部を制御する。リムーバブルメディア1011は、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスクなどにより構成され、必要に応じて装着され、制御部1009に、プログラム、その他各種のデータを提供する。   The remote controller 1010 is operated by the user and outputs a signal corresponding to the operation to the control unit 1009. The control unit 1009 is configured by a microcomputer, for example, and controls each unit based on a user instruction. The removable medium 1011 includes a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, and the like. The removable medium 1011 is mounted as necessary, and provides the control unit 1009 with programs and various other data.

次に、テレビジョン受像機1000の処理について、図73のフローチャートを参照して説明する。   Next, processing of the television receiver 1000 will be described with reference to the flowchart of FIG.

ステップS901において、チューナ1001は、図示せぬアンテナを介して受信したRF信号から、ユーザにより指示されたチャンネルの信号を復調して、画像信号を画像処理部1002に出力し、音声信号を音声処理部1007に出力する。音声信号は、音声処理部1007で復調された後、スピーカ1008から出力される。   In step S901, the tuner 1001 demodulates a signal of a channel designated by the user from an RF signal received via an antenna (not shown), outputs the image signal to the image processing unit 1002, and performs audio processing on the audio signal. Output to the unit 1007. The audio signal is demodulated by the audio processing unit 1007 and then output from the speaker 1008.

画像処理部1002は、入力された画像信号を復調し、オブジェクト追尾部1003、ズーム画像作成部1004、および選択部1005に出力する。   The image processing unit 1002 demodulates the input image signal and outputs the demodulated image signal to the object tracking unit 1003, the zoom image creation unit 1004, and the selection unit 1005.

ステップS902において、オブジェクト追尾部1003は、追尾が指示されたか否かを判定し、追尾が指示されていないと判定された場合、ステップS903,S904の処理をスキップする。ステップS905において、選択部1005は、画像処理部1002より供給される画像信号と、ズーム画像作成部1004より入力される画像信号のいずれか一方を制御部1009からの制御に基づいて選択する。いまの場合、ユーザから特に指示がなされていないので、制御部1009は、選択部1005に画像処理部1002からの画像信号を選択させる。ステップS906において画像ディスプレイ1006は、選択部1005により選択された画像を表示する。   In step S902, the object tracking unit 1003 determines whether tracking is instructed. If it is determined that tracking is not instructed, the processing of steps S903 and S904 is skipped. In step S 905, the selection unit 1005 selects one of the image signal supplied from the image processing unit 1002 and the image signal input from the zoom image creation unit 1004 based on control from the control unit 1009. In this case, since there is no specific instruction from the user, the control unit 1009 causes the selection unit 1005 to select the image signal from the image processing unit 1002. In step S906, the image display 1006 displays the image selected by the selection unit 1005.

ステップS907において、制御部1009は、ユーザの指示に基づいて画像表示処理を終了するか否かを判定する。すなわちユーザは、画像表示処理を終了するとき、リモートコントローラ1010を操作して、制御部1009にそれを指示する。ユーザから終了が指示されていない場合、処理はステップS901に戻り、それ以降の処理が繰り返し実行される。   In step S907, the control unit 1009 determines whether to end the image display process based on a user instruction. That is, when ending the image display process, the user operates the remote controller 1010 and instructs the control unit 1009 to do so. If the user has not instructed termination, the process returns to step S901, and the subsequent processes are repeatedly executed.

以上のようにして、チューナ1001により受信された信号に対応する画像をそのまま表示する通常の処理が実行される。   As described above, the normal processing for displaying the image corresponding to the signal received by the tuner 1001 as it is is executed.

ユーザは、画像ディスプレイ1006に表示されている画像を見て追尾したいと思う画像が表示されたとき、リモートコントローラ1010を操作することで、その画像を指定する。この操作がなされたとき、ステップS902において制御部1009は、追尾が指示されたと判定し、オブジェクト追尾部1003を制御する。オブジェクト追尾部1003は、この制御に基づいて、ユーザにより指定された追尾点の追尾処理を開始する。この処理は、上述したオブジェクト追尾装置26の処理と同様の処理である。   When an image desired to be tracked is displayed by looking at the image displayed on the image display 1006, the user designates the image by operating the remote controller 1010. When this operation is performed, in step S902, the control unit 1009 determines that tracking is instructed, and controls the object tracking unit 1003. Based on this control, the object tracking unit 1003 starts tracking processing of the tracking point specified by the user. This process is the same as the process of the object tracking device 26 described above.

ステップS904において、ズーム画像作成部1004は、オブジェクト追尾部1003により追尾されている追尾点を中心とするズーム画像を生成し、選択部1005に出力する。   In step S <b> 904, the zoom image creation unit 1004 generates a zoom image centered on the tracking point tracked by the object tracking unit 1003 and outputs the zoom image to the selection unit 1005.

このズーム画像作成処理は、本出願人が先に提案しているクラス分類適応処理を利用して行うことができる。例えば、特開2002−196737公報には、予め学習して得た係数を用いて、525i信号を1080i信号に変換する処理が開示されている。この処理は、垂直方向と水平方向の両方に9/4倍に画像を拡大する処理と実質的に同様の処理である。ただし、画像ディスプレイ1006は、画素数が一定であるため、ズーム画像作成部1004は、例えば9/4倍の画像を作成する場合、525i信号を1080i信号に変換した後、追尾点を中心とする所定の数の画素(画像ディスプレイ1006に対応する数の画素)を選択することでズーム画像を作成することができる。縮小する処理は、その逆の処理となる。   This zoom image creation processing can be performed using the class classification adaptation processing previously proposed by the present applicant. For example, Japanese Patent Laid-Open No. 2002-196737 discloses a process for converting a 525i signal into a 1080i signal using a coefficient obtained by learning in advance. This process is substantially the same as the process of enlarging the image 9/4 times in both the vertical direction and the horizontal direction. However, since the image display 1006 has a fixed number of pixels, the zoom image creation unit 1004 converts the 525i signal into a 1080i signal and then centers the tracking point when creating a 9 / 4-fold image, for example. A zoom image can be created by selecting a predetermined number of pixels (a number of pixels corresponding to the image display 1006). The process of reducing is the reverse process.

この原理に基づいて、任意の倍率のズーム画像を生成することができる。   Based on this principle, a zoom image with an arbitrary magnification can be generated.

追尾が指示されている場合、ステップS905において選択部1005は、ズーム画像作成部1004により作成されたズーム画像を選択する。その結果、ステップS906において、画像ディスプレイ1006は、ズーム画像作成部1004により作成されたズーム画像を表示することになる。   If tracking is instructed, the selection unit 1005 selects the zoom image created by the zoom image creation unit 1004 in step S905. As a result, in step S906, the image display 1006 displays the zoom image created by the zoom image creation unit 1004.

以上のようにして、画像ディスプレイ1006には、ユーザが指定した追尾点を中心とするズーム画像が表示される。倍率が1に設定された場合には、追尾だけが行われる。   As described above, a zoom image centered on the tracking point designated by the user is displayed on the image display 1006. When the magnification is set to 1, only tracking is performed.

図74は、本発明を監視カメラシステムに適用した場合の例を表している。この監視カメラシステム1100においては、CCDビデオカメラ等よりなる撮像部1101により撮像された画像が画像ディスプレイ1102に表示される。追尾対象検出部1103は、撮像部1101より入力された画像から追尾対象を検出し、検出結果をオブジェクト追尾部1105に出力する。オブジェクト追尾部1105は、撮像部1101より供給された画像中の、追尾対象検出部1103により指定された追尾対象を追尾するように動作する。オブジェクト追尾部1105は、上述した図1のオブジェクト追尾装置26と基本的に同様の構成を有している。カメラ駆動部1104は、オブジェクト追尾部1105からの制御に基づいて、撮像部1101が追尾対象の追尾点を中心とする画像を撮影するように撮像部1101を駆動する。   FIG. 74 shows an example where the present invention is applied to a surveillance camera system. In this surveillance camera system 1100, an image captured by an imaging unit 1101 made up of a CCD video camera or the like is displayed on an image display 1102. The tracking target detection unit 1103 detects the tracking target from the image input from the imaging unit 1101, and outputs the detection result to the object tracking unit 1105. The object tracking unit 1105 operates to track the tracking target designated by the tracking target detection unit 1103 in the image supplied from the imaging unit 1101. The object tracking unit 1105 has basically the same configuration as the object tracking device 26 of FIG. 1 described above. Based on the control from the object tracking unit 1105, the camera driving unit 1104 drives the imaging unit 1101 so that the imaging unit 1101 captures an image centered on the tracking target tracking point.

制御部1106は、例えば、マイクロコンピュータなどにより構成され、各部を制御する。制御部1106には、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスクなどにより構成されるリムーバブルメディア1107が必要に応じて接続され、プログラム、その他各種のデータが必要に応じて供給される。   The control unit 1106 is configured by, for example, a microcomputer and controls each unit. The control unit 1106 is connected to a removable medium 1107 formed of a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, or the like as necessary, and a program and various other data are supplied as necessary.

次に、図75のフローチャートを参照して、監視処理の動作について説明する。監視システム1100の電源がオンされているとき、撮像部1101は監視領域を撮像し、その撮像して得られた画像を追尾対象検出部1103、オブジェクト追尾部1105、および画像ディスプレイ1102に出力している。追尾対象検出部1103は、ステップS931において、撮像部1101から入力された画像から追尾対象を検出する処理を実行する。追尾対象検出部1103は、例えば、動く物体が検出された場合、その動く物体を追尾対象として検出する。追尾対象検出部1103は、追尾対象の中から、例えば、最も輝度の高い点、あるいは追尾対象の中心の点などを追尾点として検出し、オブジェクト追尾部1105に出力する。   Next, the operation of the monitoring process will be described with reference to the flowchart in FIG. When the power of the monitoring system 1100 is turned on, the imaging unit 1101 images the monitoring area, and outputs an image obtained by the imaging to the tracking target detection unit 1103, the object tracking unit 1105, and the image display 1102. Yes. In step S931, the tracking target detection unit 1103 executes processing for detecting a tracking target from the image input from the imaging unit 1101. For example, when a moving object is detected, the tracking target detection unit 1103 detects the moving object as a tracking target. The tracking target detection unit 1103 detects, for example, the point with the highest luminance or the center point of the tracking target from the tracking target, and outputs the detected tracking point to the object tracking unit 1105.

ステップS932において、オブジェクト追尾部1105は、ステップS931で検出された追尾点を追尾する追尾処理を実行する。この追尾処理は、上述した図5のオブジェクト追尾装置26の処理と同様の処理である。   In step S932, the object tracking unit 1105 executes a tracking process for tracking the tracking point detected in step S931. This tracking process is the same as the process of the object tracking device 26 in FIG. 5 described above.

ステップS933において、オブジェクト追尾部1105は、追尾点の画面上の位置を検出する。そして、ステップS934においてオブジェクト追尾部1105は、ステップS933の処理により検出された追尾点の位置と画像の中央との差を検出する。ステップS935において、オブジェクト追尾部1105は、ステップS934の処理で検出した差に対応するカメラ駆動信号を生成し、カメラ駆動部1104に出力する。ステップS936において、カメラ駆動部1104はカメラ駆動信号に基づいて撮像部1101を駆動する。これにより撮像部1101は、追尾点が画面の中央に位置するようにパンまたはチルトする。   In step S933, the object tracking unit 1105 detects the position of the tracking point on the screen. In step S934, the object tracking unit 1105 detects the difference between the position of the tracking point detected by the process in step S933 and the center of the image. In step S935, the object tracking unit 1105 generates a camera drive signal corresponding to the difference detected in the process of step S934, and outputs the camera drive signal to the camera drive unit 1104. In step S936, the camera drive unit 1104 drives the imaging unit 1101 based on the camera drive signal. As a result, the imaging unit 1101 pans or tilts so that the tracking point is located at the center of the screen.

ステップS937において、制御部1106は、ユーザからの指示に基づいて監視処理を終了するか否かを判定し、ユーザから終了が指示されていない場合には、ステップS931に戻り、それ以降の処理を繰り返し実行する。ユーザから監視処理の終了が指示された場合、ステップS937において終了すると判定され、制御部1106は監視処理を終了する。   In step S937, the control unit 1106 determines whether or not to end the monitoring process based on an instruction from the user. If the end instruction is not received from the user, the control unit 1106 returns to step S931 and performs the subsequent processes. Run repeatedly. When the end of the monitoring process is instructed by the user, it is determined in step S937 that the monitoring process ends, and the control unit 1106 ends the monitoring process.

以上のようにして、この監視カメラシステム1100においては、動く物体が自動的に追尾点として検出され、その追尾点を中心とする画像が画像ディスプレイ1102に表示される。これにより、より簡単かつ確実に、監視処理を行うことが可能となる。   As described above, in the surveillance camera system 1100, a moving object is automatically detected as a tracking point, and an image centered on the tracking point is displayed on the image display 1102. This makes it possible to perform the monitoring process more easily and reliably.

図76は、本発明を適用した他の監視カメラシステムの構成例を表している。この監視カメラシステム1200は、撮像部1201、画像ディスプレイ1202、オブジェクト追尾部1203、カメラ駆動部1204、制御部1205、指示入力部1206、およびリムーバブルメディア1207により構成されている。   FIG. 76 shows a configuration example of another surveillance camera system to which the present invention is applied. The surveillance camera system 1200 includes an imaging unit 1201, an image display 1202, an object tracking unit 1203, a camera driving unit 1204, a control unit 1205, an instruction input unit 1206, and a removable medium 1207.

撮像部1201は、撮像部1101と同様に、CCDビデオカメラなどにより構成され、撮像した画像を画像ディスプレイ1202とオブジェクト追尾部1203に出力する。画像ディスプレイ1202は、入力された画像を表示する。オブジェクト追尾部1203は、上述した図5のオブジェクト追尾装置26と基本的に同様の構成とされている。カメラ駆動部1204は、オブジェクト追尾部1203からの制御に基づいて、撮像部1201を所定の方向にパン、チルト駆動する。   Similar to the imaging unit 1101, the imaging unit 1201 is configured by a CCD video camera or the like, and outputs the captured image to the image display 1202 and the object tracking unit 1203. The image display 1202 displays the input image. The object tracking unit 1203 has basically the same configuration as the object tracking device 26 in FIG. 5 described above. The camera driving unit 1204 drives the imaging unit 1201 to pan and tilt in a predetermined direction based on control from the object tracking unit 1203.

制御部1205は、例えばマイクロコンピュータなどにより構成され、各部を制御する。指示入力部1206は、各種のボタン、スイッチ、あるいはリモートコントローラなどにより構成され、ユーザからの指示に対応する信号を制御部1205に出力する。リムーバブルメディア1207は、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスクなどにより構成され、必要に応じて接続され、制御部1205に必要なプログラムやデータなどを適宜供給する。   The control unit 1205 is configured by a microcomputer, for example, and controls each unit. The instruction input unit 1206 includes various buttons, switches, a remote controller, and the like, and outputs a signal corresponding to an instruction from the user to the control unit 1205. The removable medium 1207 includes a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, and the like, connected as necessary, and appropriately supplies necessary programs and data to the control unit 1205.

次に、図77のフローチャートを参照して、その動作について説明する。   Next, the operation will be described with reference to the flowchart of FIG.

ステップS961において、制御部1205は、ユーザより追尾点が指定されたか否かを判定する。追尾点が指定されていなければ、ステップS969に進み、制御部1205は、ユーザより処理の終了が指示されたか否かを判定し、終了が指示されていなければ、ステップS961に戻り、それ以降の処理を繰り返し実行する。   In step S961, the control unit 1205 determines whether a tracking point is specified by the user. If the tracking point is not specified, the process proceeds to step S969, and the control unit 1205 determines whether or not the user has instructed the end of the process. If the end is not instructed, the process returns to step S961, and the subsequent steps Repeat the process.

すなわち、この間、撮像部1201が撮像エリアを撮像して得られた画像が画像ディスプレイ1202に出力され、表示されている。この画像を見て、監視エリアを監視する処理を終了させる場合、ユーザ(監視者)は指示入力部1206を操作して終了を指令する。終了が指令されたとき、制御部1205は、監視処理を終了する。   That is, during this time, an image obtained by the imaging unit 1201 imaging the imaging area is output to the image display 1202 and displayed. When viewing the image and ending the process of monitoring the monitoring area, the user (monitoring person) operates the instruction input unit 1206 to instruct the end. When the termination is instructed, the control unit 1205 terminates the monitoring process.

一方、ユーザは、画像ディスプレイ1202に表示されている画像を見て、例えば不審者などが表示されたとき、その不審者の所定の点を追尾点として指定する。この指定は、指示入力部1206を操作することで行われる。ユーザが追尾点を指定したとき、ステップS961において、追尾点が指定されたと判定され、ステップS962に進み、追尾処理が実行される。以下、ステップS962乃至ステップS967において実行される処理は、図75のステップS932乃至ステップS937において行われる処理と同様の処理である。すなわち、これにより、撮像部1201が指定された追尾点が画面の中央に来るように駆動される。   On the other hand, the user looks at the image displayed on the image display 1202, and when, for example, a suspicious person is displayed, a predetermined point of the suspicious person is designated as a tracking point. This designation is performed by operating the instruction input unit 1206. When the user designates a tracking point, it is determined in step S961 that the tracking point has been designated, and the process proceeds to step S962 where a tracking process is executed. Hereinafter, the processing executed in steps S962 to S967 is the same as the processing performed in steps S932 to S937 in FIG. In other words, this causes the imaging unit 1201 to be driven so that the specified tracking point is at the center of the screen.

ステップS967において、制御部1205は、監視の終了が指示されたか否かを判定し、指示された場合処理を終了するが、指示されていない場合には、ステップS968に進み、ユーザより追尾の解除が指示されたか否かを判定する。ユーザは、例えば、一旦追尾を指定したものが不審者でないとわかったとき、指示入力部1206を操作して、追尾の解除を指示することができる。制御部1205は、ステップS968で、追尾の解除が指示されていないと判定された場合、ステップS962に戻り、それ以降の処理を実行する。すなわち、この場合には、指定された追尾点を追尾する処理が継続される。   In step S967, the control unit 1205 determines whether or not monitoring has been instructed. If instructed, the control unit 1205 terminates the processing. If not instructed, the control unit 1205 proceeds to step S968 and cancels tracking from the user. Whether or not is instructed is determined. For example, when it is determined that the user who has designated tracking is not a suspicious person, the user can operate the instruction input unit 1206 to instruct cancellation of tracking. When it is determined in step S968 that the tracking cancellation is not instructed, the control unit 1205 returns to step S962 and executes the subsequent processing. That is, in this case, the process of tracking the designated tracking point is continued.

ステップS968において追尾の解除が指示されたと判定された場合、追尾処理は解除され、処理はステップS961に戻り、それ以降の処理が繰り返し実行される。   If it is determined in step S968 that tracking cancellation is instructed, the tracking process is canceled, the process returns to step S961, and the subsequent processes are repeatedly executed.

以上のようにして、この監視カメラシステム1200においては、ユーザが指示した追尾点の画像が画像ディスプレイ1202の中央に表示される。従って、ユーザは、所望の画像を任意に選択して、きめ細やかに監視を行うことが可能となる。   As described above, in the surveillance camera system 1200, the image of the tracking point designated by the user is displayed at the center of the image display 1202. Therefore, the user can select a desired image arbitrarily and perform fine monitoring.

本発明は、テレビジョン受像機や監視カメラシステムに限らず、各種の画像処理装置に適応することが可能である。   The present invention can be applied not only to a television receiver and a surveillance camera system but also to various image processing apparatuses.

なお、以上においては、画像の処理単位をフレームとしたが、フィールドを処理単位とする場合にも本発明は適用が可能である。   In the above, the image processing unit is a frame, but the present invention can also be applied to a case where a field is a processing unit.

なお、上述した一連の処理をハードウェアで実現するか、ソフトウェアで実現するかは問わない。上述した一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、汎用のパーソナルコンピュータなどに、ネットワークやリムーバブルメディアなどの記録媒体からインストールされる。   It does not matter whether the above-described series of processing is realized by hardware or software. When the above-described series of processing is executed by software, a program constituting the software executes various functions by installing a computer incorporated in dedicated hardware or various programs. It is installed on a general-purpose personal computer or the like from a recording medium such as a network or a removable medium.

また、本明細書において上述した一連の処理を実行するステップは、記載された順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。   In addition, the steps of executing the series of processes described above in this specification are performed in parallel or individually even if they are not necessarily processed in time series, as well as processes performed in time series in the order described. The processing to be performed is also included.

本発明を適用した監視カメラシステムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the surveillance camera system to which this invention is applied. 監視処理を説明するフローチャートである。It is a flowchart explaining a monitoring process. 図1の監視カメラシステムにより表示される画像の例を示す図である。It is a figure which shows the example of the image displayed by the surveillance camera system of FIG. 図3の補正対象エリアの移動の例を示す図である。It is a figure which shows the example of a movement of the correction object area of FIG. 図1のオブジェクト追尾部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the object tracking part of FIG. 追尾処理を説明するフローチャート図である。It is a flowchart figure explaining a tracking process. 追尾対象が回転する場合の追尾を説明する図である。It is a figure explaining tracking when a tracking object rotates. オクルージョンが起きる場合の追尾を説明する図である。It is a figure explaining the tracking when an occlusion occurs. シーンチェンジが起きる場合の追尾を説明する図である。It is a figure explaining the tracking when a scene change occurs. 通常処理を説明するフローチャートである。It is a flowchart explaining a normal process. 通常処理の初期化処理を説明するフローチャートである。It is a flowchart explaining the initialization process of a normal process. 乗り換え候補抽出処理を説明する図である。It is a figure explaining a transfer candidate extraction process. 領域推定関連処理部の構成例を示すブロック図である。It is a block diagram which shows the structural example of an area | region estimation related process part. 領域推定関連処理を説明するフローチャートである。It is a flowchart explaining an area | region estimation related process. 領域推定処理を説明するフローチャートである。It is a flowchart explaining an area | region estimation process. サンプル点を決定する処理を説明する図である。It is a figure explaining the process which determines a sample point. サンプル点を決定する処理を説明する図である。It is a figure explaining the process which determines a sample point. サンプル点を決定する処理を説明する図である。It is a figure explaining the process which determines a sample point. サンプル点を決定する処理を説明する図である。It is a figure explaining the process which determines a sample point. 領域推定範囲の更新処理を説明するフローチャートである。It is a flowchart explaining the update process of an area estimation range. 領域推定範囲の更新を説明する図である。It is a figure explaining the update of a region estimation range. 領域推定範囲の更新を説明する図である。It is a figure explaining the update of a region estimation range. 領域推定範囲の更新を説明する図である。It is a figure explaining the update of a region estimation range. 領域推定範囲の更新を説明する図である。It is a figure explaining the update of a region estimation range. 領域推定範囲の更新処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of the update process of an area | region estimated range. 領域推定範囲の更新を説明するフローチャートである。It is a flowchart explaining the update of a region estimation range. 乗り換え候補抽出処理を説明するフローチャートである。It is a flowchart explaining a transfer candidate extraction process. テンプレート作成処理を説明するフローチャートである。It is a flowchart explaining a template creation process. テンプレート作成を説明する図である。It is a figure explaining template creation. テンプレート作成を説明する図である。It is a figure explaining template creation. テンプレートと追尾点の位置関係を説明する図である。It is a figure explaining the positional relationship of a template and a tracking point. 領域推定関連処理部の他の構成例を示すブロック図である。It is a block diagram which shows the other structural example of an area | region estimation related process part. 領域推定処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of an area | region estimation process. 同色領域の成長を説明する図である。It is a figure explaining growth of the same color area. 追尾点の同色領域と領域推定結果を説明する図である。It is a figure explaining the same color area | region of a tracking point and an area | region estimation result. 乗り換え候補抽出処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of a transfer candidate extraction process. 例外処理を説明するフローチャートである。It is a flowchart explaining exception processing. 例外処理の初期化処理を説明するフローチャートである。It is a flowchart explaining the initialization process of an exception process. テンプレートの選択を説明する図である。It is a figure explaining selection of a template. 探索範囲の設定を説明する図である。It is a figure explaining the setting of a search range. 継続判定処理を説明するフローチャートである。It is a flowchart explaining a continuation determination process. 他の通常処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of another normal process. 領域推定処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of an area | region estimation process. 乗り換え候補抽出処理の他の例を説明するフローチャートである。It is a flowchart explaining the other example of a transfer candidate extraction process. 通常処理を行った場合の乗り換え候補を説明する図である。It is a figure explaining the transfer candidate at the time of performing a normal process. 通常処理を行った場合における乗り換え候補を説明する図である。It is a figure explaining the transfer candidate in the case of performing a normal process. 動き推定部の構成例を示すブロック図である。It is a block diagram which shows the structural example of a motion estimation part. 動き推定処理を説明するフローチャートである。It is a flowchart explaining a motion estimation process. アクティビティの算出を説明する図である。It is a figure explaining calculation of activity. 評価値とアクティビティの関係を説明する図である。It is a figure explaining the relationship between an evaluation value and activity. 統合処理を説明するフローチャートである。It is a flowchart explaining an integration process. 背景動き推定部の構成例を示すブロック図である。It is a block diagram which shows the structural example of a background motion estimation part. 背景動き推定処理を説明するフローチャートである。It is a flowchart explaining a background motion estimation process. シーンチェンジ検出部53の構成例を示すブロック図である。5 is a block diagram illustrating a configuration example of a scene change detection unit 53. FIG. シーンチェンジ検出処理を説明するフローチャートである。It is a flowchart explaining a scene change detection process. 図1の画像補正部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image correction part of FIG. 画像補正部の制御信号の例を示す図である。It is a figure which shows the example of the control signal of an image correction part. 画像のぼけの原理を説明する図である。It is a figure explaining the principle of a blur of an image. 画像のぼけの原理を説明する図である。It is a figure explaining the principle of a blur of an image. 画像のぼけの原理を説明する図である。It is a figure explaining the principle of a blur of an image. 画像のぼけの原理を説明する図である。It is a figure explaining the principle of a blur of an image. パラメータコードの組み合わせの例を示す図である。It is a figure which shows the example of the combination of a parameter code. 画像のエッジ部分を説明する図である。It is a figure explaining the edge part of an image. ぼけ修正処理を説明するフローチャートである。It is a flowchart explaining a blur correction process. 画像補正処理を説明するフローチャートである。It is a flowchart explaining an image correction process. 画像特徴検出処理を説明するフローチャートである。It is a flowchart explaining an image feature detection process. 画像特徴検出部の構成例を示すブロック図である。It is a block diagram which shows the structural example of an image feature detection part. ブロック切り出し部により抽出されるブロックを説明する図である。It is a figure explaining the block extracted by a block cutout part. 画像合成処理を説明するフローチャートである。It is a flowchart explaining an image composition process. 画像合成部の構成例を示すブロック図である。It is a block diagram which shows the structural example of an image synthetic | combination part. 分散演算を説明する図である。It is a figure explaining a distributed calculation. テレビジョン受像機の構成例を示すブロック図である。It is a block diagram which shows the structural example of a television receiver. テレビジョン受像機の画像表示処理を説明するフローチャートである。It is a flowchart explaining the image display process of a television receiver. 監視カメラシステムの構成例を示すブロック図である。It is a block diagram which shows the structural example of a surveillance camera system. 監視カメラシステムの監視処理を説明するフローチャートである。It is a flowchart explaining the monitoring process of a monitoring camera system. 監視カメラシステムの他の構成例を示すブロック図である。It is a block diagram which shows the other structural example of the surveillance camera system. 監視カメラシステムの監視処理を説明するフローチャートである。It is a flowchart explaining the monitoring process of a monitoring camera system.

符号の説明Explanation of symbols

1 監視カメラシステム, 21 撮像部, 22 画像補正部, 24 追尾対象検出部, 25 エリア設定部, 26 オブジェクト追尾部, 51 テンプレートマッチング部, 52 動き推定部, 53 シーンチェンジ検出部, 54 背景動き推定部, 55 領域推定関連処理部, 56 乗り換え候補保持部, 57 追尾点決定部, 58 テンプレート保持部, 741 制御信号生成部, 742 画像特徴検出部, 743 アドレス演算部, 744 係数ROM, 745 領域抽出部, 746 積和演算部, 747 画像合成部   DESCRIPTION OF SYMBOLS 1 Surveillance camera system, 21 Image pick-up part, 22 Image correction part, 24 Tracking object detection part, 25 Area setting part, 26 Object tracking part, 51 Template matching part, 52 Motion estimation part, 53 Scene change detection part, 54 Background motion estimation , 55 region estimation related processing unit, 56 transfer candidate holding unit, 57 tracking point determination unit, 58 template holding unit, 741 control signal generation unit, 742 image feature detection unit, 743 address calculation unit, 744 coefficient ROM, 745 region extraction Section, 746 product-sum operation section, 747 image composition section

Claims (9)

移動するオブジェクトを明確に表示する画像処理装置であって、
画像の中の移動するオブジェクトの特徴点を検出する特徴点検出手段と、
前記特徴点検出手段により検出された前記特徴点に基づいて、前記画像の中の前記オブジェクトの移動を追尾する追尾手段と、
前記追尾手段による追尾結果に基づいて、前記画像の中の前記オブジェクトの周囲に予め設定された大きさの補正領域を設定する補正領域設定手段と、
前記画像の中の前記補正領域内の画像を補正する補正手段と、
前記補正領域内が前記補正手段により補正された画像の表示を制御する表示制御手段と
を備え
前記補正手段は、
前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給手段と、
前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出手段と、
前記画像のぼけの度合いを表すパラメータと、前記特徴検出手段により出力された特徴コードに対応する係数を記憶する記憶手段と、
前記記憶手段から、前記パラメータと前記特徴検出手段により出力された前記特徴コードに対応する係数を読み出す読み出し手段と、
前記読み出し手段により読み出された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算手段と、
前記積和演算手段による演算結果と前記入力画像の画素の値を選択して出力する選択出力手段とを備え、
前記補正領域内の画像のぼけを除去するように補正する
画像処理装置。
An image processing apparatus that clearly displays a moving object,
Feature point detecting means for detecting feature points of a moving object in an image;
Tracking means for tracking the movement of the object in the image based on the feature points detected by the feature point detection means;
Correction area setting means for setting a correction area of a preset size around the object in the image based on the tracking result by the tracking means;
Correction means for correcting an image in the correction region in the image;
Display control means for controlling the display of the image in the correction area corrected by the correction means ,
The correction means includes
Supply means for supplying a control signal for specifying an image in the correction area, and a parameter representing a degree of blur of the image;
Feature detection means for detecting a feature of the image in the correction region identified based on the control signal and outputting a feature code representing the detected feature;
Storage means for storing a parameter representing the degree of blur of the image and a coefficient corresponding to the feature code output by the feature detection means;
Reading means for reading out the coefficient and the coefficient corresponding to the feature code output by the feature detection means from the storage means;
Product-sum operation means for performing product-sum operation on the pixel values of the input image based on the coefficient read by the reading means;
A selection output means for selecting and outputting a calculation result by the product-sum calculation means and a pixel value of the input image;
Correct so as to remove the blur of the image in the correction area
Image processing device.
前記特徴検出手段は、
入力画像の中から、積和演算を行う画素の周囲の、予め設定された第1の領域に含まれる複数の画素を抽出する第1の抽出手段と、
前記第1の領域と、垂直または水平の複数の方向に連続した、複数の第2の領域に含まれる複数の画素を抽出する第2の抽出手段と、
前記第1の抽出手段により抽出された画素と、前記第2の抽出手段により抽出された画素において、対応する画素の値の差分の絶対値の総和を求めて、複数のブロック差分を演算するブロック差分演算手段と、
前記ブロック差分が、予め設定された閾値より大きいか否かを判定する差分判定手段と
を備える請求項に記載の画像処理装置。
The feature detection means includes
A first extraction means for extracting a plurality of pixels included in a preset first area around the pixel to be subjected to the product-sum operation from the input image;
A second extraction means for extracting a plurality of pixels included in a plurality of second regions, which are continuous in a plurality of vertical or horizontal directions, and the first region;
A block for calculating a plurality of block differences by calculating a sum of absolute values of differences between corresponding pixel values in the pixels extracted by the first extracting unit and the pixels extracted by the second extracting unit. Difference calculation means;
The image processing apparatus according to claim 1 , further comprising: a difference determination unit that determines whether the block difference is larger than a preset threshold value.
前記パラメータは、ぼけた画像の画素とぼけていない画像の画素の関係を表すモデル式におけるガウス関数のパラメータである
請求項に記載の画像処理装置。
The image processing apparatus according to claim 1 , wherein the parameter is a parameter of a Gaussian function in a model formula representing a relationship between a pixel of a blurred image and a pixel of a non-blurred image.
前記記憶手段により記憶される係数は、前記モデル式の逆行列を演算することにより求められた係数である
請求項に記載の画像処理装置。
The image processing apparatus according to claim 3 , wherein the coefficient stored by the storage unit is a coefficient obtained by calculating an inverse matrix of the model formula.
前記選択出力手段は、
前記積和演算手段により積和演算が行われた複数の画素を抽出する第1の抽出手段と、
前記第1の抽出手段により抽出された複数の画素の分散の度合いを表す分散度を演算する分散演算手段と、
前記分散演算手段により演算された分散度が予め設定された閾値より大きいか否かを判定する分散判定手段と
請求項に記載の画像処理装置。
The selection output means includes
First extraction means for extracting a plurality of pixels on which product-sum operation has been performed by the product-sum operation means;
Dispersion calculating means for calculating a degree of dispersion representing a degree of dispersion of the plurality of pixels extracted by the first extracting means;
The image processing apparatus according to claim 1 , wherein a dispersion determination unit that determines whether or not the degree of dispersion calculated by the dispersion calculation unit is greater than a preset threshold value.
前記選択出力手段は、前記分散判定手段の判定結果に基づいて、出力する画素の値を、前記積和演算手段による演算結果、または前記入力画像の画素の値のいずれかから選択する画素選択手段
をさらに備える請求項に記載の画像信号処理装置。
The selection output unit is a pixel selection unit that selects a pixel value to be output from either a calculation result by the product-sum calculation unit or a pixel value of the input image based on the determination result of the variance determination unit. The image signal processing apparatus according to claim 5 , further comprising:
画像の中で、移動するオブジェクトを明確に表示する画像処理装置の画像処理方法であって、
画像の中の移動するオブジェクトの特徴点を検出する特徴点検出ステップと、
前記特徴点検出ステップの処理により検出された前記特徴点に基づいて、画像の前記オブジェクトの移動を追尾する追尾ステップと、
前記追尾ステップの処理による追尾結果に基づいて、前記画像の中に前記オブジェクトの周囲に予め設定された大きさの補正領域を設定する補正領域設定ステップと、
前記画像の中の前記補正領域内の画像を補正する補正ステップと、
前記補正領域内が前記補正ステップの処理により補正された画像の表示を制御する表示制御ステップと
を含み
前記補正ステップは、
前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給ステップと、
前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出ステップと、
前記画像のぼけの度合いを表すパラメータと、前記特徴検出ステップの処理により出力された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、
前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出ステップの処理により出力された前記特徴コードに対応する係数を読み出す読み出しステップと、
前記読み出しステップの処理により読み出された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算ステップと、
前記積和演算ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力ステップとを含み、
前記補正領域内の画像のぼけを除去するように補正する
画像処理方法。
An image processing method of an image processing apparatus for clearly displaying a moving object in an image,
A feature point detecting step for detecting a feature point of a moving object in the image;
A tracking step of tracking the movement of the object in the image based on the feature points detected by the processing of the feature point detection step;
A correction area setting step for setting a correction area of a predetermined size around the object in the image based on the tracking result of the tracking step;
A correction step of correcting an image in the correction area of the image;
And a display control step of the correction area to control the display of the corrected image by the processing in the correction step,
The correction step includes
Supplying a control signal for specifying an image in the correction area, and a parameter representing a degree of blur of the image;
A feature detection step of detecting a feature of the image in the correction region specified based on the control signal and outputting a feature code representing the detected feature;
A parameter indicating the degree of blur of the image, and a storage control step for controlling storage of a coefficient corresponding to the feature code output by the processing of the feature detection step;
A step of reading out a parameter corresponding to the feature code output by the processing of the parameter and the feature detection step, the storage of which is controlled by the processing of the storage control step;
A product-sum operation step for performing a product-sum operation on the pixel values of the input image based on the coefficients read out by the processing in the reading step;
A selection output step of selecting and outputting a calculation result by the process of the product-sum calculation step and a pixel value of the input image;
An image processing method for performing correction so as to remove blur in an image in the correction area .
画像の中で、移動するオブジェクトを明確に表示する画像処理装置のプログラムであって、
画像の中の移動するオブジェクトの特徴点の検出を制御する特徴点検出制御ステップと、
前記特徴点検出制御ステップの処理により検出された前記特徴点に基づいて、画像の前記オブジェクトの移動を追尾するように制御する追尾制御ステップと、
前記追尾制御ステップの処理による追尾結果に基づいて、前記画像の中に前記オブジェクトの周囲に予め設定された大きさの補正領域を設定するように制御する補正領域設定制御ステップと、
前記画像の中の前記補正領域内の画像の補正を制御する補正制御ステップと、
前記補正領域内が前記補正制御ステップの処理により補正された画像の表示を制御する表示制御ステップと
を含み、
前記補正制御ステップは、
前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給制御ステップと、
前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出制御ステップと、
前記画像のぼけの度合いを表すパラメータと、前記特徴検出制御ステップの処理により出力が制御された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、
前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出制御ステップの処理により出力が制御された前記特徴コードに対応する係数を読み出す読み出し制御ステップと、
前記読み出し制御ステップの処理により読み出しが制御された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算制御ステップと、
前記積和演算制御ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力制御ステップとを含み、
前記補正領域内の画像のぼけを除去するように補正する
処理をコンピュータに実行させるプログラム。
An image processing apparatus program that clearly displays a moving object in an image,
A feature point detection control step for controlling detection of feature points of a moving object in the image;
A tracking control step for controlling to track the movement of the object in the image based on the feature point detected by the processing of the feature point detection control step;
A correction area setting control step for controlling to set a correction area of a preset size around the object in the image based on the tracking result by the processing of the tracking control step;
A correction control step for controlling correction of an image in the correction region in the image;
A display control step for controlling display of an image in which the correction area is corrected by the processing of the correction control step;
Including
The correction control step includes
A supply control step of supplying a control signal for specifying an image in the correction area, and a parameter representing a degree of blur of the image;
A feature detection control step of detecting a feature of the image in the correction region identified based on the control signal and outputting a feature code representing the detected feature;
A parameter representing the degree of blur of the image, and a storage control step for controlling storage of a coefficient corresponding to the feature code whose output is controlled by the processing of the feature detection control step;
A read control step for reading out the coefficient corresponding to the feature code whose output is controlled by the process of the parameter and the feature detection control step whose storage is controlled by the process of the storage control step;
A product-sum operation control step for performing a product-sum operation on the pixel value of the input image based on the coefficient whose reading is controlled by the processing of the reading control step;
A selection output control step of selecting and outputting a calculation result by the process of the product-sum calculation control step and a pixel value of the input image;
A program for causing a computer to execute a process of correcting so as to remove blurring of an image in the correction area .
画像の中で、移動するオブジェクトを明確に表示する画像処理装置のプログラムが記録される記録媒体であって、
画像の中の移動するオブジェクトの特徴点の検出を制御する特徴点検出制御ステップと、
前記特徴点検出制御ステップの処理により検出された前記特徴点に基づいて、画像の前記オブジェクトの移動を追尾するように制御する追尾制御ステップと、
前記追尾制御ステップの処理による追尾結果に基づいて、前記画像の中に前記オブジェクトの周囲に予め設定された大きさの補正領域を設定するように制御する補正領域設定制御ステップと、
前記画像の中の前記補正領域内の画像の補正を制御する補正制御ステップと、
前記補正領域内が前記補正制御ステップの処理により補正された画像の表示を制御する表示制御ステップと
を含み、
前記補正制御ステップは、
前記補正領域内の画像を特定する制御信号と、画像のぼけの度合い表すパラメータを供給する供給制御ステップと、
前記制御信号に基づいて特定された前記補正領域内の画像の特徴を検出し、検出された特徴を表す特徴コードを出力する特徴検出制御ステップと、
前記画像のぼけの度合いを表すパラメータと、前記特徴検出制御ステップの処理により出力が制御された特徴コードに対応する係数の記憶を制御する記憶制御ステップと、
前記記憶制御ステップの処理により記憶が制御された、前記パラメータと前記特徴検出制御ステップの処理により出力が制御された前記特徴コードに対応する係数を読み出す読み出し制御ステップと、
前記読み出し制御ステップの処理により読み出しが制御された係数に基づいて、入力画像の画素の値に対して積和演算を行う積和演算制御ステップと、
前記積和演算制御ステップの処理による演算結果と前記入力画像の画素の値を選択して出力する選択出力制御ステップとを含み、
前記補正領域内の画像のぼけを除去するように補正する
処理をコンピュータに実行させるプログラムが記録される記録媒体。
A recording medium in which a program of an image processing device for clearly displaying a moving object in an image is recorded,
A feature point detection control step for controlling detection of feature points of a moving object in the image;
A tracking control step for controlling to track the movement of the object in the image based on the feature point detected by the processing of the feature point detection control step;
A correction area setting control step for controlling to set a correction area of a preset size around the object in the image based on the tracking result by the processing of the tracking control step;
A correction control step for controlling correction of an image in the correction region in the image;
A display control step for controlling display of an image in which the correction area is corrected by the processing of the correction control step;
Including
The correction control step includes
A supply control step of supplying a control signal for specifying an image in the correction area, and a parameter representing a degree of blur of the image;
A feature detection control step of detecting a feature of the image in the correction region identified based on the control signal and outputting a feature code representing the detected feature;
A parameter representing the degree of blur of the image, and a storage control step for controlling storage of a coefficient corresponding to the feature code whose output is controlled by the processing of the feature detection control step;
A read control step for reading out the coefficient corresponding to the feature code whose output is controlled by the process of the parameter and the feature detection control step whose storage is controlled by the process of the storage control step;
A product-sum operation control step for performing a product-sum operation on the pixel value of the input image based on the coefficient whose reading is controlled by the processing of the reading control step;
A selection output control step of selecting and outputting a calculation result by the process of the product-sum calculation control step and a pixel value of the input image;
A recording medium on which is recorded a program that causes a computer to execute a correction process so as to remove blur in an image in the correction area .
JP2005000621A 2004-01-06 2005-01-05 Image processing apparatus and method, program, and recording medium Expired - Fee Related JP4725105B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005000621A JP4725105B2 (en) 2004-01-06 2005-01-05 Image processing apparatus and method, program, and recording medium

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2004000752 2004-01-06
JP2004000752 2004-01-06
JP2004077398 2004-03-18
JP2004077398 2004-03-18
JP2005000621A JP4725105B2 (en) 2004-01-06 2005-01-05 Image processing apparatus and method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2005303983A JP2005303983A (en) 2005-10-27
JP4725105B2 true JP4725105B2 (en) 2011-07-13

Family

ID=35334930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005000621A Expired - Fee Related JP4725105B2 (en) 2004-01-06 2005-01-05 Image processing apparatus and method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP4725105B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101855224B1 (en) 2014-06-17 2018-05-08 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 Image processing method and apparatus

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4682820B2 (en) * 2005-11-25 2011-05-11 ソニー株式会社 Object tracking device, object tracking method, and program
JP4826316B2 (en) * 2006-03-31 2011-11-30 ソニー株式会社 Image processing apparatus and method, program, and recording medium
JP4797753B2 (en) * 2006-03-31 2011-10-19 ソニー株式会社 Image processing apparatus and method, and program
JP4558696B2 (en) * 2006-09-25 2010-10-06 パナソニック株式会社 Automatic body tracking device
JP4874150B2 (en) * 2007-03-30 2012-02-15 セコム株式会社 Moving object tracking device
CN101398896B (en) * 2007-09-28 2012-10-17 三星电子株式会社 Device and method for extracting color characteristic with strong discernment for image forming apparatus
JP4978402B2 (en) * 2007-09-28 2012-07-18 富士通セミコンダクター株式会社 Image processing filter, image processing method of image processing filter, and image processing circuit of image processing apparatus including image processing filter
KR100927009B1 (en) * 2008-02-04 2009-11-16 광주과학기술원 Haptic interaction method and system in augmented reality
JP4513035B2 (en) 2008-03-10 2010-07-28 ソニー株式会社 Information processing apparatus and method, and program
JP4963297B2 (en) * 2008-03-17 2012-06-27 グローリー株式会社 Person counting device and person counting method
JP2009223722A (en) 2008-03-18 2009-10-01 Sony Corp Image signal processing apparatus, image signal processing method, and program
JP4623122B2 (en) 2008-04-03 2011-02-02 ソニー株式会社 Image signal processing apparatus, image signal processing method, and program
JP4513039B2 (en) * 2008-05-30 2010-07-28 ソニー株式会社 Image processing apparatus, image processing method, and program
JP4507129B2 (en) 2008-06-06 2010-07-21 ソニー株式会社 Tracking point detection apparatus and method, program, and recording medium
JP5487610B2 (en) 2008-12-18 2014-05-07 ソニー株式会社 Image processing apparatus and method, and program
JP5012875B2 (en) * 2009-11-10 2012-08-29 富士通株式会社 High-speed moving image shooting device and high-speed moving image shooting method
JP5394952B2 (en) * 2010-03-03 2014-01-22 セコム株式会社 Moving object tracking device
KR101870902B1 (en) * 2011-12-12 2018-06-26 삼성전자주식회사 Image processing apparatus and image processing method
JP5808282B2 (en) * 2012-03-23 2015-11-10 三菱電機株式会社 Video signal recording / reproducing apparatus and monitoring method
US10334159B2 (en) * 2014-08-05 2019-06-25 Panasonic Corporation Correcting and verifying method, and correcting and verifying device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61182389A (en) * 1985-02-08 1986-08-15 Hitachi Ltd Picture image signal processing device
JPS62127976A (en) * 1985-11-29 1987-06-10 Kyocera Corp Image recording processor
JP3182808B2 (en) * 1991-09-20 2001-07-03 株式会社日立製作所 Image processing system
JP2001043382A (en) * 1999-07-27 2001-02-16 Fujitsu Ltd Eye tracking device
JP2002369071A (en) * 2001-06-08 2002-12-20 Olympus Optical Co Ltd Picture processing method and digital camera mounted with the same and its program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101855224B1 (en) 2014-06-17 2018-05-08 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 Image processing method and apparatus

Also Published As

Publication number Publication date
JP2005303983A (en) 2005-10-27

Similar Documents

Publication Publication Date Title
JP4725105B2 (en) Image processing apparatus and method, program, and recording medium
KR101108634B1 (en) Image processing device and image processing method and recording medium
JP5052301B2 (en) Image processing apparatus and image processing method
JP3898606B2 (en) Motion vector detection method and apparatus, and frame interpolation image creation method and apparatus
EP2330812B1 (en) Apparatus for generating a panoramic image, method for generating a panoramic image, and computer-readable medium
US9262684B2 (en) Methods of image fusion for image stabilization
JP4489033B2 (en) Frame rate conversion device, pan / tilt determination device and video device
JP5272886B2 (en) Moving object detection apparatus, moving object detection method, and computer program
CN110008795B (en) Image target tracking method and system and computer readable recording medium
JP4617883B2 (en) Image processing apparatus and method, program, and recording medium
US10121251B2 (en) Method for controlling tracking using a color model, corresponding apparatus and non-transitory program storage device
JP2007272732A (en) Image processing apparatus and method, and program
JP5163429B2 (en) Motion vector detection apparatus, processing method thereof, and program
JP6924064B2 (en) Image processing device and its control method, and image pickup device
JP2007274543A (en) Image processing apparatus and method, program, and recording medium
JP2015080107A (en) Moving body display system and moving body display program
JP6320053B2 (en) Image processing apparatus, image processing method, and computer program
US8385430B2 (en) Video signal processing apparatus and video signal processing method
JP5841345B2 (en) Image processing apparatus, image processing method, image processing program, and imaging apparatus
JP2010114596A (en) Motion vector detection apparatus, motion vector processing method and program
JP4612522B2 (en) Change area calculation method, change area calculation device, change area calculation program
JP4826316B2 (en) Image processing apparatus and method, program, and recording medium
JP2007272731A (en) Image processing apparatus and method, and program
JP2006215657A (en) Method, apparatus, program and program storage medium for detecting motion vector
JP2007272735A (en) Image processor and image processing method, program, and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070809

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100518

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100603

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100709

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110315

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110328

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140422

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees