Sample to operate omron HVC-P2 on GR-PEACH.

Dependencies:   AsciiFont

Information

Please see here for Japanese version.
日本語版はこちらを参照ください。

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.

/media/uploads/dkato/hvcp2_demo_img3.jpg

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.

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

  1. HVC-P2 x 1
  2. USBA-microUSB conversion cable x 2
  3. USBA-microUSB conversion adapter x 1
  4. GR-PEACH x 1
  5. 4.3inc LCD shield x 1

/media/uploads/dkato/composition_hvcp2_demo.jpg

/media/uploads/dkato/composition_hvcp2_demo_2.jpg

Please close JP3 of GR-PEACH.
/media/uploads/RyoheiHagimoto/usb.jpg

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.

/media/uploads/dkato/hvcp2_demo_img2.jpg

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.

/media/uploads/dkato/hvcp2_demo_config_icon.jpg
/media/uploads/dkato/hvcp2_demo_config.jpg

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".
/media/uploads/dkato/gr-peach_switch2.jpg

Committer:
dkato
Date:
Tue Sep 05 10:01:51 2017 +0000
Revision:
5:49a61433290a
Add HVC sensing result stabilizing library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 5:49a61433290a 1 /*---------------------------------------------------------------------------*/
dkato 5:49a61433290a 2 /* Copyright(C) 2017 OMRON Corporation */
dkato 5:49a61433290a 3 /* */
dkato 5:49a61433290a 4 /* Licensed under the Apache License, Version 2.0 (the "License"); */
dkato 5:49a61433290a 5 /* you may not use this file except in compliance with the License. */
dkato 5:49a61433290a 6 /* You may obtain a copy of the License at */
dkato 5:49a61433290a 7 /* */
dkato 5:49a61433290a 8 /* http://www.apache.org/licenses/LICENSE-2.0 */
dkato 5:49a61433290a 9 /* */
dkato 5:49a61433290a 10 /* Unless required by applicable law or agreed to in writing, software */
dkato 5:49a61433290a 11 /* distributed under the License is distributed on an "AS IS" BASIS, */
dkato 5:49a61433290a 12 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
dkato 5:49a61433290a 13 /* See the License for the specific language governing permissions and */
dkato 5:49a61433290a 14 /* limitations under the License. */
dkato 5:49a61433290a 15 /*---------------------------------------------------------------------------*/
dkato 5:49a61433290a 16
dkato 5:49a61433290a 17 #include "STBFrAPI.h"
dkato 5:49a61433290a 18
dkato 5:49a61433290a 19 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 20 // FrSlideFacesRec
dkato 5:49a61433290a 21 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 22 void FrSlideFacesRec ( STB_FR_DET *facesRec )
dkato 5:49a61433290a 23 {
dkato 5:49a61433290a 24 STB_INT32 t , i ;
dkato 5:49a61433290a 25
dkato 5:49a61433290a 26 for( t = STB_FR_BACK_MAX - 2 ; t >= 0 ; t-- )
dkato 5:49a61433290a 27 {
dkato 5:49a61433290a 28 facesRec [ t + 1 ].num = facesRec[ t + 0 ].num;
dkato 5:49a61433290a 29 for( i = 0 ; i < facesRec [ t + 1 ].num ; i++ )
dkato 5:49a61433290a 30 {
dkato 5:49a61433290a 31 facesRec [ t + 1 ].fcDet[i].nDetID = facesRec [ t ].fcDet[i].nDetID ;
dkato 5:49a61433290a 32 facesRec [ t + 1 ].fcDet[i].nTraID = facesRec [ t ].fcDet[i].nTraID ;
dkato 5:49a61433290a 33
dkato 5:49a61433290a 34 facesRec [ t + 1 ].fcDet[i].dirDetPitch = facesRec [ t ].fcDet[i].dirDetPitch ;
dkato 5:49a61433290a 35 facesRec [ t + 1 ].fcDet[i].dirDetRoll = facesRec [ t ].fcDet[i].dirDetRoll ;
dkato 5:49a61433290a 36 facesRec [ t + 1 ].fcDet[i].dirDetYaw = facesRec [ t ].fcDet[i].dirDetYaw ;
dkato 5:49a61433290a 37 facesRec [ t + 1 ].fcDet[i].dirDetConf = facesRec [ t ].fcDet[i].dirDetConf ;
dkato 5:49a61433290a 38 facesRec [ t + 1 ].fcDet[i].frDetID = facesRec [ t ].fcDet[i].frDetID ;
dkato 5:49a61433290a 39 facesRec [ t + 1 ].fcDet[i].frDetConf = facesRec [ t ].fcDet[i].frDetConf ;
dkato 5:49a61433290a 40 facesRec [ t + 1 ].fcDet[i].frStatus = facesRec [ t ].fcDet[i].frStatus ;
dkato 5:49a61433290a 41
dkato 5:49a61433290a 42 }
dkato 5:49a61433290a 43 }
dkato 5:49a61433290a 44 }
dkato 5:49a61433290a 45 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 46 // FrCurFaces
dkato 5:49a61433290a 47 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 48 void FrCurFaces ( STB_FR_DET *facesRec , STB_FR_DET *srcFace )
dkato 5:49a61433290a 49 {
dkato 5:49a61433290a 50 STB_INT32 i ;
dkato 5:49a61433290a 51
dkato 5:49a61433290a 52
dkato 5:49a61433290a 53 facesRec [ 0 ].num = srcFace->num;
dkato 5:49a61433290a 54 for( i = 0 ; i < facesRec [ 0 ].num ; i++ )
dkato 5:49a61433290a 55 {
dkato 5:49a61433290a 56 facesRec [ 0 ].fcDet[i].nDetID = srcFace->fcDet[i].nDetID ;
dkato 5:49a61433290a 57 facesRec [ 0 ].fcDet[i].nTraID = srcFace->fcDet[i].nTraID ;
dkato 5:49a61433290a 58 facesRec [ 0 ].fcDet[i].dirDetPitch = srcFace->fcDet[i].dirDetPitch ;
dkato 5:49a61433290a 59 facesRec [ 0 ].fcDet[i].dirDetRoll = srcFace->fcDet[i].dirDetRoll ;
dkato 5:49a61433290a 60 facesRec [ 0 ].fcDet[i].dirDetYaw = srcFace->fcDet[i].dirDetYaw ;
dkato 5:49a61433290a 61 facesRec [ 0 ].fcDet[i].dirDetConf = srcFace->fcDet[i].dirDetConf ;
dkato 5:49a61433290a 62 facesRec [ 0 ].fcDet[i].frDetID = srcFace->fcDet[i].frDetID ;
dkato 5:49a61433290a 63 facesRec [ 0 ].fcDet[i].frDetConf = srcFace->fcDet[i].frDetConf ;
dkato 5:49a61433290a 64 facesRec [ 0 ].fcDet[i].frStatus = STB_STATUS_NO_DATA ;
dkato 5:49a61433290a 65
dkato 5:49a61433290a 66 }
dkato 5:49a61433290a 67
dkato 5:49a61433290a 68 }
dkato 5:49a61433290a 69
dkato 5:49a61433290a 70
dkato 5:49a61433290a 71 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 72 // FrStbFaceEasy
dkato 5:49a61433290a 73 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 74 void
dkato 5:49a61433290a 75 FrStbFaceEasy
dkato 5:49a61433290a 76 (
dkato 5:49a61433290a 77 STB_FR_RES* peRes ,
dkato 5:49a61433290a 78 STB_FR_DET* peRec ,
dkato 5:49a61433290a 79 STB_INT32 dirThr ,
dkato 5:49a61433290a 80 STB_INT32 dirUDMax ,
dkato 5:49a61433290a 81 STB_INT32 dirUDMin ,
dkato 5:49a61433290a 82 STB_INT32 dirLRMax ,
dkato 5:49a61433290a 83 STB_INT32 dirLRMin ,
dkato 5:49a61433290a 84 STB_INT32 frmCnt ,
dkato 5:49a61433290a 85 STB_INT32 frmRatio
dkato 5:49a61433290a 86
dkato 5:49a61433290a 87
dkato 5:49a61433290a 88 )
dkato 5:49a61433290a 89 {
dkato 5:49a61433290a 90 STB_INT32 i, t, k;
dkato 5:49a61433290a 91 STB_INT32 trID;
dkato 5:49a61433290a 92 STB_INT32 recCnt;
dkato 5:49a61433290a 93 STB_INT32 recUID [STB_FR_BACK_MAX];
dkato 5:49a61433290a 94 STB_INT32 recConf [STB_FR_BACK_MAX];
dkato 5:49a61433290a 95
dkato 5:49a61433290a 96 STB_INT32 accUID [STB_FR_BACK_MAX];
dkato 5:49a61433290a 97 STB_INT32 accCnt [STB_FR_BACK_MAX];
dkato 5:49a61433290a 98 STB_INT32 accKind;
dkato 5:49a61433290a 99 STB_INT32 tmpUID;
dkato 5:49a61433290a 100 STB_INT32 tmpCnt;
dkato 5:49a61433290a 101 STB_INT32 tmpConf;
dkato 5:49a61433290a 102 STB_INT32 topUID;
dkato 5:49a61433290a 103 STB_INT32 topCnt;
dkato 5:49a61433290a 104 STB_STATUS preStatus ;
dkato 5:49a61433290a 105 STB_INT32 preUID ;
dkato 5:49a61433290a 106 STB_INT32 preConf ;
dkato 5:49a61433290a 107
dkato 5:49a61433290a 108
dkato 5:49a61433290a 109 for( t = 0; t < STB_FR_BACK_MAX ; t++)
dkato 5:49a61433290a 110 {
dkato 5:49a61433290a 111 recUID [t] = STB_FR_INVALID_UID;
dkato 5:49a61433290a 112 recConf [t] = 0;
dkato 5:49a61433290a 113 accUID [t] = STB_FR_INVALID_UID;
dkato 5:49a61433290a 114 accCnt [t] = 0;
dkato 5:49a61433290a 115 }
dkato 5:49a61433290a 116
dkato 5:49a61433290a 117
dkato 5:49a61433290a 118 /*Checking the past data here, fill in all peRes.*/
dkato 5:49a61433290a 119 /*do stabilization processing each tracking person*/
dkato 5:49a61433290a 120
dkato 5:49a61433290a 121 peRes->frCnt = peRec[0].num;
dkato 5:49a61433290a 122 for( k = 0; k < peRes->frCnt; k++)
dkato 5:49a61433290a 123 {
dkato 5:49a61433290a 124 /*Tracking person number in the through frame*/
dkato 5:49a61433290a 125 trID = peRec[0].fcDet[k].nTraID;
dkato 5:49a61433290a 126
dkato 5:49a61433290a 127 // peRes Add -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 128 peRes->frFace[k].nTraID = trID;
dkato 5:49a61433290a 129
dkato 5:49a61433290a 130
dkato 5:49a61433290a 131 //in case of unregistered album for present UID(no album files)
dkato 5:49a61433290a 132 if( peRec[0].fcDet[k].frDetID == STB_ERR_FR_NOALBUM )
dkato 5:49a61433290a 133 {
dkato 5:49a61433290a 134 peRes->frFace[k].frRecog.value = STB_ERR_FR_NOALBUM ;
dkato 5:49a61433290a 135 peRes->frFace[k].frRecog.status = STB_STATUS_NO_DATA ;
dkato 5:49a61433290a 136 peRes->frFace[k].frRecog.conf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 137 peRec[0].fcDet[k].frDetID = STB_ERR_FR_NOALBUM ;
dkato 5:49a61433290a 138 peRec[0].fcDet[k].frStatus = STB_STATUS_NO_DATA ;
dkato 5:49a61433290a 139 peRec[0].fcDet[k].frDetConf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 140 continue;
dkato 5:49a61433290a 141 }
dkato 5:49a61433290a 142
dkato 5:49a61433290a 143 // preStatus -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 144 preStatus = STB_STATUS_NO_DATA ;
dkato 5:49a61433290a 145 preUID = STB_FR_INVALID_UID ;
dkato 5:49a61433290a 146 preConf = 0 ;
dkato 5:49a61433290a 147 for( i = 0; i < peRec[1].num ; i++)
dkato 5:49a61433290a 148 {
dkato 5:49a61433290a 149 if( peRec[1].fcDet[i].nTraID == trID )
dkato 5:49a61433290a 150 {
dkato 5:49a61433290a 151 preUID = peRec[1].fcDet[i].frDetID ;
dkato 5:49a61433290a 152 preStatus = peRec[1].fcDet[i].frStatus ;
dkato 5:49a61433290a 153 preConf = peRec[1].fcDet[i].frDetConf ;
dkato 5:49a61433290a 154 break;
dkato 5:49a61433290a 155 }
dkato 5:49a61433290a 156 }
dkato 5:49a61433290a 157
dkato 5:49a61433290a 158
dkato 5:49a61433290a 159 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 160 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 161 if ( preStatus == STB_STATUS_NO_DATA //stabilization impossible: no data of the relevant people
dkato 5:49a61433290a 162 || preStatus == STB_STATUS_CALCULATING //during stabilization : a number of data for relevant people aren't enough(a number of frames that relevant people are taken)
dkato 5:49a61433290a 163 )
dkato 5:49a61433290a 164 {
dkato 5:49a61433290a 165 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 166 //Setting "recUID" to past data of Tracking ID(trID) : (Up to "frmCnt")
dkato 5:49a61433290a 167 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 168 recCnt = 0;
dkato 5:49a61433290a 169 for( t = 0; t < STB_FR_BACK_MAX ; t++) //previous t frame
dkato 5:49a61433290a 170 {
dkato 5:49a61433290a 171 for( i = 0; i < peRec[t].num ; i++) //a number of tracking people(previous t frame)
dkato 5:49a61433290a 172 {
dkato 5:49a61433290a 173 if(
dkato 5:49a61433290a 174 peRec [ t ].fcDet[i].nTraID == trID //the same tracking number
dkato 5:49a61433290a 175 && peRec [ t ].fcDet[i].nDetID >= 0 //not lost
dkato 5:49a61433290a 176 && peRec [ t ].fcDet[i].dirDetConf >= dirThr // Face angle : confidence
dkato 5:49a61433290a 177 && peRec [ t ].fcDet[i].dirDetPitch >= dirUDMin // Face angle : pitch
dkato 5:49a61433290a 178 && peRec [ t ].fcDet[i].dirDetPitch <= dirUDMax // Face angle : pitch
dkato 5:49a61433290a 179 && peRec [ t ].fcDet[i].dirDetYaw >= dirLRMin // Face angle : yaw
dkato 5:49a61433290a 180 && peRec [ t ].fcDet[i].dirDetYaw <= dirLRMax // Face angle : yaw
dkato 5:49a61433290a 181 && peRec [ t ].fcDet[i].frDetID != STB_ERR_FR_CANNOT //Recognition impossible
dkato 5:49a61433290a 182 && peRec [ t ].fcDet[i].frDetID != STB_ERR_FR_NOALBUM // Not-registered in Album
dkato 5:49a61433290a 183 )
dkato 5:49a61433290a 184 {
dkato 5:49a61433290a 185 recUID [ recCnt ] = peRec [ t ].fcDet[ i ].frDetID ;
dkato 5:49a61433290a 186 recConf[ recCnt ] = peRec [ t ].fcDet[ i ].frDetConf;
dkato 5:49a61433290a 187 recCnt++;
dkato 5:49a61433290a 188 break;
dkato 5:49a61433290a 189 }
dkato 5:49a61433290a 190 }
dkato 5:49a61433290a 191 if( recCnt == frmCnt )
dkato 5:49a61433290a 192 {
dkato 5:49a61433290a 193 break ;//Maximum number is frmCnt
dkato 5:49a61433290a 194 }
dkato 5:49a61433290a 195 }
dkato 5:49a61433290a 196 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 197 // tmpConf
dkato 5:49a61433290a 198 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 199 tmpConf = 0;
dkato 5:49a61433290a 200 for( i = 0 ; i < recCnt ; i++)
dkato 5:49a61433290a 201 {
dkato 5:49a61433290a 202 tmpConf += recConf[ i ];
dkato 5:49a61433290a 203 }
dkato 5:49a61433290a 204 if( recCnt > 0 )
dkato 5:49a61433290a 205 {
dkato 5:49a61433290a 206 tmpConf /= recCnt;
dkato 5:49a61433290a 207 }else
dkato 5:49a61433290a 208 {
dkato 5:49a61433290a 209 tmpConf = 0 ;
dkato 5:49a61433290a 210 }
dkato 5:49a61433290a 211 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 212 //Create a cumulative frequency distribution of recUID and set it to accUID [accKind] accCnt [accKind].
dkato 5:49a61433290a 213 //AccCnt [i] pieces of data (in the past) determined to be "accUID [i]".
dkato 5:49a61433290a 214 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 215 accKind = 0;
dkato 5:49a61433290a 216 for(;;)
dkato 5:49a61433290a 217 {
dkato 5:49a61433290a 218 tmpUID = STB_FR_INVALID_UID;
dkato 5:49a61433290a 219 for( i = 0 ; i < recCnt ; i++)
dkato 5:49a61433290a 220 {
dkato 5:49a61433290a 221 if( recUID[ i ] != STB_FR_INVALID_UID )
dkato 5:49a61433290a 222 {
dkato 5:49a61433290a 223 tmpUID = recUID[ i ];
dkato 5:49a61433290a 224 break;
dkato 5:49a61433290a 225 }
dkato 5:49a61433290a 226 }
dkato 5:49a61433290a 227 if( tmpUID == STB_FR_INVALID_UID )
dkato 5:49a61433290a 228 {
dkato 5:49a61433290a 229 break;
dkato 5:49a61433290a 230 }
dkato 5:49a61433290a 231 tmpCnt = 0;
dkato 5:49a61433290a 232 for( i = 0 ; i < recCnt ; i++)
dkato 5:49a61433290a 233 {
dkato 5:49a61433290a 234 if( recUID[ i ] == tmpUID )
dkato 5:49a61433290a 235 {
dkato 5:49a61433290a 236 recUID[ i ] = STB_FR_INVALID_UID ;
dkato 5:49a61433290a 237 tmpCnt++;
dkato 5:49a61433290a 238 }
dkato 5:49a61433290a 239 }
dkato 5:49a61433290a 240 accUID[accKind] = tmpUID;
dkato 5:49a61433290a 241 accCnt[accKind] = tmpCnt;
dkato 5:49a61433290a 242 accKind++;
dkato 5:49a61433290a 243 }
dkato 5:49a61433290a 244 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 245 //Find the ID whose frequency is the maximum from the cumulative frequency distribution and set it to topUID.
dkato 5:49a61433290a 246 // -------------------------------------------------------------------------------------------------
dkato 5:49a61433290a 247 topUID = STB_FR_INVALID_UID ;
dkato 5:49a61433290a 248 topCnt = 0 ;
dkato 5:49a61433290a 249 for( i = 0 ; i < accKind ; i++)
dkato 5:49a61433290a 250 {
dkato 5:49a61433290a 251 if( topCnt < accCnt[i] )
dkato 5:49a61433290a 252 {
dkato 5:49a61433290a 253 topCnt = accCnt[i] ;
dkato 5:49a61433290a 254 topUID = accUID[i] ;
dkato 5:49a61433290a 255 }
dkato 5:49a61433290a 256 }
dkato 5:49a61433290a 257 if( topUID == STB_FR_INVALID_UID )
dkato 5:49a61433290a 258 {
dkato 5:49a61433290a 259 peRes->frFace[k].frRecog.value = STB_STATUS_NO_DATA ;
dkato 5:49a61433290a 260 peRes->frFace[k].frRecog.conf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 261 peRes->frFace[k].frRecog.status = STB_STATUS_NO_DATA;//during stabilization : a number of data for relevant people aren't enough(a number of frames that relevant people are taken)
dkato 5:49a61433290a 262 peRec[0].fcDet[k].frStatus = STB_STATUS_NO_DATA;
dkato 5:49a61433290a 263 }else
dkato 5:49a61433290a 264 {
dkato 5:49a61433290a 265 if( topCnt < frmCnt * frmRatio / 100 )
dkato 5:49a61433290a 266 {
dkato 5:49a61433290a 267 peRes->frFace[k].frRecog.value = topUID ;
dkato 5:49a61433290a 268 peRes->frFace[k].frRecog.conf = STB_CONF_NO_DATA ;
dkato 5:49a61433290a 269 peRes->frFace[k].frRecog.status = STB_STATUS_CALCULATING;//during stabilization : a number of data for relevant people aren't enough(a number of frames that relevant people are taken)
dkato 5:49a61433290a 270 peRec[0].fcDet[k].frStatus = STB_STATUS_CALCULATING;
dkato 5:49a61433290a 271 }else
dkato 5:49a61433290a 272 {
dkato 5:49a61433290a 273 peRes->frFace[k].frRecog.value = topUID ;
dkato 5:49a61433290a 274 peRes->frFace[k].frRecog.conf = tmpConf ;
dkato 5:49a61433290a 275 peRes->frFace[k].frRecog.status = STB_STATUS_COMPLETE ;//Just after stabilization : The state immediately after the number of data of the relevant person is sufficient and fixed. When creating an entry log, it is better to log data immediately after stabilization.
dkato 5:49a61433290a 276 peRec[0].fcDet[k].frDetID = topUID ;
dkato 5:49a61433290a 277 peRec[0].fcDet[k].frStatus = STB_STATUS_COMPLETE ;
dkato 5:49a61433290a 278 peRec[0].fcDet[k].frDetConf = tmpConf ;
dkato 5:49a61433290a 279 }
dkato 5:49a61433290a 280 }
dkato 5:49a61433290a 281 }else if ( preStatus == STB_STATUS_COMPLETE //Just after stabilization
dkato 5:49a61433290a 282 || preStatus == STB_STATUS_FIXED //already stabilized
dkato 5:49a61433290a 283 )
dkato 5:49a61433290a 284 {
dkato 5:49a61433290a 285 peRes->frFace[k].frRecog.value = preUID ;
dkato 5:49a61433290a 286 peRes->frFace[k].frRecog.status = STB_STATUS_FIXED ;
dkato 5:49a61433290a 287 peRes->frFace[k].frRecog.conf = preConf;
dkato 5:49a61433290a 288 peRec[0].fcDet[k].frDetID = preUID ;
dkato 5:49a61433290a 289 peRec[0].fcDet[k].frStatus = STB_STATUS_FIXED ;
dkato 5:49a61433290a 290 peRec[0].fcDet[k].frDetConf = preConf;
dkato 5:49a61433290a 291
dkato 5:49a61433290a 292 }
dkato 5:49a61433290a 293
dkato 5:49a61433290a 294
dkato 5:49a61433290a 295 }
dkato 5:49a61433290a 296 }
dkato 5:49a61433290a 297 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 298 // StbFrExec
dkato 5:49a61433290a 299 /*---------------------------------------------------------------------*/
dkato 5:49a61433290a 300 int StbFrExec ( FRHANDLE handle )
dkato 5:49a61433290a 301 {
dkato 5:49a61433290a 302
dkato 5:49a61433290a 303 int retVal = 0 ;
dkato 5:49a61433290a 304
dkato 5:49a61433290a 305 /* Face --------------------------------------*/
dkato 5:49a61433290a 306 FrSlideFacesRec ( handle->frDetRec );//Shift the time series of past data before stabilization.
dkato 5:49a61433290a 307 FrCurFaces ( handle->frDetRec ,
dkato 5:49a61433290a 308 &(handle->frDet) );//Setting "present data before the stabilization" to past data before the stabilization.
dkato 5:49a61433290a 309
dkato 5:49a61433290a 310 FrStbFaceEasy ( &(handle->frRes) ,
dkato 5:49a61433290a 311 handle->frDetRec ,
dkato 5:49a61433290a 312 handle->frFaceDirThr ,
dkato 5:49a61433290a 313 handle->frFaceDirUDMax ,
dkato 5:49a61433290a 314 handle->frFaceDirUDMin ,
dkato 5:49a61433290a 315 handle->frFaceDirLRMax ,
dkato 5:49a61433290a 316 handle->frFaceDirLRMin ,
dkato 5:49a61433290a 317 handle->frFrameCount ,
dkato 5:49a61433290a 318 handle->frFrameRatio );//Calculate "current data after stabilization" from "past data before stabilization".
dkato 5:49a61433290a 319
dkato 5:49a61433290a 320
dkato 5:49a61433290a 321
dkato 5:49a61433290a 322 return retVal;
dkato 5:49a61433290a 323 }
dkato 5:49a61433290a 324
dkato 5:49a61433290a 325
dkato 5:49a61433290a 326