Commit cdf3fd9d authored by oscar's avatar oscar

提交打印

parent 7bc45f37
......@@ -108,9 +108,15 @@ int BaseTracker<T>::Run(const std::vector<std::vector<float> >& detections, std:
detectionsId[match.second] = id;
updateId[id] = match.second;
}
SDK_LOG(SDK_INFO, "Z = [%s]", GetMatrixStr(Z.get(), no, bs);
SDK_LOG(SDK_INFO, "X = [%s]", GetMatrixStr(X.get(), ns, bs);
SDK_LOG(SDK_INFO, "P = [%s]", GetMatrixStr(P.get(), ns*ns, bs);
SDK_LOG(SDK_INFO, "HX = [%s]", GetMatrixStr(HX.get(),no,bs);
#ifdef _KF_IOU_CUDA_
kalman_update_batch(Z.get(), X.get(), P.get(), HX.get(), bs, ns, no);
#endif
SDK_LOG(SDK_INFO, "after X = [%s]", GetMatrixStr(X.get(), ns, bs);
SDK_LOG(SDK_INFO, "after P = [%s]", GetMatrixStr(P.get(), ns * ns, bs);
}
/*** Create new tracks for unmatched detections ***/
......
......@@ -41,3 +41,18 @@ std::string GetMatrixStr(const std::vector<std::vector<float>>& data_ptr, int co
}
return str;
}
std::string GetMatrixStr(float** data_ptr, int col, int row)
{
std::string str;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
char log[128] = {};
sprintf(log, "%f,", data_ptr[i][j]);
str += log;
}
}
return str;
}
......@@ -7,3 +7,4 @@ uint64_t GetCurTime();
std::string GetMatrixStr(const float* data_ptr, int col, int row);
std::string GetMatrixStr(const std::vector<std::vector<float>>& data_ptr, int col, int row);
std::string GetMatrixStr(float** data_ptr, int col, int row);
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