Commit d406feb4 authored by oscar's avatar oscar

提交代码

parent e775831d
......@@ -159,13 +159,30 @@ void BaseTracker<T>::AssociateDetectionsToTrackers(const std::vector<std::vector
tracker_states.emplace_back(measure);
}
}
int detect_size = detections.size() * (detections.size() > 0 ? detections[0].size() : 0);
int tracker_size = tracker_states.size() * (tracker_states.size() > 0 ? tracker_states[0].size() : 0);
int measure_size = detections.size() > 0 ? detections[0].size() : 0;
int tra_size = tracker_states.size() > 0 ? tracker_states[0].size() : 0;
if (measure_size == 0 || measure_size != tra_size)
return;
int detect_size = detections.size() * measure_size;
int tracker_size = tracker_states.size() * tra_size;
int iou_size = detections.size() * tracker_states.size();
std::shared_ptr<float> detect_ptr = std::shared_ptr<float>(new float[detect_size], [](float* p) {if (p) delete[] p; p = nullptr; });
std::shared_ptr<float> tracker_ptr = std::shared_ptr<float>(new float[tracker_size], [](float* p) {if (p) delete[] p; p = nullptr; });
std::shared_ptr<float> iou_ptr = std::shared_ptr<float>(new float[iou_size], [](float* p) {if (p) delete[] p; p = nullptr; });
for (int i = 0; i < detections.size(); i++)
{
for (int j = 0; j < measure_size; j++)
{
detect_ptr.get()[i * measure_size + j] = detections[i][j];
}
}
for (int i = 0; i < tracker_states.size(); i++)
{
for (int j = 0; j < tra_size; j++)
{
tracker_ptr.get()[i * tra_size + j] = tracker_states[i][j];
}
}
////bev_overlap(detections.size(), detect_ptr.get(), tracker_states.size(), tracker_ptr.get(), iou_ptr.get());
for(int i = 0; i < detections.size(); i++)
for (int j = 0; j < tracker_states.size(); j++)
......
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