123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- #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;
- typedef struct Size3D{
- Size3D()
- {
- }
- Size3D(float w, float h, float l)
- :
- width(w),
- height(h),
- length(l)
- {
- }
- float length;
- float width;
- float height;
- } Size3D;
- typedef struct Rect3D{
- Rect3D()
- {
- }
- Rect3D(cv::Point3f c, Size3D s, float y)
- :
- center(c),
- size(s),
- yaw(y)
- {
- }
- cv::Point3f center;
- Size3D size;
- float yaw;
- } Rect3D;
- ///
- /// \brief config_t
- ///
- typedef std::multimap<std::string, std::string> config_t;
- ///
- /// \brief The CRegion class
- ///
- class CRegion
- {
- public:
- CRegion()
- : m_type(-1), m_type_name(""), m_confidence(-1)
- {
- }
- CRegion(const Rect3D& rect, const int& type, float confidence)
- : m_rect(rect), m_type(type), m_confidence(confidence)
- {
- RBRect();
- }
- CRegion(const Rect3D& rect, const std::string& type, float confidence)
- : m_rect(rect), m_type_name(type), m_confidence(confidence)
- {
- RBRect();
- }
- Rect3D m_rect;
- cv::RotatedRect m_rrect;
- cv::Rect m_brect;
- int m_type = -1;
- std::string m_type_name = "";
- float m_confidence = -1;
- private:
- ///
- /// \brief B2RRect
- /// \return
- ///
- cv::RotatedRect RBRect()
- {
- m_rrect = cv::RotatedRect(Point_t(m_rect.center.x,m_rect.center.y), cv::Size(m_rect.size.width,m_rect.size.height), 0);
- m_brect = cv::Rect(m_rect.center.x-m_rect.size.width/2,m_rect.center.y-m_rect.size.height/2, m_rect.size.width,m_rect.size.height);
- return m_rrect;
- }
- };
- typedef std::vector<CRegion> regions_t;
- ///
- ///
- ///
- namespace tracking
- {
- ///
- /// \brief The DistType enum
- ///
- enum DistType
- {
- DistCenters, // Euclidean distance between centers, pixels
- DistRects, // Euclidean distance between bounding rectangles, pixels
- DistRect3Ds, // Euclidean distance between bounding rectangles, pixels
- DistsCount
- };
- ///
- /// \brief The FilterGoal enum
- ///
- enum FilterGoal
- {
- FilterCenter, // x,y
- FilterRect, // x,y,w,h
- FilterRect3D // x,y,z,w,h,l,yaw
- };
- ///
- /// \brief The KalmanType enum
- ///
- enum KalmanType
- {
- KalmanLinear
- };
- ///
- /// \brief The MatchType enum
- ///
- enum MatchType
- {
- MatchHungrian
- };
- ///
- /// \brief The LostTrackType enum
- ///
- enum LostTrackType
- {
- TrackNone
- };
- }
|