mono_dataset_code icon indicating copy to clipboard operation
mono_dataset_code copied to clipboard

Uninitialized values in undistorter

Open fairf4x opened this issue 7 years ago • 2 comments

Vignette calibration crashed with this error:

OpenCV Error: Assertion failed (s >= 0) in setSize, file /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/core/src/matrix.cpp, line 307 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/core/src/matrix.cpp:307: error: (-215) s >= 0 in function setSize

I was using following camera calibration:

395.006308 404.392711 314.697857 174.704342 0.0
856 480
none
856 480

The problem is in FOVUndistorter.cpp on the line 99. Undistorter returns and never reads output width and height which later results in error.

I suggest simply initializing out_width and out_height with values of in_width and in_height respectively. Patch is attached. patch.txt

fairf4x avatar May 11 '17 20:05 fairf4x

Hello,can you tell me how to calibrate the camera with FOV model ? seems the vignette code only support the FOV model.

LittleMing233 avatar Dec 11 '18 02:12 LittleMing233

@LittleMing233 this is off topic on this issue, but to answer your question, you can for example use Kalibr with their pinhole-fov model.

NikolausDemmel avatar Dec 11 '18 10:12 NikolausDemmel