Commit 10b7e4f1 authored by oscar's avatar oscar

修改high和low的逻辑

parent f0e955da
......@@ -318,7 +318,9 @@ void TrackingRos::Init(ros::NodeHandle& nh)
SDK_LOG(SDK_INFO, "front_camera_len = %d", m_front_camera_len);
nh.param<int32_t>("send_camera_image", m_send_camera_image, 0);
SDK_LOG(SDK_INFO, "send_camera_image = %d", m_send_camera_image);
nh.param<float>("high_low_score", m_high_low_score, 0.5);
SDK_LOG(SDK_INFO, "high_low_score = %f", m_high_low_score);
YAML::Node config = YAML::LoadFile(file.c_str());
auto cfg = config["TRACKING"];
......@@ -438,6 +440,9 @@ void TrackingRos::TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs)
}
else
continue;
obj.score += m_high_low_score;
if (obj.score > 1.0f)
obj.score = 1.0f;
if (_GET_VALID_VALUE((unsigned char)0, m_recvMsgBit))
{
//SDK_LOG(SDK_INFO, "send cloud obj x = %f, y = %f",obj.x,obj.y);
......@@ -756,7 +761,10 @@ void TrackingRos::ThreadTrackingProcess()
#endif
m_frameNum++;
//SDK_LOG(SDK_INFO, "get objs size = %d,m_frameNum = %d",objsPtr->array.size(), m_frameNum);
std::vector< std::vector<float> > input;
std::vector< std::vector<float> > inputH;
std::vector< std::vector<float> > inputL;
std::vector<int> indexH;
std::vector<int> indexL;
for (int i = 0; i < objsPtr->array.size(); i++)
{
jfx_common_msgs::det_tracking& obj = objsPtr->array[i];
......@@ -769,17 +777,28 @@ void TrackingRos::ThreadTrackingProcess()
data.push_back(obj.l);
data.push_back(obj.w);
data.push_back(obj.h);
input.emplace_back(data);
if (obj.score < m_high_low_score)
{
inputL.emplace_back(data);
indexL.emplace_back(i);
}
else
{
inputH.emplace_back(data);
indexH.emplace_back(i);
}
}
std::vector<uint64_t> detectionsId;
std::map<uint64_t, int> updateId;
//std::vector<uint64_t> detectionsId;
std::map<uint64_t, int> updateHId;
std::map<uint64_t, int> updateLId;
std::vector<uint64_t> lostId;
uint64_t begin = GetCurTime();
#ifdef _USING_NSIGHT_
nvtxRangePush("m_tracker.Run");
#endif
m_tracker.Run(input,7,10, detectionsId, updateId, lostId);
//m_tracker.Run(input,7,10, detectionsId, updateId, lostId);
m_tracker.Run(inputH,inputL, 7, 10, updateHId, updateLId, lostId);
#ifdef _USING_NSIGHT_
nvtxRangePop();
#endif
......@@ -814,9 +833,12 @@ void TrackingRos::ThreadTrackingProcess()
jfx_common_msgs::det_tracking input_obj = {};
int last_type = -1;
int is_need_send = 0;//是否需要发送
if (updateId.find(iter.first) != updateId.end())
if (updateHId.find(iter.first) != updateHId.end() || updateLId.find(iter.first) != updateLId.end())
{
obj = objsPtr->array[updateId[iter.first]];
if(updateHId.find(iter.first) != updateHId.end())
obj = objsPtr->array[indexH[updateHId[iter.first]]];
if(updateLId.find(iter.first) != updateLId.end())
obj = objsPtr->array[indexL[updateLId[iter.first]]];
input_obj = obj;
obj.obj_id = iter.first;
std::vector<float> data;
......
......@@ -73,6 +73,7 @@ public:
int m_right_left_camera_y_len = 7;//左右相机的过滤宽度米数
int m_front_camera_len = 0;//-前相机过滤的距离米数,0是不过滤,70就是过滤70米,但不过滤行人和机动车
int m_send_camera_image = 0;//是否发送相机图像,0是不发送,1是发送
float m_high_low_score = 0.5f;//high和low划分的置信度数值
void TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs);
......
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