| | |
| | | extern "C"{ |
| | | #endif |
| | | |
| | | #include <stdio.h> |
| | | #include "cface.h" |
| | | |
| | | #ifdef __cplusplus |
| | |
| | | return s->track(&img, chan, fInfo, fcnt); |
| | | } |
| | | |
| | | int resize(void *handle, const int w, const int h, const int chan){ |
| | | int track_resize(void *handle, const int w, const int h, const int chan){ |
| | | sdkface *s = (sdkface*)handle; |
| | | return s->resize(w, h, chan); |
| | | printf("call cpp function\n"); |
| | | return s->track_resize(w, h, chan); |
| | | } |
| | |
| | | int propertize(void *handle, const cFacePos *pos, const void *data, const int w, const int h, const int c, const int chan, void **res); |
| | | |
| | | int track(void *handle, const void *data, const int w, const int h, const int c, const int chan, void **fInfo, int *fcnt); |
| | | int resize(void *handle, const int w, const int h, const int chan); |
| | | int track_resize(void *handle, const int w, const int h, const int chan); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | param.nSampleSize = sample_size > 0 ? sample_size : width/2; |
| | | param.nDetectionIntervalFrame = interval; |
| | | |
| | | printf("start threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n", |
| | | printf("##########start threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n", |
| | | threads_max, gpu, width, height, max_faces, sample_size, interval); |
| | | |
| | | auto nNum = THFT_Create(threads_max, ¶m); |
| | |
| | | dtors_.emplace_back([]{THFT_Release();}); |
| | | } |
| | | |
| | | printf("end threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n", |
| | | printf("##########end threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n", |
| | | threads_max, gpu, width, height, max_faces, sample_size, interval); |
| | | |
| | | return nNum; |
| | |
| | | return nNum; |
| | | } |
| | | |
| | | int sdkface::resize(const int w, const int h, const int chan){ |
| | | int sdkface::track_resize(const int w, const int h, const int chan){ |
| | | THFT_Param tmpParam; |
| | | tmpParam.nDeviceID = param.nDeviceID; |
| | | tmpParam.nImageWidth = w; |
| | |
| | | tmpParam.nSampleSize = param.nSampleSize; |
| | | tmpParam.nDetectionIntervalFrame = param.nDetectionIntervalFrame; |
| | | |
| | | auto flag = THFT_Reset(chan, &tmpParam); |
| | | printf("sdkface:: resize ret %d, chan %d size: %dx%d\n", flag, chan, w, h); |
| | | printf("##########resize track\n"); |
| | | |
| | | return flag; |
| | | return THFT_Reset(chan, &tmpParam); |
| | | } |
| | | |
| | | } // namespace cppface |
| | |
| | | int propertize(const cFacePos &pos, const cIMAGE *img, const int chan, void **res); |
| | | |
| | | int track(const cIMAGE *img, const int chan, void **fInfo, int *fcnt); |
| | | int resize(const int w, const int h, const int chan); |
| | | int track_resize(const int w, const int h, const int chan); |
| | | private: |
| | | VecFunc dtors_; |
| | | |
| | |
| | | s.printLog("->face--> TrackerResize Failed, No Tracker Init") |
| | | return false |
| | | } |
| | | ret := C.resize(s.handle, C.int(w), C.int(h), C.int(ch)) |
| | | ret := C.track_resize(s.handle, C.int(w), C.int(h), C.int(ch)) |
| | | if ret == 1 { |
| | | return true |
| | | } |