Commit 9c76e6d4 authored by oscar's avatar oscar

修改补偿逻辑

parent 12f65d27
......@@ -132,18 +132,23 @@ void Track3D::Predict()
m_points.push_back(pos);
//根据上上次的时间戳与上一次的时间戳的间隔来调整预测的数据
uint64_t interval = 100;
if (m_obj && m_lastLastTimestamp != 0 && m_obj->frame > m_lastLastTimestamp)
if (m_obj && m_lastLastTimestamp != 0 && m_obj->frame != m_lastLastTimestamp)
interval = m_obj->frame - m_lastLastTimestamp;
if(m_obj)
m_lastLastTimestamp = m_obj->frame;
float v_rate = (float)interval / 100;
float v_rate = (double)interval / 100;
if (v_rate > 1.5 || v_rate < 0.5)
{
SDK_LOG(SDK_INFO, "predict time error, v_rate = %f, interval = %llu",v_rate,interval);
SDK_LOG(SDK_INFO, "predict time error, v_rate = %f,m_lastLastTimestamp = %llu, frame = %llu, interval = %llu", v_rate, m_lastLastTimestamp, m_obj->frame, interval);
}
if (m_obj && m_obj->frame != m_lastLastTimestamp)
m_lastLastTimestamp = m_obj->frame;
else if (m_obj)
{
m_lastLastTimestamp += 100;
m_obj->frame = m_lastLastTimestamp;
}
kf_->F_(7, 0) = v_rate;
kf_->F_(8, 1) = v_rate;
kf_->F_(9, 2) = v_rate;
kf_->F_(0, 7) = v_rate;
kf_->F_(1, 8) = v_rate;
kf_->F_(2, 9) = v_rate;
BaseTrack::Predict();
}
void Track3D::Update(const std::vector<float>& data)
......
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