#include "LivenessDetect.h" #include "FiStdDefEx.h" //#include "THFaceLive_i.h" #include "RgbDetect.h" #include "GrayDetect.h" #include "LogUtil.h" bool LivenessDetect::detect(int faceIndex) { bool success = false; try { if (GrayDetect::grayImageBuff != nullptr && GrayDetect::grayImageBuff.get() != nullptr && GrayDetect::grayImageBuff.get()->data() != nullptr) { unsigned char* pBuf_color = RgbDetect::rgb_image_buffer.get()->data(); unsigned char* pBuf_bw = GrayDetect::grayImageBuff.get()->data(); THFI_FacePos* ptfp_color = &RgbDetect::facePos.get()->at(faceIndex); THFI_FacePos* ptfp_bw = &GrayDetect::facePos.get()->at(faceIndex); int liveness = 0; // THFL_Detect(0, RgbDetect::rgb_image_buffer.get()->data(), // GrayDetect::grayImageBuff.get()->data(), // RgbDetect::width, RgbDetect::height, // &RgbDetect::facePos.get()->at(faceIndex), &GrayDetect::facePos.get()->at(faceIndex),20); this->liveness = liveness; if(liveness == 1) { success = true; } } }catch (exception & e) { LogUtil::log(e.what()); } return success; }