Table of contents
A sparse reconstruction model consists of 3 .txt files: cameras.txt, images.txt, points3D.txt
Docs
Forge Colmap Result Data
Code for writing data: colmap / scripts / python / read_write_model.py
cameras.txt
Each line is the intrinsic parameters of a camera.
Code
|
|
images.txt
One camera has two lines. The 1-st line includes extrinsic parameters. The 2-nd line lists the coordinates of 2D keypoints.
|
|
points3D.txt
Each line is a 3D point.
|
|
Problems
I didn’t manage to realize the method as the following problems:
-
Each image entry requires specify 2D keypoints.
Not sure how to obtain them yet.
-
Are the X-Y-Z axes of DTU camera aligned with right-bottom-front in COLMAP ?
This may require visulization to verify.
Install
Ubuntu 22.04 ✅
(2024-04-17)
OS: Ubuntu 22.04.4 LTS x86_64, Kernel: 6.5.0-27-generic
-
Install dependencies:
Packages list
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21sudo apt-get install \ git \ cmake \ ninja-build \ build-essential \ libboost-program-options-dev \ libboost-filesystem-dev \ libboost-graph-dev \ libboost-system-dev \ libeigen3-dev \ libflann-dev \ libfreeimage-dev \ libmetis-dev \ libgoogle-glog-dev \ libgtest-dev \ libsqlite3-dev \ libglew-dev \ qtbase5-dev \ libqt5opengl5-dev \ libcgal-dev \ libceres-dev}}}
Qt dependencies has conflicts.
Error message:
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14The following packages have unmet dependencies: libqt5opengl5 : Depends: qtbase-abi-5-15-3 qtbase5-dev : Depends: libqt5concurrent5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5core5a (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5dbus5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5gui5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5network5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5printsupport5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5sql5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed Depends: libqt5test5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed Depends: libqt5widgets5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5xml5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: qtbase5-dev-tools (= 5.15.3+dfsg-2ubuntu0.2) E: Unable to correct problems, you have held broken packages.}}}
Some posts suggests that the
libqt5opengl5has already been included into qtReference:
-
cannot install qtbase-abi-5-5-1 on ubuntu 17.10 -SO
1 2(base) zichen@homepc:~$ apt-cache search qtbase-abi libqt5core5a - Qt 5 core module
-
-
I want to skip those 2 packages and compile directly. However, got error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21(base) zichen@homepc:~/Downloads/colmap/build$ cmake .. -GNinja -- The C compiler identification is GNU 9.5.0 -- The CXX compiler identification is GNU 9.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: filesystem graph program_options system CMake Error at cmake/FindFLANN.cmake:89 (message): Could not find FLANN Call Stack (most recent call first): cmake/FindDependencies.cmake:17 (find_package) CMakeLists.txt:96 (include) -- Configuring incomplete, errors occurred!Found this issue: Colmap cmake .. error #1451
-
I indeed have not installed the
libmetis-devand other packages except for the above 2 missing packages:Packages list
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19sudo apt-get install \ git \ cmake \ ninja-build \ build-essential \ libboost-program-options-dev \ libboost-filesystem-dev \ libboost-graph-dev \ libboost-system-dev \ libeigen3-dev \ libflann-dev \ libfreeimage-dev \ libmetis-dev \ libgoogle-glog-dev \ libgtest-dev \ libsqlite3-dev \ libglew-dev \ libcgal-dev \ libceres-dev}}}
Linking failed:
1 2 3 4 5 6 7 8 9/home/zichen/anaconda3/lib/libQt5OpenGL.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Widgets.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Gui.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2 -lcudadevrt -lcudart_static -lrt -lpthread -ldl && : /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldTag@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldName@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldReadCount@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldPassCount@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldDataType@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to `_TIFFDataSize@LIBTIFF_4.0' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
-
Uninstall
libtiff1 2 3 4ninja clean conda uninstall libtiff cmake .. -GNinja ninjaI have
libtiff:1 2 3 4 5(base) zichen@homepc:~/Downloads/colmap/build$ conda list libtiff # packages in environment at /home/zichen/anaconda3: # # Name Version Build Channel libtiff 4.5.0 h6a678d5_2 https://repo.anaconda.com/pkgs/main
-
Another error about libQt5:
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43[213/213] Linking CXX executable src/colmap/exe/colmap FAILED: src/colmap/exe/colmap : && /usr/bin/c++ -Wno-maybe-uninitialized -Wall -O3 -DNDEBUG src/colmap/exe/CMakeFiles/colmap_main.dir/feature.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/sfm.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/colmap.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/database.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/gui.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/image.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/model.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/mvs.cc.o src/colmap/exe/CMakeFiles/colmap_main.dir/vocab_tree.cc.o -o src/colmap/exe/colmap -L/usr/local/cuda-11.6/targets/x86_64-linux/lib/stubs -L/usr/local/cuda-11.6/targets/x86_64-linux/lib -Wl,-rpath,/usr/local/cuda-11.6/targets/x86_64-linux/lib:/home/zichen/anaconda3/lib: src/colmap/controllers/libcolmap_controllers.a src/colmap/retrieval/libcolmap_retrieval.a src/colmap/scene/libcolmap_scene.a src/colmap/sfm/libcolmap_sfm.a src/colmap/util/libcolmap_util.a src/colmap/util/libcolmap_util_cuda.a src/colmap/mvs/libcolmap_mvs_cuda.a src/colmap/ui/libcolmap_ui.a src/colmap/util/libcolmap_util_cuda.a src/colmap/controllers/libcolmap_controllers.a src/colmap/retrieval/libcolmap_retrieval.a src/colmap/sfm/libcolmap_sfm.a src/colmap/mvs/libcolmap_mvs.a src/thirdparty/PoissonRecon/libcolmap_poisson_recon.a /usr/lib/x86_64-linux-gnu/libgmpxx.so /usr/lib/x86_64-linux-gnu/libmpfr.so /usr/lib/x86_64-linux-gnu/libgmp.so src/colmap/estimators/libcolmap_estimators.a src/colmap/feature/libcolmap_feature.a /usr/lib/x86_64-linux-gnu/libflann.so /usr/lib/x86_64-linux-gnu/liblz4.so src/thirdparty/SiftGPU/libcolmap_sift_gpu.a /usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudart.so /usr/local/cuda-11.6/targets/x86_64-linux/lib/libcurand.so /usr/lib/x86_64-linux-gnu/libGLEW.so src/colmap/optim/libcolmap_optim.a /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0 src/colmap/image/libcolmap_image.a src/colmap/scene/libcolmap_scene.a src/colmap/feature/libcolmap_feature_types.a src/colmap/geometry/libcolmap_geometry.a src/colmap/math/libcolmap_math.a /usr/lib/x86_64-linux-gnu/libmetis.so /usr/lib/x86_64-linux-gnu/libboost_graph.so.1.74.0 /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.74.0 src/colmap/sensor/libcolmap_sensor.a src/colmap/util/libcolmap_util.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0 /usr/lib/x86_64-linux-gnu/libsqlite3.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/libceres.so.2.0.0 /usr/lib/x86_64-linux-gnu/libglog.so.0.4.0 /usr/lib/x86_64-linux-gnu/libunwind.so /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2 -lpthread src/thirdparty/VLFeat/libcolmap_vlfeat.a /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a /usr/lib/x86_64-linux-gnu/libfreeimage.so src/thirdparty/LSD/libcolmap_lsd.a /home/zichen/anaconda3/lib/libQt5OpenGL.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Widgets.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Gui.so.5.15.2 /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2 -lcudadevrt -lcudart_static -lrt -lpthread -ldl && : /usr/bin/ld: warning: libicui18n.so.58, needed by /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libicuuc.so.58, needed by /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libicudata.so.58, needed by /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link) /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `u_errorName_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_setMillis_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_getAlias_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_inDaylightTime_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `u_strToLower_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_getStandardName_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `u_strToUpper_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_setSubstChars_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_getMaxCharSize_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_getTimeZoneDisplayName_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_fromUnicode_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_open_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_getDefaultName_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_getDefaultTimeZone_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_clone_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_getDSTSavings_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_strcoll_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_close_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_countAvailable_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_openCountryTimeZones_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_open_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_compareNames_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_close_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_getAvailableName_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_openTimeZoneIDEnumeration_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_open_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_setAttribute_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_openTimeZones_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `uenum_close_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_countAliases_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_close_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_getSortKey_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucal_get_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `uenum_next_58' /usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `ucnv_toUnicode_58' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.}}}
Reference:
I already have
libicu-devinstalled.
-
Install
qtbase5-devI noticed the error said: “warning: libicudata.so.58, needed by /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2, not found”.
And the binary couldn’t find symbols: “/home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to u_errorName_58'”
I didn’t have Qt? Is this why there is the suggestion?
1sudo aptitude install qtbase5-dev- Someone used
aptitudeto install the above 2 packages. Ubuntu20.04安装colmap从零开始全过程记录(包括CUDA/CUDNN/ceres/anaconda) - CSDN
I forgot to check Qt before installing qtbase5: How to find Version of Qt? - SO
1 2 3(base) zichen@homepc:~/Downloads/colmap$ QT_SELECT=5 qmake -v QMake version 3.1 Using Qt version 5.15.2 in /home/zichen/anaconda3/lib- (2024-04-19) I accepted the first solution provided by the
aptitude. But, I didn’t notice that the 1st solution is to keep everything unchanged and give up installing qtbase5.
- Someone used
Qt Pkgs Matter
(2024-04-19)
-
The “undefined reference” errors persist:
1/usr/bin/ld: /home/zichen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `u_errorName_58'
-
I uninstalled anaconda (removed ~/anaconda3 to /mnt), based on this answer: OpenCV undefined references for libQt5Core.so.5 - raggot (Found by search the above error).
- I tested later that rename the
~/anaconda3works as well. 【超详细】安装了anaconda后,Ubuntu18+COLMAP配置疯狂踩坑踩至魔怔的记录 - CSDN
- I tested later that rename the
-
Then
cmake .. -GNinja. It could not find Qt5:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16CMake Error at cmake/FindDependencies.cmake:150 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" (requested version 5.4) with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:96 (include)Qt5 has been existed on the system:
1 2 3zichen@homepc:~/Downloads/colmap$ QT_SELECT=5 qmake -v QMake version 3.1 Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu -
Specifing path to Qt5 doesn’t work:
1 2 3cmake .. -DQt5_DIR=/usr/lib/x86_64-linux-gnu/ -GNinja cmake .. -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/ -GNinja cmake -B ./build -DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/qt5;/usr/lib/qt5;/usr/share/qt5" -GNinja -
I really don’t have Qt?
“ubuntu check qt version” DDG
1 2zichen@homepc:~/Downloads/colmap$ qmake -v qmake: could not find a Qt installation of ''The following packages already existed on the system: (qt4 - How to find Version of Qt? - SO)
qt related pkgs on my computer:
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24zichen@homepc:~/Downloads/colmap$ dpkg -l | grep qt ri libfcitx-qt5-1:amd64 1.2.7-1.2build1 amd64 Free Chinese Input Toy of X - D-Bus client libraries for Qt5 ri libfcitx-qt5-data 1.2.7-1.2build1 all Free Chinese Input Toy of X - data files for Qt5 integration ii libgsettings-qt1:amd64 0.2-4 amd64 library to access GSettings from Qt (shared libraries) ii libqt5core5a:amd64 5.15.8.1-1+dde amd64 Qt 5 core module ii libqt5core5a:i386 5.15.8.1-1+dde i386 Qt 5 core module ii libqt5dbus5:amd64 5.15.8.1-1+dde amd64 Qt 5 D-Bus module ii libqt5dbus5:i386 5.15.8.1-1+dde i386 Qt 5 D-Bus module ii libqt5gui5:amd64 5.15.8.1-1+dde amd64 Qt 5 GUI module ii libqt5network5:amd64 5.15.8.1-1+dde amd64 Qt 5 network module ri libqt5positioning5:amd64 5.15.8-1+dde amd64 Qt Positioning module ri libqt5printsupport5:amd64 5.15.8.1-1+dde amd64 Qt 5 print support module ii libqt5qml5:amd64 5.15.8.1-1+dde amd64 Qt 5 QML module ii libqt5qmlmodels5:amd64 5.15.8.1-1+dde amd64 Qt 5 QML Models library ii libqt5quick5:amd64 5.15.8.1-1+dde amd64 Qt 5 Quick library ii libqt5quickwidgets5:amd64 5.15.8.1-1+dde amd64 Qt 5 Quick Widgets library ri libqt5webchannel5:amd64 5.15.8-1+dde amd64 Web communication library for Qt ii libqt5widgets5:amd64 5.15.8.1-1+dde amd64 Qt 5 widgets module ri libqt5x11extras5:amd64 5.15.8-1+dde amd64 Qt 5 X11 extras ii qt5-qmake:amd64 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 qmake Makefile generator tool ii qt5-qmake-bin 5.15.3+dfsg-2ubuntu0.2 amd64 Qt 5 qmake Makefile generator tool — binary file ii qtchooser 66-2build1 amd64 Wrapper to select between Qt development binary versions ii qttranslations5-l10n 5.15.3-1 all translations for Qt 5 zichen@homepc:~/Downloads/colmap$}}}
How to make sure that Qt5.4.2 is installed properly
1 2zichen@homepc:~/Downloads/colmap$ whereis qt5 qt5: /usr/lib/x86_64-linux-gnu/qt5 /usr/lib/qt5 /usr/share/qt5I have
qmake:1 2 3 4zichen@homepc:~/Downloads/colmap$ export QT_SELECT=qt5-x86_64-linux-gnu zichen@homepc:~/Downloads/colmap$ qmake -v QMake version 3.1 Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu -
Only 1 binary
qmakeexists:1 2 3 4 5 6zichen@homepc:~/Downloads/colmap$ tree /usr/lib/qt5 /usr/lib/qt5 └── bin └── qmake 1 directory, 1 file- There should be other libraries or binaries for development.
-
aptcan findqtbase5-dev, but I can’t install: How do you install qt on ubuntu22.04Log
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25zichen@homepc:~/Downloads/colmap$ apt-cache search qt zichen@homepc:~/Downloads/colmap$ sudo apt-get install qtbase5-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: qtbase5-dev : Depends: libqt5concurrent5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5core5a (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5dbus5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5gui5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5network5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5printsupport5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5sql5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed Depends: libqt5test5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed Depends: libqt5widgets5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: libqt5xml5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is to be installed Depends: qtbase5-dev-tools (= 5.15.3+dfsg-2ubuntu0.2) Recommends: libqt5opengl5-dev (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages.}}}
qt5-default can’t be installed neither:
1 2 3 4 5 6 7 8 9 10zichen@homepc:~/Downloads/colmap$ sudo apt-get install qt5-default [sudo] password for zichen: Reading package lists... Done Building dependency tree... Done Reading state information... Done Package qt5-default is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'qt5-default' has no installation candidateOthers packages related qtbase5:
1 2 3 4 5zichen@homepc:~/Downloads/colmap$ apt-cache search qtbase5-dev qtbase5-dev - Qt 5 base development files qtbase5-dev-tools - Qt 5 base development programs qtbase5-gles-dev - Qt 5 base development files — OpenGL ES variant qtbase5-private-gles-dev - Qt 5 base private development files — OpenGL ES variant-
Some of them requires
qtbase-abi-5-15-3But, I can’t install it:
1E: Package 'qtbase-abi-5-15-3' has no installation candidate
Select the second solution offered by
aptitude:Output
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68zichen@homepc:~/Downloads/colmap$ sudo aptitude install qtbase5-dev The following NEW packages will be installed: qtbase5-dev{b} 0 packages upgraded, 1 newly installed, 0 to remove and 15 not upgraded. Need to get 1,135 kB of archives. After unpacking 15.7 MB will be used. The following packages have unmet dependencies: qtbase5-dev : Depends: libqt5concurrent5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5core5a (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5dbus5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5gui5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5network5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5printsupport5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5sql5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not installable Depends: libqt5test5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not installable Depends: libqt5widgets5 (= 5.15.3+dfsg-2ubuntu0.2) but 5.15.8.1-1+dde is installed Depends: libqt5xml5 (= 5.15.3+dfsg-2ubuntu0.2) but it is not going to be installed Depends: qtbase5-dev-tools (= 5.15.3+dfsg-2ubuntu0.2) but it is not installable The following actions will resolve these dependencies: Keep the following packages at their current version: 1) qtbase5-dev [Not Installed] Accept this solution? [Y/n/q/?] . The following actions will resolve these dependencies: Remove the following packages: 1) libqt5core5a:i386 [5.15.8.1-1+dde (<NULL>, now)] 2) libqt5dbus5:i386 [5.15.8.1-1+dde (<NULL>, now)] 3) libqt5positioning5 [5.15.8-1+dde (<NULL>, now)] 4) libqt5webchannel5 [5.15.8-1+dde (<NULL>, now)] 5) libqt5x11extras5 [5.15.8-1+dde (<NULL>, now)] Install the following packages: 6) libqt5sql5 [5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 7) libqt5sql5-odbc [5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 8) libqt5test5 [5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 9) libqt5xml5 [5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 10) qtbase5-dev-tools [5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] Downgrade the following packages: 11) libqt5concurrent5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 12) libqt5core5a [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 13) libqt5dbus5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 14) libqt5gui5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 15) libqt5network5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 16) libqt5printsupport5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] 17) libqt5qml5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3-1+dde (<NULL>)] 18) libqt5qmlmodels5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3-1+dde (<NULL>)] 19) libqt5quick5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3-1+dde (<NULL>)] 20) libqt5quickwidgets5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3-1+dde (<NULL>)] 21) libqt5widgets5 [5.15.8.1-1+dde (<NULL>, now) -> 5.15.3+dfsg-2ubuntu0.2 (jammy-updates)] Accept this solution? [Y/n/q/?] Y The following packages will be DOWNGRADED: libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5printsupport5 libqt5qml5 libqt5qmlmodels5 libqt5quick5 libqt5quickwidgets5 libqt5widgets5 The following NEW packages will be installed: libqt5sql5{a} libqt5sql5-odbc{a} libqt5test5{a} libqt5xml5{a} qtbase5-dev qtbase5-dev-tools{a} The following packages will be REMOVED: libqt5core5a:i386{a} libqt5dbus5:i386{a} libqt5positioning5{a} libqt5webchannel5{a} libqt5x11extras5{a} The following packages are RECOMMENDED but will NOT be installed: libqt5svg5 qt5-gtk-platformtheme 0 packages upgraded, 6 newly installed, 11 downgraded, 5 to remove and 15 not upgraded. Need to get 15.1 MB of archives. After unpacking 6,725 kB will be used. Do you want to continue? [Y/n/?]}}}
After installation, there are more binary files:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15zichen@homepc:~/Downloads/colmap$ tree /usr/lib/qt5/bin/ /usr/lib/qt5/bin/ ├── fixqt4headers.pl ├── moc ├── qdbuscpp2xml ├── qdbusxml2cpp ├── qlalr ├── qmake ├── qvkgen ├── rcc ├── syncqt.pl ├── tracegen └── uic 0 directories, 11 files -
-
The Qt5OpenGL is required as well:
1 2 3 4 5 6 7 8 9 10 11 12 13 14CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package): Could not find a package configuration file provided by "Qt5OpenGL" with any of the following names: Qt5OpenGLConfig.cmake qt5opengl-config.cmake Add the installation prefix of "Qt5OpenGL" to CMAKE_PREFIX_PATH or set "Qt5OpenGL_DIR" to a directory containing one of the above files. If "Qt5OpenGL" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): cmake/FindDependencies.cmake:150 (find_package) CMakeLists.txt:96 (include)Similarly, use
aptitudeto install it:1 2 3 4 5 6zichen@homepc:~/Downloads/colmap$ sudo aptitude install libqt5opengl5-dev The following NEW packages will be installed: libqt5opengl5{a} libqt5opengl5-dev 0 packages upgraded, 2 newly installed, 0 to remove and 27 not upgraded. Need to get 195 kB of archives. After unpacking 927 kB will be used. Do you want to continue? [Y/n/?] YFinally, compilation succeeded:
1 2 3zichen@homepc:~/Downloads/colmap$ cmake -B ./build -GNinja cd build ninja
(2024-04-18)
-
CUDA requires GCC setup under Ubuntu 22.04. Docs
1 2 3 4# sudo apt-get install gcc-10 g++-10 export CC=/usr/bin/gcc-10 export CXX=/usr/bin/g++-10 export CUDAHOSTCXX=/usr/bin/g++-10 -
Installing
nvidia-cuda-toolkitfailed viaapt install. I don’t install it since I already have CUDA-11.6 installed by downloading package manually.
Verified Practice
(2024-04-19)
-
Rename
anaconda3folder, e.g.,anaconda3_1. Otherwise, theqt5called by header and cmake mismatch. issue-sofa-fredroy -
Use
aptitudeto install unavailable dependecies, asapt installcannot installqtbase5-devandlibqt5opengl5-devon Ubuntu 22.04.Select an alternative solutions provided by aptitude.
-
Specify gcc and g++ versions for Ubuntu 22.04:
1 2 3 4# sudo apt-get install gcc-10 g++-10 export CC=/usr/bin/gcc-10 export CXX=/usr/bin/g++-10 export CUDAHOSTCXX=/usr/bin/g++-10 -
Compile colmap:
1 2 3 4 5# cd colmap cmake -B ./build -GNinja cd build ninja sudo ninja installThe colmap is installed in
/usr/local{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322[0/1] Install the project... -- Install configuration: "Release" -- Installing: /usr/local/share/applications/COLMAP.desktop -- Installing: /usr/local/lib/libcolmap_controllers.a -- Installing: /usr/local/lib/libcolmap_estimators.a -- Installing: /usr/local/lib/libcolmap_exe.a -- Installing: /usr/local/lib/libcolmap_feature_types.a -- Installing: /usr/local/lib/libcolmap_feature.a -- Installing: /usr/local/lib/libcolmap_geometry.a -- Installing: /usr/local/lib/libcolmap_image.a -- Installing: /usr/local/lib/libcolmap_math.a -- Installing: /usr/local/lib/libcolmap_mvs.a -- Installing: /usr/local/lib/libcolmap_optim.a -- Installing: /usr/local/lib/libcolmap_retrieval.a -- Installing: /usr/local/lib/libcolmap_scene.a -- Installing: /usr/local/lib/libcolmap_sensor.a -- Installing: /usr/local/lib/libcolmap_sfm.a -- Installing: /usr/local/lib/libcolmap_util.a -- Installing: /usr/local/lib/libcolmap_lsd.a -- Installing: /usr/local/lib/libcolmap_poisson_recon.a -- Installing: /usr/local/lib/libcolmap_vlfeat.a -- Installing: /usr/local/lib/libcolmap_ui.a -- Installing: /usr/local/lib/libcolmap_util_cuda.a -- Installing: /usr/local/lib/libcolmap_mvs_cuda.a -- Installing: /usr/local/lib/libcolmap_sift_gpu.a -- Installing: /usr/local/share/colmap/colmap-config.cmake -- Installing: /usr/local/share/colmap/colmap-config-version.cmake -- Installing: /usr/local/share/colmap/colmap-targets.cmake -- Installing: /usr/local/share/colmap/colmap-targets-release.cmake -- Installing: /usr/local/include/colmap -- Installing: /usr/local/include/colmap/estimators -- Installing: /usr/local/include/colmap/estimators/utils.h -- Installing: /usr/local/include/colmap/estimators/pose.h -- Installing: /usr/local/include/colmap/estimators/coordinate_frame.h -- Installing: /usr/local/include/colmap/estimators/two_view_geometry.h -- Installing: /usr/local/include/colmap/estimators/generalized_absolute_pose.h -- Installing: /usr/local/include/colmap/estimators/bundle_adjustment.h -- Installing: /usr/local/include/colmap/estimators/affine_transform.h -- Installing: /usr/local/include/colmap/estimators/generalized_absolute_pose_coeffs.h -- Installing: /usr/local/include/colmap/estimators/fundamental_matrix.h -- Installing: /usr/local/include/colmap/estimators/euclidean_transform.h -- Installing: /usr/local/include/colmap/estimators/alignment.h -- Installing: /usr/local/include/colmap/estimators/homography_matrix.h -- Installing: /usr/local/include/colmap/estimators/absolute_pose.h -- Installing: /usr/local/include/colmap/estimators/similarity_transform.h -- Installing: /usr/local/include/colmap/estimators/triangulation.h -- Installing: /usr/local/include/colmap/estimators/essential_matrix_poly.h -- Installing: /usr/local/include/colmap/estimators/cost_functions.h -- Installing: /usr/local/include/colmap/estimators/generalized_relative_pose.h -- Installing: /usr/local/include/colmap/estimators/generalized_pose.h -- Installing: /usr/local/include/colmap/estimators/translation_transform.h -- Installing: /usr/local/include/colmap/estimators/essential_matrix_coeffs.h -- Installing: /usr/local/include/colmap/estimators/essential_matrix.h -- Installing: /usr/local/include/colmap/controllers -- Installing: /usr/local/include/colmap/controllers/feature_matching_utils.h -- Installing: /usr/local/include/colmap/controllers/automatic_reconstruction.h -- Installing: /usr/local/include/colmap/controllers/bundle_adjustment.h -- Installing: /usr/local/include/colmap/controllers/hierarchical_mapper.h -- Installing: /usr/local/include/colmap/controllers/incremental_mapper.h -- Installing: /usr/local/include/colmap/controllers/image_reader.h -- Installing: /usr/local/include/colmap/controllers/feature_extraction.h -- Installing: /usr/local/include/colmap/controllers/feature_matching.h -- Installing: /usr/local/include/colmap/controllers/option_manager.h -- Installing: /usr/local/include/colmap/math -- Installing: /usr/local/include/colmap/math/math.h -- Installing: /usr/local/include/colmap/math/matrix.h -- Installing: /usr/local/include/colmap/math/graph_cut.h -- Installing: /usr/local/include/colmap/math/polynomial.h -- Installing: /usr/local/include/colmap/math/random.h -- Installing: /usr/local/include/colmap/exe -- Installing: /usr/local/include/colmap/exe/gui.h -- Installing: /usr/local/include/colmap/exe/image.h -- Installing: /usr/local/include/colmap/exe/database.h -- Installing: /usr/local/include/colmap/exe/feature.h -- Installing: /usr/local/include/colmap/exe/model.h -- Installing: /usr/local/include/colmap/exe/mvs.h -- Installing: /usr/local/include/colmap/exe/vocab_tree.h -- Installing: /usr/local/include/colmap/exe/sfm.h -- Installing: /usr/local/include/colmap/optim -- Installing: /usr/local/include/colmap/optim/sampler.h -- Installing: /usr/local/include/colmap/optim/random_sampler.h -- Installing: /usr/local/include/colmap/optim/least_absolute_deviations.h -- Installing: /usr/local/include/colmap/optim/support_measurement.h -- Installing: /usr/local/include/colmap/optim/combination_sampler.h -- Installing: /usr/local/include/colmap/optim/ransac.h -- Installing: /usr/local/include/colmap/optim/progressive_sampler.h -- Installing: /usr/local/include/colmap/optim/sprt.h -- Installing: /usr/local/include/colmap/optim/loransac.h -- Installing: /usr/local/include/colmap/sensor -- Installing: /usr/local/include/colmap/sensor/models.h -- Installing: /usr/local/include/colmap/sensor/database.h -- Installing: /usr/local/include/colmap/sensor/bitmap.h -- Installing: /usr/local/include/colmap/sensor/specs.h -- Installing: /usr/local/include/colmap/util -- Installing: /usr/local/include/colmap/util/types.h -- Installing: /usr/local/include/colmap/util/ply.h -- Installing: /usr/local/include/colmap/util/string.h -- Installing: /usr/local/include/colmap/util/threading.h -- Installing: /usr/local/include/colmap/util/sqlite3_utils.h -- Installing: /usr/local/include/colmap/util/base_controller.h -- Installing: /usr/local/include/colmap/util/endian.h -- Installing: /usr/local/include/colmap/util/eigen_alignment.h -- Installing: /usr/local/include/colmap/util/logging.h -- Installing: /usr/local/include/colmap/util/version.h -- Installing: /usr/local/include/colmap/util/timer.h -- Installing: /usr/local/include/colmap/util/cuda.h -- Installing: /usr/local/include/colmap/util/controller_thread.h -- Installing: /usr/local/include/colmap/util/cache.h -- Installing: /usr/local/include/colmap/util/testing.h -- Installing: /usr/local/include/colmap/util/opengl_utils.h -- Installing: /usr/local/include/colmap/util/misc.h -- Installing: /usr/local/include/colmap/util/cudacc.h -- Installing: /usr/local/include/colmap/mvs -- Installing: /usr/local/include/colmap/mvs/mat.h -- Installing: /usr/local/include/colmap/mvs/meshing.h -- Installing: /usr/local/include/colmap/mvs/cuda_rotate.h -- Installing: /usr/local/include/colmap/mvs/cuda_texture.h -- Installing: /usr/local/include/colmap/mvs/gpu_mat_ref_image.h -- Installing: /usr/local/include/colmap/mvs/image.h -- Installing: /usr/local/include/colmap/mvs/cuda_flip.h -- Installing: /usr/local/include/colmap/mvs/patch_match_cuda.h -- Installing: /usr/local/include/colmap/mvs/cuda_transpose.h -- Installing: /usr/local/include/colmap/mvs/gpu_mat_prng.h -- Installing: /usr/local/include/colmap/mvs/depth_map.h -- Installing: /usr/local/include/colmap/mvs/normal_map.h -- Installing: /usr/local/include/colmap/mvs/workspace.h -- Installing: /usr/local/include/colmap/mvs/fusion.h -- Installing: /usr/local/include/colmap/mvs/patch_match.h -- Installing: /usr/local/include/colmap/mvs/model.h -- Installing: /usr/local/include/colmap/mvs/gpu_mat.h -- Installing: /usr/local/include/colmap/mvs/consistency_graph.h -- Installing: /usr/local/include/colmap/image -- Installing: /usr/local/include/colmap/image/undistortion.h -- Installing: /usr/local/include/colmap/image/warp.h -- Installing: /usr/local/include/colmap/image/line.h -- Installing: /usr/local/include/colmap/sfm -- Installing: /usr/local/include/colmap/sfm/incremental_mapper.h -- Installing: /usr/local/include/colmap/sfm/incremental_triangulator.h -- Installing: /usr/local/include/colmap/retrieval -- Installing: /usr/local/include/colmap/retrieval/utils.h -- Installing: /usr/local/include/colmap/retrieval/vote_and_verify.h -- Installing: /usr/local/include/colmap/retrieval/inverted_file_entry.h -- Installing: /usr/local/include/colmap/retrieval/inverted_file.h -- Installing: /usr/local/include/colmap/retrieval/geometry.h -- Installing: /usr/local/include/colmap/retrieval/inverted_index.h -- Installing: /usr/local/include/colmap/retrieval/visual_index.h -- Installing: /usr/local/include/colmap/scene -- Installing: /usr/local/include/colmap/scene/synthetic.h -- Installing: /usr/local/include/colmap/scene/point2d.h -- Installing: /usr/local/include/colmap/scene/two_view_geometry.h -- Installing: /usr/local/include/colmap/scene/reconstruction_manager.h -- Installing: /usr/local/include/colmap/scene/reconstruction_io.h -- Installing: /usr/local/include/colmap/scene/image.h -- Installing: /usr/local/include/colmap/scene/scene_clustering.h -- Installing: /usr/local/include/colmap/scene/database.h -- Installing: /usr/local/include/colmap/scene/database_cache.h -- Installing: /usr/local/include/colmap/scene/camera.h -- Installing: /usr/local/include/colmap/scene/track.h -- Installing: /usr/local/include/colmap/scene/reconstruction.h -- Installing: /usr/local/include/colmap/scene/correspondence_graph.h -- Installing: /usr/local/include/colmap/scene/projection.h -- Installing: /usr/local/include/colmap/scene/visibility_pyramid.h -- Installing: /usr/local/include/colmap/scene/camera_rig.h -- Installing: /usr/local/include/colmap/scene/point3d.h -- Installing: /usr/local/include/colmap/tools -- Installing: /usr/local/include/colmap/feature -- Installing: /usr/local/include/colmap/feature/utils.h -- Installing: /usr/local/include/colmap/feature/types.h -- Installing: /usr/local/include/colmap/feature/matcher.h -- Installing: /usr/local/include/colmap/feature/sift.h -- Installing: /usr/local/include/colmap/feature/extractor.h -- Installing: /usr/local/include/colmap/geometry -- Installing: /usr/local/include/colmap/geometry/pose.h -- Installing: /usr/local/include/colmap/geometry/gps.h -- Installing: /usr/local/include/colmap/geometry/sim3.h -- Installing: /usr/local/include/colmap/geometry/rigid3.h -- Installing: /usr/local/include/colmap/geometry/homography_matrix.h -- Installing: /usr/local/include/colmap/geometry/triangulation.h -- Installing: /usr/local/include/colmap/geometry/essential_matrix.h -- Installing: /usr/local/include/colmap/ui -- Installing: /usr/local/include/colmap/ui/qt_utils.h -- Installing: /usr/local/include/colmap/ui/image_viewer_widget.h -- Installing: /usr/local/include/colmap/ui/colormaps.h -- Installing: /usr/local/include/colmap/ui/bundle_adjustment_widget.h -- Installing: /usr/local/include/colmap/ui/feature_extraction_widget.h -- Installing: /usr/local/include/colmap/ui/model_viewer_widget.h -- Installing: /usr/local/include/colmap/ui/thread_control_widget.h -- Installing: /usr/local/include/colmap/ui/point_viewer_widget.h -- Installing: /usr/local/include/colmap/ui/project_widget.h -- Installing: /usr/local/include/colmap/ui/reconstruction_options_widget.h -- Installing: /usr/local/include/colmap/ui/reconstruction_manager_widget.h -- Installing: /usr/local/include/colmap/ui/license_widget.h -- Installing: /usr/local/include/colmap/ui/point_painter.h -- Installing: /usr/local/include/colmap/ui/media -- Installing: /usr/local/include/colmap/ui/undistortion_widget.h -- Installing: /usr/local/include/colmap/ui/render_options.h -- Installing: /usr/local/include/colmap/ui/movie_grabber_widget.h -- Installing: /usr/local/include/colmap/ui/reconstruction_stats_widget.h -- Installing: /usr/local/include/colmap/ui/shaders -- Installing: /usr/local/include/colmap/ui/match_matrix_widget.h -- Installing: /usr/local/include/colmap/ui/feature_matching_widget.h -- Installing: /usr/local/include/colmap/ui/options_widget.h -- Installing: /usr/local/include/colmap/ui/main_window.h -- Installing: /usr/local/include/colmap/ui/log_widget.h -- Installing: /usr/local/include/colmap/ui/database_management_widget.h -- Installing: /usr/local/include/colmap/ui/triangle_painter.h -- Installing: /usr/local/include/colmap/ui/automatic_reconstruction_widget.h -- Installing: /usr/local/include/colmap/ui/line_painter.h -- Installing: /usr/local/include/colmap/ui/dense_reconstruction_widget.h -- Installing: /usr/local/include/colmap/ui/render_options_widget.h -- Installing: /usr/local/include/colmap/thirdparty -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/LiteWindow.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/GlobalUtil.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/PyramidGL.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/PyramidCL.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/CuTexImage.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/SiftPyramid.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ProgramCU.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/GLTexImage.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ProgramCG.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/SiftMatchCU.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/SiftMatch.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/SiftGPU.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/CLTexImage.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ProgramCL.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/FrameBufferObject.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ShaderMan.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ProgramGLSL.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/PyramidCU.h -- Installing: /usr/local/include/colmap/thirdparty/SiftGPU/ProgramGPU.h -- Installing: /usr/local/include/colmap/thirdparty/LSD -- Installing: /usr/local/include/colmap/thirdparty/LSD/lsd.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/fisher.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/qsort-def.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/generic.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/sift.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/mathop_sse2.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/heap-def.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/gmm.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/ikmeans.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/slic.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/stringop.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/quickshift.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/hog.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/lbp.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/float.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/kmeans.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/mathop_avx.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/host.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/dsift.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/homkermap.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/array.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/pgm.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/svmdataset.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/shuffle-def.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/mathop.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/svm.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/mser.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/liop.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/scalespace.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/imopv_sse2.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/rodrigues.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/vlad.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/covdet.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/imopv.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/aib.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/hikmeans.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/getopt_long.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/random.h -- Installing: /usr/local/include/colmap/thirdparty/VLFeat/kdtree.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/SurfaceTrimmer.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Polynomial.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/BinaryNode.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.IsoSurface.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Geometry.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/BSplineData.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/CmdLineParser.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Allocator.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.Evaluation.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Factor.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/BSplineData.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Polynomial.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/PPolynomial.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/SparseMatrix.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/FunctionData.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MarchingCubes.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/SparseMatrix.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Array.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/FunctionData.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Array.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MAT.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/PoissonRecon.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MAT.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Geometry.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Octree.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.SortedTreeNodes.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MemoryUsage.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.WeightedSamples.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Hash.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/PPolynomial.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Octree.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/PointStream.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/CmdLineParser.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MultiGridOctreeData.System.inl -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/Ply.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/MyTime.h -- Installing: /usr/local/include/colmap/thirdparty/PoissonRecon/PointStream.h -- Installing: /usr/local/share/colmap/cmake -- Installing: /usr/local/share/colmap/cmake/FindLZ4.cmake -- Installing: /usr/local/share/colmap/cmake/FindMetis.cmake -- Installing: /usr/local/share/colmap/cmake/FindFLANN.cmake -- Installing: /usr/local/share/colmap/cmake/FindGlew.cmake -- Installing: /usr/local/share/colmap/cmake/FindFreeImage.cmake -- Installing: /usr/local/share/colmap/cmake/FindGlog.cmake -- Installing: /usr/local/share/colmap/cmake/FindDependencies.cmake -- Installing: /usr/local/bin/colmap -- Set non-toolchain portion of runtime path of "/usr/local/bin/colmap" to ""}}}
Ubuntu 20.04 ❌
(2024-04-18)
System info:
- OS: Ubuntu 20.04.6 LTS x86_64; Kernel: 5.15.0-101-generic
- Host: Alienware Aurora R8 1.0.6
- CPU: Intel i7-9700 (8) @ 4.700GHz, GPU: Intel UHD Graphics 630
- GPU: NVIDIA GeForce GTX 1050 Ti
- Memory: 16GB
- gcc version 9.4.0
- Cuda compilation tools, release 11.6, V11.6.55; Build cuda_11.6.r11.6/compiler.30794723_0 (
nvcc -V) - Nvidia Driver Version: 545.23.06
-
Dependecies: Docs
The installation has no error reported:
Log
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52(base) yi@yi-Alienware-Aurora-R8:~/Downloads$ sudo apt-get install \ > git \ > cmake \ > ninja-build \ > build-essential \ > libboost-program-options-dev \ > libboost-filesystem-dev \ > libboost-graph-dev \ > libboost-system-dev \ > libeigen3-dev \ > libflann-dev \ > libfreeimage-dev \ > libmetis-dev \ > libgoogle-glog-dev \ > libgtest-dev \ > libsqlite3-dev \ > libglew-dev \ > qtbase5-dev \ > libqt5opengl5-dev \ > libcgal-dev \ > libceres-dev [sudo] password for yi: Reading package lists... Done Building dependency tree Reading state information... Done libboost-filesystem-dev is already the newest version (1.71.0.0ubuntu2). libboost-filesystem-dev set to manually installed. libboost-program-options-dev is already the newest version (1.71.0.0ubuntu2). libboost-program-options-dev set to manually installed. libboost-system-dev is already the newest version (1.71.0.0ubuntu2). libboost-system-dev set to manually installed. libboost-graph-dev is already the newest version (1.71.0.0ubuntu2). libboost-graph-dev set to manually installed. libeigen3-dev is already the newest version (3.3.7-2). libglew-dev is already the newest version (2.1.0-4). build-essential is already the newest version (12.8ubuntu1.1). build-essential set to manually installed. git is already the newest version (1:2.25.1-1ubuntu3.11). The following additional packages will be installed: cmake-data googletest libaec-dev libatlas3-base libblas-dev libbtf1 libceres1 libcxsparse3 libflann1.9 libfreeimage3 libgflags-dev libgflags2.2 libgmp-dev libgmpxx4ldbl libgoogle-glog0v5 libgraphblas3 libhdf5-mpi-dev libhdf5-openmpi-dev libjxr0 libklu1 liblapack-dev libldl2 liblz4-dev libmongoose2 libmpfr-dev libqt5opengl5 librbio2 librhash0 libspqr2 libsuitesparse-dev qt5-qmake qt5-qmake-bin qtbase5-dev-tools qtchooser Suggested packages: cmake-doc liblapack-doc libmpfi-dev libntl-dev gmp-doc libgmp10-doc libhdf5-doc libmpfr-doc sqlite3-doc default-libmysqlclient-dev firebird-dev libpq-dev unixodbc-dev The following NEW packages will be installed: cmake cmake-data googletest libaec-dev libatlas3-base libblas-dev libbtf1 libceres-dev libceres1 libcgal-dev libcxsparse3 libflann-dev libflann1.9 libfreeimage-dev libfreeimage3 libgflags-dev libgflags2.2 libgmp-dev libgmpxx4ldbl libgoogle-glog-dev libgoogle-glog0v5 libgraphblas3 libgtest-dev libhdf5-mpi-dev libhdf5-openmpi-dev libjxr0 libklu1 liblapack-dev libldl2 liblz4-dev libmetis-dev libmongoose2 libmpfr-dev libqt5opengl5 libqt5opengl5-dev librbio2 librhash0 libspqr2 libsqlite3-dev libsuitesparse-dev ninja-build qt5-qmake qt5-qmake-bin qtbase5-dev qtbase5-dev-tools qtchooser 0 upgraded, 46 newly installed, 0 to remove and 47 not upgraded. Need to get 39.1 MB of archives. After this operation, 323 MB of additional disk space will be used. Do you want to continue? [Y/n]}}}
-
Compile
-
Same error pertain to
libtiffas above.1 2 3 4 5(base) yi@yi-Alienware-Aurora-R8:~/Downloads/colmap/build$ conda list libtiff # packages in environment at /home/yi/anaconda3: # # Name Version Build Channel libtiff 4.5.1 h6a678d5_0Uninstall
libtiffHowever,
conda uninstall libtiffhangs forever.
-
Docker Image
System Info
-
Problems:
-
Applications are not preserved through a system reinstallation, and backing up the
bindirectory is inefficient due to its size. -
Compiling COLMAP is cumbersome due to missing dependencies and configurations.
-
Docker can create the correct environment for a (prebuilt) application, with all its dependencies properly configured r1-Gemini.
-
Colmap provides a pre-built Docker image with CUDA support r2-Docs
::: aside
-
-
Supports
-
Check Install Requirements for Docker Image Build
-
lsb_release -a: Ubuntu 22.04.5 LTS -
docker --version: Docker version 28.4.0, build d8eb465 -
./setup-ubuntu.sh: Check host CUDA version to update Dockerfile -
neofetch{{{1 2 3 4 5 6 7 8 9zichen@zichen-X570-AORUS-PRO-WIFI --------------------------------- OS: Ubuntu 22.04.5 LTS x86_64 Host: X570 AORUS PRO WIFI -CF Kernel: 6.8.0-83-generic Shell: bash 5.1.16 CPU: AMD Ryzen 7 5700X (16) @ 3.400GHz GPU: NVIDIA 09:00.0 NVIDIA Corporation Device 2203 Memory: 25734MiB / 128754MiB}}}
-
gcc --version: gcc (Ubuntu 10.5.0-1ubuntu1~22.04.2) 10.5.0 -
nvcc -V: NVIDIA (R) Cuda compiler driver, release 11.3, V11.3.58, cuda_11.3.r11.3/compiler.29745058_0 -
nvidia-smi: Nvidia Driver Version 550.163.01
-
-
The
UBUNTU_VERSIONidentified in thesetup-ubuntu.shis for the Docker image, not related to the host system.
-
-
Actions:
-
Download COLMAP source code
1 2 3zichen@zichen-X570-AORUS-PRO-WIFI:~/Programs$ git clone --depth=1 https://github.com/colmap/colmap cd colmap/docker -
Run
setup-ubuntu.shr3-GitHub to get CUDA version number1./setup-ubuntu.sh-
That script performs: Update nvidia driver, Identify compatible CUDA version, Install nvidia-container-toolkit, Run a test container
(I already have the packagenvidia-container-toolkitinstalled.) -
Nvidia driver upgraded to
580.65, and reboot is required. -
Run the script again after rebooting
-
-
Error:
1 2 3🔍 Finding latest patch version for CUDA 12.9... ❌ No CUDA 12.9 images found for Ubuntu 24.04, trying Ubuntu 22.04... ❌ No compatible CUDA images found -
The target image is not found due to the URL request only fetchs links on
page=1, but the link to the target image (12.9.0-base-ubuntu22.04) is located on thepage=2.
-
Modify Sh for Dynm Pages
-
Problems:
- The execution of
./setup-ubuntu.shfailed because no image was found for CUDA 12.9.
::: aside
- References: {{{
- The execution of
-
Supports:
-
Docker images for old CUDA are superseded by new versions, making it impossible to retrieve a link to an image from the latest 100 images.
-
Solution: Implement Dynamic Pagination Handling. r2-Gemini
-
jqextracts specified fields from JSON.
-
-
Actions:
-
Add a function to check all pages on Docker Hub
- Use the
sleepcommand to implement a delay between requests within the loop to avoid hitting rate limits.
Code Modification
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64# Function to search for a CUDA image tag, sending progress to stderr find_cuda_image_tag() { local cuda_ver=$1 local ubuntu_ver=$2 local page_num=1 local url="https://registry.hub.docker.com/v2/repositories/nvidia/cuda/tags/?page=${page_num}&page_size=100" # This progress message now goes to stderr echo "⏳ Searching for CUDA ${cuda_ver} on Ubuntu ${ubuntu_ver}..." >&2 while [ -n "$url" ]; do # This progress message also goes to stderr echo " - Checking page ${page_num}..." >&2 response=$(curl -s "$url") if ! echo "$response" | jq empty 2>/dev/null; then echo " - Warning: Could not retrieve or parse page ${page_num}." >&2 break fi found_tag=$(echo "$response" | jq -r '.results[].name' | grep -E "^${cuda_ver}\.[0-9]+-base-ubuntu${ubuntu_ver}$" | head -1) if [ -n "$found_tag" ]; then # This is the RESULT. It goes to stdout so it can be captured by the variable. echo "$found_tag" return 0 fi url=$(echo "$response" | jq -r '.next // empty') page_num=$((page_num + 1)) if [ -n "$url" ]; then sleep 1 fi done echo " - Search complete. No matching tag found." >&2 return 1 } echo "🔍 Finding latest patch version for CUDA $COMPATIBLE_CUDA..." # 1. Try to find a matching image for Ubuntu 24.04 by searching all pages AVAILABLE_VERSIONS=$(find_cuda_image_tag "$COMPATIBLE_CUDA" "24.04") if [ -n "$AVAILABLE_VERSIONS" ]; then # Extract full version (e.g., "12.9.1" from "12.9.1-base-ubuntu24.04") FULL_CUDA_VERSION=$(echo "$AVAILABLE_VERSIONS" | cut -d'-' -f1) UBUNTU_VERSION="24.04" echo "✅ Found CUDA version: $FULL_CUDA_VERSION for Ubuntu $UBUNTU_VERSION" else echo "❌ No CUDA $COMPATIBLE_CUDA images found for Ubuntu 24.04, trying Ubuntu 22.04..." # 2. If not found, fall back to searching for an Ubuntu 22.04 image AVAILABLE_VERSIONS=$(find_cuda_image_tag "$COMPATIBLE_CUDA" "22.04") if [ -n "$AVAILABLE_VERSIONS" ]; then FULL_CUDA_VERSION=$(echo "$AVAILABLE_VERSIONS" | cut -d'-' -f1) UBUNTU_VERSION="22.04" echo "✅ Found CUDA version: $FULL_CUDA_VERSION for Ubuntu $UBUNTU_VERSION" else echo "❌ No compatible CUDA images found for CUDA $COMPATIBLE_CUDA on supported Ubuntu versions." exit 1 fi fi}}}
- Use the
-
Run script
./setup-ubuntu-pages_1.shTerminal output
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41📦 Configure Docker INFO[0000] Loading config from /etc/docker/daemon.json INFO[0000] Wrote updated config to /etc/docker/daemon.json INFO[0000] It is recommended that docker daemon be restarted. 🔍 Finding latest patch version for CUDA 12.9... ⏳ Searching for CUDA 12.9 on Ubuntu 24.04... - Checking page 1... - Checking page 2... ✅ Found CUDA version: 12.9.1 for Ubuntu 24.04 🧪 Testing with automatically detected compatible CUDA version: 12.9... Unable to find image 'nvidia/cuda:12.9.1-base-ubuntu24.04' locally 12.9.1-base-ubuntu24.04: Pulling from nvidia/cuda 32f112e3802c: Already exists 644e9b203583: Pull complete 02559cd4bc8d: Pull complete 2cd52cbb1ebe: Pull complete 6e8af4fd0a07: Pull complete Digest: sha256:29e5e3425e2e0f5a4e97c9fb4695ba4887cd78210a43cf94c3bcafc6ab01c5e6 Status: Downloaded newer image for nvidia/cuda:12.9.1-base-ubuntu24.04 Sun Sep 28 05:19:19 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.65.06 Driver Version: 580.65.06 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 3090 Ti Off | 00000000:09:00.0 Off | Off | | 0% 27C P8 23W / 450W | 134MiB / 24564MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ ✅ GPU support working with CUDA 12.9.1! ✅ Updated Dockerfile to use CUDA 12.9.1}}}
-
Execute Colmap
-
Problems:
- Run colmap for reconstruction from multi-view images
-
Supports:
-
Start container from the folder containing input images
1./run.sh /path/to/folder
-
Colmap Used by 3DGS
-
Problems:
-
3DGS initializes the scene point cloud using COLMAP via
convert.pyr1-README1colmap_command = '"{}"'.format(args.colmap_executable) if len(args.colmap_executable) > 0 else "colmap"
::: aside
- References: {{{
-
-
Supports:
-
In my experiment: The input images for
CasMVSNet_plwere also processed by COLMAP for comparison.-
The input images were saved to
/mnt/Seagate4T/04-Projects/CasMVSNet_pl-comments/results/dtu/image_ref/scan1/imgSource: CasMVSNet_pl-comments/eval_refine.py, Line #353
1cv2.imwrite(f'results/{args.dataset_name}/image_ref/{scan}/img/{ref_vid:08d}.png', image_ref[:,:,::-1])
-
-
-
Actions:
-
Use the script
CasMVSNet_pl-comments/test_scripts/mvDTU_3dgsColmap.shto copyimgfolders to/mnt/Seagate4T/04-Projects/gaussian-splatting/directory, then runconvert.pyfor each scan to reconstruct a sparse point cloud using COLMAP.-
COLMAP inputs:
1 2 3 4 5 6<location> |---input | |---<image 0> | |---<image 1> | |---... | -
Execute
1python convert.py -s "/mnt/Seagate4T/04-Projects/gaussian-splatting/DTU_testScans/scan1"
-
-
Convert Sparse bin to Ply
(2024-07-10)
-
Use
readColmapSceneInfo()function in 3DGS.--source_path="DTU_scan1":1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16gaussian-splatting | |---scene | |---temp.ipynb | |---DTU_scan1 |---images | |---<image 0> | |---<image 1> | |---... |---sparse |---0 |---cameras.bin |---images.bin |---points3D.binFunction call:
1 2 3 4# --- temp.ipynb --- from scene.dataset_readers import readColmapSceneInfo readColmapSceneInfo('DTU_scan1', 'images', False)
Visualize Sparse Point Cloud
(2024-07-10)
-
The sparse point cloud of DTU scan1 generated by colmap only has only 388 points. They are observable in Open3D if the camera pose is appropriate.
The translation vector (the 4th column) in the original extrinsics matrix from the DTU dataset mismatch the scale in Open3D. I guess Open3D has rescaled the translation vector according to the size of the input point cloud.
-
The original pose43 from DTU dataset won’t show any point of this sparse point cloud, although the dense point cloud restored from CasMVSNet can be displayed correctly:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18import open3d as o3d pcd = o3d.io.read_point_cloud("DTU_scan1/sparse/0/points3D.ply", format='ply') # pcd = o3d.io.read_point_cloud("../CasMVSNet_pl-comments/results/dtu/points/scan001_l3.ply", format='ply') import numpy as np vis = o3d.visualization.VisualizerWithKeyCallback() vis.create_window(width=800, height=800) vis.add_geometry(pcd) vis.get_render_option().background_color = np.asarray([1,1,1]) w2c = np.array([[0.311619, -0.853452, 0.417749, -285.581], [0.0270351, 0.447425, 0.893913, -541.214], [-0.949823, -0.267266, 0.162499, 545.452], [0.0, 0.0, 0.0, 1.0]]) # cam 43 extrinsic view_ctl = vis.get_view_control() cam = view_ctl.convert_to_pinhole_camera_parameters() cam.extrinsic = w2c view_ctl.convert_from_pinhole_camera_parameters(cam, True) vis.run() vis.destroy_window() -
The viewpoint parameters saved by pressing:
Ctrl+ccannot be reloaded withvis.get_render_option().load_from_json().(Search: “open3d display colmap point cloud” in Google ➔ Visualization — Open3D latest (664eff5) documentation)
-
Save the copied json content into a file “o3d_render_scan1.json”:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19{ "class_name" : "ViewTrajectory", "interval" : 29, "is_loop" : false, "trajectory" : [ { "boundingbox_max" : [ 2.0850396156311035, 8.7633571624755859, 31.446575164794922 ], "boundingbox_min" : [ -9.2711105346679688, -2.8082370758056641, 20.023061752319336 ], "field_of_view" : 60.0, "front" : [ 0.57468924964379176, 0.44402843879692444, -0.68743800584737935 ], "lookat" : [ -3.5930354595184326, 2.9775600433349609, 25.734818458557129 ], "up" : [ -0.33054624782933378, -0.64249516212987978, -0.69133142897285405 ], "zoom" : 0.69999999999999996 } ], "version_major" : 1, "version_minor" : 0 } -
This viewpoint should’t be loaded with
get_render_option().load_from_json(), like:1 2 3 4 5 6 7 8import open3d as o3d pcd = o3d.io.read_point_cloud("DTU_scan1/sparse/0/points3D.ply", format='ply') vis = o3d.visualization.Visualizer() vis.create_window(width=800, height=800) vis.add_geometry(pcd) vis.get_render_option().load_from_json("o3d_render_scan1.json") vis.run() vis.destroy_window()Loading camera parameters with
get_render_option()will pop an “unsupport” error:1[Open3D WARNING] ViewTrajectory read JSON failed: unsupported json format.Because
RenderOptionis notViewControl(camera parameters). (Directed by Google)
-
-
I drag the visualizer to a similar viewpoint to the pose43, and save the camera parameter with
write_pinhole_camera_parameters()as a json file.(Found in DDG ➔ How to load viewpoint in Visualization? #567)
1 2 3 4 5 6 7 8 9import open3d as o3d pcd = o3d.io.read_point_cloud("DTU_scan1/sparse/0/points3D.ply", format='ply') vis = o3d.visualization.Visualizer() vis.create_window(width=800, height=800) vis.add_geometry(pcd) vis.run() # user changes the view and press "q" to terminate param = vis.get_view_control().convert_to_pinhole_camera_parameters() o3d.io.write_pinhole_camera_parameters("o3d_render_scan1_save.json", param) vis.destroy_window()The json file contains extrinsic and intrinsic.
{{{1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41{ "class_name" : "PinholeCameraParameters", "extrinsic" : [ 0.65176050659153895, 0.35039808285127577, -0.67262874275612927, 0.0, -0.68560130823217202, 0.65140983980868639, -0.32498625624902339, 0.0, 0.3242824204268171, 0.67296835299631441, 0.66479659119730228, 0.0, -3.962131546638247, -17.999337566932006, -4.527720017212074, 1.0 ], "intrinsic" : { "height" : 800, "intrinsic_matrix" : [ 692.82032302755101, 0.0, 0.0, 0.0, 692.82032302755101, 0.0, 399.5, 399.5, 1.0 ], "width" : 800 }, "version_major" : 1, "version_minor" : 0 }}}}
Then, the identical viewpoint can be recovered by loading this json file with
read_pinhole_camera_parameters:1 2 3 4 5 6 7 8 9 10import open3d as o3d pcd = o3d.io.read_point_cloud("DTU_scan1/sparse/0/points3D.ply", format='ply') vis = o3d.visualization.Visualizer() vis.create_window(width=800, height=800) ctr = vis.get_view_control() param = o3d.io.read_pinhole_camera_parameters("o3d_render_scan1_save.json") vis.add_geometry(pcd) ctr.convert_from_pinhole_camera_parameters(param) vis.run() vis.destroy_window() -
I write the extrinsic in the above json to a
w2cmatrix:1 2 3 4w2c = np.array([[0.65176050659153895, -0.68560130823217202, 0.3242824204268171, -3.962131546638247], [0.35039808285127577, 0.65140983980868639, 0.67296835299631441, -17.999337566932006], [-0.67262874275612927, -0.32498625624902339, 0.66479659119730228, -4.527720017212074], [0.0, 0.0, 0.0, 1.0]])Using this
w2c, the sparse point cloud can be displayed correctly. -
Replace the translation vector of pose43 with the above one, while keep the rotation 3x3 part unchanged:
1 2 3 4w2c = np.array([[0.311619, -0.853452, 0.417749, -3.96], [0.0270351, 0.447425, 0.893913, -17.999], [-0.949823, -0.267266, 0.162499, -4.52], [0.0, 0.0, 0.0, 1.0]]) # cam 43With using this
w2c, points are visible.
-
PyCOLMAP
-
Supports: