face_recognitionでお顔の識別以外にやってること


ラズベリーパイ3で顔認識で使ったface_recognitionは、その他にいろいろな使い方のサンプルが含まれています。

dlibの機械学習やOpenCVの使用例といったところです。

主だった例を見てみます。

 


find_faces_in_picture.py

画像の中から顔の部分を切り出します。HOG特徴を使っているようです。

同じもので、find_faces_in_picture_cnn.pyがあります。これはCNN学習モデルを使ったものですが、NVIDIAのGPUが必要で、ラズパイでは動作しません。

 

identify_and_draw_boxes_on_faces.py

画像を読み込んで登録している顔があったら、名前付きのBOXで囲みます。

 

recognize_faces_in_pictures.py

画像を読み込んで登録している顔があったら、だれなのか名前を教えてくれます。

 

digital_makeup.py

画像を読み込んで顔のパーツをペインティングします。

 

find_facial_features_in_picture.py

画像を読み込んで顔のパーツを見つけて、座標をとって、線引きします。

単純なパーツ検出ですが、リストの次元数は一定です。

カメラなどから時系列で取得すれば、パーツの面積や相対位置や距離の変化などから何かの情報を読み取れると思います。

536 x 550の顔画像

The top_lip in this face has the following points: [(240, 409), (275, 402), (308, 395), (325, 396), (339, 388), (358, 387), (375, 384), (367, 388), (340, 398), (326, 404), (309, 405), (249, 409)]
The bottom_lip in this face has the following points: [(375, 384), (361, 416), (344, 435), (328, 441), (310, 443), (277, 435), (240, 409), (249, 409), (309, 426), (326, 424), (341, 417), (367, 388)]
The right_eyebrow in this face has the following points: [(313, 223), (333, 209), (356, 201), (380, 204), (396, 220)]
The left_eye in this face has the following points: [(202, 279), (219, 266), (238, 263), (256, 275), (240, 278), (222, 281)]
The nose_tip in this face has the following points: [(285, 368), (304, 369), (323, 370), (337, 364), (350, 356)]
The chin in this face has the following points: [(107, 304), (119, 348), (131, 390), (146, 428), (172, 459), (209, 482), (248, 497), (289, 510), (324, 509), (351, 493), (373, 463), (395, 432), (414, 398), (423, 360), (422, 321), (416, 282), (406, 245)]
The right_eye in this face has the following points: [(331, 262), (343, 243), (360, 238), (375, 244), (364, 252), (348, 257)]
The nose_bridge in this face has the following points: [(300, 262), (307, 290), (315, 318), (323, 346)]
The left_eyebrow in this face has the following points: [(163, 265), (180, 238), (209, 224), (242, 223), (272, 230)]

 


その他

【face_distance.py】

顔認識の肝になる関数の使用例

【facerec_on_raspberry_pi.py】

ラズパイのカメラモジュールを使用する例

【face_recognition_knn.py】

KNNで学習


 

Be the first to comment

Leave a Reply

Your email address will not be published.


*