using Ceres with Cmake

2,284 views
Skip to first unread message

Lang Tan

unread,
Jun 7, 2016, 12:29:30 AM6/7/16
to Ceres Solver
Hi guys,

I'm just beginning to use Ceres. I have successfully installed Ceres and tried some examples. I test the simple_bundle_adjuster with the dataset problem-16-22106-pre.txt which is in the Ceres data folder. It works fine and there is the result:


Then I try to follow the tutorial using Ceres with Cmake, and implement this example as a standalone project. In my project folder, there are 3 files : CMakeLists.txt, simple_bundle_adjuster.cc(copied from ceres/example/), problem-16-22106-pre.txt(copied from ceres/data/), the CMakeLists.txt : 
cmake_minimum_required(VERSION 2.8)
project(simple_ba)
find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
# 
add_executable(simple_ba simple_bundle_adjuster.cc)
target_link_libraries(simple_ba ${CERES_LIBRARIES})
However, it becomes extremely slow:


Now it takes 60s to evaluate the Jacobian. I couldn't figure out why it becomes such slow, I guess my CMakeLists.txt is too simple. But i don't know how to improve it.

Thanks in advance!

Tan. 

Keir Mierle

unread,
Jun 11, 2016, 5:39:14 PM6/11/16
to ceres-...@googlegroups.com
Hi Lang,

Sorry for the slow reply.

Can you please make sure the library is compiled in Release mode? Optimization makes an enormous difference in Ceres due to the extensive Eigen template usage. Furthermore, please include the result of FullReport() (which includes important details like problem size and so on).

Thanks,
Keir

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/e1466a7f-9239-48e5-82ab-66af8b43f42d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lang Tan

unread,
Jun 11, 2016, 9:54:15 PM6/11/16
to Ceres Solver
Thanks Keir, this has already been solved ! And you are right, I got good result by compiling it in Release mode!

Lang

在 2016年6月12日星期日 UTC+8上午5:39:14,Keir Mierle写道:
Reply all
Reply to author
Forward
0 new messages