123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- #pragma once
- #include <vector>
- #include <string>
- #include <map>
- #include <opencv2/opencv.hpp>
- // ---------------------------------------------------------------------------
- //
- // ---------------------------------------------------------------------------
- typedef float track_t;
- typedef cv::Point_<track_t> Point_t;
- #define El_t CV_32F
- #define Mat_t CV_32FC
- typedef std::vector<int> assignments_t;
- typedef std::vector<track_t> distMatrix_t;
- ///
- /// \brief config_t
- ///
- typedef std::multimap<std::string, std::string> config_t;
- ///
- /// \brief The CRegion class
- ///
- class CRegion
- {
- public:
- CRegion()
- : m_type(""), m_confidence(-1)
- {
- }
- CRegion(const cv::Rect& rect)
- : m_brect(rect)
- {
- B2RRect();
- }
- CRegion(const cv::RotatedRect& rrect)
- : m_rrect(rrect)
- {
- R2BRect();
- }
- CRegion(const cv::Rect& rect, const std::string& type, float confidence)
- : m_brect(rect), m_type(type), m_confidence(confidence)
- {
- B2RRect();
- }
- CRegion(const cv::RotatedRect& rrect, const std::string& type, float confidence)
- : m_rrect(rrect), m_type(type), m_confidence(confidence)
- {
- R2BRect();
- }
- cv::RotatedRect m_rrect;
- cv::Rect m_brect;
- std::string m_type;
- float m_confidence = -1;
- mutable cv::Mat m_hist;
- private:
- ///
- /// \brief R2BRect
- /// \return
- ///
- cv::Rect R2BRect()
- {
- m_brect = m_rrect.boundingRect();
- return m_brect;
- }
- ///
- /// \brief B2RRect
- /// \return
- ///
- cv::RotatedRect B2RRect()
- {
- m_rrect = cv::RotatedRect(m_brect.tl(), cv::Point2f(static_cast<float>(m_brect.x + m_brect.width), static_cast<float>(m_brect.y)), m_brect.br());
- return m_rrect;
- }
- };
- typedef std::vector<CRegion> regions_t;
- ///
- ///
- ///
- namespace tracking
- {
- ///
- /// \brief The Detectors enum
- ///
- enum Detectors
- {
- Motion_VIBE,
- Motion_MOG,
- Motion_GMG,
- Motion_CNT,
- Motion_SuBSENSE,
- Motion_LOBSTER,
- Motion_MOG2,
- Face_HAAR,
- Pedestrian_HOG,
- Pedestrian_C4,
- SSD_MobileNet,
- Yolo_OCV,
- Yolo_Darknet,
- Yolo_TensorRT
- };
- ///
- /// \brief The DistType enum
- ///
- enum DistType
- {
- DistCenters, // Euclidean distance between centers, pixels
- DistRects, // Euclidean distance between bounding rectangles, pixels
- DistJaccard, // Intersection over Union, IoU, [0, 1]
- DistHist, // Bhatacharia distance between histograms, [0, 1]
- DistsCount
- };
- ///
- /// \brief The FilterGoal enum
- ///
- enum FilterGoal
- {
- FilterCenter,
- FilterRect
- };
- ///
- /// \brief The KalmanType enum
- ///
- enum KalmanType
- {
- KalmanLinear,
- KalmanUnscented,
- KalmanAugmentedUnscented
- };
- ///
- /// \brief The MatchType enum
- ///
- enum MatchType
- {
- MatchHungrian/*,
- //MatchBipart*/
- };
- ///
- /// \brief The LostTrackType enum
- ///
- enum LostTrackType
- {
- TrackNone,
- TrackKCF,
- TrackMIL,
- TrackMedianFlow,
- TrackGOTURN,
- TrackMOSSE,
- TrackCSRT/*,
- TrackDAT,
- TrackSTAPLE,
- TrackLDES*/
- };
- }
|