Added CPU Optical Flow

This commit is contained in:
Howard Stark
2018-02-18 22:04:01 -08:00
parent 4a7a076d09
commit 892860e84e
3 changed files with 142 additions and 9 deletions

View File

@ -33,6 +33,17 @@ struct detector_gpu_t{
unsigned int *track_id;
};
#ifdef OPENCV
cv::Scalar obj_id_to_color(int obj_id)
{
int const colors[6][3] = { { 1,0,1 },{ 0,0,1 },{ 0,1,1 },{ 0,1,0 },{ 1,1,0 },{ 1,0,0 } };
int const offset = obj_id * 123457 % 6;
int const color_scale = 150 + (obj_id * 123457) % 100;
cv::Scalar color(colors[offset][0], colors[offset][1], colors[offset][2]);
color *= color_scale;
return color;
}
#endif
YOLODLL_API Detector::Detector(std::string cfg_filename, std::string weight_filename, int gpu_id) : cur_gpu_id(gpu_id)
{