#ifndef FACEID2_0_RGBDETECT_H #define FACEID2_0_RGBDETECT_H #include #include "THFeature_i.h" #include #include "BaseDetect.h" #include "FileUtil.h" #include "FiStdDefEx.h" //#include "THFaceLive_i.h" #include #include using namespace std; class RgbDetect : public BaseDetect { public: RgbDetect(const char* rgbFileName, int width, int height) { if (rgbFileName != nullptr) { RgbDetect::rgbFileName = rgbFileName; RgbDetect::width = width; RgbDetect::height = height; size_t fileSize = FileUtil::getFileSize(rgbFileName); if (RgbDetect::fileSize != fileSize) { RgbDetect::rgb_image_buffer = make_shared>(fileSize); RgbDetect::fileSize = fileSize; } if (RgbDetect::rgb_image_buffer == nullptr) { RgbDetect::rgb_image_buffer = make_shared>(fileSize); } if (RgbDetect::facePos == nullptr) { RgbDetect::facePos = make_shared>(5); } FILE *file = fopen(rgbFileName, "r+"); int bytes_read = fread(rgb_image_buffer.get()->data(), sizeof(unsigned char), fileSize, file); fclose(file); //FileUtil::readFile(rgbFileName, RgbDetect::rgb_image_buffer,fileSize); } } bool detect(int detectFaceCount) ; bool detect(int channel, int detectFaceCount) ; bool detect4(int channel, int detectFaceCount) ; static shared_ptr> rgb_image_buffer; static shared_ptr> facePos; static shared_ptr> rgb_image_buffer4; static shared_ptr> facePos4; static const char* rgbFileName; static int width; static int height; static long int fileSize; static int face_nums; static int face_nums4; }; #endif //FACEID2_0_RGBDETECT_H