![](/media/cache/group/renesas_logomark_l.jpg.50x50_q85.jpg)
Sample program that can send the recognition data from HVC-P2 to Fujitsu IoT Platform using REST (HTTP)
Dependencies: AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP USBHost_custom easy-connect-gr-peach mbed-http picojson
Information
Here are both English and Japanese description. First, English description is shown followed by Japanese one. 本ページには英語版と日本語版の説明があります。まず英語版、続いて日本語版の説明となります。
Overview
This sample program shows how to send the cognitive data gathered by Omron HVC-P2 (Human Vision Components B5T-007001) to IoT Platform managed by FUJITSU ( http://jp.fujitsu.com/solutions/cloud/k5/function/paas/iot-platform/ ).
Hardware Configuration
- GR-PEACH 1 set ( https://developer.mbed.org/platforms/Renesas-GR-PEACH/ )
- LCD Shield 1 set ( https://developer.mbed.org/teams/Renesas/Wiki/LCD-shield )
- HVC-P2 1 set ( Human Vision Components B5T-007001 ) ( https://plus-sensin.omron.com/product/B5T-007001/ )
- USBA - Micro USB Cable 2 sets
- USBA (Female) - Micro USB (Male) Adapter 1 set
When executing this sample program, please configure the above H/W as shown below:
Also, please close JP3 of GR-PEACH as follows:
Application Preconfiguration
- Configure Ethernet settings. For details, please refer to the following link:
https://developer.mbed.org/teams/Renesas/code/GR-PEACH_IoT_Platform_HTTP_sample/wiki/Ethernet-settings - On IoT Platform, set up the resource and its access code where the gathered data would be stored. For details on resource and access code, please refer to the following links:
https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/userguide_en.pdf
https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/apireference_en.pdf
https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/portalmanual_en.pdf
Build Procedure
- Import this sample program onto mbed Compiler
- In GR-PEACH_HVC-P2_IoTPlatform_http/IoT_Platform/iot_platform.cpp, please replace <ACCESS CODE> with the access code you set up on IoT Platform. For details on how to set up Access Code, please refer to the above Application Setup. Then, please delete the line beginning with #error macro.
Access Code configuration
#define ACCESS_CODE <Access CODE> #error "You need to replace <Access CODE for your resource> with yours"
- In GR-PEACH_HVC-P2_IoTPlatform_http/IoT_Platform/iot_platform.cpp, please replace <Base URI>, <Tenant ID> and <Path-to-Resource> below with yours and delete the line beginning with #error macro. For details on <Base URI> and <Tenant ID>, please contact FUJITSU LIMITED. Also, for details on <Path-to-Resource>, please refer to the above Application Setup.
URI configuration
std::string put_uri_base("<Base URI>/v1/<Tenant ID>/<Path-to-Resource>.json"); #error "You need to replace <Base URI>, <Tenant ID> and <Path-to-Resource> with yours" **snip** std::string get_uri("<Base URI>/v1/<Tenant ID>/<Path-to-Resource>/_past.json"); #error "You need to replace <Base URI>, <Tenant ID> and <Path-to-Resource> with yours"
- Compile the program. If compilation is successfully terminated, the binary should be downloaded on your PC.
- Plug Ethernet cable into GR-PEACH
- Plug micro-USB cable into the port which lies on the next to RESET button. If GR-PEACH is successfully recognized, it appears as the USB flash disk named mbed as show below:
- Copy the downloaded binary to mbed drive
- Press RESET button on GR-PEACH in order to run the program. If it's successfully run, you can see the following message on terminal:
Format of Data to be sent to IoT Platform
In this program, the cognitive data sent from HVC-P2 is serialized in the following JSON format and send it to IoT Platform:
- Face detection data
{ "RecodeType": "HVC-P2(face)" "id": <GR-PEACH ID>-<Sensor ID>" "FaceRectangle": { "Height": xxxx, "Left": xxxx, "Top": xxxx, "Width": xxxx, }, "Gender": "male" or "female", "Scores": { "Anger": zzz, "Hapiness": zzz, "Neutral": zzz, "Sadness": zzz, "Surprise": zzz } } xxxx: Top-left coordinate, width and height of the rectangle circumscribing the detected face in LCD display coordinate system zzz: the value indicating the expression estimated from the detected face
//
- Body detection data
{ "RecodeType": "HVC-P2(body)" "id": <GR-PEACH ID>-<Sensor ID>" "BodyRectangle": { "Height": xxxx, "Left": xxxx, "Top": xxxx, "Width": xxxx, } } xxxx: Top-left coordinate, width and height of the rectangle circumscribing the detected body in LCD display coordinate system
概要
本プログラムは、オムロン社製HVC-P2 (Human Vision Components B5T-007001)で収集した各種認識データを、富士通社のIoT Platform ( http://jp.fujitsu.com/solutions/cloud/k5/function/paas/iot-platform/ ) に送信するサンプルプログラムです。
ハードウェア構成
- GR-PEACH 1式 ( https://developer.mbed.org/platforms/Renesas-GR-PEACH/ )
- LCD Shield 1式 ( https://developer.mbed.org/teams/Renesas/Wiki/LCD-shield )
- HVC-P2 1式 ( Human Vision Components B5T-007001 ) ( https://plus-sensin.omron.com/product/B5T-007001/ )
- USBA - Micro USBケーブル 2式
- USBA (メス) - Micro USB (オス)変換アダプタ 1式
本プログラムを動作させる場合、上記H/Wを下図のように接続してください。
また下図に示すGR-PEACHのJP3をショートしてください。
アプリケーションの事前設定
- Ethernetの設定を行います。詳細は下記リンクを参照ください。
https://developer.mbed.org/teams/Renesas/code/GR-PEACH_IoT_Platform_HTTP_sample/wiki/Ethernet-settings - HVC-P2で収集したデータを格納するリソース、およびそのアクセスコードをIoT Platform上で設定します。詳細は下記リンクを参照ください。
https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/userguide_en.pdf https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/apireference_en.pdf https://iot-docs.jp-east-1.paas.cloud.global.fujitsu.com/en/manual/portalmanual_en.pdf
ビルド手順
- 本サンプルプログラムをmbed Compilerにインポートします
- 下記に示すGR-PEACH_HVC-P2_IoTPlatform_http/IoT_Platform/iot_platform.cpp中の<ACCESS CODE> を、IoT Platform上で設定したアクセスコードで上書きしてください。<Access Code>の設定方法につきましては、上述のApplication Setupを参照願います。また #errorマクロで始まる行を削除してください。
Access Code configuration
#define ACCESS_CODE <Access CODE> #error "You need to replace <Access CODE for your resource> with yours"
- 下記に示すGR-PEACH_HVC-P2_IoTPlatform_http/IoT_Platform/iot_platform.cpp中の<Base URI>と <Tenant ID>、および<Path-to-Resource>>を適当な値に置換えるとともに、#errorマクロで始まる行を削除してください。ここで、<Base URI>、 <Tenant ID>の詳細につきましては富士通社へご確認願います。また<Path-to-Resource>>につきましては、Application Setupの項を参照ください。
URI configuration
std::string put_uri_base("<Base URI>/v1/<Tenant ID>/<Path-to-Resource>.json"); #error "You need to replace <Base URI>, <Tenant ID> and <Path-to-Resource> with yours" (中略) std::string get_uri("<Base URI>/v1/<Tenant ID>/<Path-to-Resource>/_past.json"); #error "You need to replace <Base URI>, <Tenant ID> and <Path-to-Resource> with yours"
- プログラムをコンパイルします。コンパイルが正常終了すると、バイナリがお使いのPCにダウンロードされます。
- GR-PEACHのRJ-45コネクタにEthernetケーブルを差し込んでください。
- USBA - Micro USBケーブルを、GR-PEACHのRESETボタンの隣に配置されたMicro USBポートに差し込んでください。GR-PEACHが正常に認識されると、下図に示すようにGR-PEACHがmbedという名称のUSBドライブとして認識されます。
- ダウンロードしたバイナリをmbedドライブにコピーします。
- RESETボタンを押下してプログラムを実行します。正常に実行された場合、下記に示すメッセージがターミナル上に表示されます。
送信データフォーマット
本プログラムでは、HVC-P2が収集した認識データを下記のJSONフォーマットにシリアライズし、IoT Platformへ送信します。
- Face detection data
{ "RecodeType": "HVC-P2(face)" "id": <GR-PEACH ID>-<Sensor ID>" "FaceRectangle": { "Height": xxxx, "Left": xxxx, "Top": xxxx, "Width": xxxx, }, "Gender": "male" or "female", "Scores": { "Anger": zzz, "Hapiness": zzz, "Neutral": zzz, "Sadness": zzz, "Surprise": zzz } } xxxx: LCD表示座標系における検出した顔に外接する矩形の左上座標・幅・高さ zzz: 検出した顔から推定した各種感情を示す数値
//
- Body detection data
{ "RecodeType": "HVC-P2(body)" "id": <GR-PEACH ID>-<Sensor ID>" "BodyRectangle": { "Height": xxxx, "Left": xxxx, "Top": xxxx, "Width": xxxx, } } xxxx: LCD表示座標系における検出した人体に外接する矩形の左上座標・幅・高さ
HVCApi/HVCDef.h@0:813a237f1c50, 2017-09-07 (annotated)
- Committer:
- Osamu Nakamura
- Date:
- Thu Sep 07 18:15:54 2017 +0900
- Revision:
- 0:813a237f1c50
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Osamu Nakamura |
0:813a237f1c50 | 1 | /*---------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 2 | /* Copyright(C) 2017 OMRON Corporation */ |
Osamu Nakamura |
0:813a237f1c50 | 3 | /* */ |
Osamu Nakamura |
0:813a237f1c50 | 4 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ |
Osamu Nakamura |
0:813a237f1c50 | 5 | /* you may not use this file except in compliance with the License. */ |
Osamu Nakamura |
0:813a237f1c50 | 6 | /* You may obtain a copy of the License at */ |
Osamu Nakamura |
0:813a237f1c50 | 7 | /* */ |
Osamu Nakamura |
0:813a237f1c50 | 8 | /* http://www.apache.org/licenses/LICENSE-2.0 */ |
Osamu Nakamura |
0:813a237f1c50 | 9 | /* */ |
Osamu Nakamura |
0:813a237f1c50 | 10 | /* Unless required by applicable law or agreed to in writing, software */ |
Osamu Nakamura |
0:813a237f1c50 | 11 | /* distributed under the License is distributed on an "AS IS" BASIS, */ |
Osamu Nakamura |
0:813a237f1c50 | 12 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ |
Osamu Nakamura |
0:813a237f1c50 | 13 | /* See the License for the specific language governing permissions and */ |
Osamu Nakamura |
0:813a237f1c50 | 14 | /* limitations under the License. */ |
Osamu Nakamura |
0:813a237f1c50 | 15 | /*---------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 16 | |
Osamu Nakamura |
0:813a237f1c50 | 17 | #ifndef HVCDef_H__ |
Osamu Nakamura |
0:813a237f1c50 | 18 | #define HVCDef_H__ |
Osamu Nakamura |
0:813a237f1c50 | 19 | |
Osamu Nakamura |
0:813a237f1c50 | 20 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 21 | /* Execution flag */ |
Osamu Nakamura |
0:813a237f1c50 | 22 | #define HVC_ACTIV_BODY_DETECTION 0x00000001 |
Osamu Nakamura |
0:813a237f1c50 | 23 | #define HVC_ACTIV_HAND_DETECTION 0x00000002 |
Osamu Nakamura |
0:813a237f1c50 | 24 | #define HVC_ACTIV_FACE_DETECTION 0x00000004 |
Osamu Nakamura |
0:813a237f1c50 | 25 | #define HVC_ACTIV_FACE_DIRECTION 0x00000008 |
Osamu Nakamura |
0:813a237f1c50 | 26 | #define HVC_ACTIV_AGE_ESTIMATION 0x00000010 |
Osamu Nakamura |
0:813a237f1c50 | 27 | #define HVC_ACTIV_GENDER_ESTIMATION 0x00000020 |
Osamu Nakamura |
0:813a237f1c50 | 28 | #define HVC_ACTIV_GAZE_ESTIMATION 0x00000040 |
Osamu Nakamura |
0:813a237f1c50 | 29 | #define HVC_ACTIV_BLINK_ESTIMATION 0x00000080 |
Osamu Nakamura |
0:813a237f1c50 | 30 | #define HVC_ACTIV_EXPRESSION_ESTIMATION 0x00000100 |
Osamu Nakamura |
0:813a237f1c50 | 31 | #define HVC_ACTIV_FACE_RECOGNITION 0x00000200 |
Osamu Nakamura |
0:813a237f1c50 | 32 | |
Osamu Nakamura |
0:813a237f1c50 | 33 | /* Image info of Execute command */ |
Osamu Nakamura |
0:813a237f1c50 | 34 | #define HVC_EXECUTE_IMAGE_NONE 0x00000000 |
Osamu Nakamura |
0:813a237f1c50 | 35 | #define HVC_EXECUTE_IMAGE_QVGA 0x00000001 |
Osamu Nakamura |
0:813a237f1c50 | 36 | #define HVC_EXECUTE_IMAGE_QVGA_HALF 0x00000002 |
Osamu Nakamura |
0:813a237f1c50 | 37 | |
Osamu Nakamura |
0:813a237f1c50 | 38 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 39 | /* Error code */ |
Osamu Nakamura |
0:813a237f1c50 | 40 | |
Osamu Nakamura |
0:813a237f1c50 | 41 | /* Parameter error */ |
Osamu Nakamura |
0:813a237f1c50 | 42 | #define HVC_ERROR_PARAMETER -1 |
Osamu Nakamura |
0:813a237f1c50 | 43 | |
Osamu Nakamura |
0:813a237f1c50 | 44 | /* Send signal timeout error */ |
Osamu Nakamura |
0:813a237f1c50 | 45 | #define HVC_ERROR_SEND_DATA -10 |
Osamu Nakamura |
0:813a237f1c50 | 46 | |
Osamu Nakamura |
0:813a237f1c50 | 47 | /* Receive header signal timeout error */ |
Osamu Nakamura |
0:813a237f1c50 | 48 | #define HVC_ERROR_HEADER_TIMEOUT -20 |
Osamu Nakamura |
0:813a237f1c50 | 49 | /* Invalid header error */ |
Osamu Nakamura |
0:813a237f1c50 | 50 | #define HVC_ERROR_HEADER_INVALID -21 |
Osamu Nakamura |
0:813a237f1c50 | 51 | /* Receive data signal timeout error */ |
Osamu Nakamura |
0:813a237f1c50 | 52 | #define HVC_ERROR_DATA_TIMEOUT -22 |
Osamu Nakamura |
0:813a237f1c50 | 53 | |
Osamu Nakamura |
0:813a237f1c50 | 54 | |
Osamu Nakamura |
0:813a237f1c50 | 55 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 56 | /* Album data size */ |
Osamu Nakamura |
0:813a237f1c50 | 57 | #define HVC_ALBUM_SIZE_MIN 32 |
Osamu Nakamura |
0:813a237f1c50 | 58 | #define HVC_ALBUM_SIZE_MAX 816032 |
Osamu Nakamura |
0:813a237f1c50 | 59 | |
Osamu Nakamura |
0:813a237f1c50 | 60 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 61 | /* Expression */ |
Osamu Nakamura |
0:813a237f1c50 | 62 | typedef enum { |
Osamu Nakamura |
0:813a237f1c50 | 63 | EX_NEUTRAL = 1, |
Osamu Nakamura |
0:813a237f1c50 | 64 | EX_HAPPINESS, |
Osamu Nakamura |
0:813a237f1c50 | 65 | EX_SURPRISE, |
Osamu Nakamura |
0:813a237f1c50 | 66 | EX_ANGER, |
Osamu Nakamura |
0:813a237f1c50 | 67 | EX_SADNESS |
Osamu Nakamura |
0:813a237f1c50 | 68 | }EXPRESSION; |
Osamu Nakamura |
0:813a237f1c50 | 69 | |
Osamu Nakamura |
0:813a237f1c50 | 70 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 71 | /* Struct */ |
Osamu Nakamura |
0:813a237f1c50 | 72 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 73 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 74 | /* Devicefs model and version info */ |
Osamu Nakamura |
0:813a237f1c50 | 75 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 76 | typedef struct { |
Osamu Nakamura |
0:813a237f1c50 | 77 | UINT8 string[12]; |
Osamu Nakamura |
0:813a237f1c50 | 78 | UINT8 major; |
Osamu Nakamura |
0:813a237f1c50 | 79 | UINT8 minor; |
Osamu Nakamura |
0:813a237f1c50 | 80 | UINT8 relese; |
Osamu Nakamura |
0:813a237f1c50 | 81 | UINT8 revision[4]; |
Osamu Nakamura |
0:813a237f1c50 | 82 | }HVC_VERSION; |
Osamu Nakamura |
0:813a237f1c50 | 83 | |
Osamu Nakamura |
0:813a237f1c50 | 84 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 85 | /* Detection result */ |
Osamu Nakamura |
0:813a237f1c50 | 86 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 87 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 88 | INT32 posX; /* Center x-coordinate */ |
Osamu Nakamura |
0:813a237f1c50 | 89 | INT32 posY; /* Center y-coordinate */ |
Osamu Nakamura |
0:813a237f1c50 | 90 | INT32 size; /* Size */ |
Osamu Nakamura |
0:813a237f1c50 | 91 | INT32 confidence; /* Degree of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 92 | }DETECT_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 93 | |
Osamu Nakamura |
0:813a237f1c50 | 94 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 95 | /* Face direction */ |
Osamu Nakamura |
0:813a237f1c50 | 96 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 97 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 98 | INT32 yaw; /* Yaw angle */ |
Osamu Nakamura |
0:813a237f1c50 | 99 | INT32 pitch; /* Pitch angle */ |
Osamu Nakamura |
0:813a237f1c50 | 100 | INT32 roll; /* Roll angle */ |
Osamu Nakamura |
0:813a237f1c50 | 101 | INT32 confidence; /* Degree of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 102 | }DIR_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 103 | |
Osamu Nakamura |
0:813a237f1c50 | 104 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 105 | /* Age */ |
Osamu Nakamura |
0:813a237f1c50 | 106 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 107 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 108 | INT32 age; /* Age */ |
Osamu Nakamura |
0:813a237f1c50 | 109 | INT32 confidence; /* Degree of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 110 | }AGE_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 111 | |
Osamu Nakamura |
0:813a237f1c50 | 112 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 113 | /* Gender */ |
Osamu Nakamura |
0:813a237f1c50 | 114 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 115 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 116 | INT32 gender; /* Gender */ |
Osamu Nakamura |
0:813a237f1c50 | 117 | INT32 confidence; /* Degree of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 118 | }GENDER_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 119 | |
Osamu Nakamura |
0:813a237f1c50 | 120 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 121 | /* Gaze */ |
Osamu Nakamura |
0:813a237f1c50 | 122 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 123 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 124 | INT32 gazeLR; /* Yaw angle */ |
Osamu Nakamura |
0:813a237f1c50 | 125 | INT32 gazeUD; /* Pitch angle */ |
Osamu Nakamura |
0:813a237f1c50 | 126 | }GAZE_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 127 | |
Osamu Nakamura |
0:813a237f1c50 | 128 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 129 | /* Blink */ |
Osamu Nakamura |
0:813a237f1c50 | 130 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 131 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 132 | INT32 ratioL; /* Left eye blink result */ |
Osamu Nakamura |
0:813a237f1c50 | 133 | INT32 ratioR; /* Right eye blink result */ |
Osamu Nakamura |
0:813a237f1c50 | 134 | }BLINK_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 135 | |
Osamu Nakamura |
0:813a237f1c50 | 136 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 137 | /* Expression */ |
Osamu Nakamura |
0:813a237f1c50 | 138 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 139 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 140 | INT32 topExpression; /* Top expression */ |
Osamu Nakamura |
0:813a237f1c50 | 141 | INT32 topScore; /* Top score */ |
Osamu Nakamura |
0:813a237f1c50 | 142 | INT32 score[5]; /* Score of 5 expression */ |
Osamu Nakamura |
0:813a237f1c50 | 143 | INT32 degree; /* Negative-positive degree */ |
Osamu Nakamura |
0:813a237f1c50 | 144 | }EXPRESSION_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 145 | |
Osamu Nakamura |
0:813a237f1c50 | 146 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 147 | /* Face Recognition */ |
Osamu Nakamura |
0:813a237f1c50 | 148 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 149 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 150 | INT32 uid; /* User ID */ |
Osamu Nakamura |
0:813a237f1c50 | 151 | INT32 confidence; /* Degree of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 152 | }RECOGNITION_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 153 | |
Osamu Nakamura |
0:813a237f1c50 | 154 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 155 | /* Face Detection & Estimations result */ |
Osamu Nakamura |
0:813a237f1c50 | 156 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 157 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 158 | DETECT_RESULT dtResult; /* Face detection result */ |
Osamu Nakamura |
0:813a237f1c50 | 159 | DIR_RESULT dirResult; /* Face direction estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 160 | AGE_RESULT ageResult; /* Age Estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 161 | GENDER_RESULT genderResult; /* Gender Estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 162 | GAZE_RESULT gazeResult; /* Gaze Estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 163 | BLINK_RESULT blinkResult; /* Blink Estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 164 | EXPRESSION_RESULT expressionResult; /* Expression Estimation result */ |
Osamu Nakamura |
0:813a237f1c50 | 165 | RECOGNITION_RESULT recognitionResult; /* Face Recognition result */ |
Osamu Nakamura |
0:813a237f1c50 | 166 | }FACE_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 167 | |
Osamu Nakamura |
0:813a237f1c50 | 168 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 169 | /* Human Body Detection results */ |
Osamu Nakamura |
0:813a237f1c50 | 170 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 171 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 172 | UINT8 num; /* Number of Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 173 | DETECT_RESULT bdResult[35]; /* Detection result */ |
Osamu Nakamura |
0:813a237f1c50 | 174 | }BD_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 175 | |
Osamu Nakamura |
0:813a237f1c50 | 176 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 177 | /* Hand Detection results */ |
Osamu Nakamura |
0:813a237f1c50 | 178 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 179 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 180 | UINT8 num; /* Number of Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 181 | DETECT_RESULT hdResult[35]; /* Detection result */ |
Osamu Nakamura |
0:813a237f1c50 | 182 | }HD_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 183 | |
Osamu Nakamura |
0:813a237f1c50 | 184 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 185 | /* Face Detection & Estimations results */ |
Osamu Nakamura |
0:813a237f1c50 | 186 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 187 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 188 | UINT8 num; /* Number of Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 189 | FACE_RESULT fcResult[35]; /* Detection & Estimations result */ |
Osamu Nakamura |
0:813a237f1c50 | 190 | }FD_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 191 | |
Osamu Nakamura |
0:813a237f1c50 | 192 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 193 | /* Image data */ |
Osamu Nakamura |
0:813a237f1c50 | 194 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 195 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 196 | INT32 width; |
Osamu Nakamura |
0:813a237f1c50 | 197 | INT32 height; |
Osamu Nakamura |
0:813a237f1c50 | 198 | UINT8 image[320*240]; |
Osamu Nakamura |
0:813a237f1c50 | 199 | }HVC_IMAGE; |
Osamu Nakamura |
0:813a237f1c50 | 200 | |
Osamu Nakamura |
0:813a237f1c50 | 201 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 202 | /* Eesult data of Execute command */ |
Osamu Nakamura |
0:813a237f1c50 | 203 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 204 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 205 | INT32 executedFunc; /* Execution flag */ |
Osamu Nakamura |
0:813a237f1c50 | 206 | BD_RESULT bdResult; /* Human Body Detection results */ |
Osamu Nakamura |
0:813a237f1c50 | 207 | HD_RESULT hdResult; /* Hand Detection results */ |
Osamu Nakamura |
0:813a237f1c50 | 208 | FD_RESULT fdResult; /* Face Detection & Estimations results */ |
Osamu Nakamura |
0:813a237f1c50 | 209 | HVC_IMAGE image; /* Image data */ |
Osamu Nakamura |
0:813a237f1c50 | 210 | }HVC_RESULT; |
Osamu Nakamura |
0:813a237f1c50 | 211 | |
Osamu Nakamura |
0:813a237f1c50 | 212 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 213 | /* Threshold of confidence */ |
Osamu Nakamura |
0:813a237f1c50 | 214 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 215 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 216 | INT32 bdThreshold; /* Threshold of confidence of Human Body Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 217 | INT32 hdThreshold; /* Threshold of confidence of Hand Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 218 | INT32 dtThreshold; /* Threshold of confidence of Face Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 219 | INT32 rsThreshold; /* Threshold of confidence of Face Recognition */ |
Osamu Nakamura |
0:813a237f1c50 | 220 | }HVC_THRESHOLD; |
Osamu Nakamura |
0:813a237f1c50 | 221 | |
Osamu Nakamura |
0:813a237f1c50 | 222 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 223 | /* Detection size */ |
Osamu Nakamura |
0:813a237f1c50 | 224 | /*----------------------------------------------------------------------------*/ |
Osamu Nakamura |
0:813a237f1c50 | 225 | typedef struct{ |
Osamu Nakamura |
0:813a237f1c50 | 226 | INT32 bdMinSize; /* Minimum detection size of Human Body Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 227 | INT32 bdMaxSize; /* Maximum detection size of Human Body Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 228 | INT32 hdMinSize; /* Minimum detection size of Hand Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 229 | INT32 hdMaxSize; /* Maximum detection size of Hand Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 230 | INT32 dtMinSize; /* Minimum detection size of Face Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 231 | INT32 dtMaxSize; /* Maximum detection size of Face Detection */ |
Osamu Nakamura |
0:813a237f1c50 | 232 | }HVC_SIZERANGE; |
Osamu Nakamura |
0:813a237f1c50 | 233 | |
Osamu Nakamura |
0:813a237f1c50 | 234 | #endif /* HVCDef_H__ */ |
Osamu Nakamura |
0:813a237f1c50 | 235 |