Exemple #1
0
    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"));
    }
 void Sequence::setup(const StringMap & settings)
 {
     setMinimumChanges(std::atoi(settings.at("heuristics.Sequence.minimumChanges").c_str()));
     setSequenceDuration(std::atoi(settings.at("heuristics.Sequence.minimumDuration").c_str()));
     setNoMotionDelayTime(std::atoi(settings.at("heuristics.Sequence.noMotionDelayTime").c_str()));
 }