(3D_Vision_Tutorial) Ubuntu 20.04 + OpenCV + Ceres 솔버 설치 – (1)

https://github.com/mint-lab/3dv_tutorial : 3dvision 튜토리얼 코드

– 종속성: OpenCV / Ceres 솔버

OpenCV 설치

$ pkg-config --modversion opencv # OpenCV 가 이미 깔려있는지 확인하기
$ pkg-config --modversion opencv4 # version 4 부터는 이렇게 확인해야한다.

세레스 솔버 설치

git clone https://ceres-solver.googlesource.com/ceres-solver
# 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
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver
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.
make install

install_ceres.sh
0.00MB


세레스 솔버 테스트

https://ceres-solver.googlesource.com/ceres-solver/+/master/examples/helloworld.cc

example/helloworld.cc – ceres-solver – Google의 Git

// Ceres Solver – 빠른 비선형 최소제곱 최소화기 // Copyright 2015 Google Inc. All Rights Reserved. 판권 소유. // http://ceres-solver.org/ // 수정 여부에 관계없이 소스 및 바이너리 형식으로 재배포 및 사용 // 허용됩니다.

ceres-solver.googlesource.com

CMakeLists.txt
0.00MB


helloworld.cc
0.00MB


mkdir build
cd build
cmake ..
make

Ceres 솔버 설치 오류

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

https://github.com/ceres-solver/ceres-solver/blob/master/CMakeLists.txt -> USE_CUDA 설정이 필요합니다.

https://www.cv-learn.com/20230321-ccmake/#more

(참조)

OpenCV 설치(https://docs.opencv.org/4.x/df/d65/tutorial_table_of_content_introduction.html)

– 위 페이지에서

우분투(https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html)

Ceres 솔버 설치(http://ceres-solver.org/installation.html#linux)

세레스 솔버 안녕하세요 세레스:https://github.com/LimHyungTae/helloceres