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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HVCDef.h Source File

HVCDef.h

00001 /*---------------------------------------------------------------------------*/
00002 /* Copyright(C)  2017  OMRON Corporation                                     */
00003 /*                                                                           */
00004 /* Licensed under the Apache License, Version 2.0 (the "License");           */
00005 /* you may not use this file except in compliance with the License.          */
00006 /* You may obtain a copy of the License at                                   */
00007 /*                                                                           */
00008 /*     http://www.apache.org/licenses/LICENSE-2.0                            */
00009 /*                                                                           */
00010 /* Unless required by applicable law or agreed to in writing, software       */
00011 /* distributed under the License is distributed on an "AS IS" BASIS,         */
00012 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  */
00013 /* See the License for the specific language governing permissions and       */
00014 /* limitations under the License.                                            */
00015 /*---------------------------------------------------------------------------*/
00016 
00017 #ifndef HVCDef_H__
00018 #define HVCDef_H__
00019 
00020 /*----------------------------------------------------------------------------*/
00021 /* Execution flag */
00022 #define HVC_ACTIV_BODY_DETECTION        0x00000001
00023 #define HVC_ACTIV_HAND_DETECTION        0x00000002
00024 #define HVC_ACTIV_FACE_DETECTION        0x00000004
00025 #define HVC_ACTIV_FACE_DIRECTION        0x00000008
00026 #define HVC_ACTIV_AGE_ESTIMATION        0x00000010
00027 #define HVC_ACTIV_GENDER_ESTIMATION     0x00000020
00028 #define HVC_ACTIV_GAZE_ESTIMATION       0x00000040
00029 #define HVC_ACTIV_BLINK_ESTIMATION      0x00000080
00030 #define HVC_ACTIV_EXPRESSION_ESTIMATION 0x00000100
00031 #define HVC_ACTIV_FACE_RECOGNITION      0x00000200
00032 
00033 /* Image info of Execute command */
00034 #define HVC_EXECUTE_IMAGE_NONE          0x00000000
00035 #define HVC_EXECUTE_IMAGE_QVGA          0x00000001
00036 #define HVC_EXECUTE_IMAGE_QVGA_HALF     0x00000002
00037 
00038 /*----------------------------------------------------------------------------*/
00039 /* Error code */
00040 
00041 /* Parameter error */
00042 #define HVC_ERROR_PARAMETER             -1
00043 
00044 /* Send signal timeout error */
00045 #define HVC_ERROR_SEND_DATA             -10
00046 
00047 /* Receive header signal timeout error */
00048 #define HVC_ERROR_HEADER_TIMEOUT        -20
00049 /* Invalid header error */
00050 #define HVC_ERROR_HEADER_INVALID        -21
00051 /* Receive data signal timeout error */
00052 #define HVC_ERROR_DATA_TIMEOUT          -22
00053 
00054 
00055 /*----------------------------------------------------------------------------*/
00056 /* Album data size */
00057 #define HVC_ALBUM_SIZE_MIN              32
00058 #define HVC_ALBUM_SIZE_MAX              816032
00059 
00060 /*----------------------------------------------------------------------------*/
00061 /* Expression */
00062 typedef enum {
00063     EX_NEUTRAL = 1,
00064     EX_HAPPINESS,
00065     EX_SURPRISE,
00066     EX_ANGER,
00067     EX_SADNESS
00068 }EXPRESSION;
00069 
00070 /*----------------------------------------------------------------------------*/
00071 /* Struct                                                                     */
00072 /*----------------------------------------------------------------------------*/
00073 /*----------------------------------------------------------------------------*/
00074 /* Device�fs model and version info                                           */
00075 /*----------------------------------------------------------------------------*/
00076 typedef struct {
00077     UINT8   string[12];
00078     UINT8   major;
00079     UINT8   minor;
00080     UINT8   relese;
00081     UINT8   revision[4];
00082 }HVC_VERSION;
00083 
00084 /*----------------------------------------------------------------------------*/
00085 /* Detection result                                                           */
00086 /*----------------------------------------------------------------------------*/
00087 typedef struct{
00088     INT32   posX;       /* Center x-coordinate */
00089     INT32   posY;       /* Center y-coordinate */
00090     INT32   size;       /* Size */
00091     INT32   confidence; /* Degree of confidence */
00092 }DETECT_RESULT;
00093 
00094 /*----------------------------------------------------------------------------*/
00095 /* Face direction                                                             */
00096 /*----------------------------------------------------------------------------*/
00097 typedef struct{
00098     INT32   yaw;        /* Yaw angle */
00099     INT32   pitch;      /* Pitch angle */
00100     INT32   roll;       /* Roll angle */
00101     INT32   confidence; /* Degree of confidence */
00102 }DIR_RESULT;
00103 
00104 /*----------------------------------------------------------------------------*/
00105 /* Age                                                                        */
00106 /*----------------------------------------------------------------------------*/
00107 typedef struct{
00108     INT32   age;        /* Age */
00109     INT32   confidence; /* Degree of confidence */
00110 }AGE_RESULT;
00111 
00112 /*----------------------------------------------------------------------------*/
00113 /* Gender                                                                     */
00114 /*----------------------------------------------------------------------------*/
00115 typedef struct{
00116     INT32   gender;     /* Gender */
00117     INT32   confidence; /* Degree of confidence */
00118 }GENDER_RESULT;
00119 
00120 /*----------------------------------------------------------------------------*/
00121 /* Gaze                                                                       */
00122 /*----------------------------------------------------------------------------*/
00123 typedef struct{
00124     INT32   gazeLR;     /* Yaw angle */
00125     INT32   gazeUD;     /* Pitch angle */
00126 }GAZE_RESULT;
00127 
00128 /*----------------------------------------------------------------------------*/
00129 /* Blink                                                                      */
00130 /*----------------------------------------------------------------------------*/
00131 typedef struct{
00132     INT32   ratioL;     /* Left eye blink result */
00133     INT32   ratioR;     /* Right eye blink result */
00134 }BLINK_RESULT;
00135 
00136 /*----------------------------------------------------------------------------*/
00137 /* Expression                                                                 */
00138 /*----------------------------------------------------------------------------*/
00139 typedef struct{
00140     INT32   topExpression;  /* Top expression */
00141     INT32   topScore;       /* Top score */
00142     INT32   score[5];       /* Score of 5 expression */
00143     INT32   degree;         /* Negative-positive degree */
00144 }EXPRESSION_RESULT;
00145 
00146 /*----------------------------------------------------------------------------*/
00147 /* Face Recognition                                                           */
00148 /*----------------------------------------------------------------------------*/
00149 typedef struct{
00150     INT32   uid;        /* User ID */
00151     INT32   confidence; /* Degree of confidence */
00152 }RECOGNITION_RESULT;
00153 
00154 /*----------------------------------------------------------------------------*/
00155 /* Face Detection & Estimations result                                        */
00156 /*----------------------------------------------------------------------------*/
00157 typedef struct{
00158     DETECT_RESULT       dtResult;           /* Face detection result */
00159     DIR_RESULT          dirResult;          /* Face direction estimation result */
00160     AGE_RESULT          ageResult;          /* Age Estimation result */
00161     GENDER_RESULT       genderResult;       /* Gender Estimation result */
00162     GAZE_RESULT         gazeResult;         /* Gaze Estimation result */
00163     BLINK_RESULT        blinkResult;        /* Blink Estimation result */
00164     EXPRESSION_RESULT   expressionResult;   /* Expression Estimation result */
00165     RECOGNITION_RESULT  recognitionResult;  /* Face Recognition result */
00166 }FACE_RESULT;
00167 
00168 /*----------------------------------------------------------------------------*/
00169 /* Human Body Detection results                                               */
00170 /*----------------------------------------------------------------------------*/
00171 typedef struct{
00172     UINT8           num;            /* Number of Detection */
00173     DETECT_RESULT   bdResult[35];   /* Detection result */
00174 }BD_RESULT;
00175 
00176 /*----------------------------------------------------------------------------*/
00177 /* Hand Detection results                                                     */
00178 /*----------------------------------------------------------------------------*/
00179 typedef struct{
00180     UINT8           num;            /* Number of Detection */
00181     DETECT_RESULT   hdResult[35];   /* Detection result */
00182 }HD_RESULT;
00183 
00184 /*----------------------------------------------------------------------------*/
00185 /* Face Detection & Estimations results                                       */
00186 /*----------------------------------------------------------------------------*/
00187 typedef struct{
00188     UINT8           num;            /* Number of Detection */
00189     FACE_RESULT     fcResult[35];   /* Detection & Estimations result */
00190 }FD_RESULT;
00191 
00192 /*----------------------------------------------------------------------------*/
00193 /* Image data                                                                 */
00194 /*----------------------------------------------------------------------------*/
00195 typedef struct{
00196     INT32   width;
00197     INT32   height;
00198     UINT8   image[320*240];
00199 }HVC_IMAGE;
00200 
00201 /*----------------------------------------------------------------------------*/
00202 /* Eesult data of Execute command                                             */
00203 /*----------------------------------------------------------------------------*/
00204 typedef struct{
00205     INT32       executedFunc;   /* Execution flag */
00206     BD_RESULT   bdResult;       /* Human Body Detection results */
00207     HD_RESULT   hdResult;       /* Hand Detection results */
00208     FD_RESULT   fdResult;       /* Face Detection & Estimations results */
00209     HVC_IMAGE   image;          /* Image data */
00210 }HVC_RESULT;
00211 
00212 /*----------------------------------------------------------------------------*/
00213 /* Threshold of confidence                                                    */
00214 /*----------------------------------------------------------------------------*/
00215 typedef struct{
00216     INT32   bdThreshold;        /* Threshold of confidence of Human Body Detection */
00217     INT32   hdThreshold;        /* Threshold of confidence of Hand Detection */
00218     INT32   dtThreshold;        /* Threshold of confidence of Face Detection */
00219     INT32   rsThreshold;        /* Threshold of confidence of Face Recognition */
00220 }HVC_THRESHOLD;
00221 
00222 /*----------------------------------------------------------------------------*/
00223 /* Detection size                                                             */
00224 /*----------------------------------------------------------------------------*/
00225 typedef struct{
00226     INT32   bdMinSize;          /* Minimum detection size of Human Body Detection */
00227     INT32   bdMaxSize;          /* Maximum detection size of Human Body Detection */
00228     INT32   hdMinSize;          /* Minimum detection size of Hand Detection */
00229     INT32   hdMaxSize;          /* Maximum detection size of Hand Detection */
00230     INT32   dtMinSize;          /* Minimum detection size of Face Detection */
00231     INT32   dtMaxSize;          /* Maximum detection size of Face Detection */
00232 }HVC_SIZERANGE;
00233 
00234 #endif /* HVCDef_H__ */
00235