GithubHelp home page GithubHelp logo

hengli / camodocal Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 387.0 79.02 MB

CamOdoCal: Automatic Intrinsic and Extrinsic Calibration of a Rig with Multiple Generic Cameras and Odometry

License: Other

CMake 2.89% C++ 96.71% C 0.28% Python 0.12%

camodocal's People

Contributors

ahundt avatar cgart avatar fjonath1 avatar hengli avatar maxzon3 avatar mintar avatar sandeepnmenon avatar shahriarsefati avatar supervacuus avatar youkely avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camodocal's Issues

bin/extrinsic_calib Segmentation fault

When I run:
$ bin/extrinsic_calib --calib /home/miao/Desktop/camodocal/build/ --camera-count 1 --output /home/miao/Desktop/camodocal/build/calib --input /home/miao/Desktop/camodocal/data/newimage/ --data /home/miao/Desktop/camodocal/data/newimage/ --event /home/miao/Desktop/camodocal/build/camera_chessboard_data.dat
in which --input contains .bmp and frames, --calib is generated by bin/intrinsic_calib, and --event is generated by bin/intrinsic_calib.
However I got error like this:

# INFO: Initializing... 
Read /home/miao/Desktop/camodocal/build/camera_chessboard_data.dat file to get all the events
# INFO: Initialization finished!
# INFO: Running camera-odometry calibration for each of the 1 cameras.
# ERROR: No segments, calibration fails!!
# INFO: Calibrating odometry - camera 0...
Rotation: 
6.91456e-310 6.91452e-310 6.91456e-310
6.91456e-310 6.91452e-310 7.90505e-323
6.91452e-310 6.91452e-310 6.91452e-310
Translation: 
2.52962e-321            0 6.91456e-310
# INFO: Completed camera-odometry calibration for all cameras.
# INFO: Saving intermediate data... Done. Took 0.00s.
# INFO: Running camera rig calibration.
Segmentation fault (core dumped)

I wonder if the owner could give a dataset just for extrinsic_calib, thanks a lot.
Anyone gives any suggestions is appreciated.

Question regarding coordinate systems and determining the yaw angle from bearing

Hi, I would really appreciate your help in answering my questions below. I have been struggling with this for over three weeks now.

(1) I have a 5-camera mounted on a van with a GPS receiver (only 3 is used in the testing with CamOdoCal). I obtained position (Lat/Lon) and bearing angle from GPS. As I don't have an IMU, I computed the yaw angle which tells the orientation around the Z axis.

   double yaw_degree = -(bearing_degree_from_GPS - 90.0);

Here, I assume the coordinate system used in CamOdoCal is ENU, and the vehicle's positive x-axis points toward the direction of movement, positive y-axis on the the vehicle left. I wonder if my assumption is right, please help confirm.

In the testing to perform extrinsic calibration for multi-camera, we only made the yaw motion, ensuring that the ground is flat (making no pitch and roll).

(2) Using those yaw angles converted to rotation matrix then quaternion, and input into CamOdoCal in the form of
[timestamp] CAM [camera_id] [image filename]
[timestamp] IMU [quaternion x] [quaternion y] [quaternion z] [quaternion w]
[timestamp] GPS [latitude] [longitude] [alt]
and, despite changing some setting such as detector and descriptor, I still couldn't have CamOdoCal run past stage 3 of CamaeraRigBA::Run.

[PASSED] stage 1 - triangulate 3D points with feature correspondences from mono VO and run BA
[PASSED ] stage 2 - run robust pose graph SLAM and find inlier 2D-3D correspondences from loop closures
[PROGRAM STOPPED HERE] stage 3 - find local inter-camera 3D-3D correspondences
with the following log messages: (no crashed)

Please can you suggest what should I do to make it work with my system. Your help is really much appreciated. Thank you very much.
.......

Ceres Solver Report: Iterations: 31, Initial cost: 2.702882e+01, Final cost: 1.206417e+01, Termination: FUNCTION_TOLERANCE.
.# INFO: After refinement:
H_cam_odo =
0.693116 0.168301 0.700903 -0.100646
-0.144071 0.985086 -0.0940688 0.325688
-0.706282 -0.0357792 0.707026 0
0 0 0 1
scales =
-0.0966268
.#. INFO: Calibrating odometry - camera 2...
Rotation:
0.693116 0.168301 0.700903
-0.144071 0.985086 -0.0940688
-0.706282 -0.0357792 0.707026
Translation:
-0.100646 0.325688 0
Ceres Solver Report: Iterations: 25, Initial cost: 1.799722e+01, Final cost: 1.064531e+01, Termination: FUNCTION_TOLERANCE.
.# INFO: After refinement:
H_cam_odo =
0.713364 -0.280516 -0.642202 -0.113423
0.0840694 0.944029 -0.31897 0.294703
0.695733 0.173552 0.697019 0
0 0 0 1
scales =
0.0699959
.# INFO: Calibrating odometry - camera 1...
Rotation:
0.713364 -0.280516 -0.642202
0.0840694 0.944029 -0.31897
0.695733 0.173552 0.697019
Translation:
-0.113423 0.294703 0
Ceres Solver Report: Iterations: 75, Initial cost: 2.484698e+01, Final cost: 1.217647e+01, Termination: FUNCTION_TOLERANCE.
.# INFO: After refinement:
H_cam_odo =
0.0996435 -0.98357 0.150533 -0.111327
0.710327 -0.0356262 -0.702969 0.349939
0.696783 0.176974 0.695107 0
0 0 0 1
scales =
0.0813187
.# INFO: Calibrating odometry - camera 0...
Rotation:
0.0996435 -0.98357 0.150533
0.710327 -0.0356262 -0.702969
0.696783 0.176974 0.695107
Translation:
-0.111327 0.349939 0
.# INFO: Reprojection error for camera 2: avg = 0.516288 px | max = 801.914 px
.# INFO: Reprojection error for camera 0: avg = 0.565628 px | max = 469.029 px
.# INFO: Reprojection error for camera 1: avg = 0.304846 px | max = 84.1896 px
.# INFO: Completed camera-odometry calibration for all cameras.
.# INFO: Saving intermediate data...
Done. Took 24.46s.
.# INFO: Running camera rig calibration.
.# INFO: # segments = 1
.# INFO: Segment 0: # frame sets = 59
.# INFO: Reprojection error: avg = 0.45 px | max = 493.62 px | # obs = 389194
.# INFO: Triangulating feature correspondences...
.# INFO: Reprojection error after triangulation: avg = 9400363031163346944.00 px | max = 1178337959001900481249280.00 px | # obs = 269012
.# INFO: # 3D scene points: 101400
.# INFO: Checking the validity of the graph...
.# INFO: Finished checking the validity of the graph.
.# INFO: Reprojection error after pruning: avg = 632419244318232832.00 px | max = 146216321810127040544768.00 px | # obs = 245574
.# INFO: # 3D scene points: 97063
.# INFO: Running BA on odometry data...
.# INFO: Done.
.# INFO: Reprojection error after BA (odometry): avg = 45.00 px | max = 10016.56 px | # obs = 233509
.# INFO: # 3D scene points: 92924
.# INFO: Running robust pose graph optimization...
.# INFO: Building odometry edges...
.# INFO: Built 58 odometry edges.
.# INFO: Building loop closure edges...
.# INFO: Built 0 loop closure edges.
Ceres Solver Report: Iterations: 0, Initial cost: 2.572128e-31, Final cost: 2.572128e-31, Termination: PARAMETER_TOLERANCE.
.# INFO: # inlier 2D-3D correspondences: 0
.# INFO: Merged 0 3D scene points.
.# INFO: Running BA on odometry data...
.# INFO: Reprojection error after robust pose-graph optimization: avg = 43.25 px | max = 4145.38 px | # obs = 229033
.# INFO: # 3D scene points: 90947
.# INFO: Finding inter-map 3D-3D correspondences...
.# INFO: Entering frame set node 0-0 [ 1 0 1 ]

Cata Camera calibration large gamma

Hello,

i was trying to calibrate the camera using Cata (MEI) model. how ever it results in very large
gamma values (focal X/Y): 3000+
trying different models like Pinhole gives adequate focal values.
what can be the reason for such results?

Crash when running the examples/extrinsic_calib executable

When I run the example/extrinsic_calib executable, camodocal crashes during the optimization in beginStage 4. I use CUDA, OpenCV 2.4.9 on a Ubuntu 14.04 OS. Here's the console output:

./extrinsic_calib -v
(the exe runs well with about 200 images, then it stops suddenly )

Ceres Solver Report: Iterations: 100, Initial cost: 9.564510e+05, Final cost: 7.334577e+04, Termination: FUNCTION_TOLERANCE.
INFO: Done.
INFO: Reprojection error after BA (odometry): avg = 1.07 px | max = 30.75 px | # obs = 48068
INFO: # 3D scene points: 13924
INFO: Running robust pose graph optimization...
INFO: Building odometry edges...
INFO: Built 222 odometry edges.
INFO: Building loop closure edges...
INFO: Built 0 loop closure edges.
Ceres Solver Report: Iterations: 0, Initial cost: 8.363728e-31, Final cost: 8.363728e-31, Termination: PARAMETER_TOLERANCE.
INFO: # inlier 2D-3D correspondences: 0
INFO: Merged 0 3D scene points.
INFO: Running BA on odometry data...
INFO: Loss parameter = 25
INFO: sqrt precision matrix (keypoint position):
5 0
0 5
Ceres Solver Report: Iterations: 0, Initial cost: 7.322093e+04, Final cost: 7.322093e+04, Termination: FUNCTION_TOLERANCE.
INFO: Reprojection error after robust pose-graph optimization: avg = 1.07 px | max = 30.75 px | # obs = 48068
INFO: # 3D scene points: 13924
INFO: Finding inter-map 3D-3D correspondences...
INFO: Entering frame set node 0-0 [ 1 ]
INFO: Entering frame set node 0-1 [ 2 ]
INFO: Entering frame set node 0-2 [ 3 ]
INFO: Entering frame set node 0-3 [ 4 ]
...
INFO: Entering frame set node 0-221 [ 7 ]
INFO: Entering frame set node 0-222 [ 7 ]
INFO: # local inter-map 3D-3D correspondences = 0
INFO: # features seen in camera 0: 0
INFO: Done.
INFO: Reprojection error after local matching: avg = 1.07 px | max = 30.75 px | # obs = 48068
INFO: # 3D scene points: 13924
INFO: Assigned weight of 0.00 to scene points observed by a single camera.
INFO: Running BA on odometry data -> optimize CAMERA_ODOMETRY_TRANSFORM | ODOMETRY_6D_POSE | POINT_3D ...
INFO: Added 222 residuals from odometry data.
INFO: Loss parameter = 25
INFO: sqrt precision matrix (keypoint position):
5 0
0 5
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0F0813 17043 46.173960: 43 :46.233960 1189111888 orrector.cc:42: Check failed: rho[1] > 0.0 (0 vs. 0)42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11892 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233990 11893 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11895 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11896 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0)
*** Check failure stack trace: ***
F0F0813 17043 46.173960: 43 :46.233960 1189111888 orrector.cc:42: Check failed: rho[1] > 0.0 (0 vs. 0)42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11892 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233990 11893 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11895 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0) F0813 17:43:46.233960 11896 corrector.cc:42] Check failed: rho[1] > 0.0 (0 vs. 0)
*** Check failure stack trace: ***
Abandon (core dumped)

I can't figure out why this failure appears. I searched for this error on google and I found this forum :https://groups.google.com/forum/#!topic/ceres-solver/kTMuM-6X3bo but this solution did'nt solved it. Do you have any idea why this problem appears?

Logic Errors found by Xcode Static Analysis

There are a number of logic errors found by static analysis that lead to junk data and calculations in the code. Some of them are in functions that look pretty important, I included the most important ones below.

Logic error Group
camodocal/src/dbow2/DUtilsCV/Transformations.cpp:125:26: The left operand of '*' is a garbage value
camodocal/src/dbow2/DUtilsCV/Transformations.cpp:126:26: The right operand of '*' is a garbage value
camodocal/src/dbow2/DUtilsCV/Transformations.cpp:127:26: The right operand of '*' is a garbage value
Logic error Group
camodocal/src/camera_models/CostFunctionFactory.cc:396:9: Assigned value is garbage or undefined (within a call to 'spaceToPlane')
Logic error Group
camodocal/src/infrastr_calib/InfrastructureCalibration.cc:1047:9: The result of the '>>' expression is undefined (within a call to 'random_shuffle')
Logic error Group
camodocal/src/examples/extrinsic_calib.cc:329:38: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage (within a call to 'rotation')
camodocal/src/dbow2/DUtils/Profiler.cpp:207:15: The left operand of '*' is a garbage value (mean)
camodocal/src/gpl/gpl.cc:853:39: The left operand of '-' is a garbage value (ZoneLetter)
Logic error Group
camodocal/src/ceres-solver/internal/ceres/corrector.cc:108:18: Array access (from variable 'residuals') results in a null pointer dereference
camodocal/src/ceres-solver/internal/ceres/corrector.cc:133:24: Array access (from variable 'jacobian') results in a null pointer dereference
camodocal/src/ceres-solver/internal/ceres/corrector.cc:133:53: Array access (from variable 'residuals') results in a null pointer dereference
camodocal/src/ceres-solver/internal/ceres/problem_impl.cc:530:3: Called C++ object pointer is null (within a call to 'SetParameterization')
camodocal/src/ceres-solver/internal/ceres/visibility_based_preconditioner.cc:404:17: Access to field 'values' results in a dereference of a null pointer (loaded from variable 'cell_info')
Memory Error Group
camodocal/src/sparse_graph/SparseGraph.cc:1425:5: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'
Logic error Group
camodocal/src/visual_odometry/SlidingWindowBA.cc:940:9: The result of the '>>' expression is undefined (within a call to 'random_shuffle')

Some of these are from ceres, so I don't know if it may be worthwhile to update the version.

There are also quite a few "dead stores", or values that are set or defined but never read, they just eat up CPU/memory and are less critical so I left them out to keep the scope of problems to the important ones for this issue.

pthread_create exist failed

I have tried to compile camodocal on Ubuntu14.04. As I used VirtualBox, I have problem with CUDA so I didn't CUDA on my machine.

I compiled the sourcecode and it showed 'Configuring done', 'Generating done'.
build result

Anyway, the errors I found in CMakeError.log are
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
and
/usr/bin/ld: cannot find -lpthreads
And I couldn't get any executables in my build folder.

I'm not sure if this is related to no CUDA intalled (but as I understood, the compilation of CamOdoCal without CUDA has be solved).

Any comments or suggestions to fix this issue would be greatly appreciate. Thank you very much.

Possible cmake issue

@ahundt

Referring to #47

In comparison to the previous sourcecode, I found the latest sourcecode produced an error when running the command below:

cmake -DCMAKE_BUILD_TYPE=Release ..

The test environment is OpenCV 3.0 + No CUDA (on a virtual machine)

I attached logs in the post. Thanks very much.

BuildCamOdocal_20150104.zip

Camodocal doesn't build

When freshly checking out camodocal, and following the build instructions, I get the following error on make:

/usr/bin/ld: cannot find -lcamodocal_camera_models

This seems to be related to the pre-condition (CERES_FOUND) for the camera_models package. I got it to build by:

  • moving the "add_subdirectory(ceres-solver)" to the first position in the src/CMakeLists.txt
  • Removing the encapsulating if-statements on both camera_models and ceres-solver.

Does this make sense? What's the proper solution to this problem?

CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.

CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.

My status of this library is as follows

CMake Warning (dev) at CMakeLists.txt:4 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found version ".")
CMake Warning at cmake/DependencyUtilities.cmake:19 (find_package):
By not providing "FindCeres.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Ceres", but
CMake did not find one.

Could not find a package configuration file provided by "Ceres" with any of
the following names:

CeresConfig.cmake
ceres-config.cmake
Add the installation prefix of "Ceres" to CMAKE_PREFIX_PATH or set
"Ceres_DIR" to a directory containing one of the above files. If "Ceres"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
cmake/LibraryConfig.cmake:41 (camodocal_optional_dependency)
CMakeLists.txt:20 (include)

-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Failed to find glog - Could not find glog library, set GLOG_LIBRARY to full path to libglog.
-- Could NOT find Glog (missing: GLOG_INCLUDE_DIRS GLOG_LIBRARIES)
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find gflags - Could not find gflags library, set GFLAGS_LIBRARY to full path to libgflags.
-- Could NOT find Gflags (missing: GFLAGS_INCLUDE_DIRS GFLAGS_NAMESPACE)
-- Found Intel TBB
-- OpenCV version: 2.4.6.1
-- Using internal version of ceres-solver
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- serialization
-- system
-- thread
-- *** Build type is Release ***
-- Found SSE4.1 extensions, using flags: -msse4.1 -mfpmath=sse
-- Looking for C++ include iso646.h
-- Looking for C++ include iso646.h - not found
-- Found LibDL: /usr/lib/i386-linux-gnu/libdl.so
-- Found LIBNSL: /usr/lib/i386-linux-gnu/libnsl.so
-- Could NOT find Librt (missing: Librt_LIBRARIES)
-- Found LIBM: /usr/lib/i386-linux-gnu/libm.so
-- CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.

-- DEPENDENCY: Required: Found:

-- BLAS yes yes
-- Eigen3 yes yes
-- LAPACK yes yes
-- SuiteSparse yes yes
-- CUDA no yes
-- Ceres no yes
-- GTest no yes
-- OpenMP no yes
-- Glog no no
-- Gflags no yes
-- TBB no yes
-- OpenCV no yes
-- Threads no yes

-- Library: Build: Condition:

-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Failed
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Failed
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Failed
-- agast TRUE (satisfied)
-- camodocal_brisk TRUE (satisfied)
-- camodocal_calib TRUE (satisfied)
-- camodocal_camera_systems TRUE (satisfied)
-- camodocal_chessboard TRUE (satisfied)
-- camodocal_dbow2 TRUE (satisfied)
-- camodocal_dutils TRUE (satisfied)
-- camodocal_dutilscv TRUE (satisfied)
-- camodocal_dvision TRUE (satisfied)
-- camodocal_gpl TRUE (satisfied)
-- camodocal_location_recognitionTRUE (satisfied)
-- camodocal_fivepoint TRUE (satisfied)
-- camodocal_pose_estimation TRUE (satisfied)
-- camodocal_pose_graph TRUE (satisfied)
-- camodocal_pugixml TRUE (satisfied)
-- camodocal_sparse_graph TRUE (satisfied)

-- Executable: Build: Condition:

-- dbow2_demo TRUE (satisfied)
-- train_voctree TRUE (satisfied)

-- Test: Build: Condition:

--
-- Configuring done
-- Generating done

cannot run extrinsic_calib

I've extracted the camera's intrinsic parameters using examples/intrinsic_calib
However, I can't correctly run the program examples/extrinsic_calib
In the --help option, there are many argument values need to set, but I have no idea how to set them
The following is how I set the argument values
--calib, the folder containing camera_0_calib.yaml file which is generated from intrinsic_calib
--output, empty folder
--input, the folder containing images that in camodocal/data/images
Can someone who has successfully run the program briefly explain or give an example command

Thanks for considering my issue.

Possible bug in HandEyeCalibration?

This issue ties back to issue #17 where I'm continuing to have difficulty solving for the transform accurately.

I ran HandEyeCalibration_test.cc, and it appears to show the presence of a bug, unless I am misunderstanding something. As you can see the Z axis expects 0.7 and is finding -0.02, which is a surprisingly large error relative to the random variation between -1.0 and +1.0.

./bin/./HandEyeCalibration_test
Running main() from gtest_main.cc
[==========] Running 3 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 3 tests from HandEyeCalibration
[ RUN      ] HandEyeCalibration.FullMotion
[       OK ] HandEyeCalibration.FullMotion (11 ms)
[ RUN      ] HandEyeCalibration.PlanarMotion
[       OK ] HandEyeCalibration.PlanarMotion (0 ms)
[ RUN      ] HandEyeCalibration.PlanarMotionWithNoise
# INFO: No unique solution, returned an arbitrary one.
# INFO: Before refinement: H_12 =
 0.919962 -0.310734  0.238986   7.33089
 0.346704  0.929456 -0.126123   9.88994
-0.182936  0.198886  0.962797   18.7327
        0         0         0         1
Ceres Solver Report: Iterations: 12, Initial cost: 1.756146e+05, Final cost: 4.096604e-07, Termination: GRADIENT_TOLERANCE.
# INFO: After refinement: H_12 =
  0.926695  -0.300955   0.225083   0.489981
   0.32348   0.943636 -0.0700894   0.611425
 -0.191302   0.137761   0.971815 -0.0208261
         0          0          0          1
# INFO: H_12_expected =
  0.926699  -0.300952   0.225068        0.5
  0.323506   0.943615 -0.0702454        0.6
 -0.191237   0.137907   0.971807        0.7
         0          0          0          1
[       OK ] HandEyeCalibration.PlanarMotionWithNoise (34 ms)
[----------] 3 tests from HandEyeCalibration (45 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 1 test case ran. (45 ms total)
[  PASSED  ] 3 tests.

If I increase motionCount in HandEyeCalibration_test.cc to 100 I get a similar result:

./bin/./HandEyeCalibration_test
Running main() from gtest_main.cc
[==========] Running 3 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 3 tests from HandEyeCalibration
[ RUN      ] HandEyeCalibration.FullMotion
[       OK ] HandEyeCalibration.FullMotion (5 ms)
[ RUN      ] HandEyeCalibration.PlanarMotion
[       OK ] HandEyeCalibration.PlanarMotion (0 ms)
[ RUN      ] HandEyeCalibration.PlanarMotionWithNoise
# INFO: No unique solution, returned an arbitrary one.
# INFO: Before refinement: H_12 =
  0.926525  -0.300674   0.226158   0.503363
  0.323268   0.943739 -0.0696776   0.595669
 -0.192483   0.137668   0.971595    4.31143
         0          0          0          1
Ceres Solver Report: Iterations: 18, Initial cost: 1.156761e-07, Final cost: 1.114745e-11, Termination: FUNCTION_TOLERANCE.
# INFO: After refinement: H_12 =
    0.9267  -0.300952   0.225065   0.499987
  0.323503   0.943617 -0.0702337   0.599988
 -0.191238   0.137895   0.971809  -0.100819
         0          0          0          1
# INFO: H_12_expected =
  0.926699  -0.300952   0.225068        0.5
  0.323506   0.943615 -0.0702454        0.6
 -0.191237   0.137907   0.971807        0.7
         0          0          0          1
[       OK ] HandEyeCalibration.PlanarMotionWithNoise (32 ms)
[----------] 3 tests from HandEyeCalibration (37 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 1 test case ran. (37 ms total)
[  PASSED  ] 3 tests.

Bug report when running extrinsic_calib on a non-GPU machine (known root cause)

I am just reporting a bug here.

I am running extrinsic_calib on a VirtualBox machine with no GPU. The program broke and returned Segmentation fault.

The problem is at the file \src\calib\CamOdoThread.cc

void
CamOdoThread::threadFunction(void)
{
TemporalFeatureTracker tracker(m_camera,
SURF_GPU_DETECTOR, SURF_GPU_DESCRIPTOR,
RATIO_GPU, m_preprocess, m_camOdoTransform);

Here, GPU parameters are passed to the CamOdoThread::threadFunction function, which makes the program fail when running on a non-GPU machine. I simply solved this on my local sourcecode by passing in ORB_DETECTOR, ORB_DESCRIPTOR and RATIO and now it could run.

bin/intrinsic_calib segmentation fault (core dumped)

Hello,

When I run bin/intrinsic_calib with the suggesting parameters, I got the following error: [1] 13750 segmentation fault (core dumped) bin/intrinsic_calib -i ../data/images -p img --camera-model mei -v. Firstly I searched the issues for help and found that only #65 has the similar problem as me. After some exploring, I finally get it work properly. For someone who may get similar problems, I log my tuning process down here. Just like @dkoguciuk does, for sake of completeness, I enable the -v option and run the program and get the following log(BTW, my eigen versoin is 3.3.3 and ceres version is 1.13.0, and I use ubuntu 14.04):

# INFO: Camera model: Mei
# INFO: Adding ../data/images/img1.bmp
# INFO: Adding ../data/images/img113.bmp
# INFO: Adding ../data/images/img108.bmp
# INFO: Adding ../data/images/img148.bmp
# INFO: Adding ../data/images/img80.bmp
# INFO: Adding ../data/images/img84.bmp
# INFO: Adding ../data/images/img19.bmp
# INFO: Adding ../data/images/img18.bmp
# INFO: Adding ../data/images/img136.bmp
# INFO: Adding ../data/images/img25.bmp
# INFO: Adding ../data/images/img34.bmp
# INFO: Adding ../data/images/img77.bmp
# INFO: Adding ../data/images/img17.bmp
# INFO: Adding ../data/images/img129.bmp
# INFO: Adding ../data/images/img137.bmp
# INFO: Adding ../data/images/img26.bmp
# INFO: Adding ../data/images/img42.bmp
# INFO: Adding ../data/images/img112.bmp
# INFO: Adding ../data/images/img87.bmp
# INFO: Adding ../data/images/img85.bmp
# INFO: Adding ../data/images/img2.bmp
# INFO: Adding ../data/images/img160.bmp
# INFO: Adding ../data/images/img149.bmp
# INFO: Adding ../data/images/img58.bmp
# INFO: Adding ../data/images/img0.bmp
# INFO: Adding ../data/images/img159.bmp
# INFO: Adding ../data/images/img158.bmp
# INFO: Adding ../data/images/img20.bmp
# INFO: Adding ../data/images/img47.bmp
# INFO: Adding ../data/images/img82.bmp
# INFO: Adding ../data/images/img70.bmp
# INFO: Adding ../data/images/img22.bmp
# INFO: Adding ../data/images/img79.bmp
# INFO: Adding ../data/images/img30.bmp
# INFO: Adding ../data/images/img83.bmp
# INFO: Adding ../data/images/img110.bmp
# INFO: Adding ../data/images/img5.bmp
# INFO: Adding ../data/images/img45.bmp
# INFO: Adding ../data/images/img48.bmp
# INFO: Adding ../data/images/img140.bmp
# INFO: Adding ../data/images/img44.bmp
# INFO: Adding ../data/images/img117.bmp
# INFO: Adding ../data/images/img32.bmp
# INFO: Adding ../data/images/img69.bmp
# INFO: Adding ../data/images/img4.bmp
# INFO: Adding ../data/images/img39.bmp
# INFO: Adding ../data/images/img60.bmp
# INFO: Adding ../data/images/img78.bmp
# INFO: Adding ../data/images/img53.bmp
# INFO: Adding ../data/images/img116.bmp
# INFO: Adding ../data/images/img54.bmp
# INFO: Adding ../data/images/img56.bmp
# INFO: Adding ../data/images/img55.bmp
# INFO: Adding ../data/images/img23.bmp
# INFO: Adding ../data/images/img52.bmp
# INFO: Adding ../data/images/img40.bmp
# INFO: Adding ../data/images/img76.bmp
# INFO: Adding ../data/images/img81.bmp
# INFO: Adding ../data/images/img61.bmp
# INFO: Adding ../data/images/img111.bmp
# INFO: Adding ../data/images/img131.bmp
# INFO: Adding ../data/images/img139.bmp
# INFO: Adding ../data/images/img115.bmp
# INFO: # images: 63
# INFO: Did not detect chessboard in image 1
# INFO: Detected chessboard in image 2
# INFO: Detected chessboard in image 3
# INFO: Detected chessboard in image 4
# INFO: Detected chessboard in image 5
# INFO: Detected chessboard in image 6
# INFO: Did not detect chessboard in image 7
# INFO: Did not detect chessboard in image 8
# INFO: Detected chessboard in image 9
# INFO: Detected chessboard in image 10
# INFO: Detected chessboard in image 11
# INFO: Detected chessboard in image 12
# INFO: Did not detect chessboard in image 13
# INFO: Detected chessboard in image 14
# INFO: Detected chessboard in image 15
# INFO: Detected chessboard in image 16
# INFO: Detected chessboard in image 17
# INFO: Detected chessboard in image 18
# INFO: Detected chessboard in image 19
# INFO: Detected chessboard in image 20
# INFO: Detected chessboard in image 21
# INFO: Detected chessboard in image 22
# INFO: Detected chessboard in image 23
# INFO: Detected chessboard in image 24
# INFO: Did not detect chessboard in image 25
# INFO: Detected chessboard in image 26
# INFO: Detected chessboard in image 27
# INFO: Detected chessboard in image 28
# INFO: Detected chessboard in image 29
# INFO: Detected chessboard in image 30
# INFO: Detected chessboard in image 31
# INFO: Detected chessboard in image 32
# INFO: Detected chessboard in image 33
# INFO: Did not detect chessboard in image 34
# INFO: Detected chessboard in image 35
# INFO: Detected chessboard in image 36
# INFO: Detected chessboard in image 37
# INFO: Detected chessboard in image 38
# INFO: Detected chessboard in image 39
# INFO: Detected chessboard in image 40
# INFO: Detected chessboard in image 41
# INFO: Detected chessboard in image 42
# INFO: Detected chessboard in image 43
# INFO: Detected chessboard in image 44
# INFO: Detected chessboard in image 45
# INFO: Detected chessboard in image 46
# INFO: Detected chessboard in image 47
# INFO: Detected chessboard in image 48
# INFO: Detected chessboard in image 49
# INFO: Detected chessboard in image 50
# INFO: Detected chessboard in image 51
# INFO: Detected chessboard in image 52
# INFO: Detected chessboard in image 53
# INFO: Detected chessboard in image 54
# INFO: Detected chessboard in image 55
# INFO: Detected chessboard in image 56
# INFO: Detected chessboard in image 57
# INFO: Detected chessboard in image 58
# INFO: Detected chessboard in image 59
# INFO: Detected chessboard in image 60
# INFO: Detected chessboard in image 61
# INFO: Detected chessboard in image 62
# INFO: Detected chessboard in image 63
# INFO: Calibrating...
[camera] # INFO: Initial reprojection error: 3.655 pixels
iter      cost      cost_change  |gradient|   |step|    tr_ratio  tr_radius  ls_iter  iter_time  total_time
   0  3.032690e+03    0.00e+00    2.39e+04   0.00e+00   0.00e+00  1.00e+04        0    3.87e-03    4.61e-03
   1  3.393926e+03   -3.61e+02    0.00e+00   7.65e+02  -4.57e-01  5.00e+03        1    4.33e-03    8.97e-03
   2  3.148750e+03   -1.16e+02    0.00e+00   6.01e+02  -1.55e-01  1.25e+03        1    2.50e-03    1.15e-02
   3  2.712094e+03    3.21e+02    8.75e+04   3.82e+02   5.06e-01  1.25e+03        1    5.51e-03    1.70e-02
   4  1.413625e+03    1.30e+03    1.11e+05   3.05e+02   1.86e+00  3.75e+03        1    4.04e-03    2.11e-02
   5  6.458786e+02    7.68e+02    1.23e+05   3.37e+02   1.56e+00  1.13e+04        1    3.60e-03    2.47e-02
   6  2.359550e+02    4.10e+02    4.41e+04   2.09e+02   1.53e+00  3.38e+04        1    3.60e-03    2.83e-02
   7  2.042056e+02    3.17e+01    5.56e+03   3.43e+01   1.27e+00  1.01e+05        1    3.90e-03    3.22e-02
   8  2.017213e+02    2.48e+00    9.27e+03   1.50e+01   9.81e-01  3.04e+05        1    4.62e-03    3.68e-02
   9  2.007571e+02    9.64e-01    4.03e+03   9.36e+00   1.07e+00  9.11e+05        1    3.78e-03    4.06e-02
  10  2.005674e+02    1.90e-01    1.02e+03   3.09e+00   1.26e+00  2.73e+06        1    3.95e-03    4.46e-02
  11  2.005371e+02    3.03e-02    3.87e+02   1.20e+00   1.44e+00  8.20e+06        1    3.90e-03    4.85e-02
  12  2.005303e+02    6.83e-03    2.26e+02   5.73e-01   1.49e+00  2.46e+07        1    3.24e-03    5.18e-02
  13  2.005286e+02    1.67e-03    1.17e+02   2.83e-01   1.50e+00  7.38e+07        1    3.94e-03    5.57e-02
  14  2.005282e+02    4.21e-04    5.93e+01   1.41e-01   1.50e+00  2.21e+08        1    4.32e-03    6.01e-02

Solver Summary (v 1.13.0-eigen-(3.3.3)-lapack-suitesparse-(4.2.1)-cxsparse-(3.1.2)-openmp)

                                     Original                  Reduced
Parameter blocks                          115                      115
Parameters                                408                      408
Effective parameters                      351                      351
Residual blocks                          3078                     3078
Residual                                 6156                     6156

Minimizer                        TRUST_REGION

Sparse linear algebra library    SUITE_SPARSE
Trust region strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver          SPARSE_NORMAL_CHOLESKY   SPARSE_NORMAL_CHOLESKY
Threads                                     8                        8
Linear solver threads                       1                        1
Linear solver ordering              AUTOMATIC                      115

Cost:
Initial                          3.032690e+03
Final                            2.005282e+02
Change                           2.832161e+03

Minimizer iterations                       15
Successful steps                           13
Unsuccessful steps                          2

Time (in seconds):
Preprocessor                           0.0007

  Residual evaluation                  0.0047
  Jacobian evaluation                  0.0264
  Linear solver                        0.0248
Minimizer                              0.0615

Postprocessor                          0.0001
Total                                  0.0623

Termination:                      CONVERGENCE (Function tolerance reached. |cost_change|/cost: 5.371050e-07 <= 1.000000e-06)

Then I run the program under gdb environment with command gdb --args bin/intrinsic_calib -i ../data/images -p img --camera-model mei, and the log is as following:

(gdb) run
Starting program: /home/wyh/WkDir/Calib/camodocal-master/build/bin/intrinsic_calib -i ../data/images -p img --camera-model mei
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffaae7c700 (LWP 13951)]
[New Thread 0x7fffaa67b700 (LWP 13952)]
[New Thread 0x7fffa7e7a700 (LWP 13953)]
# INFO: Camera model: Mei
[New Thread 0x7fffa18fb700 (LWP 13955)]
[New Thread 0x7fffa10fa700 (LWP 13956)]
[New Thread 0x7fffa08f9700 (LWP 13957)]
[New Thread 0x7fff9bfff700 (LWP 13958)]
[New Thread 0x7fff9b7fe700 (LWP 13959)]
[New Thread 0x7fff9affd700 (LWP 13960)]
[New Thread 0x7fff9a7fc700 (LWP 13961)]
[New Thread 0x7fff99ffb700 (LWP 13962)]
[New Thread 0x7fff997fa700 (LWP 13963)]
[New Thread 0x7fff98ff9700 (LWP 13964)]
[New Thread 0x7fff8ffff700 (LWP 13965)]
[New Thread 0x7fff8e137700 (LWP 13966)]
[New Thread 0x7fff8d936700 (LWP 13967)]
[New Thread 0x7fff8d135700 (LWP 13970)]
[New Thread 0x7fff8c934700 (LWP 13971)]
[New Thread 0x7fff79fff700 (LWP 13972)]
[New Thread 0x7fff797fe700 (LWP 13973)]
[New Thread 0x7fff78ffd700 (LWP 13974)]
[New Thread 0x7fff73fff700 (LWP 13975)]
[New Thread 0x7fff737fe700 (LWP 13976)]

Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x81) at malloc.c:2931
2931	malloc.c: No such file or directory.
(gdb) backtrace 
#0  __GI___libc_free (mem=0x81) at malloc.c:2931
#1  0x00007ffff0d64247 in ceres::AutoDiffCostFunction<camodocal::ReprojectionError1<camodocal::CataCamera>, 2, 9, 4, 3, 0, 0, 0, 0, 0, 0, 0>::~AutoDiffCostFunction() ()
   from /home/wyh/WkDir/Calib/camodocal-master/build/lib/libcamodocal_camera_models.so
#2  0x00000000004774bf in void ceres::STLDeleteUniqueContainerPointers<__gnu_cxx::__normal_iterator<ceres::CostFunction**, std::vector<ceres::CostFunction*, std::allocator<ceres::CostFunction*> > > >(__gnu_cxx::__normal_iterator<ceres::CostFunction**, std::vector<ceres::CostFunction*, std::allocator<ceres::CostFunction*> > >, __gnu_cxx::__normal_iterator<ceres::CostFunction**, std::vector<ceres::CostFunction*, std::allocator<ceres::CostFunction*> > >) ()
#3  0x000000000046dbf8 in ceres::internal::ProblemImpl::~ProblemImpl() ()
#4  0x0000000000467691 in ceres::Problem::~Problem() ()
#5  0x00007ffff74bff65 in camodocal::CameraCalibration::optimize(boost::shared_ptr<camodocal::Camera>&, std::vector<cv::Mat, std::allocator<cv::Mat> >&, std::vector<cv::Mat, std::allocator<cv::Mat> >&) const () from /home/wyh/WkDir/Calib/camodocal-master/build/lib/libcamodocal_calib.so
#6  0x00007ffff74c07ab in camodocal::CameraCalibration::calibrateHelper(boost::shared_ptr<camodocal::Camera>&, std::vector<cv::Mat, std::allocator<cv::Mat> >&, std::vector<cv::Mat, std::allocator<cv::Mat> >&) const () from /home/wyh/WkDir/Calib/camodocal-master/build/lib/libcamodocal_calib.so
#7  0x00007ffff74c0c71 in camodocal::CameraCalibration::calibrate() ()
   from /home/wyh/WkDir/Calib/camodocal-master/build/lib/libcamodocal_calib.so
#8  0x000000000045c0cf in main ()

Seems something is wrong with the ceres destrction functions. So what I do is to change different ceres versions. Then I get the source code of ceres from github, and try 1.12.0 but the same result. And when I change to 1.11.0 (via git checkout 1.11.0, and the commit number is 41455566a), there is eigen version uncompatible:
Not any problem in cmake process, but when I try to make ceres, the following error messages come out:

In file included from /usr/local/include/eigen3/Eigen/Core:348:0,
                 from /home/wyh/Downloads/ceres-solver/include/ceres/jet.h:165,
                 from /home/wyh/Downloads/ceres-solver/internal/ceres/jet_test.cc:31:
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h: In instantiation of โ€˜struct Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, Eigen::Matrix<ceres::Jet<double, 2>, 2, 2>, false>โ€™:
/usr/local/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h:50:1:   required by substitution of โ€˜template<class T> typename Eigen::internal::enable_if<true, const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<typename Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<T, ceres::Jet<double, 2>, Eigen::internal::scalar_product_op<T, ceres::Jet<double, 2> > > >::value>::type, ceres::Jet<double, 2> >, const typename Eigen::internal::plain_constant_type<Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1>, typename Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<T, ceres::Jet<double, 2>, Eigen::internal::scalar_product_op<T, ceres::Jet<double, 2> > > >::value>::type>::type, const Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1> > >::type Eigen::operator*(const T&, const StorageBaseType&) [with T = Eigen::Matrix<ceres::Jet<double, 2>, 2, 2>]โ€™
/home/wyh/Downloads/ceres-solver/internal/ceres/jet_test.cc:459:12:   required from here
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:64:8: error: no type named โ€˜Literalโ€™ in โ€˜struct Eigen::NumTraits<ceres::Jet<double, 2> >โ€™
 struct promote_scalar_arg<S,T,false> : promote_scalar_arg_unsupported<S,T,typename NumTraits<S>::Literal> {};
        ^
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h: In instantiation of โ€˜struct Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1>, false>โ€™:
/usr/local/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h:50:1:   required by substitution of โ€˜template<class T> typename Eigen::internal::enable_if<true, const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, typename Eigen::internal::promote_scalar_arg<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, T> > >::value>::type>, const Derived, const typename Eigen::internal::plain_constant_type<Derived, typename Eigen::internal::promote_scalar_arg<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, T> > >::value>::type>::type> >::type Eigen::MatrixBase<Derived>::operator*(const T&) const [with T = T; Derived = Eigen::Matrix<ceres::Jet<double, 2>, 2, 2>] [with T = Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1>]โ€™
/home/wyh/Downloads/ceres-solver/internal/ceres/jet_test.cc:459:12:   required from here
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:64:8: error: no type named โ€˜Literalโ€™ in โ€˜struct Eigen::NumTraits<ceres::Jet<double, 2> >โ€™
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h: In instantiation of โ€˜struct Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1> >, false>โ€™:
/usr/local/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h:50:1:   required by substitution of โ€˜template<class T> typename Eigen::internal::enable_if<true, const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<typename Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<T, ceres::Jet<double, 2>, Eigen::internal::scalar_product_op<T, ceres::Jet<double, 2> > > >::value>::type, ceres::Jet<double, 2> >, const typename Eigen::internal::plain_constant_type<Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 2> >, typename Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<T, ceres::Jet<double, 2>, Eigen::internal::scalar_product_op<T, ceres::Jet<double, 2> > > >::value>::type>::type, const Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 2> > > >::type Eigen::operator*(const T&, const StorageBaseType&) [with T = Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1> >]โ€™
/home/wyh/Downloads/ceres-solver/internal/ceres/jet_test.cc:460:37:   required from here
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:64:8: error: no type named โ€˜Literalโ€™ in โ€˜struct Eigen::NumTraits<ceres::Jet<double, 2> >โ€™
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h: In instantiation of โ€˜struct Eigen::internal::promote_scalar_arg<ceres::Jet<double, 2>, Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 2> >, false>โ€™:
/usr/local/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h:50:1:   required by substitution of โ€˜template<class T> typename Eigen::internal::enable_if<true, const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, typename Eigen::internal::promote_scalar_arg<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, T> > >::value>::type>, const Derived, const typename Eigen::internal::plain_constant_type<Derived, typename Eigen::internal::promote_scalar_arg<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<typename Eigen::internal::traits<T>::Scalar, T, Eigen::internal::scalar_product_op<typename Eigen::internal::traits<T>::Scalar, T> > >::value>::type>::type> >::type Eigen::MatrixBase<Derived>::operator*(const T&) const [with T = T; Derived = Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 1, 0, 2, 1> >] [with T = Eigen::Transpose<Eigen::Matrix<ceres::Jet<double, 2>, 2, 2> >]โ€™
/home/wyh/Downloads/ceres-solver/internal/ceres/jet_test.cc:460:37:   required from here
/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:64:8: error: no type named โ€˜Literalโ€™ in โ€˜struct Eigen::NumTraits<ceres::Jet<double, 2> >โ€™
make[2]: *** [internal/ceres/CMakeFiles/jet_test.dir/jet_test.cc.o] Error 1
make[1]: *** [internal/ceres/CMakeFiles/jet_test.dir/all] Error 2
make: *** [all] Error 2

So I change the eigen version to 3.2.10 and the error disappear and finally the segmentation fault also disappears and the program runs normally. Finally the libraries and tools I use are Eigen 3.2.10, ceres 1.11.0 and cmake 3.6.3. And the following is the output intrinsic parameters:

[camera] # INFO: Final reprojection error: 0.312 pixels
[camera] # INFO: Camera Parameters:
    model_type MEI
   camera_name camera
   image_width 1280
  image_height 960
Mirror Parameters
            xi 0.8508641084
Distortion Parameters
            k1 -0.3162948324
            k2 0.0803981985
            p1 -0.0002393541
            p2 0.0006171507
Projection Parameters
        gamma1 714.7558811236
        gamma2 716.7897975933
            u0 637.5525880360
            v0 476.9495313017

# INFO: Calibration took a total time of 4.245 sec.
# INFO: Wrote calibration file to camera_camera_calib.yaml

difficulty linking on linux with ubuntu 14.04 and linuxbrew

I'm trying to build on linux with linuxbrew on 14.04, and it seems I'm missing one library I need to link, but I'm not sure what it should be, since the table of found libraries seems to be ok. Some of these functions seem to be implemented in netlib, but I'm not sure that's the right thing to add.

Key part of cmake command

cmake .. -DBLAS_LIBRARIES_DIR=~/.linuxbrew/lib -DLAPACK_LIBRARIES_DIR=~/.linuxbrew/lib -DLibrt_LIBRARIES=~/.linuxbrew/lib/librt.so; make VERBOSE=1

linker error

[ 14%] Linking CXX shared library ../../../../../../lib/libceres.so
cd /home/hbr/robonetracker/build/thirdparty/camodocal/src/ceres-solver/internal/ceres && /home/hbr/.linuxbrew/Cellar/cmake/3.3.2/bin/cmake -E cmake_link_script CMakeFiles/ceres.dir/link.txt --verbose=1
/home/hbr/.linuxbrew/bin/c++  -fPIC -Wall -Wno-deprecated -fPIC -finline-limit=400 -fpermissive -mfpmath=sse -msse4.1 -std=c++11 -fopenmp -DCMAKE_BUILD_TYPE=Release -DNDEBUG -O2                   -O3 -ftree-vectorize -ftree-vectorizer-verbose=0 -march=native -Wl,--no-undefined -shared -Wl,-soname,libceres.so -o ../../../../../../lib/libceres.so CMakeFiles/ceres.dir/array_utils.cc.o CMakeFiles/ceres.dir/blas.cc.o CMakeFiles/ceres.dir/block_evaluate_preparer.cc.o CMakeFiles/ceres.dir/block_jacobi_preconditioner.cc.o CMakeFiles/ceres.dir/block_jacobian_writer.cc.o CMakeFiles/ceres.dir/block_random_access_crs_matrix.cc.o CMakeFiles/ceres.dir/block_random_access_dense_matrix.cc.o CMakeFiles/ceres.dir/block_random_access_matrix.cc.o CMakeFiles/ceres.dir/block_random_access_sparse_matrix.cc.o CMakeFiles/ceres.dir/block_sparse_matrix.cc.o CMakeFiles/ceres.dir/block_structure.cc.o CMakeFiles/ceres.dir/c_api.cc.o CMakeFiles/ceres.dir/canonical_views_clustering.cc.o CMakeFiles/ceres.dir/cgnr_solver.cc.o CMakeFiles/ceres.dir/compressed_col_sparse_matrix_utils.cc.o CMakeFiles/ceres.dir/compressed_row_jacobian_writer.cc.o CMakeFiles/ceres.dir/compressed_row_sparse_matrix.cc.o CMakeFiles/ceres.dir/conditioned_cost_function.cc.o CMakeFiles/ceres.dir/conjugate_gradients_solver.cc.o CMakeFiles/ceres.dir/coordinate_descent_minimizer.cc.o CMakeFiles/ceres.dir/corrector.cc.o CMakeFiles/ceres.dir/covariance.cc.o CMakeFiles/ceres.dir/covariance_impl.cc.o CMakeFiles/ceres.dir/cxsparse.cc.o CMakeFiles/ceres.dir/dense_normal_cholesky_solver.cc.o CMakeFiles/ceres.dir/dense_qr_solver.cc.o CMakeFiles/ceres.dir/dense_sparse_matrix.cc.o CMakeFiles/ceres.dir/detect_structure.cc.o CMakeFiles/ceres.dir/dogleg_strategy.cc.o CMakeFiles/ceres.dir/evaluator.cc.o CMakeFiles/ceres.dir/file.cc.o CMakeFiles/ceres.dir/gradient_checking_cost_function.cc.o CMakeFiles/ceres.dir/implicit_schur_complement.cc.o CMakeFiles/ceres.dir/incomplete_lq_factorization.cc.o CMakeFiles/ceres.dir/iterative_schur_complement_solver.cc.o CMakeFiles/ceres.dir/levenberg_marquardt_strategy.cc.o CMakeFiles/ceres.dir/lapack.cc.o CMakeFiles/ceres.dir/line_search.cc.o CMakeFiles/ceres.dir/line_search_direction.cc.o CMakeFiles/ceres.dir/line_search_minimizer.cc.o CMakeFiles/ceres.dir/linear_least_squares_problems.cc.o CMakeFiles/ceres.dir/linear_operator.cc.o CMakeFiles/ceres.dir/linear_solver.cc.o CMakeFiles/ceres.dir/local_parameterization.cc.o CMakeFiles/ceres.dir/loss_function.cc.o CMakeFiles/ceres.dir/low_rank_inverse_hessian.cc.o CMakeFiles/ceres.dir/minimizer.cc.o CMakeFiles/ceres.dir/normal_prior.cc.o CMakeFiles/ceres.dir/parameter_block_ordering.cc.o CMakeFiles/ceres.dir/partitioned_matrix_view.cc.o CMakeFiles/ceres.dir/polynomial.cc.o CMakeFiles/ceres.dir/preconditioner.cc.o CMakeFiles/ceres.dir/problem.cc.o CMakeFiles/ceres.dir/problem_impl.cc.o CMakeFiles/ceres.dir/program.cc.o CMakeFiles/ceres.dir/residual_block.cc.o CMakeFiles/ceres.dir/residual_block_utils.cc.o CMakeFiles/ceres.dir/runtime_numeric_diff_cost_function.cc.o CMakeFiles/ceres.dir/schur_complement_solver.cc.o CMakeFiles/ceres.dir/schur_eliminator.cc.o CMakeFiles/ceres.dir/schur_jacobi_preconditioner.cc.o CMakeFiles/ceres.dir/scratch_evaluate_preparer.cc.o CMakeFiles/ceres.dir/solver.cc.o CMakeFiles/ceres.dir/solver_impl.cc.o CMakeFiles/ceres.dir/sparse_matrix.cc.o CMakeFiles/ceres.dir/sparse_normal_cholesky_solver.cc.o CMakeFiles/ceres.dir/split.cc.o CMakeFiles/ceres.dir/stringprintf.cc.o CMakeFiles/ceres.dir/suitesparse.cc.o CMakeFiles/ceres.dir/triplet_sparse_matrix.cc.o CMakeFiles/ceres.dir/trust_region_minimizer.cc.o CMakeFiles/ceres.dir/trust_region_strategy.cc.o CMakeFiles/ceres.dir/types.cc.o CMakeFiles/ceres.dir/visibility.cc.o CMakeFiles/ceres.dir/visibility_based_preconditioner.cc.o CMakeFiles/ceres.dir/wall_time.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_d_d_d.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_3_4.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_4_4_2.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_3_3.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_4_4_d.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_3_d.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_3_9.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_4_4_3.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_4_d.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_2_2.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_4_4.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_2_d.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_4_4_4.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_4_3.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_2_3.cc.o CMakeFiles/ceres.dir/generated/schur_eliminator_2_2_4.cc.o  -L/home/hbr/robonetracker/build/lib -lglog -Wl,-Bstatic -lspqr -lcholmod -lccolamd -lcamd -lcolamd -lamd -lsuitesparseconfig -lcxsparse -Wl,-Bdynamic -lgomp -lgflags -lpthread -lglog -ldl -lnsl -lm -lpthread -lrt -Wl,-Bstatic -lcholmod -lamd -lcamd -lcolamd -lccolamd -lldl -lspqr -lsuitesparseconfig -lcxsparse -Wl,-Bdynamic -ltbb -ltbbmalloc -lglog -Wl,-Bstatic -lcholmod -lccolamd -lcamd -lcolamd -lamd -Wl,-Bdynamic -lgomp -lgflags -lpthread -ldl -lnsl -lm -lrt -Wl,-Bstatic -lldl -Wl,-Bdynamic -ltbb -ltbbmalloc -Wl,-rpath,/home/hbr/robonetracker/build/lib 
CMakeFiles/ceres.dir/blas.cc.o: In function `ceres::internal::BLAS::SymmetricRankKUpdate(int, int, double const*, bool, double, double, double*)':
blas.cc:(.text+0x62): undefined reference to `dsyrk_'
CMakeFiles/ceres.dir/lapack.cc.o: In function `ceres::internal::LAPACK::SolveInPlaceUsingCholesky(int, double const*, double*)':
lapack.cc:(.text+0x4c): undefined reference to `dpotrf_'
lapack.cc:(.text+0xd8): undefined reference to `dpotrs_'
CMakeFiles/ceres.dir/lapack.cc.o: In function `ceres::internal::LAPACK::SolveUsingQR(int, int, double const*, int, double*, double*)':
lapack.cc:(.text+0x1b6): undefined reference to `dgels_'
CMakeFiles/ceres.dir/lapack.cc.o: In function `ceres::internal::LAPACK::EstimateWorkSizeForQR(int, int)':
lapack.cc:(.text+0x22a): undefined reference to `dgels_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_maxcolnorm.o): In function `double spqr_maxcolnorm<double>(cholmod_sparse_struct*, cholmod_common_struct*)':
spqr_maxcolnorm.cpp:(.text._Z15spqr_maxcolnormIdEdP21cholmod_sparse_structP21cholmod_common_struct[_Z15spqr_maxcolnormIdEdP21cholmod_sparse_structP21cholmod_common_struct]+0xd0): undefined reference to `dnrm2_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_maxcolnorm.o): In function `double spqr_maxcolnorm<std::complex<double> >(cholmod_sparse_struct*, cholmod_common_struct*)':
spqr_maxcolnorm.cpp:(.text._Z15spqr_maxcolnormISt7complexIdEEdP21cholmod_sparse_structP21cholmod_common_struct[_Z15spqr_maxcolnormISt7complexIdEEdP21cholmod_sparse_structP21cholmod_common_struct]+0xd4): undefined reference to `dznrm2_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_front.o): In function `long spqr_front<double>(long, long, long, double, long, long, double*, long*, char*, double*, double*, double*, double*, cholmod_common_struct*)':
spqr_front.cpp:(.text._Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct[_Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct]+0x2f9): undefined reference to `dlarfg_'
spqr_front.cpp:(.text._Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct[_Z10spqr_frontIdElllldllPT_PlPcS1_S1_PdS4_P21cholmod_common_struct]+0x52c): undefined reference to `dlarf_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_front.o): In function `long spqr_front<std::complex<double> >(long, long, long, double, long, long, std::complex<double>*, long*, char*, std::complex<double>*, std::complex<double>*, double*, double*, cholmod_common_struct*)':
spqr_front.cpp:(.text._Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct[_Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct]+0x337): undefined reference to `zlarfg_'
spqr_front.cpp:(.text._Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct[_Z10spqr_frontISt7complexIdEElllldllPT_PlPcS3_S3_PdS6_P21cholmod_common_struct]+0x5eb): undefined reference to `zlarf_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_larftb.o): In function `spqr_private_larft(char, char, long, long, double*, long, double*, double*, long, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z18spqr_private_larftccllPdlS_S_lP21cholmod_common_struct[_Z18spqr_private_larftccllPdlS_S_lP21cholmod_common_struct]+0x87): undefined reference to `dlarft_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_larftb.o): In function `spqr_private_larft(char, char, long, long, std::complex<double>*, long, std::complex<double>*, std::complex<double>*, long, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z18spqr_private_larftccllPSt7complexIdElS1_S1_lP21cholmod_common_struct[_Z18spqr_private_larftccllPSt7complexIdElS1_S1_lP21cholmod_common_struct]+0x87): undefined reference to `zlarft_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_larftb.o): In function `spqr_private_larfb(char, char, char, char, long, long, long, double*, long, double*, long, double*, long, double*, long, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z18spqr_private_larfbcccclllPdlS_lS_lS_lP21cholmod_common_struct[_Z18spqr_private_larfbcccclllPdlS_lS_lS_lP21cholmod_common_struct]+0xfb): undefined reference to `dlarfb_'
/home/hbr/.linuxbrew/lib/libspqr.a(spqr_larftb.o): In function `spqr_private_larfb(char, char, char, char, long, long, long, std::complex<double>*, long, std::complex<double>*, long, std::complex<double>*, long, std::complex<double>*, long, cholmod_common_struct*)':
spqr_larftb.cpp:(.text._Z18spqr_private_larfbcccclllPSt7complexIdElS1_lS1_lS1_lP21cholmod_common_struct[_Z18spqr_private_larfbcccclllPSt7complexIdElS1_lS1_lS1_lP21cholmod_common_struct]+0x106): undefined reference to `zlarfb_'
/home/hbr/.linuxbrew/lib/libcholmod.a(cholmod_super_numeric.o): In function `r_cholmod_super_numeric.isra.18':
cholmod_super_numeric.c:(.text.unlikely+0x77c): undefined reference to `dsyrk_'
cholmod_super_numeric.c:(.text.unlikely+0x84a): undefined reference to `dgemm_'
cholmod_super_numeric.c:(.text.unlikely+0xab9): undefined reference to `dpotrf_'
cholmod_super_numeric.c:(.text.unlikely+0xc48): undefined reference to `dtrsm_'
/home/hbr/.linuxbrew/lib/libcholmod.a(cholmod_super_numeric.o): In function `c_cholmod_super_numeric.isra.19':
cholmod_super_numeric.c:(.text.unlikely+0x147c): undefined reference to `zherk_'
cholmod_super_numeric.c:(.text.unlikely+0x1550): undefined reference to `zgemm_'
cholmod_super_numeric.c:(.text.unlikely+0x17c0): undefined reference to `zpotrf_'
cholmod_super_numeric.c:(.text.unlikely+0x195f): undefined reference to `ztrsm_'
/home/hbr/.linuxbrew/lib/libcholmod.a(cholmod_super_numeric.o): In function `z_cholmod_super_numeric.isra.20':
cholmod_super_numeric.c:(.text.unlikely+0x21f7): undefined reference to `zherk_'
cholmod_super_numeric.c:(.text.unlikely+0x22cb): undefined reference to `zgemm_'
cholmod_super_numeric.c:(.text.unlikely+0x253f): undefined reference to `zpotrf_'
cholmod_super_numeric.c:(.text.unlikely+0x26de): undefined reference to `ztrsm_'
/home/hbr/.linuxbrew/lib/libcholmod.a(cholmod_super_solve.o): In function `cholmod_super_lsolve':
cholmod_super_solve.c:(.text+0x410): undefined reference to `dtrsv_'
cholmod_super_solve.c:(.text+0x49a): undefined reference to `dgemv_'
cholmod_super_solve.c:(.text+0x562): undefined reference to `dtrsm_'
cholmod_super_solve.c:(.text+0x6e0): undefined reference to `dgemm_'
cholmod_super_solve.c:(.text+0x8f1): undefined reference to `ztrsv_'
cholmod_super_solve.c:(.text+0x97f): undefined reference to `zgemv_'
cholmod_super_solve.c:(.text+0xa6a): undefined reference to `ztrsm_'
cholmod_super_solve.c:(.text+0xbfd): undefined reference to `zgemm_'
/home/hbr/.linuxbrew/lib/libcholmod.a(cholmod_super_solve.o): In function `cholmod_super_ltsolve':
cholmod_super_solve.c:(.text+0x1081): undefined reference to `dgemv_'
cholmod_super_solve.c:(.text+0x10e6): undefined reference to `dtrsv_'
cholmod_super_solve.c:(.text+0x1284): undefined reference to `dgemm_'
cholmod_super_solve.c:(.text+0x1318): undefined reference to `dtrsm_'
cholmod_super_solve.c:(.text+0x14da): undefined reference to `zgemv_'
cholmod_super_solve.c:(.text+0x1544): undefined reference to `ztrsv_'
cholmod_super_solve.c:(.text+0x16f7): undefined reference to `zgemm_'
cholmod_super_solve.c:(.text+0x1794): undefined reference to `ztrsm_'
collect2: error: ld returned 1 exit status
thirdparty/camodocal/src/ceres-solver/internal/ceres/CMakeFiles/ceres.dir/build.make:2500: recipe for target 'lib/libceres.so' failed
make[2]: *** [lib/libceres.so] Error 1
make[2]: Leaving directory '/home/hbr/robonetracker/build'
CMakeFiles/Makefile2:1915: recipe for target 'thirdparty/camodocal/src/ceres-solver/internal/ceres/CMakeFiles/ceres.dir/all' failed
make[1]: *** [thirdparty/camodocal/src/ceres-solver/internal/ceres/CMakeFiles/ceres.dir/all] Error 2
make[1]: Leaving directory '/home/hbr/robonetracker/build'
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

remove ceres-solver source code?

I've been using ceres-solver 1.11 as installed by ubuntu 14.04 and homebrew on os x, and I believe it works ok. What do people think of removing it from the camodocal build tree? It could potentially simplify cmake configuration and installation noticeably.

make error

CMakeFiles/camodocal_features2d.dir/ORBGPU.cc.o: In function camodocal::ORBGPU::ORBGPU(int, float, int, int, int, int, int, int)': ORBGPU.cc:(.text+0x108): undefined reference to cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
CMakeFiles/camodocal_features2d.dir/SurfGPU.cc.o: In function camodocal::SurfGPU::SurfGPU(double, int, int, bool, float)': SurfGPU.cc:(.text+0x96): undefined reference to cv::cuda::DescriptorMatcher::createBFMatcher(int)'
collect2: error: ld returned 1 exit status
src/features2d/CMakeFiles/camodocal_features2d.dir/build.make:184: recipe for target 'lib/libcamodocal_features2d.so' failed
make[2]: *** [lib/libcamodocal_features2d.so] Error 1
CMakeFiles/Makefile2:1149: recipe for target 'src/features2d/CMakeFiles/camodocal_features2d.dir/all' failed
make[1]: *** [src/features2d/CMakeFiles/camodocal_features2d.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Using Hand Eye Calibration

I'm trying to use the hand Eye calibration and I'm getting values that are way off, so I was hoping for some help. I'm using a robot arm and an optical tracker, aka camera, plus a fiducial attached to the end effector. In my case the camera is not on the hand, but instead sitting off to the side looking at the arm.

HandEyeCalibrationQuestion

I'm moving the arm to a series of 36 points on a path (blue line), and near each point I'm taking a position (xyz) and orientation (angle axis with theta magnitude) of Camera->Fiducial and Base->EndEffector, and putting them in the vectors required by the HandEyeCalibration Algorithm. I also make sure to vary the orientation by about +-30 degrees or so in roll pitch yaw.

I then run estimateHandEyeScrew, and I get the following results, and as you can see the position is off by an order of magnitude.

[-0.0583, 0.0387, -0.0373] Real
[-0.185, -0.404, -0.59] Estimated with HandEyeCalib

Here is the full transforms and debug output:

# INFO: Before refinement: H_12 =
-0.443021 -0.223478  -0.86821  0.321341
 0.856051 -0.393099 -0.335633  0.470857
-0.266286 -0.891925   0.36546   2.07762
        0         0         0         1
Ceres Solver Report: Iterations: 140, Initial cost: 2.128370e+03, Final cost: 6.715033e+00, Termination: FUNCTION_TOLERANCE.
# INFO: After refinement: H_12 =
  0.896005   0.154992  -0.416117  -0.185496
 -0.436281    0.13281  -0.889955  -0.404254
-0.0826716   0.978948   0.186618  -0.590227
         0          0          0          1


expected RobotTipToFiducial (simulation only):   0.168   -0.861    0.481  -0.0583
expected RobotTipToFiducial (simulation only):   0.461   -0.362    -0.81   0.0387
expected RobotTipToFiducial (simulation only):   0.871    0.358    0.336  -0.0373
expected RobotTipToFiducial (simulation only):       0        0        0        1


estimated RobotTipToFiducial:   0.896    0.155   -0.416   -0.185
estimated RobotTipToFiducial:  -0.436    0.133    -0.89   -0.404
estimated RobotTipToFiducial: -0.0827    0.979    0.187    -0.59
estimated RobotTipToFiducial:       0        0        0        1

Am I perhaps using it in the wrong way? Is there any advice you can give?

reprojection error

When I used intrinsic_calib to calibrate my camera. After STEP 1: Estimate intrinsics and STEP 2: Estimate extrinsics the reprojection error is 79.94 ,and then after STEP 3: optimization using ceres,the error is more than 83.Why? Can you help me ?
Here is the pics: http://pan.baidu.com/s/1eQreDSQ

Segmentation Fault when running extrinsic calibration

I've been trying to run the extrinsic_calib example provided with CamOdoCal but keep running into a segmentation fault.

My system is set up as follows:
My camodocal folder is located in /home/jrebello/projects. I then set up the following structure

  1. In my camodocal folder I created another folder called 'gaist_data'
  2. In 'gaist_data' I set up various other folders such as (1) 'calib', (2) 'calibration_data', (3) 'data', (4) 'input' to hold the (1) intrinsic calibration data of the cameras, (2) empty, (3) empty, and (4) frames and the Event.dat file [as shown in the image provided]
  3. I also moved only the 'surf64.yml.gz' file to the build/bin folder.

I run the program with the following cammand:
bin/extrinsic_calib --calib /home/jrebello/projects/camodocal/gaist_data/calib --camera-count 3 --output /home/jrebello/projects/camodocal/gaist_data/calibration_data/ --motions 200 --input /home/jrebello/projects/camodocal/gaist_data/input --data /home/jrebello/projects/camodocal/gaist_data/data/ --event /home/jrebello/projects/camodocal/gaist_data/input/Event_152516_123_150-400.dat

but get the following error

INFO: Initializing...

Read /home/jrebello/projects/camodocal/gaist_data/input/Event_152516_123_150-400.dat file to get all the events

INFO: Initialization finished!

GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [9953]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10015]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10078]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10156]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10218]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10280]
IMG: 10218 -> /home/jrebello/projects/camodocal/gaist_data/input/frames_0/Front_154.jpg
Pose : 10280
-0.669131 0.743145 0
-0.743145 -0.669131 0
0 0 1

INFO: Running camera-odometry calibration for each of the 3 cameras.

Segmentation fault (core dumped)

I have also followed the issue list and made the required changes such as this one according to issue #31 #31. I ran gdb on the program and found the error was in
camodocal::interpolatePose (poseBuffer=..., timestamp=timestamp@entry=10218, interpPose=...) at /home/jrebello/projects/camodocal/src/calib/utils.cc:76

Does anyone have any thoughts on how to solve this issue or have any data that I can use with extrinsic_calib ? Please let me know if you require more information.

Also, can someone provide me with data of a working example that runs on the latest source code. Thanks.

Bug found in SurfGPU.cc for OpenCV3 with no CUDA

My testing environment: OpenCV 3.0 with No CUDA

I believe the bug is more related to OpenCV 3 or else not because CUDA or no CUDA.

In the function SurfGPU::match, defined in SurfGPU.cc, it calls

m_matcher->knnMatch(dtorsGPU[0], dtorsGPU[1], candidateFwdMatches, 2);

in which, for OpenCV 3.0 (both Cuda and Non Cuda environment), m_matcher is not defined. This crashed the program. Could you please verify if that is the case and if possible suggest a solution for this please? Thank you very much.

PS. I couldn't built the latest source code from Github so I have to use the previously committed version. Is there any change in make??

Has anyone experienced this error: malloc(): memory corruption with extrinsic_calib?

Hello,

I have set up an Ubuntu 14.04 with OpenCV3.0 and CUDA. Using the previous committed source code, CamOdoCal was built successfully. However, when I ran it, it showed this error:

.# INFO: Initializing...
.# INFO: Initialization finished!
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [9953]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10015]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10078]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10156]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10218]
GPS: lat=53.9487, lon=-1.04606, alt=0, qx=0, qy=0, qz=0.913545, qw=-0.406737 [10280]
IMG: 10218 -> /home/supannee/src/camodocal-master/gaist_data/sample_test//frames_0/Front_154.jpg
.# INFO: Running camera-odometry calibration for each of the 3 cameras.
*** Error in `bin/extrinsic_calib': malloc(): memory corruption: 0x00007fc416238f20 ***
LOC: 5979583.339446 628229.702183 0.000000

I had no error running the same dataset on a Virtual Machine Ubuntu (without CUDA).

Just in case, anyone has found this error before and know how to fix this. Thank you very much.

Unknown CMake command "camodocal_library".

Excuse me, shall I know anyone successfully build CamOdoCal with OpenCV 2.4.6 on Windows? There is a question below:
The C compiler identification is MSVC 16.0.30319.1
The CXX compiler identification is MSVC 16.0.30319.1
Check for working C compiler using: Visual Studio 10 2010
Check for working C compiler using: Visual Studio 10 2010 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 10 2010
Check for working CXX compiler using: Visual Studio 10 2010 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
CMake Error at brisk/CMakeLists.txt:12 (camodocal_library):
Unknown CMake command "camodocal_library".

CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.0)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

Bug found in cmake/LibraryConfig.cmake

In the if(OpenCV_FOUND) ... endif() part:
The three if branches following three check_include_file_cxx parts share the same structure as:
if(have the file) ... elseif() print_error_message endif()
These parts should be used to find the target files, if the files are not found, corresponding error messages will be printed out. But to print out the error message, else() instead of elseif() should be used. Since if elseif() is used, the printing part will be ignored when no target file was found.
So the elseif()s should be replaced with else():
if(have the file) ... else() print_error_message endif()

bin/intrinsic_calib (core dumped)

Hello,

I wanted to use camodocal and I've started with examples provided with your package. Something went wrong on my PC so I've set up a clean virtual machine with Ubuntu 16.04 and also faced the problem below. I know it's something with EIGEN alignment, but before I'll dive into the code I thought maybe someone is already aware of it?

intrinsic_calib: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 4; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
Aborted (core dumped)

For sake of completeness the whole verbose output of the program:

ubuntu@ubuntu-VirtualBox:~/camodocal/build$ bin/intrinsic_calib -i ../data/images/ -p img --camera-model mei --verbose
# INFO: Camera model: Mei
# INFO: Adding ../data/images/img117.bmp
# INFO: Adding ../data/images/img108.bmp
# INFO: Adding ../data/images/img84.bmp
# INFO: Adding ../data/images/img22.bmp
# INFO: Adding ../data/images/img115.bmp
# INFO: Adding ../data/images/img19.bmp
# INFO: Adding ../data/images/img110.bmp
# INFO: Adding ../data/images/img17.bmp
# INFO: Adding ../data/images/img52.bmp
# INFO: Adding ../data/images/img4.bmp
# INFO: Adding ../data/images/img42.bmp
# INFO: Adding ../data/images/img26.bmp
# INFO: Adding ../data/images/img53.bmp
# INFO: Adding ../data/images/img160.bmp
# INFO: Adding ../data/images/img77.bmp
# INFO: Adding ../data/images/img60.bmp
# INFO: Adding ../data/images/img111.bmp
# INFO: Adding ../data/images/img20.bmp
# INFO: Adding ../data/images/img55.bmp
# INFO: Adding ../data/images/img30.bmp
# INFO: Adding ../data/images/img5.bmp
# INFO: Adding ../data/images/img54.bmp
# INFO: Adding ../data/images/img56.bmp
# INFO: Adding ../data/images/img39.bmp
# INFO: Adding ../data/images/img113.bmp
# INFO: Adding ../data/images/img87.bmp
# INFO: Adding ../data/images/img61.bmp
# INFO: Adding ../data/images/img25.bmp
# INFO: Adding ../data/images/img148.bmp
# INFO: Adding ../data/images/img158.bmp
# INFO: Adding ../data/images/img139.bmp
# INFO: Adding ../data/images/img129.bmp
# INFO: Adding ../data/images/img131.bmp
# INFO: Adding ../data/images/img137.bmp
# INFO: Adding ../data/images/img69.bmp
# INFO: Adding ../data/images/img47.bmp
# INFO: Adding ../data/images/img159.bmp
# INFO: Adding ../data/images/img1.bmp
# INFO: Adding ../data/images/img82.bmp
# INFO: Adding ../data/images/img112.bmp
# INFO: Adding ../data/images/img136.bmp
# INFO: Adding ../data/images/img116.bmp
# INFO: Adding ../data/images/img79.bmp
# INFO: Adding ../data/images/img48.bmp
# INFO: Adding ../data/images/img32.bmp
# INFO: Adding ../data/images/img58.bmp
# INFO: Adding ../data/images/img23.bmp
# INFO: Adding ../data/images/img80.bmp
# INFO: Adding ../data/images/img83.bmp
# INFO: Adding ../data/images/img34.bmp
# INFO: Adding ../data/images/img18.bmp
# INFO: Adding ../data/images/img140.bmp
# INFO: Adding ../data/images/img149.bmp
# INFO: Adding ../data/images/img76.bmp
# INFO: Adding ../data/images/img2.bmp
# INFO: Adding ../data/images/img44.bmp
# INFO: Adding ../data/images/img45.bmp
# INFO: Adding ../data/images/img70.bmp
# INFO: Adding ../data/images/img0.bmp
# INFO: Adding ../data/images/img40.bmp
# INFO: Adding ../data/images/img78.bmp
# INFO: Adding ../data/images/img81.bmp
# INFO: Adding ../data/images/img85.bmp
# INFO: # images: 63
# INFO: Detected chessboard in image 1
# INFO: Detected chessboard in image 2
# INFO: Detected chessboard in image 3
# INFO: Detected chessboard in image 4
# INFO: Detected chessboard in image 5
# INFO: Did not detect chessboard in image 6
# INFO: Detected chessboard in image 7
# INFO: Did not detect chessboard in image 8
# INFO: Detected chessboard in image 9
# INFO: Detected chessboard in image 10
# INFO: Detected chessboard in image 11
# INFO: Detected chessboard in image 12
# INFO: Detected chessboard in image 13
# INFO: Detected chessboard in image 14
# INFO: Detected chessboard in image 15
# INFO: Detected chessboard in image 16
# INFO: Detected chessboard in image 17
# INFO: Detected chessboard in image 18
# INFO: Detected chessboard in image 19
# INFO: Did not detect chessboard in image 20
# INFO: Detected chessboard in image 21
# INFO: Detected chessboard in image 22
# INFO: Detected chessboard in image 23
# INFO: Detected chessboard in image 24
# INFO: Detected chessboard in image 25
# INFO: Detected chessboard in image 26
# INFO: Detected chessboard in image 27
# INFO: Detected chessboard in image 28
# INFO: Detected chessboard in image 29
# INFO: Detected chessboard in image 30
# INFO: Detected chessboard in image 31
# INFO: Detected chessboard in image 32
# INFO: Detected chessboard in image 33
# INFO: Detected chessboard in image 34
# INFO: Detected chessboard in image 35
# INFO: Detected chessboard in image 36
# INFO: Detected chessboard in image 37
# INFO: Did not detect chessboard in image 38
# INFO: Detected chessboard in image 39
# INFO: Detected chessboard in image 40
# INFO: Detected chessboard in image 41
# INFO: Detected chessboard in image 42
# INFO: Detected chessboard in image 43
# INFO: Detected chessboard in image 44
# INFO: Detected chessboard in image 45
# INFO: Detected chessboard in image 46
# INFO: Detected chessboard in image 47
# INFO: Detected chessboard in image 48
# INFO: Detected chessboard in image 49
# INFO: Detected chessboard in image 50
# INFO: Did not detect chessboard in image 51
# INFO: Detected chessboard in image 52
# INFO: Detected chessboard in image 53
# INFO: Detected chessboard in image 54
# INFO: Detected chessboard in image 55
# INFO: Detected chessboard in image 56
# INFO: Detected chessboard in image 57
# INFO: Detected chessboard in image 58
# INFO: Did not detect chessboard in image 59
# INFO: Detected chessboard in image 60
# INFO: Detected chessboard in image 61
# INFO: Detected chessboard in image 62
# INFO: Detected chessboard in image 63
# INFO: Calibrating...
[camera] # INFO: Initial reprojection error: 3.655 pixels
intrinsic_calib: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 4; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
Aborted (core dumped)

And gdb backtrace:

Thread 1 "intrinsic_calib" received signal SIGABRT, Aborted.
0x00007fffee97a428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007fffee97a428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007fffee97c02a in __GI_abort () at abort.c:89
#2  0x00007fffee972bd7 in __assert_fail_base (fmt=<optimized out>, 
    assertion=assertion@entry=0x7ffff72d1318 "(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAss"..., file=file@entry=0x7ffff72d12e0 "/usr/include/eigen3/Eigen/src/Core/DenseStorage.h", line=line@entry=128, 
    function=function@entry=0x7ffff72d3420 <Eigen::internal::plain_array<double, 4, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 4; int MatrixOrArrayOptions = 0]") at assert.c:92
#3  0x00007fffee972c82 in __GI___assert_fail (
    assertion=0x7ffff72d1318 "(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && \"this assertion is explained here: \" \"http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAss"..., file=0x7ffff72d12e0 "/usr/include/eigen3/Eigen/src/Core/DenseStorage.h", line=128, 
    function=0x7ffff72d3420 <Eigen::internal::plain_array<double, 4, 0, 32>::plain_array()::__PRETTY_FUNCTION__> "Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 4; int MatrixOrArrayOptions = 0]") at assert.c:101
#4  0x00007ffff70d7fe3 in Eigen::internal::plain_array<double, 4, 0, 32>::plain_array (this=0x1fe2bf0) at /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128
#5  0x00007ffff70d22aa in Eigen::DenseStorage<double, 4, 4, 1, 0>::DenseStorage (this=0x1fe2bf0) at /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:187
#6  0x00007ffff70d2b94 in Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> >::PlainObjectBase (this=0x1fe2bf0) at /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:457
#7  0x00007ffff70d06fe in Eigen::Matrix<double, 4, 1, 0, 4, 1>::Matrix (this=0x1fe2bf0) at /usr/include/eigen3/Eigen/src/Core/Matrix.h:259
#8  0x00007ffff70ce158 in Eigen::Quaternion<double, 0>::Quaternion (this=0x1fe2bf0) at /usr/include/eigen3/Eigen/src/Geometry/Quaternion.h:242
#9  0x00007fffec4bf9ec in camodocal::Transform::Transform (this=0x1fe2bf0) at /home/ubuntu/camodocal/src/sparse_graph/Transform.cc:6
#10 0x00007ffff71a402c in __gnu_cxx::new_allocator<camodocal::Transform>::construct<camodocal::Transform> (this=0x7fffffffcc90, __p=0x1fe2bf0) at /usr/include/c++/5/ext/new_allocator.h:120
#11 0x00007ffff71a2acc in std::allocator_traits<Eigen::aligned_allocator<camodocal::Transform> >::_S_construct<camodocal::Transform> (__a=..., __p=0x1fe2bf0) at /usr/include/c++/5/bits/alloc_traits.h:256
#12 0x00007ffff71a10aa in std::allocator_traits<Eigen::aligned_allocator<camodocal::Transform> >::construct<camodocal::Transform> (__a=..., __p=0x1fe2bf0) at /usr/include/c++/5/bits/alloc_traits.h:402
#13 0x00007ffff719f981 in std::__uninitialized_default_n_a<camodocal::Transform*, unsigned long, Eigen::aligned_allocator<camodocal::Transform> > (__first=0x1fe2bf0, __n=57, __alloc=...)
    at /usr/include/c++/5/bits/stl_uninitialized.h:623
#14 0x00007ffff719d975 in std::vector<camodocal::Transform, Eigen::aligned_allocator<camodocal::Transform> >::_M_default_initialize (this=0x7fffffffcc90, __n=57)
    at /usr/include/c++/5/bits/stl_vector.h:1311
#15 0x00007ffff719b235 in std::vector<camodocal::Transform, Eigen::aligned_allocator<camodocal::Transform> >::vector (this=0x7fffffffcc90, __n=57, __a=...) at /usr/include/c++/5/bits/stl_vector.h:279
#16 0x00007ffff7196bae in camodocal::CameraCalibration::optimize (this=0x7fffffffdb60, camera=..., rvecs=std::vector of length 57, capacity 57 = {...}, 
    tvecs=std::vector of length 57, capacity 57 = {...}) at /home/ubuntu/camodocal/src/calib/CameraCalibration.cc:471
#17 0x00007ffff71968cb in camodocal::CameraCalibration::calibrateHelper (this=0x7fffffffdb60, camera=..., rvecs=std::vector of length 57, capacity 57 = {...}, 
    tvecs=std::vector of length 57, capacity 57 = {...}) at /home/ubuntu/camodocal/src/calib/CameraCalibration.cc:450
#18 0x00007ffff719425c in camodocal::CameraCalibration::calibrate (this=0x7fffffffdb60) at /home/ubuntu/camodocal/src/calib/CameraCalibration.cc:75
#19 0x0000000000489879 in main (argc=8, argv=0x7fffffffddb8) at /home/ubuntu/camodocal/src/examples/intrinsic_calib.cc:198

The instructions I've used to set up the virtual machine:

sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install cmake cmake-curses-gui git libboost-all-dev python-pip virtualbox-guest-utils libyaml-cpp-dev qtcreator libopenblas-dev libeigen3-dev libgoogle-glog-dev libatlas-base-dev libsuitesparse-dev libsuitesparse-dev libblas-dev liblapack-dev liblapacke-dev

cd
git clone https://github.com/opencv/opencv_contrib.git
git clone http://github.com/opencv/opencv.git
cd opencv && mkdir build && cd build
cmake -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -DBUILD_opencv_legacy=OFF ../
make
sudo make install

cd 
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver && mkdir build && cd build
cmake ../
make
sudo make install

Problem linking opencv nonfree libraries

When compiling the code using openCV 2.4, I came across the following error:

CMakeFiles/camodocal_dvision.dir/SurfSet.cpp.o: In function `DVision::SurfSet::extract(cv::Mat const&, CvSURFParams const&)':
SurfSet.cpp:(.text+0x14af): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
SurfSet.cpp:(.text+0x163d): undefined reference to `cv::SURF::operator()(cv::_InputArray const&, cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_OutputArray const&, bool) const'
SurfSet.cpp:(.text+0x1803): undefined reference to `VTT for cv::SURF'
CMakeFiles/camodocal_dvision.dir/SurfSet.cpp.o: In function `DVision::SurfSet::compute(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, CvSURFParams const&)':
SurfSet.cpp:(.text+0x1d63): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
SurfSet.cpp:(.text+0x1ee1): undefined reference to `cv::SURF::operator()(cv::_InputArray const&, cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::_OutputArray const&, bool) const'
SurfSet.cpp:(.text+0x208f): undefined reference to `VTT for cv::SURF'
CMakeFiles/camodocal_dvision.dir/SurfSet.cpp.o: In function `cv::SURF::~SURF()':
SurfSet.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x10): undefined reference to `VTT for cv::SURF'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libcamodocal_dvision.so] Error 1
make[1]: *** [src/dbow2/DVision/CMakeFiles/camodocal_dvision.dir/all] Error 2
make: *** [all] Error 2

It is a linking problem with the opencv nonfree libraries, I solved it by adding "opencv_nonfree" to target link libraries in camodocal/src/dbow2/DVision/CMakeLists.txt

support custom install dir in find scripts for all dependencies

If required dependencies are installed in a separate location, it should be possible to specify

cmake .. -Ddepname_DIR=path/to/dep

For all the relevant dependencies. This is necessary to support non-standard build environments, particularly when a specific build configuration is required by other dependencies in a project that are not camodocal, and in standalone environments such as those that can be created using linuxbrew.

libceres.so not compile

Hi!

I get this error when compiling

This version is worth
http://faculty.cse.tamu.edu/davis/SuiteSparse/
SuiteSparse-3.7.1.tar.gz

Linking CXX shared library ../../../../lib/libceres.so
CMakeFiles/ceres.dir/covariance_impl.cc.o: In function ceres::internal::CovarianceImpl::ComputeCovarianceValuesUsingSparseQR()': /home/slava/workspace/camodocal/src/ceres-solver/internal/ceres/covariance_impl.cc:678: undefined reference tolong SuiteSparseQR(int, double, long, cholmod_sparse_struct_, cholmod_sparse_struct__, long__, cholmod_common_struct_)'
collect2: error: ld returned 1 exit status

Help please!

Possible build issue with OpenCV 2.4.11

Hi,

May I know anyone successfully build CamOdoCal with OpenCV 2.4.11? I setup camodocal on Ubuntu, MacBook Pro 15 with nvidia GT750m, but encountered build error using "make" after "cmake" command, and it seems related to SurfGPU.cc. However, my OpenCV 2.4.11 installation (cmake/make/make install) on MBP is flawless, but OpenCV 2.4.9 did cause some errors. Would you suggest to use only OpenCV 2.4.9? Or, there might be other issues?

And also, while "cmake" this project, all the environment path are found including CUDA, Eigen, OpenCV and OpenMP. I can also "nvcc -V" to see my CUDA 6.5. But the dependency table shows CUDA "no". Any idea about fixing this issue from my side?

I had tried to build camodocal for 2 weeks, and any support will be very appreciated!

Best,
Jay

More details below for "make" error after cmake:

make[2]: *** [src/features2d/CMakeFiles/camodocal_features2d.dir/SurfGPU.cc.o] Error 1
make[1]: *** [src/features2d/CMakeFiles/camodocal_features2d.dir/all] Error 2
make: *** [all] Error 2

For cmake report (cmake -DCMAKE_BUILD_TYPE=Release ..):

...
(removed)
...
-- Found CUDA: /usr/local/cuda (found version "6.5")
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")
-- A library with LAPACK API found.
-- Found OpenCV: /usr/local/lib/libopencv_calib3d.so
-- Found OpenCV: /usr/local/lib/libopencv_contrib.so
-- Found OpenCV: /usr/local/include
-- Found OpenCV: /usr/local/lib/libopencv_gpu.so
-- Found OpenCV: /usr/local/lib/libopencv_highgui.so
-- Found OpenCV: /usr/local/lib/libopencv_imgproc.so
-- Found OpenCV: /usr/local/lib/libopencv_legacy.so
-- Found OpenCV: /usr/local/lib/libopencv_ml.so
-- Found GTest: /usr/lib/libgtest.a
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
...
(removed)
...
-- Found OpenMP.


-- DEPENDENCY: Required: Found:


-- BLAS yes yes
-- CUDA yes no
-- Eigen3 yes yes
-- LAPACK yes yes
-- OpenCV yes yes
-- SuiteSparse yes yes
-- GTest no yes
-- OpenMP no yes


-- Library: Build: Condition:


-- ceres TRUE (satisfied)
-- camodocal_brisk TRUE (satisfied)
-- camodocal_calib TRUE (satisfied)
-- camodocal_camera_models TRUE (satisfied)
-- camodocal_camera_systems TRUE (satisfied)
-- camodocal_chessboard TRUE (satisfied)
-- camodocal_DBoW2 TRUE (satisfied)
-- camodocal_DUtils TRUE (satisfied)
-- camodocal_DUtilsCV TRUE (satisfied)
-- camodocal_DVision TRUE (satisfied)
-- camodocal_features2d TRUE (satisfied)
-- camodocal_gpl TRUE (satisfied)
-- camodocal_infrastr_calib TRUE (satisfied)
-- camodocal_location_recognitionTRUE (satisfied)
-- camodocal_fivepoint TRUE (satisfied)
-- camodocal_pose_estimation TRUE (satisfied)
-- camodocal_pose_graph TRUE (satisfied)
-- camodocal_pugixml TRUE (satisfied)
-- camodocal_sparse_graph TRUE (satisfied)
-- camodocal_visual_odometry TRUE (satisfied)


-- Executable: Build: Condition:


-- dbow2_demo TRUE (satisfied)
-- intrinsic_calib TRUE (satisfied)
-- stereo_calib TRUE (satisfied)
-- extrinsic_calib TRUE (satisfied)
-- train_voctree TRUE (satisfied)


-- Test: Build: Condition:


-- CamOdoCalibration_test TRUE (satisfied)
-- HandEyeCalibration_test TRUE (satisfied)
-- PlanarHandEyeCalibration_test TRUE (satisfied)
-- CataCamera_test TRUE (satisfied)
-- EquidistantCamera_test TRUE (satisfied)
-- PinholeCamera_test TRUE (satisfied)
-- SlidingWindowBA_test TRUE (satisfied)

-- Configuring done
-- Generating done
-- Build files have been written to:

Question regarding running extrinsic_calib

There is a problem that has already been bothering me for a long time.

When it runs to m_camOdoCalib.calibrate(H_cam_odo),
if (!m_camOdoTransformUseEstimate)
{
// m_camOdoCalib.writeMotionSegmentsToFile(filename);
Eigen::Matrix4d H_cam_odo;
m_camOdoCalib.calibrate(H_cam_odo);
m_camOdoTransform = H_cam_odo;
}

I always get the error:
F1221 00:53:49.959568 4757 problem_impl.cc:65] Check failed: it != parameter_map.end() Parameter block not found: 0x7f2063ffd7a0
Check failure stack trace:
F1221 00:53:49.959614 4756 problem_impl.cc:65] Check failed: it != parameter_map.end() Parameter block not found: 0x7f2068bae7a0
Check failure stack trace:
@ 0x7f208d6959fd google::LogMessage::Fail()
@ 0x7f208d6959fd google::LogMessage::Fail()
@ 0x7f208d69789d google::LogMessage::SendToLog()
@ 0x7f208d69789d google::LogMessage::SendToLog()
@ 0x7f208d6955ec google::LogMessage::Flush()
@ 0x7f208d6955ec google::LogMessage::Flush()
@ 0x7f208d6981be google::LogMessageFatal::~LogMessageFatal()
@ 0x452280 ceres::internal::ProblemImpl::SetParameterization()
@ 0x7f208d6981be google::LogMessageFatal::~LogMessageFatal()
@ 0x452280 ceres::internal::ProblemImpl::SetParameterization()
@ 0x7f20901d8c1f camodocal::CamOdoCalibration::refineEstimate()
@ 0x7f20901d8c1f camodocal::CamOdoCalibration::refineEstimate()
@ 0x7f20901db84f camodocal::CamOdoCalibration::estimate()
@ 0x7f20901db84f camodocal::CamOdoCalibration::estimate()
@ 0x7f20901dc709 camodocal::CamOdoCalibration::calibrate()
@ 0x7f20901dc709 camodocal::CamOdoCalibration::calibrate()
@ 0x7f20901f231b camodocal::CamOdoThread::threadFunction()
@ 0x7f20901f231b camodocal::CamOdoThread::threadFunction()
@ 0x7f208cba0a4a (unknown)
@ 0x7f208cba0a4a (unknown)
@ 0x7f208d8c1182 start_thread
@ 0x7f208d8c1182 start_thread
@ 0x7f208cea547d (unknown)

I found that the reason seems to be in

    framePrev = frame;
    if (!camValid)
    {
        std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> > voPoses = tracker.getPoses();
        if (odometryPoses.size() >= k_minVOSegmentSize)
        {
            addCamOdoCalibData(voPoses, odometryPoses, tracker.getFrames());
        }

        if (!odometryPoses.empty())
        {
            odometryPoses.erase(odometryPoses.begin(), odometryPoses.begin() + voPoses.size() - 1);
        }
        ++trackBreaks;
    }

I don't quit understand when camValid is true and when it is false. If camValid is always true, it cannot go to addCamOdoCalibData, and the program cannot run down.
Is the File containing estimate for the extrinsic calibration always necessary? If the answer is yes, then what is the format of the file?

I'd be very grateful if you could give me some advice.

Can't run extrinsic_calib

I've extracted the camera's intrinsic parameters using the first method. However, when I try to use the camera_chessboard_data.dat and camera_0_calib.yaml files to obtain the extrinsic parameters, it returns an error.

To explain the folder hierarchy: the dataset folder inside build has the (1) calib folder with the camera_0_calib.yaml file, the (2) calibration_data and (3) data used, respectively, for the output and
the working data, and the (4) input folder, which contains the same .png chessboard images used for intrinsic calibration and parameters extraction, named camera_0_X.png.

Here is the command line I'm writing:
bin/extrinsic_calib --calib /home/camodocal/build/dataset/calib --camera-count 1 --output /home/camodocal/build/dataset/calibration_data/ --input /home/camodocal/build/dataset/input --data /home/camodocal/build/dataset/data --event /home/camodocal/build/dataset/input/camera_chessboard_data.dat

Here is the return:
`# INFO: Initializing...
Read /home/camodocal/build/dataset/input/camera_chessboard_data.dat file to get all the events

INFO: Initialization finished!

INFO: Running camera-odometry calibration for each of the 1 cameras.

ERROR: No segments, calibration fails!!

INFO: Calibrating odometry - camera 0...

Rotation:
6.9117e-310 6.91165e-310 6.9117e-310
6.9117e-310 6.91165e-310 7.90505e-323
6.91165e-310 6.91165e-310 6.91165e-310
Translation:
2.52962e-321 0 6.9117e-310

INFO: Completed camera-odometry calibration for all cameras.

INFO: Saving intermediate data... Done. Took 0.00s.

INFO: Running camera rig calibration.

WARNING: Logging before InitGoogleLogging() is written to STDERR
E0510 17:29:24.825707 4409 solver_impl.cc:354] Problem contains no parameter blocks.
Segmentation fault (core dumped)
`

Sorry if this is a very silly question, and thank you for your attention.

Fail to estimate the intrinsic camera parameters of model mei

The program runs well to estimate all the intrinsic parameters of the pinhole model, however, it crashes when specified as mei, the unified projection model. Seems like it failed to estimate the Jacobian matrix. The detailed output:

./intrinsic_calib -i ./videoCam/ -p img -e jpg --camera-model mei
# INFO: Camera model: Mei
[camera] # INFO: CataCamera model fails with given data. 
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0727 18:46:44.989917 1971659536 parameter_block.h:339] Local parameterization Jacobian computation returnedan invalid matrix for x: nan nan nan nan
 Jacobian matrix : nan nan nan
nan nan nan
nan nan nan
nan nan nan
F0727 18:46:44.989989 1971659536 parameter_block.h:177] Check failed: UpdateLocalParameterizationJacobian() Local parameterization Jacobian computation failed for x: nan nan nan nan
*** Check failure stack trace: ***
Abort trap: 6

Is there any obvious mistake here? I actually just want to calibrate a normal webcam.

Eigen assertion during CamOdoCalibration::estimateRyx()

I receive the following assertion,

extrinsics: /usr/include/eigen3/Eigen/src/Core/Redux.h:215: static Eigen::internal::redux_impl<Func, Derived, 3, 0>::Scalar Eigen::internal::redux_impl<Func, Derived, 3, 0>::run(const Derived&, const Func&) [with Func = Eigen::internal::scalar_max_op<double>, Derived = Eigen::Matrix<double, 1, -0x00000000000000001>, Eigen::internal::redux_impl<Func, Derived, 3, 0>::Scalar = double]: Assertion `size && "you are using an empty matrix"' failed.

I had added 547 image frames and several more odometry frames before calling the run function of a CamRigOdoCalibration object. The stack snapshot during the assertion is give below. Please ask me if you need more information for debugging.

/home/dorothee/Driving/stacks/ExtCal/extCalib/bin/extrinsics [12173] [cores: 0,2,3,4,5] 
    Thread [7] 12182 [core: 2] (Suspended : Container)  
        __kernel_vsyscall() at 0xb7fdd424   
        select() at 0xb6afee01  
        0x899b094e  
        0x89327ccd  
        0x899b2f66  
        start_thread() at 0xb6bc6d4c    
        clone() at 0xb6b05dde   
    Thread [5] 12180 [core: 0] (Suspended : Signal : SIGABRT:Aborted)   
        __kernel_vsyscall() at 0xb7fdd424   
        raise() at 0xb6a451df   
        abort() at 0xb6a48825   
        0xb6a3e085  
        __assert_fail() at 0xb6a3e137   
        Eigen::internal::redux_impl<Eigen::internal::scalar_max_op<double>, Eigen::Matrix<double, 1, -1, 1, 1, -1>, 3, 0>::run() at Redux.h:215 0xb75cf5c6  
        Eigen::DenseBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> >::redux<Eigen::internal::scalar_max_op<double> >() at Redux.h:330 0xb75c9584   
        Eigen::DenseBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> >::maxCoeff() at Redux.h:348 0xb75c1d8d 
        Eigen::ColPivHouseholderQR<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::compute() at ColPivHouseholderQR.h:390 0xb75b84e0    
        Eigen::ColPivHouseholderQR<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> >::ColPivHouseholderQR() at ColPivHouseholderQR.h:114 0xb75ac0c8    
        Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2, 0, true>::run() at JacobiSVD.h:144 0xb759e97c  
        Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::compute() at JacobiSVD.h:598 0xb758e93c  
        Eigen::JacobiSVD<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>, 2>::JacobiSVD() at JacobiSVD.h:418 0xb7581451    
        camodocal::CamOdoCalibration::estimateRyx() at CamOdoCalibration.cc:490 0xb75f5a3c  
        camodocal::CamOdoCalibration::estimate() at CamOdoCalibration.cc:298 0xb75f45f0 
        camodocal::CamOdoCalibration::calibrate() at CamOdoCalibration.cc:174 0xb75f3b3d    
        camodocal::CamOdoThread::threadFunction() at CamOdoThread.cc:533 0xb762a41d 
        sigc::bound_mem_functor0<void, camodocal::CamOdoThread>::operator() at mem_fun.h:1,787 0xb7637f84   
        sigc::adaptor_functor<sigc::bound_mem_functor0<void, camodocal::CamOdoThread> >::operator() at adaptor_trait.h:251 0xb7637430   
        sigc::internal::slot_call0<sigc::bound_mem_functor0<void, camodocal::CamOdoThread>, void>::call_it() at slot.h:103 0xb7635fd4   
        0xb6dcc432  
        0xb53aa6b3  
        start_thread() at 0xb6bc6d4c    
        clone() at 0xb6b05dde   
    Thread [3] 12178 [core: 4] (Suspended : Container)  
        __kernel_vsyscall() at 0xb7fdd424   
        poll() at 0xb6af7690    
        g_poll() at 0xb5394a7b  
        0xb53870ae  
        g_main_loop_run() at 0xb538756b 
        0x96c9b1ba  
        0xb53aa6b3  
        start_thread() at 0xb6bc6d4c    
        clone() at 0xb6b05dde   
    Thread [2] 12177 [core: 3] (Suspended : Container)  
        __kernel_vsyscall() at 0xb7fdd424   
        poll() at 0xb6af7690    
        g_poll() at 0xb5394a7b  
        0xb53870ae  
        g_main_loop_run() at 0xb538756b 
        0x8ee9b134  
        0xb53aa6b3  
        start_thread() at 0xb6bc6d4c    
        clone() at 0xb6b05dde   
    Thread [1] 12173 [core: 5] (Suspended : Container)  
        __kernel_vsyscall() at 0xb7fdd424   
        poll() at 0xb6af7690    
        g_poll() at 0xb5394a7b  
        0xb53870ae  
        g_main_loop_run() at 0xb538756b 
        Glib::MainLoop::run() at 0xb6dd5983 
        camodocal::CamRigOdoCalibration::start() at CamRigOdoCalibration.cc:140 0xb763c099  
        main() at extrinsic_test.cpp:335 0x80898c9  

Bug report on a non-GPU machine @ CameraRigBA.cc

Hi, I'm reporting an issue I found on a non-GPU machine just in case you are planning to fix.

In the file CameraRigBA.cc, the function

CameraRigBA::matchFrameToFrame(FramePtr& frame1, FramePtr& frame2,
std::vector* corr2D2D,
double reprojErrorThresh)

calls "SurfGPU" which makes the program suddenly stops withno crashed report on a non-GPU machine while running in the middle of stage_3 in the function
CamaeraRigBA::Run.

[PASSED] stage 1 - triangulate 3D points with feature correspondences from mono VO and run BA
[PASSED ] stage 2 - run robust pose graph SLAM and find inlier 2D-3D correspondences from loop closures
[PROGRAM STOPPED HERE] stage 3 - find local inter-camera 3D-3D correspondences
with the following log messages: (no crashed)

Thank you very much.

I cannot build it on ubuntu14.04. There are cmake errors.

`CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_LANGUAGES_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_LANGUAGES_COMPILER
CMake Error: Could not find cmake module file: /home/lpp/git_src/camodocal/build/CMakeFiles/2.8.12.2/CMakeLANGUAGESCompiler.cmake
CMake Error: Could not find cmake module file: CMakeLANGUAGESInformation.cmake
CMake Error: CMAKE_LANGUAGES_COMPILER not set, after EnableLanguage
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
-- Found installed version of Eigen:
-- Found required Ceres dependency: Eigen version 3.2.0 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.13.0 installed in: /usr/local with components: [LAPACK, SuiteSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations, OpenMP]
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
-- Found Intel TBB
-- OpenCV version: 3.2.0
-- defined HAVE_OPENCV3
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- serialization
-- system
-- thread
-- *** Build type is Release ***
-- Found SSE4.1 extensions, using flags: -msse4.1 -mfpmath=sse
-- Could NOT find Librt (missing: Librt_LIBRARIES)
-- CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.


-- DEPENDENCY: Required: Found:


-- BLAS yes yes
-- Eigen3 yes yes
-- LAPACK yes yes
-- SuiteSparse yes yes
-- CUDA no no
-- Ceres no yes
-- GTest no yes
-- OpenMP no yes
-- Glog no yes
-- Gflags no yes
-- TBB no yes
-- OpenCV no yes
-- Threads no yes


-- Library: Build: Condition:


-- agast TRUE (satisfied)
-- camodocal_brisk TRUE (satisfied)
-- camodocal_calib TRUE (satisfied)
-- camodocal_camera_models TRUE (satisfied)
-- camodocal_camera_systems TRUE (satisfied)
-- camodocal_chessboard TRUE (satisfied)
-- camodocal_dbow2 TRUE (satisfied)
-- camodocal_dutils TRUE (satisfied)
-- camodocal_dutilscv TRUE (satisfied)
-- camodocal_dvision TRUE (satisfied)
-- camodocal_gpl TRUE (satisfied)
-- camodocal_location_recognitionTRUE (satisfied)
-- camodocal_fivepoint TRUE (satisfied)
-- camodocal_pose_estimation TRUE (satisfied)
-- camodocal_pose_graph TRUE (satisfied)
-- camodocal_pugixml TRUE (satisfied)
-- camodocal_sparse_graph TRUE (satisfied)


-- Executable: Build: Condition:


-- dbow2_demo TRUE (satisfied)
-- train_voctree TRUE (satisfied)


-- Test: Build: Condition:


-- CataCamera_test FALSE
-- EquidistantCamera_test FALSE
-- PinholeCamera_test FALSE

CMake Error at /usr/share/cmake-2.8/Modules/WriteBasicConfigVersionFile.cmake:39 (message):
No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/CMakePackageConfigHelpers.cmake:152 (write_basic_config_version_file)
cmake/InstallProjectConfig.cmake:10 (write_basic_package_version_file)
CMakeLists.txt:300 (INCLUDE)

-- Configuring incomplete, errors occurred!
See also "/home/lpp/git_src/camodocal/build/CMakeFiles/CMakeOutput.log".
See also "/home/lpp/git_src/camodocal/build/CMakeFiles/CMakeError.log".
`

blas packages that resolve the FindBLAS.cmake dependencies

Is it possible to enumerate the blas libraries that findblas can find and used successfully get through the linking step?

I'm having a little difficulty finding solid options to get this working on linux. I ended up resorting to a package at my lab that includes netlib, which worked, but I'd rather use an upstream resource.

Compilation error - cannot link boost library

When I tried to compile the compilations haults with an error saying that it cannot see boost functions while linking. However, I made sure I installed boost in my Ubuntu system.

Here is the error msg:

CMakeFiles/camodocal_features2d.dir/ORBGPU.cc.o: In function boost::thread_exception::thread_exception(int, char const*)': ORBGPU.cc:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x1b): undefined reference toboost::system::system_category()'
CMakeFiles/camodocal_features2d.dir/ORBGPU.cc.o: In function _GLOBAL__sub_I_ORBGPU.cc': ORBGPU.cc:(.text.startup+0x12): undefined reference toboost::system::generic_category()'
ORBGPU.cc:(.text.startup+0x29): undefined reference to boost::system::generic_category()' ORBGPU.cc:(.text.startup+0x34): undefined reference toboost::system::system_category()'
CMakeFiles/camodocal_features2d.dir/SurfGPU.cc.o: In function _GLOBAL__sub_I_SurfGPU.cc': SurfGPU.cc:(.text.startup+0x15): undefined reference toboost::system::generic_category()'
SurfGPU.cc:(.text.startup+0x2c): undefined reference to boost::system::generic_category()' SurfGPU.cc:(.text.startup+0x37): undefined reference toboost::system::system_category()'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libcamodocal_features2d.so] Error 1

Eigen assertion during CamOdoThread constructor call

The assertion is

# INFO: Initializing... extrinsics: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:69: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array() [with T = double, int Size = 16, int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.

The fix, that I tried (and worked), was to add the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro to the public part of the CamOdoThread class declaration. This I believe is required for the mCamOdoTransform member variable. Further explanation is given in the following pages.

http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html
http://eigen.tuxfamily.org/dox-devel/group__TopicStructHavingEigenMembers.html

Cannot build CamOdoCalibration_test, HandEyeCalibration_test,

CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.

My status of this library is as follows

CMake Warning (dev) at CMakeLists.txt:4 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION

This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found version ".")
CMake Warning at cmake/DependencyUtilities.cmake:19 (find_package):
By not providing "FindCeres.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Ceres", but
CMake did not find one.

Could not find a package configuration file provided by "Ceres" with any of
the following names:

CeresConfig.cmake
ceres-config.cmake

Add the installation prefix of "Ceres" to CMAKE_PREFIX_PATH or set
"Ceres_DIR" to a directory containing one of the above files. If "Ceres"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
cmake/LibraryConfig.cmake:41 (camodocal_optional_dependency)
CMakeLists.txt:20 (include)

-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Failed to find glog - Could not find glog library, set GLOG_LIBRARY to full path to libglog.
-- Could NOT find Glog (missing: GLOG_INCLUDE_DIRS GLOG_LIBRARIES)
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find gflags - Could not find gflags library, set GFLAGS_LIBRARY to full path to libgflags.
-- Could NOT find Gflags (missing: GFLAGS_INCLUDE_DIRS GFLAGS_NAMESPACE)
-- Found Intel TBB
-- OpenCV version: 2.4.6.1
-- Using internal version of ceres-solver
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- serialization
-- system
-- thread
-- *** Build type is Release ***
-- Found SSE4.1 extensions, using flags: -msse4.1 -mfpmath=sse
-- Looking for C++ include iso646.h
-- Looking for C++ include iso646.h - not found
-- Found LibDL: /usr/lib/i386-linux-gnu/libdl.so
-- Found LIBNSL: /usr/lib/i386-linux-gnu/libnsl.so
-- Could NOT find Librt (missing: Librt_LIBRARIES)
-- Found LIBM: /usr/lib/i386-linux-gnu/libm.so
-- CANNOT BUILD CamOdoCalibration_test, HandEyeCalibration_test, and PlanarHandEyeCalibration_test because it depends on OPENCV and HAVE_OPENCV_XFEATURES2D_NONFREE.


-- DEPENDENCY: Required: Found:


-- BLAS yes yes
-- Eigen3 yes yes
-- LAPACK yes yes
-- SuiteSparse yes yes
-- CUDA no yes
-- Ceres no yes
-- GTest no yes
-- OpenMP no yes
-- Glog no no
-- Gflags no yes
-- TBB no yes
-- OpenCV no yes
-- Threads no yes


-- Library: Build: Condition:


-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Failed
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Failed
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Failed
-- agast TRUE (satisfied)
-- camodocal_brisk TRUE (satisfied)
-- camodocal_calib TRUE (satisfied)
-- camodocal_camera_systems TRUE (satisfied)
-- camodocal_chessboard TRUE (satisfied)
-- camodocal_dbow2 TRUE (satisfied)
-- camodocal_dutils TRUE (satisfied)
-- camodocal_dutilscv TRUE (satisfied)
-- camodocal_dvision TRUE (satisfied)
-- camodocal_gpl TRUE (satisfied)
-- camodocal_location_recognitionTRUE (satisfied)
-- camodocal_fivepoint TRUE (satisfied)
-- camodocal_pose_estimation TRUE (satisfied)
-- camodocal_pose_graph TRUE (satisfied)
-- camodocal_pugixml TRUE (satisfied)
-- camodocal_sparse_graph TRUE (satisfied)


-- Executable: Build: Condition:


-- dbow2_demo TRUE (satisfied)
-- train_voctree TRUE (satisfied)


-- Test: Build: Condition:


--
-- Configuring done
-- Generating done

Query regarding GPS/INS data for extrinsic_calib

Hi, This is not an issue but I have a problem when running extrinsic_calib (I have successfully run intrinsic_calib).
I passed in Event.dat file, which contains data about IMG, IMU and GPS, in the format below:

[timestamp] CAM [camera_id] [image filename]
[timestamp] IMU [quaternion x] [quaternion y] [quaternion z] [quaternion w]
[timestamp] GPS [lat] [lon] [alt]

However, after running extrinsic_calib, it shows error said No GPS/INS data as the last line below:

.# INFO: Initializing...
Read ../data/input/Event.dat file to get all the events
.# INFO: Initialization finished!
GPS: lat=53.9582, lon=-2.02281, alt=0, qx=0, qy=0, qz=0.945519, qw=-0.325568 [74]
GPS: lat=53.9582, lon=-2.02281, alt=0, qx=0, qy=0, qz=0.945519, qw=-0.325568 [141]
GPS: lat=53.9582, lon=-2.02281, alt=0, qx=0, qy=0, qz=0.945519, qw=-0.325568 [207]
GPS: lat=53.9582, lon=-2.02281, alt=0, qx=0, qy=0, qz=0.945519, qw=-0.325568 [275]
IMG: 74 -> ../data/input/frames_0/Carriageway_1.jpg
.# INFO: Running camera-odometry calibration for each of the 5 cameras.
.# ERROR: No GPS/INS data for 4s. Exiting...

I have checked that the problem occurs at the function
SensorDataBuffer::nearest(uint64_t timestamp, T& dataBefore, T& dataAfter)
in which it cannot find nearest before and after.

I wonder it must be because of my data (?) Please could you suggest if I need to change any in my Event file, I show some below. The timestamp I have is in millisecond, and I have 5 cameras.

Is my timestamp between each capture too far ? 74ms -->141ms-->207ms-->275ms-->336ms
Or the input format is wrong?

Thank you very much for your help.

=============== My Event file ============
74 CAM 0 Carriageway_1.jpg
74 CAM 1 Front_1.jpg
74 CAM 2 LeftSide_1.jpg
74 CAM 3 Rear_1.jpg
74 CAM 4 RightSide_1.jpg
74 IMU 0 0 0.945518575599317 -0.325568154457157
74 GPS 53.958210493654 -2.02280608249833 0
141 CAM 0 Carriageway_2.jpg
141 CAM 1 Front_2.jpg
141 CAM 2 LeftSide_2.jpg
141 CAM 3 Rear_2.jpg
141 CAM 4 RightSide_2.jpg
141 IMU 0 0 0.945518575599317 -0.325568154457157
141 GPS 53.9582094642619 -2.02280829792919 0
207 CAM 0 Carriageway_3.jpg
207 CAM 1 Front_3.jpg
207 CAM 2 LeftSide_3.jpg
207 CAM 3 Rear_3.jpg
207 CAM 4 RightSide_3.jpg
207 IMU 0 0 0.945518575599317 -0.325568154457157
207 GPS 53.9582084502338 -2.02281048029392 0
275 CAM 0 Carriageway_4.jpg
275 CAM 1 Front_4.jpg
275 CAM 2 LeftSide_4.jpg
275 CAM 3 Rear_4.jpg
275 CAM 4 RightSide_4.jpg
275 IMU 0 0 0.945518575599317 -0.325568154457157
275 GPS 53.9582074054776 -2.02281272879092 0
336 CAM 0 Carriageway_5.jpg
336 CAM 1 Front_5.jpg
336 CAM 2 LeftSide_5.jpg
336 CAM 3 Rear_5.jpg
336 CAM 4 RightSide_5.jpg
336 IMU 0 0 0.945518575599317 -0.325568154457157
336 GPS 53.9582064682699 -2.02281474582498 0

OpenCV3 without CUDA compilation errors

There are several issues with compilation when using OpenCV3 without CUDA.

In particular, this is when the macro definition HAVE_OPENCV3 has been defined and HAVE_CUDA has not been defined.

  • the namespace of cv::SURF is wrong and should be cv::xfeatures2d::SURF.
  • SurfGPU.cc line 71 call m_surfGPU(image,mask,keypoints); is not correct for OpenCV2 without CUDA. The signature of the SURF functions may differ between the CUDA and non-cuda versions.
  • camodothread.cc needs to add #include <opencv2/imgproc.hpp>. Ensuring the HAVE_OPENCV3 macro definitions are correct so that both opencv2 and 3 are supported correctly.
  • On ubuntu 14.04 extrinsic_calib executable under example doesn't link boost::program_options, which is required.
  • FindOpenCV.cmake finds several libraries which should be optional but are not, leading to inappropriate configuration errors.
  • make xfeatures2d, cudafeatures2d in opencv3 find script OPTIONAL
  • check for namespace of gflags.h failed, I believe it currently needs to use the google namespace.
  • make opencv nonfree contrib gpu libraries need to be fixed and made optional for linux
  • check that OPENCV_VERSION works properly in CMake.
    • if statement in FindOpenCV.cmake should probably be changed to if(OPENCV_VERSION VERSION_LESS "3.0.0")

Crash when running the examples/intrinsic_calibration executable

When I run the example/intrinsic_calibration executable on the chessboard images in date/images, camodocal crashes after corner detection). Here's the console output:

./intrinsic_calib -i /media/ssd/pm/data/images -p img -v
... (The corner detection runs through, corners are found)
[camera] # INFO: Initial reprojection error: 3.655 pixels
*** glibc detected *** ./intrinsic_calib: double free or corruption (!prev): 0x00007f19e40008c0 ***
*** glibc detected *** ./intrinsic_calib: double free or corruption (!prev): 0x0000000001f6abb0 ***
*** glibc detected *** ./intrinsic_calib: double free or corruption (!prev): 0x00007f19f00008c0 ***
*** glibc detected *** ./intrinsic_calib: double free or corruption (!prev): 0x00007f19cc0008c0 ***
*** glibc detected *** ./intrinsic_calib: realloc(): invalid next size: 0x00007f19e0001430 ***
Aborted (core dumped)

I'm really puzzled by this. Do you have any idea what could be going on? Is this example supposed to work?

CMake error with newest OpenCV (3.0)

Below is my error message on Ubuntu 14.04 with the newest OpenCV (3.0) built from trunk

-- Found OpenCV: /usr/local/lib/libopencv_calib3d.so
-- Found OpenCV: /usr/local/include
-- Found OpenCV: /usr/local/lib/libopencv_highgui.so
-- Found OpenCV: /usr/local/lib/libopencv_imgproc.so
-- Found OpenCV: /usr/local/lib/libopencv_ml.so
-- OPENCV_VERSION: 3.0.0 VERSION_LESS 3.0.0
-- OPENCV_VERSION: 3.0.0 VERSION_LESS 3.0.0 NOT_LESS
-- Found OpenCV: /usr/local/lib/libopencv_imgcodecs.so
CMake Error at cmake/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find opencv_xfeatures2d (OpenCV) (missing:
OPENCV_XFEATURES2D_LIBRARY)
Call Stack (most recent call first):
cmake/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
cmake/FindOpenCV.cmake:202 (find_package_handle_standard_args)
cmake/DependencyUtilities.cmake:5 (find_package)
cmake/LibraryConfig.cmake:36 (camodocal_required_dependency)
CMakeLists.txt:33 (include)

-- Configuring incomplete, errors occurred!

Is it possible to get camodocal to work without downgrading OpenCV to 2.4.X?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.