Commit 6a733931 authored by oscar's avatar oscar

提交修改

parent 2c1d0c39
......@@ -29,7 +29,7 @@ public:
void SetValidUpdateCount(int count){ m_updateValidCount = count; }
void SetValues(std::vector<float>& values) { m_values = values; }
int Run(const std::vector<std::vector<float> >& detections,std::vector<uint64_t>& detectionsId,std::map<uint64_t,int>& updateId,std::vector<uint64_t>& lostId);
int Run(const std::vector<std::vector<float> >& detections,int _no/*观测数量*/,int _ns/*状态数量*/,std::vector<uint64_t>& detectionsId,std::map<uint64_t,int>& updateId,std::vector<uint64_t>& lostId);
std::map<uint64_t, std::shared_ptr<T> > GetStates();
......@@ -53,7 +53,7 @@ public:
template<class T>
int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std::vector<uint64_t>& detectionsId, std::map<uint64_t, int>& updateId, std::vector<uint64_t>& lostId)
int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, int _no/*观测数量*/, int _ns/*状态数量*/, std::vector<uint64_t>& detectionsId, std::map<uint64_t, int>& updateId, std::vector<uint64_t>& lostId)
{
/*** Predict internal tracks from previous frame ***/
for (auto& track : m_tracker)
......@@ -74,7 +74,7 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
std::vector<int> unmatched_det;
// return values - matched, unmatched_det
AssociateDetectionsToTrackers(detections, m_tracker, matched, unmatched_det);
AssociateDetectionsToTrackers(detections,_no,_ns, m_tracker, matched, unmatched_det);
/*** Update tracks with associated bbox ***/
if (m_isGPU == 0)
......@@ -93,7 +93,7 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
if (bs > 0)
{
int ns = 0;
int no = detections.size() > 0 ? detections[0].size() : 0;
int no = _no;
std::shared_ptr<float> Z = std::shared_ptr<float>(new float[bs * no], [](float* p) {if (p) delete[] p; p = nullptr; });
std::shared_ptr<float*> X = std::shared_ptr<float*>(new float* [bs], [](float** p) {if (p) delete[] p; p = nullptr; });
std::shared_ptr<float*> P = std::shared_ptr<float*>(new float* [bs], [](float** p) {if (p) delete[] p; p = nullptr; });
......@@ -185,7 +185,7 @@ std::map<uint64_t, std::shared_ptr<T> > BaseTracker<T>::GetStates()
}
template<class T>
void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector<float> >& detections, std::map<uint64_t, std::shared_ptr<T> >& tracks, std::map<uint64_t, int>& matched, std::vector<int>& unmatched_det)
void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector<float> >& detections, int _no/*观测数量*/, int _ns/*状态数量*/, std::map<uint64_t, std::shared_ptr<T> >& tracks, std::map<uint64_t, int>& matched, std::vector<int>& unmatched_det)
{
if (tracks.empty())
{
......@@ -255,7 +255,7 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
iter.second->GetIouDataOrder(iouOrder);
}
}
int measure_size = detections.size() > 0 ? detections[0].size() : 0;
int measure_size = _no;
int tra_size = tracker_states.size() > 0 ? tracker_states[0].size() : 0;
if (measure_size == 0 || measure_size != tra_size)
return;
......
......@@ -300,6 +300,7 @@ void TrackingRos::ThreadTrackingProcess()
{
jfx_common_msgs::det_tracking& obj = objsPtr->array[i];
std::vector<float> data;
data.push_back(obj.type);
data.push_back(obj.x);//x对应经度
data.push_back(obj.y);//y对应纬度
data.push_back(obj.z);
......@@ -314,7 +315,7 @@ void TrackingRos::ThreadTrackingProcess()
std::vector<uint64_t> lostId;
uint64_t begin = GetCurTime();
m_tracker.Run(input, detectionsId, updateId, lostId);
m_tracker.Run(input,7,10, detectionsId, updateId, lostId);
uint64_t rTime = GetCurTime() - begin;
//SDK_LOG(SDK_INFO, "m_tracker.Run time = %llu", rTime);
std::map<uint64_t, std::shared_ptr<Track3D> > trackers = m_tracker.GetStates();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment