[Code Project] ハンドジェスチャーの識別


Hands Gesture Recognition
http://www.codeproject.com/KB/audio-video/hands_gesture_recognition.aspx
より。



Introduction
Since the time I’ve wrote my first article about motion detection, I’ve got a lot of e-mails from different people around the world, who found the article quite useful and found a lot of applications of the code in many different areas. Those areas included simple video surveillance topics to quite impressive applications, like laser gesture recognition, detecting comets with telescope, detecting humming-birds and making camera shots of them, controlling water cannons, and many others.

In this article, I would like to discuss one more application, which uses motion detection as its first step, and then does some interesting routines with the detected object – hands gesture recognition. Let’s suppose we have a camera which monitors an area. When somebody gets into the area and makes some hands gestures in front of the camera, the application should detect the type of the gesture, and raise an event, for example. When a hands gesture is detected, the application could perform different actions depending on the type of the gesture. For example, a gesture recognition application could control some sort of device, or another application sending different commands to it depending on the recognized gesture. What type of hands gestures are we talking about? The particular application which is discussed in the article can recognize up to 15 gestures, which are a combination of four different positions of two hands – hand is not raised, raised diagonally down, diagonally up, or raised straight.

All the algorithms described in the article are based on the AForge.NET framework, which provides different image processing routines used by the application. The application also uses some motion detection routines which are inspired by the framework and another article dedicated to motion detection.



イントロダクション
前回モーションディテクションの記事を書いてから、この記事を有用だと感じた人々からたくさんのメールをもらい、さまざまな分野のアプリケーションのコードを目にしてきた。シンプルな監視カメラ、レーザ光線ジェスチャーの識別、望遠鏡と組み合わせた彗星の発見、ハチドリを発見しカメラで撮影、放水車の制御など。
この記事では、モーションディテクションをベースとしたアプリケーションを紹介する。識別したオブジェクトにたいしてさらに興味深いを処理をおこなうハンドジェスチャーディテクションだ。たとえば、あるエリアを撮影しているカメラがあり、そのエリアに人がはいってきてカメラの前でなんらかのハンドジェスチャーをおこなうとしよう、その時にアプリケーションがそのジェスチャーを識別し、イベントを発生させるというものだ。
ジェスチャー識別アプリケーションでデバイスを制御したり、識別されたジェスチャーごとに異なったコマンドを別のアプリケーションに送信するといった例が考えられる。
ハンドジェスチャーとはどういったものなのか?この記事で紹介するアプリケーションは15個までのジェスチャーを識別することができる。
ジェスチャーは左右の手の4つの位置の組み合わせで表現される(下がっている、斜め下、斜め上、真上)
この記事で解説しているアルゴリズムはAForge.NET frameworkのものをベースとしている。(このアプリケーションで使用しているものとは異なる画像処理機能も提供している)またいくつかのモーションディテクションの処理は、このフレームワークやモーションディテクションについて記述した別の記事からアイデアを得ている。


処理の内容を抜粋すると

  1. 最初のフレームを背景として認識する
  2. 現在の画像と背景の差分を取得し、ノイズ処理を施して人の形を認識する
  3. 認識されたピクセルを水平・垂直方向のヒストグラムにする
  4. 水平・垂直方向のヒストグラムから胴体の部分を取り除く
  5. 残った部分のヒストグラムから腕の部分を位置を判定する

となっている


詳細は、上記のサイトを参照