-
Notifications
You must be signed in to change notification settings - Fork 5.8k
gsoc_2015: sfm module integration #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@edgarriba, thanks for the PR. Putting libmv inside OpenCV is not a good idea. We will not be able to support such big chunk of code. Please, link to external libmv instead. |
@vpisarev ok. I'll work on that. thks! |
There is no |
Here it's well explained: http://ceres-solver.org/building.html#linux besides, I'm on Ubuntu 14.04 and I have ceres in the repo |
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Winvalid-pch) | ||
|
||
# needed since we are linking static libs | ||
set(CMAKE_CXX_FLAGS ${CMAKE_CSS_FLAGS} "-fPIC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag doesn't work with MSVS.
Please use something like this:
https://github.com/Itseez/opencv/blob/09b9b0fb9e9c9dd8c9e0d65705f8f19aa4c27f8a/3rdparty/zlib/CMakeLists.txt#L79-L83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@edgarriba Thanks. I will try.
It is docker-based Ubuntu image. No ROS features is added here by default. |
Installed on Linux slave. Other builders (Mac,Win,android) are without Ceres, so sfm module should be disabled in these cases. |
cool! thanks! what about your comment for module definition? |
set(CMAKE_CXX_FLAGS "${CMAKE_CSS_FLAGS} -fPIC") | ||
endif() | ||
else() | ||
ocv_module_disable(sfm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNIX
condition is not right. It should be like this:
if (NOT HAVE_EIGEN)
ocv_module_disable(sfm)
endif()
@alalek why is core not found? additionally, in local don't succeed compiing due to an Eigen error in core module: /home/eriba/software/opencv/modules/core/include/opencv2/core/eigen.hpp:63:22: error: ‘Eigen’ does not name a type Any idea? |
It looks like missed BTW, Buildbot shows this problem:
Do you have this file? (Update: It was old build) |
|
||
if (NOT HAVE_EIGEN) | ||
ocv_module_disable(sfm) | ||
message(STATUS "SfM module is disabled. Eigen library is required.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ocv_module_disable
is a macro with return()
. This command is not executed.
You can place message before ocv_module_disable
.
it's an old eigen cv2eigen implementation that was removed. Now I fixed the includes for this error (it's weird that my compiler didn't show me this error) |
Try to add |
|
||
ocv_set_module_sources( HEADERS ${OPENCV_SFM_HDRS} SOURCES ${OPENCV_SFM_SRC} ) | ||
|
||
ocv_module_include_directories() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place ocv_module_include_directories()
on line 65 (before add_subdirectory(src/libmv_light)
)
This should resolve this problem:
opencv_contrib/modules/sfm/src/libmv_light/libmv/correspondence/feature.h:24:28: fatal error: opencv2/core.hpp: No such file or directory
#include <opencv2/core.hpp>
working in local. Let's see |
|
||
if(UNIX) | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CSS_FLAGS} -fPIC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS -> CXX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this error:
t_triangulation.cpp.o
Building CXX object modules/sfm/CMakeFiles/opencv_test_sfm.dir/test/test_fundamental.cpp.o
[100%] Building CXX object modules/sfm/CMakeFiles/opencv_test_sfm.dir/test/scene.cpp.o
Linking CXX executable ../../bin/opencv_test_sfm
CMakeFiles/opencv_test_sfm.dir/test/test_triangulation.cpp.o: En la función checkTriangulation(int, int, bool, float, float) [clone .constprop.73]': test_triangulation.cpp:(.text._ZL18checkTriangulationiibff.constprop.73+0xce6): referencia a
cv::triangulatePoints(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&)' sin definir
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_test_sfm] Error 1
make[1]: *** [modules/sfm/CMakeFiles/opencv_test_sfm.dir/all] Error 2
make[1]: *** Se espera a que terminen otras tareas....
Linking CXX shared library ../../lib/cv2.so
[100%] Built target opencv_python2
make: *** [all] Error 2
Currently I have this problem (build without ceres):
Also I saw build failures with these messages:
|
find_package(Ceres QUIET) | ||
|
||
if(NOT DEFINED SFM_DEPS_OK) | ||
set(_fname "${CMAKE_CURRENT_BINARY_DIR}/test_sfm_deps.cpp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this code to resolve issue with ARM compiler (cross-compiler is buggy and has access to host include files in /usr/include , so we force check for glog library here):
if(NOT DEFINED GLOG_LIBRARIES)
set(GLOG_LIBRARIES "glog")
endif()
@alalek ARM compilation appears as not_queued |
ARM build is not triggered automatically. |
@alalek what's ocv-carma2? |
@edgarriba It is our second embedded ARM linux board with some network problems. This failure is expected at this moment. I check compilation step only, it is fine. |
@alalek oki. Ping me if you want me to fix something |
@alalek when it's supposed to be merged the PR? |
Python binding knows and can handle only limited set of types, so there is no "std::string" support. |
@alalek just realized that header sfm.hpp it's not installed after "make install" |
👍 |
@vpisarev there's an issue with installation |
Awesome contribution! There seem to be two separate problems:
|
|
Ah, thanks for clarifying |
@alalek right, need to commit test data. |
- Previously, when Ceres was built as a static library we did not compile position independent code. This means that the resulting static library could not be linked against shared libraries, but could be used by executables. - To enable the use of a static Ceres library by other shared libraries as reported in [1], the static library must be generated from position independent code (except on Windows, where PIC does not apply). [1] opencv/opencv_contrib#290 (comment) Change-Id: I99388f1784ece688f91b162d009578c5c97ddaf6
- Previously, when Ceres was built as a static library we did not compile position independent code. This means that the resulting static library could not be linked against shared libraries, but could be used by executables. - To enable the use of a static Ceres library by other shared libraries as reported in [1], the static library must be generated from position independent code (except on Windows, where PIC does not apply). [1] opencv/opencv_contrib#290 (comment) Change-Id: I99388f1784ece688f91b162d009578c5c97ddaf6
- Previously, when Ceres was built as a static library we did not compile position independent code. This means that the resulting static library could not be linked against shared libraries, but could be used by executables. - To enable the use of a static Ceres library by other shared libraries as reported in [1], the static library must be generated from position independent code (except on Windows, where PIC does not apply). [1] opencv/opencv_contrib#290 (comment) Change-Id: I99388f1784ece688f91b162d009578c5c97ddaf6
opencv_extra: opencv/opencv_extra#279
Structure From Motion integration project