JP2013149228A - Position detector and position detection program - Google Patents
Position detector and position detection program Download PDFInfo
- Publication number
- JP2013149228A JP2013149228A JP2012025567A JP2012025567A JP2013149228A JP 2013149228 A JP2013149228 A JP 2013149228A JP 2012025567 A JP2012025567 A JP 2012025567A JP 2012025567 A JP2012025567 A JP 2012025567A JP 2013149228 A JP2013149228 A JP 2013149228A
- Authority
- JP
- Japan
- Prior art keywords
- measured
- contour
- image
- template
- camera
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、画像の中の対象物の位置を、画像の分解能である画素のピッチよりも高い分解能で検出する技術に関する。 The present invention relates to a technique for detecting the position of an object in an image with a resolution higher than the pixel pitch, which is the resolution of the image.
机上に配置された手指の位置を検出して、仮想キーボード上のどのキーを打鍵したかを検出する技術がある。特許文献1では手指の左右の輪郭から指の幅を画素単位の小数点以下まで計測する技術が開示されている。このように対象物の位置や大きさを画像の分解能以下まで計測する必要がある技術分野が多い。 There is a technique for detecting which key on a virtual keyboard is pressed by detecting the position of a finger placed on a desk.
特許文献1の場合、手指の幅を決定するために、まず手指の左右輪郭を抽出した上で、各Y座標での左右輪郭の幅を計測して平均値を計算するという手順が必要である。このように計算が煩雑であり、処理時間を要する。 In the case of
本発明の目的は、画像内の対象物の輪郭を抽出して、左右輪郭(上下輪郭も含む)の幅を画像の分解能以下まで精度よく短時間で計測することを目的とする。 An object of the present invention is to extract the contour of an object in an image, and to measure the width of the left and right contours (including the top and bottom contours) accurately and in a short time to the resolution of the image or less.
上記の課題を解決するために、本発明の位置検出装置は、事前に作成して記憶した輪郭テンプレートと、被測定物の画像を取得するカメラと、前記カメラで取得した被測定物が写っている画像に対して、前記輪郭テンプレートを移動させながらマッチング計算をするマッチング計算部と、前記マッチング計算部で計算した結果から、前記テンプレートと最も一致した位置を被測定物の位置として検出する位置検出部と、から構成される位置検出装置において、前記位置検出部は被測定物のX方向とY方向の少なくとも片方の位置を、左右(あるいは上下)に近接した複数のマッチング計算結果の関数として輪郭の位置をサブピクセルまで測定することを特徴とする。 In order to solve the above problems, the position detection device of the present invention includes a contour template created and stored in advance, a camera that acquires an image of the object to be measured, and the object to be measured acquired by the camera. Position detection for detecting a position that most closely matches the template as a position of the object to be measured from a result calculated by the matching calculation unit and a matching calculation unit that performs matching calculation while moving the contour template In the position detection device constituted by a portion, the position detection portion contours at least one position in the X direction and the Y direction of the object to be measured as a function of a plurality of matching calculation results close to the left and right (or up and down). Is measured up to a subpixel.
このように構成することで、複数の対象物の輪郭テンプレートとのマッチング結果から最も高い一致がみられたテンプレートに該当する対象物であることを決定できるとともに、輪郭の位置をサブピクセルまで測定することができる。 By configuring in this way, it is possible to determine that the object corresponds to the template with the highest match from the matching result with the contour template of a plurality of objects, and measure the position of the contour to the sub-pixel. be able to.
また、本発明の位置検出装置は、被測定物の輪郭の両サイドを測定することで、被測定物の大きさをサブピクセルまで測定する、ことを特徴とする。 The position detection apparatus of the present invention is characterized in that the size of the object to be measured is measured up to the subpixel by measuring both sides of the contour of the object to be measured.
また本発明の位置検出装置は、初期位置での被測定物の大きさを測定して記憶する記憶部と、現在位置での被測定物の大きさを測定した結果と、前記記憶部に記憶した初期位置での被測定物の大きさとを比較することで、被測定物のカメラからの距離の変化を測定することを特徴とする The position detection apparatus of the present invention also stores a storage unit that measures and stores the size of the object to be measured at the initial position, a result of measuring the size of the object to be measured at the current position, and the storage unit. The change of the distance from the camera of the object to be measured is measured by comparing the size of the object to be measured at the initial position.
また、本発明の輪郭テンプレートは、初期位置での被測定物の輪郭画像から作成することを特徴とする。 Further, the contour template of the present invention is created from a contour image of an object to be measured at an initial position.
また、本発明の被測定物の例は机上に配置された使用者の指であり、位置検出部は机上に配置された前記使用者の指の初期位置からの移動距離を測定することを特徴とする。 An example of the object to be measured according to the present invention is a user's finger placed on a desk, and the position detection unit measures a moving distance from the initial position of the user's finger placed on the desk. And
このように構成することで、仮想キーボード上のどのキーを打鍵したのかを正確に判定できる。また仮想キーボードの打鍵よりも高い分解能が求められる仮想マウスの操作に高い有用性を発揮できる。 With this configuration, it is possible to accurately determine which key on the virtual keyboard has been pressed. In addition, it is highly useful for operating a virtual mouse that requires a higher resolution than that of a virtual keyboard.
机上の手指の位置と大きさとを精度よく検出することで仮想キーボードや仮想マウスの操作を容易に実現できる。また同様に画像上の対象物の位置と大きさとを精度よく検出する必要がある画像認識の分野に広く使用することができる。 By accurately detecting the position and size of the fingers on the desk, the operation of the virtual keyboard and virtual mouse can be easily realized. Similarly, it can be widely used in the field of image recognition where it is necessary to detect the position and size of an object on an image with high accuracy.
以下、本発明の実施形態について図面を参照して説明する。
図1A、図1B、図1Cおよび図1Dは仮想マウスの操作の説明図である。図1Aは机上に近接して配置されたカメラで撮影された画像100の中の使用者101とマウスポインタを操作する右手102と人差指103を示している。図1Bは右手の人差指104だけを机上に接触させて静止することで指の初期位置と大きさを示している。図1Cは右手の人差指105が机上を右前方に移動して画像上の指のサイズが大きくなった図である。図1Dは別に設けられている表示画面106と表示されているマウスポインタの位置を示している。マウスポインタの初期位置107が、図1Bの右手人差指104の初期位置と大きさに対応付けられ、移動後のマウスポインタの位置108が図1Cの右手人差指105の移動後の位置と大きさに対応付けられる。Embodiments of the present invention will be described below with reference to the drawings.
1A, 1B, 1C, and 1D are explanatory diagrams of the operation of the virtual mouse. FIG. 1A shows a
右手人差指を前後に動かすことによって人差指の画像上の大きさが変化し、これに合わせてマウスポインタを前後に動かすことになる。従って指の幅を画像上の画素のピッチよりも高い分解能で検出することでマウスポインタを分解能良く前後に動かすことができる。このように画像上の画素のピッチよりもどれだけ高い分解能で対象物の位置を検出できるかで機器の性能が決まる技術分野に広く使用できる技術を提供する。 The size of the index finger on the image changes by moving the right hand index finger back and forth, and the mouse pointer is moved back and forth accordingly. Therefore, the mouse pointer can be moved back and forth with good resolution by detecting the width of the finger with a resolution higher than the pixel pitch on the image. Thus, the present invention provides a technique that can be widely used in a technical field in which the performance of an apparatus is determined depending on how much the position of an object can be detected with a resolution higher than the pixel pitch on the image.
図2A、図2B、図2Cおよび図2Dは指の輪郭と輪郭テンプレートの説明図である。図2Aの指の右輪郭110を切出して図2Bに示している。図2Bはカメラ画像上の各画素112と指の輪郭111を重ねて現わしている。指の輪郭111はX座標の複数画素に渡って検出される。図では約3画素に渡っている例を示している。複数画素に渡る理由は種々ある。指が円筒形であるために輪郭部では光の反射が徐々に変化することや、カメラの焦点がずれている等の光学系の要因がある。 2A, 2B, 2C, and 2D are explanatory diagrams of a finger contour and a contour template. The
図2Bの画素行113を取り出して輝度の変化を示したのが図2Cである。図2Cの横軸はX座標であり、縦軸は各画素の輝度であり、各点が一つの画素を示している。指の輪郭の外側の輝度が低く、内側が高い例である。X方向の微分値が最も大きいのが画素114であるがその左右の画素も輝度が変化している。 FIG. 2C shows a change in luminance by taking out the pixel row 113 in FIG. 2B. In FIG. 2C, the horizontal axis represents the X coordinate, the vertical axis represents the luminance of each pixel, and each point represents one pixel. In this example, the brightness on the outside of the finger outline is low and the inside is high. The
図2Dは輪郭テンプレートの一例である。図2Bの有効な輝度変化を持つ画素を抽出したものであり、各画素115は原画像112のX方向微分値の絶対値であり、画素ごとに異なる値を持つ。図では4×4の輪郭テンプレートを示しているが、指輪郭の場合はY方向にはさらに多くの画素が輪郭情報として有効であり数十画素のテンプレートとする。輪郭テンプレートは通常は矩形領域で作成されるが、指輪郭の場合は輪郭が斜めになっていることや、爪などの周辺画像がノイズとなるため図2Dのように指の輪郭として有効な微分値を持つ画素だけからなる変形したテンプレートとするのが有効である。 FIG. 2D is an example of a contour template. FIG. 2B is an extracted pixel having an effective luminance change, and each
このように作成した輪郭テンプレートをX軸方向とY軸方向に一画素ずつ移動させながら、検出対象となる原画像の各画素をX方向微分の絶対値に置き換えた画像(以下微分画像と書く)と相関マッチング計算をすると指の輪郭画像の位置で最大値になる。相関マッチング計算は次の数式1で求めることができる。 An image in which each of the pixels of the original image to be detected is replaced with the absolute value of the X-direction differential (hereinafter referred to as a differential image) while the contour template thus created is moved pixel by pixel in the X-axis direction and Y-axis direction When the correlation matching calculation is performed, the maximum value is obtained at the position of the finger contour image. The correlation matching calculation can be obtained by the following
ここでT(i,j)は輪郭テンプレートであり、X軸方向にi個の画素、Y方向にj個の画素を持つことを示している。I(x,y)は微分画像である。輪郭テンプレートも微分画像もX軸方向に複数の連続した有意な微分値を持つことから、相関マッチング結果が最大値になる(x,y)に隣接する(x−1,y)や(x+1,y)も有意な相関マッチング結果が得られる。 Here, T (i, j) is a contour template, indicating that it has i pixels in the X-axis direction and j pixels in the Y direction. I (x, y) is a differential image. Since both the contour template and the differential image have a plurality of consecutive significant differential values in the X-axis direction, (x-1, y) and (x + 1, y) adjacent to (x, y) where the correlation matching result is the maximum value. y) also provides a significant correlation matching result.
図3は相関マッチング結果のパターンを示す図である。図3の(1)では画素番号Nで最大値になり、両サイドのX座標での相関マッチング結果は同じ値になっている。この場合の輪郭のX座標はNになる。図3の(5)ではこれが1画素分右にシフトしており、この場合の輪郭のX座標はN+1になる。図3の(3)では画素番号NとN+1で同等の最大値を取り、この場合の輪郭のX座標はN+1/2になる。これらの中間のパターンである図3の(2)や(4)からわかるように輪郭のX座標はこれらのパターンによって微小な座標の違いを識別することができる。数式2は図3のパターンから輪郭のX座標を求める式の一例である。 FIG. 3 is a diagram showing a pattern of a correlation matching result. In (1) of FIG. 3, the pixel number N is the maximum value, and the correlation matching result at the X coordinates on both sides is the same value. In this case, the X coordinate of the contour is N. In (5) of FIG. 3, this is shifted to the right by one pixel, and the X coordinate of the contour in this case is N + 1. In FIG. 3 (3), pixel numbers N and N + 1 have the same maximum value, and the X coordinate of the contour in this case is N + 1/2. As can be seen from (2) and (4) in FIG. 3 which are intermediate patterns of these, the X coordinate of the contour can identify a minute coordinate difference by these patterns.
ここで座標(x,y)は相関マッチング計算の結果が最大となった座標であり、加算する範囲iは座標(x,y)を中心に左右に輪郭テンプレートが存在する範囲である。この計算によって加算する範囲iにおける相関マッチングの値R(x+i,y)を重みとした平均座標が得られる。原理上は画像のAD変換の分解能のレベルまで輪郭位置の分解能が得られる。 Here, the coordinates (x, y) are the coordinates at which the result of the correlation matching calculation is maximized, and the range i to be added is the range where the contour template exists on the left and right with the coordinates (x, y) as the center. By this calculation, an average coordinate with the weight R as the correlation matching value R (x + i, y) in the range i to be added is obtained. In principle, the resolution of the contour position can be obtained up to the level of the AD conversion resolution of the image.
以上のようにして指の右輪郭のX座標を精度よく検出できたが、同様にして指の左輪郭を検出することで指の幅を精度よく測定することができる。また初期位置での指の幅と移動後の指の幅を精度よく測定することで、指とカメラとの相対距離の変化を計算することができ、これに合わせてマウスポインタを高い分解能で移動させることができる。 Although the X coordinate of the right contour of the finger can be detected with high accuracy as described above, the width of the finger can be measured with high accuracy by detecting the left contour of the finger in the same manner. In addition, by accurately measuring the width of the finger at the initial position and the width of the finger after movement, the change in the relative distance between the finger and the camera can be calculated, and the mouse pointer can be moved with high resolution accordingly. Can be made.
図4は前後移動距離計算のフローチャートの一例である。画像上の対象物のカメラに対する前後移動距離を計算している。微分画像の中で検出対象物が存在する可能性のある座標に対して、右輪郭テンプレートをX軸方向とY軸方向に一画素ずつシフトしながら相関マッチング計算をする(ステップS1)。同様にして左輪郭テンプレートでも相関マッチング計算をする(ステップS2)。検出対象物がカメラに対して前後移動した場合に、その画像上の大きさの変化には通常上限下限がある。そのためステップS1とS2ではマッチング計算結果の最大値から順に複数の輪郭候補を抽出しておき、ステップS3では左右輪郭の候補の中から対象物の大きさとして許容される輪郭のペアを抽出し、その中で左右の相関マッチング計算値の和の最大のものを選定し、対象物の輪郭として決定する。 FIG. 4 is an example of a flowchart for calculating the longitudinal movement distance. The distance of the object on the image to be moved back and forth with respect to the camera is calculated. Correlation matching calculation is performed while shifting the right contour template one pixel at a time in the X-axis direction and the Y-axis direction with respect to the coordinates where the detection target may exist in the differential image (step S1). Similarly, correlation matching calculation is also performed for the left contour template (step S2). When the detection object moves back and forth with respect to the camera, there is usually an upper and lower limit for the change in size on the image. Therefore, in steps S1 and S2, a plurality of contour candidates are extracted in order from the maximum value of the matching calculation result, and in step S3, a pair of contours allowed as the size of the target object is extracted from the left and right contour candidates, Among them, the largest sum of the left and right correlation matching calculated values is selected and determined as the contour of the object.
決定した左右それぞれの輪郭の精度のよい座標を数式2に従って計算する(ステップS4)。相関マッチングの値そのものはステップ1とステップ2で計算済みなので、ステップ4では加重計算をするだけで済む。次に左右輪郭の座標の差から左右輪郭間の幅を求める(ステップS5)。これで測定対象物の大きさが求まる。 Accurate coordinates of the determined right and left contours are calculated according to Equation 2 (step S4). Since the correlation matching value itself has already been calculated in
あらかじめ記憶しておいた測定対象物の初期位置での大きさと、今回の微分画像上での大きさの比較から、所定の計算によって測定対象物のカメラからの前後距離の距離を計算する(ステップS6)。 From the comparison of the size at the initial position of the measurement object stored in advance and the size on the differential image this time, the distance of the front and rear distance from the camera of the measurement object is calculated by a predetermined calculation (step) S6).
図5は位置検出装置120のハードウエアブロック図の一例である。カメラ121から取り込まれた画像はプロセッサ122によって処理され、RAM125に保存される。ROM123に書き込まれたソフトウエアプログラム124で図4のフローチャートの処理を実現している。検出された対象物の位置情報はティスプレイ126に適宜表示される。 FIG. 5 is an example of a hardware block diagram of the position detection device 120. An image captured from the
100 カメラで撮影された画像
101 使用者
102 操作する右手
103、104、105 人差指
106 表示画面
107 マウスポインタの初期位置
108 移動後のマウスポインタ位置
110 指の右輪郭
111 指の輪郭
112 カメラ画像上の各画素
113 画素行
114 画素
115 画素
120 位置検出装置
121 カメラ
122 プロセッサ
123 ROM
124 プログラム
125 RAM
126 ディスプレイDESCRIPTION OF
124
126 display
Claims (5)
被測定物の画像を取得するカメラと、
前記カメラで取得した被測定物が写っている画像に対して、前記輪郭テンプレートを移動させながらマッチング計算をするマッチング計算部と、
前記マッチング計算部で計算した結果から、前記テンプレートと最も一致した位置を被測定物の位置として検出する位置検出部と、
から構成される位置検出装置において、
前記位置検出部は被測定物のX方向とY方向の少なくとも片方について、左右(あるいは上下)に近接した複数のマッチング計算結果の関数として輪郭の位置をサブピクセルまで測定することを特徴とする位置検出装置。Contour templates created and stored in advance,
A camera for acquiring an image of the object to be measured;
A matching calculation unit that performs a matching calculation while moving the contour template with respect to an image of the object to be measured acquired by the camera;
From the result calculated by the matching calculation unit, a position detection unit that detects the position most consistent with the template as the position of the object to be measured;
In a position detection device comprising:
The position detecting unit measures the position of the contour to a sub-pixel as a function of a plurality of matching calculation results close to the left and right (or up and down) for at least one of the X direction and the Y direction of the object to be measured. Detection device.
現在位置での被測定物の大きさを測定した結果と、前記記憶部に記憶した初期位置での被測定物の大きさとを比較することで、被測定物の前記カメラからの距離の変化を測定する移動距離測定部を有することを特徴とする請求項2に記載の位置検出装置。A storage unit for measuring and storing the size of the object to be measured at the initial position;
By comparing the result of measuring the size of the object to be measured at the current position with the size of the object to be measured at the initial position stored in the storage unit, the change in the distance of the object to be measured from the camera can be determined. The position detecting device according to claim 2, further comprising a moving distance measuring unit for measuring.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012025567A JP2013149228A (en) | 2012-01-23 | 2012-01-23 | Position detector and position detection program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012025567A JP2013149228A (en) | 2012-01-23 | 2012-01-23 | Position detector and position detection program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013149228A true JP2013149228A (en) | 2013-08-01 |
Family
ID=49046638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012025567A Pending JP2013149228A (en) | 2012-01-23 | 2012-01-23 | Position detector and position detection program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013149228A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018510400A (en) * | 2015-01-26 | 2018-04-12 | ネオノード インコーポレイテッド | Optical proximity sensor and associated user interface |
US10324565B2 (en) | 2013-05-30 | 2019-06-18 | Neonode Inc. | Optical proximity sensor |
US10496180B2 (en) | 2012-10-14 | 2019-12-03 | Neonode, Inc. | Optical proximity sensor and associated user interface |
US10928957B2 (en) | 2012-10-14 | 2021-02-23 | Neonode Inc. | Optical proximity sensor |
US11073948B2 (en) | 2012-10-14 | 2021-07-27 | Neonode Inc. | Optical proximity sensors |
US11842014B2 (en) | 2019-12-31 | 2023-12-12 | Neonode Inc. | Contactless touch input system |
-
2012
- 2012-01-23 JP JP2012025567A patent/JP2013149228A/en active Pending
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10496180B2 (en) | 2012-10-14 | 2019-12-03 | Neonode, Inc. | Optical proximity sensor and associated user interface |
US10802601B2 (en) | 2012-10-14 | 2020-10-13 | Neonode Inc. | Optical proximity sensor and associated user interface |
US10928957B2 (en) | 2012-10-14 | 2021-02-23 | Neonode Inc. | Optical proximity sensor |
US11073948B2 (en) | 2012-10-14 | 2021-07-27 | Neonode Inc. | Optical proximity sensors |
US11379048B2 (en) | 2012-10-14 | 2022-07-05 | Neonode Inc. | Contactless control panel |
US11733808B2 (en) | 2012-10-14 | 2023-08-22 | Neonode, Inc. | Object detector based on reflected light |
US10324565B2 (en) | 2013-05-30 | 2019-06-18 | Neonode Inc. | Optical proximity sensor |
JP2018510400A (en) * | 2015-01-26 | 2018-04-12 | ネオノード インコーポレイテッド | Optical proximity sensor and associated user interface |
US11842014B2 (en) | 2019-12-31 | 2023-12-12 | Neonode Inc. | Contactless touch input system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5631025B2 (en) | Information processing apparatus, processing method thereof, and program | |
EP3076334A1 (en) | Image analyzing apparatus and image analyzing method | |
JP5699788B2 (en) | Screen area detection method and system | |
US20160086322A1 (en) | Image measurement device | |
JP2013149228A (en) | Position detector and position detection program | |
US9836130B2 (en) | Operation input device, operation input method, and program | |
JP2016091457A (en) | Input device, fingertip-position detection method, and computer program for fingertip-position detection | |
US8269750B2 (en) | Optical position input system and method | |
WO2015149712A1 (en) | Pointing interaction method, device and system | |
JP4193519B2 (en) | Object identification method and object identification apparatus | |
US20150227789A1 (en) | Information processing apparatus, information processing method, and program | |
JP2020106966A (en) | Object recognition device and object recognition method | |
KR20140056790A (en) | Apparatus for image recognition and method thereof | |
JP6278842B2 (en) | Inspection device, inspection method, and program | |
JP2016184362A (en) | Input device, input operation detection method, and input operation detection computer program | |
JP6599697B2 (en) | Image measuring apparatus and control program therefor | |
US20160116990A1 (en) | Depth determining method and depth determining device of operating body | |
TWI417774B (en) | Optical distance determination device, optical touch monitor system and method for measuring distance of a touch point on an optical touch panel | |
JP2015029504A (en) | Colony count device, colony count method, and colony count program | |
JP6229554B2 (en) | Detection apparatus and detection method | |
KR20100095161A (en) | Method and apparatus for detecting changes in background of images using multiple binary images thereof and hough transform | |
KR101536673B1 (en) | Virtual Touch Sensor Using Depth Information and Method for controlling the same | |
US10140509B2 (en) | Information processing for detection and distance calculation of a specific object in captured images | |
JP2018049498A (en) | Image processor, operation detection method, computer program, and storage medium | |
CN115082520A (en) | Positioning tracking method and device, terminal equipment and computer readable storage medium |