Commit fe578b1f authored by oscar's avatar oscar

提交代码

parent accae224
......@@ -46,12 +46,13 @@ Track2D::Track2D():BaseTrack(8, 4)
}
float Track2D::CalculateIou(std::vector<float>& data)
float Track2D::CalculateIou(const std::vector<float>& data)
{
//auto trk = track->GetStateAsBbox();
//// get min/max points
//auto xx1 = std::max(det.tl().x, trk.tl().x);
//auto yy1 = std::max(det.tl().y, trk.tl().y);
std::vector<float> states;
GetStateData(states);
//auto xx1 = std::max(states[0], data[0]);
//auto yy1 = std::max(states[1], data[1]);
//auto xx2 = std::min(det.br().x, trk.br().x);
//auto yy2 = std::min(det.br().y, trk.br().y);
//auto w = std::max(0, xx2 - xx1);
......
......@@ -11,5 +11,5 @@ public:
Track2D();
~Track2D() {}
virtual float CalculateIou(std::vector<float>& data);
virtual float CalculateIou(const std::vector<float>& data);
};
......@@ -64,8 +64,8 @@ double Track3D::CalculateIou(const std::vector<float>& data)
std::vector<float> states;
GetStateData(states);
std::vector<float> truth_poses{ states[0], states[1], states[2],0, 0, states[6], states[3], states[4], states[5] };
std::vector<float> landmark_poses{ data[0], data[1], data[2],0, 0, data[6], data[3], data[4], data[5] };
std::vector<float> truth_poses{ states[0], states[1], states[2],0, 0, states[6], states[3]/2, states[4]/2, states[5]/2 };
std::vector<float> landmark_poses{ data[0], data[1], data[2],0, 0, data[6], data[3]/2, data[4]/2, data[5]/2 };
double iou_3d = CuboidIoU(truth_poses, landmark_poses);
return iou_3d;
}
......@@ -29,6 +29,8 @@ void TrackingRos::TrackingCallBackFunc(const jfx_common_msgs::det_tracking_array
objTrackListPtr objsPtr = std::make_shared<jfx_common_msgs::det_tracking_array>();
objsPtr->array = msg->array;
objsPtr->cloud = msg->cloud;
SDK_LOG(SDK_INFO, "recv msg size = %d",msg->array.size());
//for (auto& item : msg->array)
//{
// objTrackPtr obj = std::make_shared<objTrack>();
......
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