zhengthomastang / 2018AICity_TeamUW

The winning method in Track 1 and Track 3 at the 2nd AI City Challenge Workshop in CVPR 2018 - Official Implementation
http://openaccess.thecvf.com/content_cvpr_2018_workshops/w3/html/Tang_Single-Camera_and_Inter-Camera_CVPR_2018_paper.html
550 stars 198 forks source link

Track1/6_SPD_EST nullptr issue #10

Open danb31 opened 5 years ago

danb31 commented 5 years ago

Hi,

I am trying to use the SPD_EST_IPL tool with Visual Studio (Windows 10), however keep getting the following error for line 24 of main.cpp (frame count):

Exception thrown: read access violation. this was nullptr.

I input tracking and camera parameters in the specified format, and reference the frame images directory. Any idea on how to deal with this issue?

Thanks, Dan

zhengthomastang commented 5 years ago

Hi @danb31. Thanks for using our code. I am not exactly sure where the issue is, as m_nFrmCnt should be defined at Line 45. The getter is called at Line 463 by cmpFrmCnt(), but all the objects should be initialized in vvoTrkNd through Line 299 and Line 308. A possible reason is that the 2D tracking results in MOTChallenge format are not provided correctly (Line 290), so the objects are not initialized properly. Do you have some extra information to provide?

danb31 commented 5 years ago

Hi @zhengthomastang thanks for your help.

When debugging I get the following outputs:

Exception thrown at 0x00007FFB66BBA388 in SPD_EST_IPL.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000D6A7B7C7B8.
Exception thrown: read access violation.
**this** was nullptr.

My data is structured in the following file format:

-Track1 ---SPD_EST_IPL ------SPD_EST_IPL ---------data ------------Loc1_1 ---------------trk2d.txt ---------------camCal ------------------camParam.txt ---------------img1 ------------------1.jpg ------------------2.jpg ------------------3.jpg…

My trk2d.txt is in the following format, which I believe matches what is required in line 290?

1,4,604,120,22,53,0.891,-1,-1,-1,car 1,3,0,184,332,166,0.644,-1,-1,-1,car 1,2,586,195,45,35,0.765,-1,-1,-1,car 1,1,462,196,59,33,0.347,-1,-1,-1,car 2,4,604,120,21,53,0.946,-1,-1,-1,car 2,2,584,195,47,35,0.278,-1,-1,-1,car 2,1,464,195,59,32,0.754,-1,-1,-1,car 3,4,603,121,22,51,0.759,-1,-1,-1,car 3,2,584,194,47,37,0.534,-1,-1,-1,car 3,1,467,195,56,31,0.860,-1,-1,-1,car …

zhengthomastang commented 5 years ago

@danb31 Do you have the input of camera calibration? Please also change the file/directory paths at Lines 214, 220, 226, 232, 238 and 244 of Track1/SPD_EST_IPL/SPD_EST_IPL/src/main.cpp.

danb31 commented 5 years ago

@zhengthomastang My camera calibration: camParam.txt

Lines have been changed to match paths. When running the first frame begins processing but crashes after a few seconds.

zhengthomastang commented 5 years ago

@danb31 Please make sure that the length unit for the camera height (in translation matrix) is in mm. I am not sure where the crashes are caused from. Do you have some debug messages?

dahlan77 commented 5 years ago
-Track1
---SPD_EST_IPL
------SPD_EST_IPL
---------data
------------Loc1_1
---------------trk2d.txt
---------------camCal
------------------camParam.txt
---------------img1
------------------1.jpg
------------------2.jpg
------------------3.jpg…

My trk2d.txt is in the following format, which I believe matches what is required in line 290?

1,4,604,120,22,53,0.891,-1,-1,-1,car
1,3,0,184,332,166,0.644,-1,-1,-1,car
1,2,586,195,45,35,0.765,-1,-1,-1,car
1,1,462,196,59,33,0.347,-1,-1,-1,car
2,4,604,120,21,53,0.946,-1,-1,-1,car
2,2,584,195,47,35,0.278,-1,-1,-1,car
2,1,464,195,59,32,0.754,-1,-1,-1,car
3,4,603,121,22,51,0.759,-1,-1,-1,car
3,2,584,194,47,37,0.534,-1,-1,-1,car
3,1,467,195,56,31,0.860,-1,-1,-1,car

how I got that result in track2d.txt?

zhengthomastang commented 5 years ago

@danb31 The format of input frames should be %06d.jpg, e.g., 000001.jpg 000002.jpg ...

zhengthomastang commented 5 years ago

@danb31 Also, the detection scores are in percentage (between 0.0 and 100.0). Or you can tune the threshold for detection scores.

LionelLeee commented 5 years ago

Hi,@zhengthomastang How does the speed scale get? I have not found the relevant code for the calculation in your code?

zhengthomastang commented 5 years ago

@LionelLeee The 2018 AI City Challenge data are not available anymore. The scale was fine-tuned on the training set.

LionelLeee commented 5 years ago

@zhengthomastang Thank you for your prompt reply. Then if you want to calculate the speed scale, you recommend the algorithm is more suitable.

LionelLeee commented 4 years ago

@zhengthomastang ,Why multiply 2.23694f in SPD_EST_IPL

zhengthomastang commented 4 years ago

@LionelLeee The scale and offset parameters are fine-tuned for each video, according to the speed limit for different road conditions.