Skip to content

Commit

Permalink
Solve compatibility with Kitti dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-elvira committed Jul 31, 2020
1 parent 5e59189 commit 866135f
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions Examples/Monocular/KITTI00-02.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 718.856
Expand Down
1 change: 1 addition & 0 deletions Examples/Monocular/KITTI03.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 721.5377
Expand Down
1 change: 1 addition & 0 deletions Examples/Monocular/KITTI04-12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 707.0912
Expand Down
1 change: 1 addition & 0 deletions Examples/RGB-D/TUM1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 517.306408
Expand Down
1 change: 1 addition & 0 deletions Examples/RGB-D/TUM2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 520.908620
Expand Down
1 change: 1 addition & 0 deletions Examples/RGB-D/TUM3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 535.4
Expand Down
1 change: 1 addition & 0 deletions Examples/ROS/ORB_SLAM3/Asus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 535.4
Expand Down
1 change: 1 addition & 0 deletions Examples/Stereo/KITTI00-02.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 718.856
Expand Down
1 change: 1 addition & 0 deletions Examples/Stereo/KITTI03.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 721.5377
Expand Down
1 change: 1 addition & 0 deletions Examples/Stereo/KITTI04-12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 707.0912
Expand Down
5 changes: 3 additions & 2 deletions include/Tracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class Tracking


//TEST--
cv::Mat M1l, M2l;
cv::Mat M1r, M2r;
bool mbNeedRectify;
//cv::Mat M1l, M2l;
//cv::Mat M1r, M2r;

bool mbWriteStats;

Expand Down
24 changes: 18 additions & 6 deletions src/Tracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ Tracking::Tracking(System *pSys, ORBVocabulary* pVoc, FrameDrawer *pFrameDrawer,
mbInitWith3KFs = false;


//Test Images
//Rectification parameters
/*mbNeedRectify = false;
if((mSensor == System::STEREO || mSensor == System::IMU_STEREO) && sCameraName == "PinHole")
{
cv::Mat K_l, K_r, P_l, P_r, R_l, R_r, D_l, D_r;
Expand All @@ -289,17 +290,28 @@ Tracking::Tracking(System *pSys, ORBVocabulary* pVoc, FrameDrawer *pFrameDrawer,
int rows_r = fSettings["RIGHT.height"];
int cols_r = fSettings["RIGHT.width"];
// M1r y M2r son los outputs (igual para l)
// M1r y M2r son las matrices relativas al mapeo correspondiente a la rectificación de mapa en el eje X e Y respectivamente
cv::initUndistortRectifyMap(K_l,D_l,R_l,P_l.rowRange(0,3).colRange(0,3),cv::Size(cols_l,rows_l),CV_32F,M1l,M2l);
cv::initUndistortRectifyMap(K_r,D_r,R_r,P_r.rowRange(0,3).colRange(0,3),cv::Size(cols_r,rows_r),CV_32F,M1r,M2r);
if(K_l.empty() || K_r.empty() || P_l.empty() || P_r.empty() || R_l.empty() || R_r.empty() || D_l.empty() || D_r.empty()
|| rows_l==0 || cols_l==0 || rows_r==0 || cols_r==0)
{
mbNeedRectify = false;
}
else
{
mbNeedRectify = true;
// M1r y M2r son los outputs (igual para l)
// M1r y M2r son las matrices relativas al mapeo correspondiente a la rectificación de mapa en el eje X e Y respectivamente
//cv::initUndistortRectifyMap(K_l,D_l,R_l,P_l.rowRange(0,3).colRange(0,3),cv::Size(cols_l,rows_l),CV_32F,M1l,M2l);
//cv::initUndistortRectifyMap(K_r,D_r,R_r,P_r.rowRange(0,3).colRange(0,3),cv::Size(cols_r,rows_r),CV_32F,M1r,M2r);
}
}
else
{
int cols = 752;
int rows = 480;
cv::Mat R_l = cv::Mat::eye(3, 3, CV_32F);
}
}*/

mnNumDataset = 0;

Expand Down

0 comments on commit 866135f

Please sign in to comment.