網站首頁 編程語言 正文
ByteTrack的卡爾曼濾波使用什么樣的邊框坐標信息
flyfish
如果想直接看結果,可以直接看文章末尾。
8維的狀態空間,前4維表邊框坐標信息,那么這個邊框坐標信息是什么樣子的
邊框又叫邊界框、bounding box。通常是目標檢測中一個矩形框包含了目標在哪里的信息。
整個分析過程都在STrack類和BYTETracker類中
首先看一個坐標的賦值
在 std::vector BYTETracker::update(const std::vector& objects)成員函數中
std::vector tlbr_;
tlbr_.resize(4);
tlbr_[0] = objects[i].box.x;
tlbr_[1] = objects[i].box.y;
tlbr_[2] = objects[i].box.x + objects[i].box.width;
tlbr_[3] = objects[i].box.y + objects[i].box.height;
float score = objects[i].score;
STrack strack(STrack::tlbr_to_tlwh(tlbr_), score);
tlbr_在構建的使用的坐標信息是
0 left
1 top
2 right
3 bottom
std::vector STrack::tlbr_to_tlwh( std::vector &tlbr)
{
tlbr[2] -= tlbr[0];
tlbr[3] -= tlbr[1];
return tlbr;
}
STrack在構建的使用的坐標信息
0 left
1 top
2 width
3 height
STrack的構造函數
STrack::STrack( std::vector tlwh_, float score)
{
_tlwh.resize(4);
_tlwh.assign(tlwh_.begin(), tlwh_.end());
is_activated = false;
track_id = 0;
state = TrackState::New;
tlwh.resize(4);
tlbr.resize(4);
static_tlwh();
static_tlbr();
frame_id = 0;
tracklet_len = 0;
this->score = score;
start_frame = 0;
}
構造函數調用了
static_tlwh();
static_tlbr();
void STrack::static_tlwh()
{
if (this->state == TrackState::New)
{
tlwh[0] = _tlwh[0];
tlwh[1] = _tlwh[1];
tlwh[2] = _tlwh[2];
tlwh[3] = _tlwh[3];
return;
}
tlwh[0] = mean[0];
tlwh[1] = mean[1];
tlwh[2] = mean[2];
tlwh[3] = mean[3];
tlwh[2] *= tlwh[3];
tlwh[0] -= tlwh[2] / 2;
tlwh[1] -= tlwh[3] / 2;
}
void STrack::static_tlbr()
{
tlbr.clear();
tlbr.assign(tlwh.begin(), tlwh.end());
tlbr[2] += tlbr[0];
tlbr[3] += tlbr[1];
}
STrack類有兩個成員變量
std::vector tlwh;
std::vector tlbr;
邊框坐標信息1
tlbr
0 left
1 top
2 width
3 height
邊框坐標信息2
tlwh
0 left
1 top
2 width
3 height
卡爾曼濾波使用的邊框坐標信息
void STrack::activate(byte_kalman::KalmanFilter &kalman_filter, int frame_id)
{
this->kalman_filter = kalman_filter;
this->track_id = this->next_id();
std::vector _tlwh_tmp(4);
_tlwh_tmp[0] = this->_tlwh[0];
_tlwh_tmp[1] = this->_tlwh[1];
_tlwh_tmp[2] = this->_tlwh[2];
_tlwh_tmp[3] = this->_tlwh[3];
std::vector xyah = tlwh_to_xyah(_tlwh_tmp);
DETECTBOX xyah_box;
xyah_box[0] = xyah[0];
xyah_box[1] = xyah[1];
xyah_box[2] = xyah[2];
xyah_box[3] = xyah[3];
auto mc = this->kalman_filter.initiate(xyah_box);
this->mean = mc.first;
this->covariance = mc.second;
static_tlwh();
static_tlbr();
this->tracklet_len = 0;
this->state = TrackState::Tracked;
if (frame_id == 1)
{
this->is_activated = true;
}
//this->is_activated = true;
this->frame_id = frame_id;
this->start_frame = frame_id;
}
最終定位到STrack類的tlwh_to_xyah函數
std::vector STrack::tlwh_to_xyah( std::vector tlwh_tmp)
{
std::vector tlwh_output = tlwh_tmp;
tlwh_output[0] += tlwh_output[2] / 2;
tlwh_output[1] += tlwh_output[3] / 2;
tlwh_output[2] /= tlwh_output[3];
return tlwh_output;
}
通過該成員函數得知ByteTrack的卡爾曼濾波使用的邊框坐標信息是
0 邊框中心點 left
1 邊框中心點 top
2 邊框的寬高比 或者說 縱橫比、width/height
3 邊框的高度
總結
tlbr 邊框坐標信息1
0 left
1 top
2 width
3 height
tlwh 邊框坐標信息2
0 left
1 top
2 width
3 height
xyah 邊框坐標信息3
即卡爾曼濾波使用的邊框坐標信息
0 邊框中心點 left
1 邊框中心點 top
2 邊框的寬高比 或者說 縱橫比、width/height
3 邊框的高度
原文鏈接:https://blog.csdn.net/flyfish1986/article/details/123913938
- 上一篇:C++ 使用ffmpeg實現rtsp取流
- 下一篇:eigen交叉編譯
相關推薦
- 2022-10-26 C++賦值函數+移動賦值函數+移動構造函數詳解_C 語言
- 2022-01-30 使用ref手動改變antd的搜索框Input.Search的搜索內容
- 2022-11-05 Nginx反向代理location和proxy_pass配置規則詳細總結_nginx
- 2023-03-20 C#實現簡單的文件加密與解密方式_C#教程
- 2022-04-04 vscode中將.art文件與html文件相關聯
- 2024-02-28 UNI-APP中,swiper和tabbar結合實現滑動翻頁效果
- 2021-12-01 Android之小球自由碰撞動畫示例_Android
- 2022-05-26 python中的getter與setter你了解嗎_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支