Sample to operate omron HVC-P2 on GR-PEACH.
Dependencies: AsciiFont
What is this ?
This is a sample that runs OMRON HVC-P2 with GR-PEACH. In this sample, you can try following among the functions of HVC-P2 : Human Body Detection, Face Detection, Age Estimation, Gender Estimation, Expression Estimation and Face Recognition.
Both GR-PEACH and HVC-P2 use Renesas RZ/A1H included ARM® Cortex™-A9 processor.
HVC-P2 (Human Vision Components B5T-007001) is a human-sensing component that recognizes people. It is an integrated module that is built into other device and provides both the OKAO Vision's ten types of image sensing and a camera module.
For details, please refer to the following link.
- SENSING EGG PROJECT > HVC-P2 (In Japanese)
https://plus-sensing.omron.co.jp/egg-project/product/hvc-p2/ - HVC-P2 (Human Vision Components B5T-007001)
http://www.omron.com/ecb/products/mobile/hvc_p2/ - OKAO Vision
https://plus-sensing.omron.com/technology/index.html
In the HVCApi folder of this sample, the code of the following link destination Sample Code "SampleCode_rev.2.0.2" is used. (You can download from "Product Information" -> "Sample Code" in the middle of the following page.)
http://www.omron.com/ecb/products/mobile/hvc_p2/
Constitution
- HVC-P2 x 1
- USBA-microUSB conversion cable x 2
- USBA-microUSB conversion adapter x 1
- GR-PEACH x 1
- 4.3inc LCD shield x 1
Please close JP3 of GR-PEACH.
How to use
It starts when connecting the power supply USB cable. At startup, all functions are turned off. By pressing the button on the right of the screen you can switch the function on / off.
- Function ON : orange or green
- Function OFF : blue or gray
Only the FACE button changes to "FACE (blue) -> FACE (orange) -> RECOGNITION (green)". When FACE (blue), following buttons are gray and can not be operated : AGE, GENDER and EXPRESSION.
"Response time" at the bottom left of the screen indicates "image processing + USB transfer time". It is not pure image processing time.
Register Data (Face Recognition)
Set the FACE button to RECOGNITION (green), and touch the screen with one person on the screen to register the face. In this sample, face registration will record up to 10 people. Delete the old registrant when registering after 11 people. Registration information is stored in the RAM on the HVC-P2 side. It is discarded by power off and reset.
Change parameters
When you press Config icon at the bottom right of the screen, the parameter setting screen is displayed. You can change threshold value, detection size and face angle parameters.
Change transfer image size
By pressing USER_BUTTON0 on the back of the board, the image transfer size switches in the order of "160 x 120 -> 320 x 240 -> no image".
HVC/HVCApi/HVCApi.h@8:92c19be0aced, 2018-09-28 (annotated)
- Committer:
- dkato
- Date:
- Fri Sep 28 05:16:44 2018 +0000
- Revision:
- 8:92c19be0aced
- Parent:
- 5:49a61433290a
Supports mbed-os-5.10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:f5de229c9a00 | 1 | /*---------------------------------------------------------------------------*/ |
dkato | 0:f5de229c9a00 | 2 | /* Copyright(C) 2017 OMRON Corporation */ |
dkato | 0:f5de229c9a00 | 3 | /* */ |
dkato | 0:f5de229c9a00 | 4 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ |
dkato | 0:f5de229c9a00 | 5 | /* you may not use this file except in compliance with the License. */ |
dkato | 0:f5de229c9a00 | 6 | /* You may obtain a copy of the License at */ |
dkato | 0:f5de229c9a00 | 7 | /* */ |
dkato | 0:f5de229c9a00 | 8 | /* http://www.apache.org/licenses/LICENSE-2.0 */ |
dkato | 0:f5de229c9a00 | 9 | /* */ |
dkato | 0:f5de229c9a00 | 10 | /* Unless required by applicable law or agreed to in writing, software */ |
dkato | 0:f5de229c9a00 | 11 | /* distributed under the License is distributed on an "AS IS" BASIS, */ |
dkato | 0:f5de229c9a00 | 12 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ |
dkato | 0:f5de229c9a00 | 13 | /* See the License for the specific language governing permissions and */ |
dkato | 0:f5de229c9a00 | 14 | /* limitations under the License. */ |
dkato | 0:f5de229c9a00 | 15 | /*---------------------------------------------------------------------------*/ |
dkato | 0:f5de229c9a00 | 16 | |
dkato | 0:f5de229c9a00 | 17 | /* |
dkato | 0:f5de229c9a00 | 18 | HVC Sample API |
dkato | 0:f5de229c9a00 | 19 | */ |
dkato | 0:f5de229c9a00 | 20 | |
dkato | 0:f5de229c9a00 | 21 | #ifndef HVCApi_H__ |
dkato | 0:f5de229c9a00 | 22 | #define HVCApi_H__ |
dkato | 0:f5de229c9a00 | 23 | |
dkato | 0:f5de229c9a00 | 24 | #ifndef UINT8 |
dkato | 0:f5de229c9a00 | 25 | typedef unsigned char UINT8; /* 8 bit Unsigned Integer */ |
dkato | 0:f5de229c9a00 | 26 | #endif /* UINT8 */ |
dkato | 0:f5de229c9a00 | 27 | #ifndef INT32 |
dkato | 0:f5de229c9a00 | 28 | typedef int INT32; /* 32 bit Signed Integer */ |
dkato | 0:f5de229c9a00 | 29 | #endif /* INT32 */ |
dkato | 0:f5de229c9a00 | 30 | #ifndef NULL |
dkato | 0:f5de229c9a00 | 31 | #define NULL 0 |
dkato | 0:f5de229c9a00 | 32 | #endif |
dkato | 0:f5de229c9a00 | 33 | |
dkato | 0:f5de229c9a00 | 34 | #include "HVCDef.h" |
dkato | 0:f5de229c9a00 | 35 | |
dkato | 0:f5de229c9a00 | 36 | #ifdef __cplusplus |
dkato | 0:f5de229c9a00 | 37 | extern "C" { |
dkato | 0:f5de229c9a00 | 38 | #endif |
dkato | 0:f5de229c9a00 | 39 | |
dkato | 0:f5de229c9a00 | 40 | /* HVC_GetVersion */ |
dkato | 0:f5de229c9a00 | 41 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 42 | /* : HVC_VERSION *outVersion version data */ |
dkato | 0:f5de229c9a00 | 43 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 44 | INT32 HVC_GetVersion(INT32 inTimeOutTime, HVC_VERSION *outVersion, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 45 | |
dkato | 0:f5de229c9a00 | 46 | /* HVC_SetCameraAngle */ |
dkato | 0:f5de229c9a00 | 47 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 48 | /* : INT32 inAngleNo camera angle number */ |
dkato | 0:f5de229c9a00 | 49 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 50 | INT32 HVC_SetCameraAngle(INT32 inTimeOutTime, INT32 inAngleNo, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 51 | |
dkato | 0:f5de229c9a00 | 52 | /* HVC_GetCameraAngle */ |
dkato | 0:f5de229c9a00 | 53 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 54 | /* : INT32 *outAngleNo camera angle number */ |
dkato | 0:f5de229c9a00 | 55 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 56 | INT32 HVC_GetCameraAngle(INT32 inTimeOutTime, INT32 *outAngleNo, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 57 | |
dkato | 0:f5de229c9a00 | 58 | /* HVC_Execute */ |
dkato | 0:f5de229c9a00 | 59 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 60 | /* : INT32 inExec executable function */ |
dkato | 0:f5de229c9a00 | 61 | /* : INT32 inImage image output number */ |
dkato | 0:f5de229c9a00 | 62 | /* : HVC_RESULT *outHVCResult result data */ |
dkato | 0:f5de229c9a00 | 63 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 64 | INT32 HVC_Execute(INT32 inTimeOutTime, INT32 inExec, INT32 inImage, HVC_RESULT *outHVCResult, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 65 | |
dkato | 0:f5de229c9a00 | 66 | /* HVC_ExecuteEx */ |
dkato | 0:f5de229c9a00 | 67 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 68 | /* : INT32 inExec executable function */ |
dkato | 0:f5de229c9a00 | 69 | /* : INT32 inImage image output number */ |
dkato | 0:f5de229c9a00 | 70 | /* : HVC_RESULT *outHVCResult result data */ |
dkato | 0:f5de229c9a00 | 71 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 72 | INT32 HVC_ExecuteEx(INT32 inTimeOutTime, INT32 inExec, INT32 inImage, HVC_RESULT *outHVCResult, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 73 | |
dkato | 0:f5de229c9a00 | 74 | /* HVC_SetThreshold */ |
dkato | 0:f5de229c9a00 | 75 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 76 | /* : HVC_THRESHOLD *inThreshold threshold values */ |
dkato | 0:f5de229c9a00 | 77 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 78 | INT32 HVC_SetThreshold(INT32 inTimeOutTime, HVC_THRESHOLD *inThreshold, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 79 | |
dkato | 0:f5de229c9a00 | 80 | /* HVC_GetThreshold */ |
dkato | 0:f5de229c9a00 | 81 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 82 | /* : HVC_THRESHOLD *outThreshold threshold values */ |
dkato | 0:f5de229c9a00 | 83 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 84 | INT32 HVC_GetThreshold(INT32 inTimeOutTime, HVC_THRESHOLD *outThreshold, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 85 | |
dkato | 0:f5de229c9a00 | 86 | /* HVC_SetSizeRange */ |
dkato | 0:f5de229c9a00 | 87 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 88 | /* : HVC_SIZERANGE *inSizeRange detection sizes */ |
dkato | 0:f5de229c9a00 | 89 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 90 | INT32 HVC_SetSizeRange(INT32 inTimeOutTime, HVC_SIZERANGE *inSizeRange, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 91 | |
dkato | 0:f5de229c9a00 | 92 | /* HVC_GetSizeRange */ |
dkato | 0:f5de229c9a00 | 93 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 94 | /* : HVC_SIZERANGE *outSizeRange detection sizes */ |
dkato | 0:f5de229c9a00 | 95 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 96 | INT32 HVC_GetSizeRange(INT32 inTimeOutTime, HVC_SIZERANGE *outSizeRange, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 97 | |
dkato | 0:f5de229c9a00 | 98 | /* HVC_SetFaceDetectionAngle */ |
dkato | 0:f5de229c9a00 | 99 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 100 | /* : INT32 inPose Yaw angle range */ |
dkato | 0:f5de229c9a00 | 101 | /* : INT32 inAngle Roll angle range */ |
dkato | 0:f5de229c9a00 | 102 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 103 | INT32 HVC_SetFaceDetectionAngle(INT32 inTimeOutTime, INT32 inPose, INT32 inAngle, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 104 | |
dkato | 0:f5de229c9a00 | 105 | /* HVC_GetFaceDetectionAngle */ |
dkato | 0:f5de229c9a00 | 106 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 107 | /* : INT32 *outPose Yaw angle range */ |
dkato | 0:f5de229c9a00 | 108 | /* : INT32 *outAngle Roll angle range */ |
dkato | 0:f5de229c9a00 | 109 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 110 | INT32 HVC_GetFaceDetectionAngle(INT32 inTimeOutTime, INT32 *outPose, INT32 *outAngle, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 111 | |
dkato | 0:f5de229c9a00 | 112 | /* HVC_SetBaudRate */ |
dkato | 0:f5de229c9a00 | 113 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 114 | /* : INT32 inRate Baudrate */ |
dkato | 0:f5de229c9a00 | 115 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 116 | INT32 HVC_SetBaudRate(INT32 inTimeOutTime, INT32 inRate, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 117 | |
dkato | 0:f5de229c9a00 | 118 | /* HVC_Registration */ |
dkato | 0:f5de229c9a00 | 119 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 120 | /* : INT32 inUserID User ID (0-499) */ |
dkato | 0:f5de229c9a00 | 121 | /* : INT32 inDataID Data ID (0-9) */ |
dkato | 0:f5de229c9a00 | 122 | /* : HVC_IMAGE *outImage image info */ |
dkato | 0:f5de229c9a00 | 123 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 124 | INT32 HVC_Registration(INT32 inTimeOutTime, INT32 inUserID, INT32 inDataID, HVC_IMAGE *outImage, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 125 | |
dkato | 0:f5de229c9a00 | 126 | /* HVC_DeleteData */ |
dkato | 0:f5de229c9a00 | 127 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 128 | /* : INT32 inUserID User ID (0-499) */ |
dkato | 0:f5de229c9a00 | 129 | /* : INT32 inDataID Data ID (0-9) */ |
dkato | 0:f5de229c9a00 | 130 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 131 | INT32 HVC_DeleteData(INT32 inTimeOutTime, INT32 inUserID, INT32 inDataID, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 132 | |
dkato | 0:f5de229c9a00 | 133 | /* HVC_DeleteUser */ |
dkato | 0:f5de229c9a00 | 134 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 135 | /* : INT32 inUserID User ID (0-499) */ |
dkato | 0:f5de229c9a00 | 136 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 137 | INT32 HVC_DeleteUser(INT32 inTimeOutTime, INT32 inUserID, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 138 | |
dkato | 0:f5de229c9a00 | 139 | /* HVC_DeleteAll */ |
dkato | 0:f5de229c9a00 | 140 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 141 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 142 | INT32 HVC_DeleteAll(INT32 inTimeOutTime, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 143 | |
dkato | 0:f5de229c9a00 | 144 | /* HVC_GetUserData */ |
dkato | 0:f5de229c9a00 | 145 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 146 | /* : INT32 inUserID User ID (0-499) */ |
dkato | 0:f5de229c9a00 | 147 | /* : INT32 *outDataNo Registration Info */ |
dkato | 0:f5de229c9a00 | 148 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 149 | INT32 HVC_GetUserData(INT32 inTimeOutTime, INT32 inUserID, INT32 *outDataNo, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 150 | |
dkato | 0:f5de229c9a00 | 151 | /* HVC_SaveAlbum */ |
dkato | 0:f5de229c9a00 | 152 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 153 | /* : UINT8 *outAlbumData Album data */ |
dkato | 0:f5de229c9a00 | 154 | /* : INT32 *outAlbumDataSize Album data size */ |
dkato | 0:f5de229c9a00 | 155 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 156 | INT32 HVC_SaveAlbum(INT32 inTimeOutTime, UINT8 *outAlbumData, INT32 *outAlbumDataSize, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 157 | |
dkato | 0:f5de229c9a00 | 158 | /* HVC_LoadAlbum */ |
dkato | 0:f5de229c9a00 | 159 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 160 | /* : UINT8 *inAlbumData Album data */ |
dkato | 0:f5de229c9a00 | 161 | /* : INT32 inAlbumDataSize Album data size */ |
dkato | 0:f5de229c9a00 | 162 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 163 | INT32 HVC_LoadAlbum(INT32 inTimeOutTime, UINT8 *inAlbumData, INT32 inAlbumDataSize, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 164 | |
dkato | 0:f5de229c9a00 | 165 | /* HVC_WriteAlbum */ |
dkato | 0:f5de229c9a00 | 166 | /* param : INT32 inTimeOutTime timeout time (ms) */ |
dkato | 0:f5de229c9a00 | 167 | /* : UINT8 *outStatus response code */ |
dkato | 0:f5de229c9a00 | 168 | INT32 HVC_WriteAlbum(INT32 inTimeOutTime, UINT8 *outStatus); |
dkato | 0:f5de229c9a00 | 169 | |
dkato | 0:f5de229c9a00 | 170 | #ifdef __cplusplus |
dkato | 0:f5de229c9a00 | 171 | } |
dkato | 0:f5de229c9a00 | 172 | #endif |
dkato | 0:f5de229c9a00 | 173 | |
dkato | 0:f5de229c9a00 | 174 | #endif /* HVCApi_H__ */ |