JakobEngel / dso

Direct Sparse Odometry
GNU General Public License v3.0
2.31k stars 911 forks source link

UndistortFOV::distortCoordinates function #201

Open wendaoyuchen opened 5 years ago

wendaoyuchen commented 5 years ago

Hi, I am a little confused about the UndistortFOV::distortCoordinates function. I guess this camera model is Mei model? I cann't understand the following code: float d2t = 2.0f * tan(dist / 2.0f); float fac = (r==0 || dist==0) ? 1 : atanf(r * d2t)/(dist*r); it's different from Unified Omnidirectional Model in OmniDSO. Can you give me any advice or where is the formula above from?

NikolausDemmel commented 5 years ago

FOV camera model is different from Unified Omnidirectional camera model.

See for a concise description that includes both models: https://arxiv.org/abs/1807.08957

wendaoyuchen commented 5 years ago

@NikolausDemmel ,thank you !

fangxu622 commented 5 years ago

what the meaning of omega ? field of view? and how modify the omega according the camera calibration file.

YAML:1.0
---
calibration_time: "2019年09月12日 星期四 22时04分43秒"
nr_of_frames: 59
image_width: 1170
image_height: 1060
board_width: 9
board_height: 6
square_size: 28.
fix_aspect_ratio: 0.
# flags: +fix_skew +recompute_extrinsic
flags: 522
fisheye_model: 1
camera_matrix: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 3.6912148232429854e+02, 0., 5.8450000000000000e+02, 0.,
       3.6744085176579568e+02, 5.2950000000000000e+02, 0., 0., 1. ]
distortion_coefficients: !!opencv-matrix
   rows: 4
   cols: 1
   dt: d
   data: [ -2.4186349759586639e-02, 1.5894697610393346e-02,
       -1.3159612010960154e-02, 2.0194749478321047e-03 ]
avg_reprojection_error: 1.1655669009404384e+00
NikolausDemmel commented 5 years ago

Please refer to the referenced publication and its references on FOV.

The file you post looks like it may be the OpenCV "fisheye" model. This should correspond to Kannala Brandt with 4 radial parameters.

fangxu622 commented 5 years ago

thanks , i'm begineer ,fishyeye model, I found this 1 open fishyey modelsm, it don't get omega value 2 kalibr , It have fov camera models for get omega ,but it's used on ros and need to make rosbag data.

could post your relative calibration tools or git address .

it 's confusion for me how to make dso data with our fisheye camera. could post some relative camera calibration tools (url)

for example : tum mono-dataset sequences_01 camera.txt

0.349153000000000   0.436593000000000   0.493140000000000   0.499021000000000   0.933271000000000
1280 1024
0.4 0.53 0.5 0.5 0
640 480

the first line fx fy don't equal the third line fx fy ? how to define these value according to calibration file that such as get from opencv fisheye model(fx fy cx cy)

how to compute the third line fx fy

this is my dataset , contain chessboard images for calibration

https://drive.google.com/file/d/16sPX8gMBIRMZjpAyc2gGXfnHw-9tvyvP/view?usp=sharing