[3D_Vision_Tutorial] Ubuntu 20.04 + OpenCV + Ceres Solver install - [1]
- https://github.com/mint-lab/3dv_tutorial : 3dvision tutorial code
- Dependency : OpenCV / Ceres Solver
๐ฑ OpenCV Install
$ pkg-config --modversion opencv # OpenCV ๊ฐ ์ด๋ฏธ ๊น๋ ค์๋์ง ํ์ธํ๊ธฐ
$ pkg-config --modversion opencv4 # version 4 ๋ถํฐ๋ ์ด๋ ๊ฒ ํ์ธํด์ผํ๋ค.
- Install ์ฐธ๊ณ https://webnautes.tistory.com/1186
๐ซ Ceres-Solver install
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse (optional)
sudo apt-get install libsuitesparse-dev
wget http://ceres-solver.org/ceres-solver-2.1.0.tar.gz
tar zxf ceres-solver-2.1.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.1.0
make -j4
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
sudo make install
๐ช Ceres-solver test
- ํ ํด๋์ ์๋ ํ์ผ์ ์์ฑํ๊ณ
- CMake ์์ฑ๋ฒ ์ฌ์ฉ๋ฒ ์ฐธ๊ณ (https://edward0im.github.io/technology/2020/09/16/cmake/)
https://ceres-solver.googlesource.com/ceres-solver/+/master/examples/helloworld.cc
mkdir build
cd build
cmake ..
make
โ Ceres-solver install error 1
Total Test time (real) = 78.95 sec
The following tests FAILED:
2 - cuda_memcheck_dense_cholesky_test (Failed)
25 - cuda_dense_cholesky_test (SEGFAULT)
27 - cuda_kernels_test (Child aborted)
28 - cuda_sparse_matrix_test (Child aborted)
29 - cuda_vector_test (Child aborted)
31 - dense_cholesky_test (Child aborted)
104 - ba_denseschur_cuda_auto_test (Child aborted)
121 - ba_denseschur_cuda_auto_threads_test (Child aborted)
138 - ba_denseschur_cuda_user_test (Child aborted)
155 - ba_denseschur_cuda_user_threads_test (Child aborted)
Errors while running CTest
make: *** [Makefile:130: test] Error 8
์ ๊ทผ 1 ) USE_CUDA ํ์ฑ
https://github.com/ceres-solver/ceres-solver/blob/master/CMakeLists.txt -> USE_CUDA ์ค์ ์ด ํ์ํ๋ค
https://www.cv-learn.com/20230321-ccmake/#more
์ ๊ทผ 2 ) wget์ผ๋ก ๋ค์ด๋ฐ์์ ์ค์น (clone์ผ๋ก ํ ํ์ผ ๋ง๊ณ wget์ผ๋ก ๋ค์ด๋ฐ์์ ์ค์นํ๋ ๋๋ค,,ใ ,,)
โ Ceres-solver install error 2
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:41 (file):
file cannot create directory: /usr/local/lib/cmake/Ceres. Maybe need
administrative privileges.
-> make install ์ sudo๋ฅผ ๋ถ์ด์ ๋ฐ๋ก cmake ๋ INSTALL_PREFIX ๊ฒฝ๋ก๋ฅผ ์ง์ ํ ๊ฒ์ด ์๋๋ผ๋ฉด
๐ซ Clion setting
- ํ์ ๊ณ์ ์ค์ : https://www.jetbrains.com/community/education/#students
Free Educational Licenses - Community Support
Learn or teach how to code with best-of-industry tools from JetBrains. Free Educational Licenses for JetBrains' tools.
www.jetbrains.com
- ํ์ ๊ณ์ ์ค์ ๊ด๋ จ ์ฐธ๊ณ ๊ธ
๐ Reference
[1] OpenCV install
- https://docs.opencv.org/4.x/df/d65/tutorial_table_of_content_introduction.html
- ์ ํ์ด์ง ์ค
- OpenCV configuration options reference : build option
- Using OpenCV with gcc and CMake : compile ํ ๋ ์ถ๊ฐํ๋ ๋ฐฉ๋ฒ๋ฑ์ด ๋์์๋ค.
[2] with Ubuntu https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html
[3] Ceres Solver install http://ceres-solver.org/installation.html#linux
[4] Ceres Solver helloceres :https://github.com/LimHyungTae/helloceres