#pragma once #include "Eigen/Dense" namespace ByteTrackNCNN { template using Tlwh = Eigen::Matrix; template using Tlbr = Eigen::Matrix; template using Xyah = Eigen::Matrix; template class Rect { public: Tlwh tlwh; Rect() = default; Rect(const T &x, const T &y, const T &width, const T &height); ~Rect(); const T &x() const; const T &y() const; const T &width() const; const T &height() const; T &x(); T &y(); T &width(); T &height(); const T &tl_x() const; const T &tl_y() const; T br_x() const; T br_y() const; Tlbr getTlbr() const; Xyah getXyah() const; float calcIoU(const Rect& other) const; }; template Rect generate_rect_by_tlbr(const Tlbr& tlbr); template Rect generate_rect_by_xyah(const Xyah& xyah); }