Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about the speed calculation #35

Open
wenyan96 opened this issue Jan 12, 2022 · 1 comment
Open

about the speed calculation #35

wenyan96 opened this issue Jan 12, 2022 · 1 comment

Comments

@wenyan96
Copy link

Hi! Thanks for your great work firstly.

I have 2 questions when calculating the speed of objects(please see the following code). why times 36 in the sp_est_norm? From m/s to km/h --> supposed to be 3.6 times?And the formula 24 in the paper, why not use the timestamps of consecutive frames as the delta_t to calculate the speed?

// // ***** get the ground truth object speed here ***** (use version 1 here)
cv::Mat sp_gt_v, sp_gt_v2;
sp_gt_v = H_p_c.rowRange(0,3).col(3) - (cv::Mat::eye(3,3,CV_32F)-H_p_c.rowRange(0,3).colRange(0,3))*ObjCentre3D_pre; // L_w_p.rowRange(0,3).col(3) or ObjCentre3D_pre
sp_gt_v2 = L_w_p.rowRange(0,3).col(3) - L_w_c.rowRange(0,3).col(3);
float sp_gt_norm = std::sqrt( sp_gt_v.at<float>(0)*sp_gt_v.at<float>(0) + sp_gt_v.at<float>(1)*sp_gt_v.at<float>(1) + sp_gt_v.at<float>(2)*sp_gt_v.at<float>(2) )*36;
// float sp_gt_norm2 = std::sqrt( sp_gt_v2.at<float>(0)*sp_gt_v2.at<float>(0) + sp_gt_v2.at<float>(1)*sp_gt_v2.at<float>(1) + sp_gt_v2.at<float>(2)*sp_gt_v2.at<float>(2) )*36;
mCurrentFrame.vObjSpeed_gt[i] = sp_gt_norm;

// // ***** calculate the estimated object speed *****
// estimated speed
cv::Mat sp_est_v;
// formula 24
sp_est_v = mCurrentFrame.vObjMod[i].rowRange(0,3).col(3) - (cv::Mat::eye(3,3,CV_32F)-mCurrentFrame.vObjMod[i].rowRange(0,3).colRange(0,3))*ObjCentre3D_pre;

float sp_est_norm = std::sqrt( sp_est_v.at<float>(0)*sp_est_v.at<float>(0) + sp_est_v.at<float>(1)*sp_est_v.at<float>(1) + sp_est_v.at<float>(2)*sp_est_v.at<float>(2) )*36;

cout << "estimated and ground truth object speed: " << sp_est_norm << "km/h " << sp_gt_norm << "km/h " << endl;

@wenyan96
Copy link
Author

wenyan96 commented Jan 19, 2022

Hello, halajun
when reading the codes, I'm confused with some variables. Could you help me check if I have the correct understanding?
Frame::nSemPosition means the label in semantic instance mask of valid object classes
Frame::nModLabel means the tracking id of each object class but what's the difference between it and vObjLabel ?
when tracking the dynamic objects, the semantic label of the same car doesn't need to be the same in consecutive frames(eg. in Frame n, the label is 2, in the next Frame, the label is 3), the car can be tracked by optical flow(association between label2 and label3), and assign the same TrackId to the Obj in the consecutive frame. Is it correct? Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant