#ifndef _SAMPLES_UTILITY_HPP_ #define _SAMPLES_UTILITY_HPP_ #include inline cv::Ptr createTrackerByName(cv::String name) { cv::Ptr tracker; if (name == "KCF") tracker = cv::TrackerKCF::create(); else if (name == "TLD") tracker = cv::TrackerTLD::create(); else if (name == "BOOSTING") tracker = cv::TrackerBoosting::create(); else if (name == "MEDIAN_FLOW") tracker = cv::TrackerMedianFlow::create(); else if (name == "MIL") tracker = cv::TrackerMIL::create(); else if (name == "GOTURN") tracker = cv::TrackerGOTURN::create(); else if (name == "MOSSE") tracker = cv::TrackerMOSSE::create(); else if (name == "CSRT") tracker = cv::TrackerCSRT::create(); else CV_Error(cv::Error::StsBadArg, "Invalid tracking algorithm name\n"); return tracker; } #endif