| | |
| | | #endif |
| | | |
| | | // To use tracking - uncomment the following line. Tracking is supported only by OpenCV 3.x |
| | | #define TRACK_OPTFLOW |
| | | //#define TRACK_OPTFLOW |
| | | |
| | | #include "yolo_v2_class.hpp" // imported functions from DLL |
| | | |
| | |
| | | #include "opencv2/videoio/videoio.hpp" |
| | | #define OPENCV_VERSION CVAUX_STR(CV_VERSION_MAJOR)""CVAUX_STR(CV_VERSION_MINOR)""CVAUX_STR(CV_VERSION_REVISION) |
| | | #pragma comment(lib, "opencv_world" OPENCV_VERSION ".lib") |
| | | #ifdef TRACK_OPTFLOW |
| | | #pragma comment(lib, "opencv_cudaoptflow" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_cudaimgproc" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_core" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_imgproc" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_highgui" OPENCV_VERSION ".lib") |
| | | #endif // TRACK_OPTFLOW |
| | | #else |
| | | #define OPENCV_VERSION CVAUX_STR(CV_VERSION_EPOCH)""CVAUX_STR(CV_VERSION_MAJOR)""CVAUX_STR(CV_VERSION_MINOR) |
| | | #pragma comment(lib, "opencv_core" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_imgproc" OPENCV_VERSION ".lib") |
| | | #pragma comment(lib, "opencv_highgui" OPENCV_VERSION ".lib") |
| | | #endif |
| | | #endif // CV_VERSION_EPOCH |
| | | |
| | | class track_kalman { |
| | | public: |
| | |
| | | auto current_image = det_image; |
| | | consumed = true; |
| | | while (current_image.use_count() > 0) { |
| | | auto result = detector.detect_resized(*current_image, frame_size, thresh, false); // true |
| | | auto result = detector.detect_resized(*current_image, frame_size.width, frame_size.height, |
| | | thresh, false); // true |
| | | ++fps_det_counter; |
| | | std::unique_lock<std::mutex> lock(mtx); |
| | | thread_result_vec = result; |