void Counter::setup(const StringMap & settings) { std::vector<std::string> coordinates; // Set incoming coordinates helper::tokenize(settings.at("heuristics.Counter.markers"), coordinates, "|"); for(int i = 0; i < 2; i++) { std::vector<std::string> fromAndTo; helper::tokenize(coordinates[i], fromAndTo, ","); int from = std::atoi(fromAndTo[0].c_str()); int to = std::atoi(fromAndTo[1].c_str()); cv::Point p(from ,to); m_in.push_back(p); } // Set outgoing coordinates for(int i = 2; i < 4; i++) { std::vector<std::string> fromAndTo; helper::tokenize(coordinates[i], fromAndTo, ","); int from = std::atoi(fromAndTo[0].c_str()); int to = std::atoi(fromAndTo[1].c_str()); cv::Point p(from ,to); m_out.push_back(p); } setMinimumChanges(std::atoi(settings.at("heuristics.Counter.minimumChanges").c_str())); setNoMotionDelayTime(std::atoi(settings.at("heuristics.Counter.noMotionDelayTime").c_str())); setAppearance(std::atoi(settings.at("heuristics.Counter.appearance").c_str())); setMaxDistance(std::atoi(settings.at("heuristics.Counter.maxDistance").c_str())); setMinArea(std::atoi(settings.at("heuristics.Counter.minArea").c_str())); setOnlyTrueWhenCounted((settings.at("heuristics.Counter.onlyTrueWhenCounted") == "true")); }
ArmContourFinder::ArmContourFinder() { // Find from the bounding boxes bounds.push_back(22); bounds.push_back(42); bounds.push_back(601); bounds.push_back(438); setMinArea(50); MIN_HAND_SIZE = 56; MAX_HAND_SIZE = 75; MAX_WRIST_WIDTH = 33; MIN_WRIST_WIDTH = 15; smoothingRate = 0.5; }