add drawSpecificTargetsInFrame and findClosestTargetID function,add confs dictionary to repository

This commit is contained in:
Eason Yi
2024-05-31 10:44:36 +08:00
committed by 王世豪
parent 34367b5e0f
commit 2bd20331d5
23 changed files with 2292 additions and 12 deletions

View File

@@ -800,6 +800,8 @@ void SingleObjectTrackerBase::init(cv::Mat img_, const cv::Rect& bounding_box_)
}
void SingleObjectTrackerBase::track(cv::Mat img_, TargetsInFrame& tgts_)
{
Rect rect;
bool ok = trackImpl(img_, rect);
@@ -809,6 +811,10 @@ void SingleObjectTrackerBase::track(cv::Mat img_, TargetsInFrame& tgts_)
tgts_.setFPS(1000.0 / std::chrono::duration_cast<std::chrono::milliseconds>(t1 - this->_t0).count());
this->_t0 = std::chrono::system_clock::now();
tgts_.setTimeNow();
double z = 0;
double x = 0;
double y = 0;
if (ok)
{
@@ -818,6 +824,10 @@ void SingleObjectTrackerBase::track(cv::Mat img_, TargetsInFrame& tgts_)
tgt.setLOS(tgt.cx, tgt.cy, this->camera_matrix, img_.cols, img_.rows);
int ow = int(round(rect.width));
int oh = int(round(rect.height));
if (this->_use_width_or_height == 0)
{
double z = this->camera_matrix.at<double>(0, 0) * this->_object_ws / ow;
@@ -1199,14 +1209,5 @@ void CommonObjectDetectorBase::_load()
}