Instant-ngp Windows11 のインストールと使用記録

インスタント NeRF - 調査とデバッグ

このマシンは Y9000P RTX3060 Win11 で構成されています

1.Git

  1. 通常どおりダウンロードしてインストールし、Git Bash を起動します

  2. ユーザー名を設定する

$ git config --global user.name "**"
$ git config --global user.email "–*******@gmail.com"
$ git config --global --list
user.name=**
user.email=<U+0096>********@gmail.com

上記のメールボックスはブラウザからコピーしたものなので、 <U+0096> の前にがありますが、端末には表示されません(ブラウザでコピーしたものにはよくあります)。解決策は、コマンドを手動で再入力することです

$ git config --global user.email "*********@gmail.com"
  1. Github へのリンク。詳細についてはオンライン チュートリアルを参照してください。ここのパスワードは覚えるのが面倒なので空です。
$ ssh-keygen  -t  rsa  -C "*******@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/****/.ssh/id_rsa):
Created directory '/c/Users/****/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/****.ssh/id_rsa
Your public key has been saved in /c/Users/****/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:****************** ****@gmail.com
The key's randomart image is:
+---[RSA 3072]----+
|    ...  o.=. .  |
|   . ****.       |
|    o . .o.*o. ..|
|. .    .. =o  .  |
|E*****           |
|=.O     +        |
|oB.-----         |
|= =.B            |
|.+ *.            |
+----[SHA256]-----+

  1. Github リモート ウェアハウスに ping を試みます。成功します。
$ ssh [email protected]
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
PTY allocation request failed on channel 0
Hi **********! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
  1. git clone がエラーを報告する
$ git clone --recursive https://github.com/nvlabs/instant-ngp 
  • 接続がリセットされました、エラー番号 10054
fatal: unable to access 'https://github.com/nvlabs/instant-ngp/': OpenSSL SSL_read: Connection was reset, errno 10054

解決:

$ git config --global http.sslVerify false
  • ポート 443 21083 ミリ秒後: タイムアウトしました
fatal: unable to access 'https://github.com/nvlabs/instant-ngp/': Failed to connect to github.com port 443 after 21083 ms: Timed out

プロキシの問題。Clash で設定したポート番号を構成に追加します

解決:

    $ git config --global http.proxy http://127.0.0.1:7890
    $ git config --global https.proxy https://127.0.0.1:7890

2.CMake

開発者コマンド プロンプト ウィンドウで実行します (開発者コマンド プロンプトでは、この英語の検索を直接使用します)

$ cd instant-ngp
instant-ngp$ cmake . -B build

出力は次のとおりです。

D:\Project\CmakeProject\instant-ngp>cmake . -B build
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
-- The C compiler identification is MSVC 19.29.30145.0
-- The CXX compiler identification is MSVC 19.29.30145.0
-- The CUDA compiler identification is NVIDIA 11.1.105
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - 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: D:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: D:/Program Files (x86)/NVIDIA/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Targeting GPU architectures: 86
-- Module support is disabled.
-- Version: 9.0.0
-- Build type:
-- CXX_STANDARD: 14
-- Required features: cxx_variadic_templates
-- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found version "")
CMake Warning at CMakeLists.txt:118 (message):
  Vulkan was not found.  Neural graphics primitives will still compile and
  run correctly, but DLSS will not be supported.


-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Using Win32 for window creation
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- !!! Warning OptiX_INSTALL_DIR not set in environment. using default
-- OptiX_INSTALL_DIR value: C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.5.0
-- OptiX headers (optix.h and friends) not found.
CMake Warning at CMakeLists.txt:194 (message):
  OptiX was not found.  Neural graphics primitives will still compile and run
  correctly.  However, SDF training in 'raystab' and 'pathescape' modes will
  be significantly slower.


-- Found Python: D:/ProgramData/Anaconda3/python.exe (found suitable version "3.9.12", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- pybind11 v2.7.1
CMake Warning (dev) at D:/Program Files (x86)/CMake/share/cmake-3.23/Modules/CMakeDependentOption.cmake:89 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  dependencies/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Project/CmakeProject/instant-ngp/build

いくつかのものが不足しています。OptiX をインストールしてみてください。ほとんどのチュートリアルでこれがインストールされているようです。

インストール場所はD:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0システム変数に入れる必要があります (N は変数名、V は変数値)

N:	OptiX_INSTALL_DIR
V:	D:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0

追加するだけでは不十分です。システム変数を更新し、set PATH=C: シェルを閉じて再度開きecho %PATH% 、cmake を再起動する必要があります。出力は次のとおりです。

D:\Project\CmakeProject\instant-ngp>cmake . -B build
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
-- Targeting GPU architectures: 86
-- Module support is disabled.
-- Version: 9.0.0
-- Build type:
-- CXX_STANDARD: 14
-- Required features: cxx_variadic_templates
-- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found version "")
CMake Warning at CMakeLists.txt:118 (message):
  Vulkan was not found.  Neural graphics primitives will still compile and
  run correctly, but DLSS will not be supported.


-- Using Win32 for window creation
-- OptiX_INSTALL_DIR value: D:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0
-- pybind11 v2.7.1
CMake Warning (dev) at D:/Program Files (x86)/CMake/share/cmake-3.23/Modules/CMakeDependentOption.cmake:89 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  dependencies/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: D:/Project/CmakeProject/instant-ngp/build

OptiX は完成しましたが、まだ多くの問題があります。まずは Vulkan を見てください。

  1. また、ダウンロードしてインストールします。デフォルトのインストール ディレクトリに従って、実際のインストール ディレクトリは次のように調整されます。D:\Program Files (x86)\NVIDIA\VulkanSDK\1.3.224.1

  2. 環境変数も追加します。cmake プロンプトにはそれぞれ 2 つ必要と推定されます。

    N:	Vulkan_LIBRARY
    V:	D:\Program Files (x86)\NVIDIA\VulkanSDK\1.3.224.1\Lib
    
    N:	Vulkan_INCLUDE_DIR
    V:	D:\Program Files (x86)\NVIDIA\VulkanSDK\1.3.224.1\Include
    
  3. 環境変数も更新します (上記を参照)

  4. Cmakeを再起動すると、出力は次のようになります

    D:\Project\CmakeProject\instant-ngp>cmake . -B build
    -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
    -- Targeting GPU architectures: 86
    -- Module support is disabled.
    -- Version: 9.0.0
    -- Build type:
    -- CXX_STANDARD: 14
    -- Required features: cxx_variadic_templates
    -- Found Vulkan: D:/Program Files (x86)/NVIDIA/VulkanSDK/1.3.224.1/Lib/vulkan-1.lib (found version "1.3.224")
    -- Using Win32 for window creation
    -- OptiX_INSTALL_DIR value: D:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0
    -- pybind11 v2.7.1
    CMake Warning (dev) at D:/Program Files (x86)/CMake/share/cmake-3.23/Modules/CMakeDependentOption.cmake:89 (message):
      Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
      Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.
    Call Stack (most recent call first):
      dependencies/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/Project/CmakeProject/instant-ngp/build
    

    cmake関連の問題だけが残っているようです

    プロンプトに従って実行cmake --help-policy CMP0127

    D:\Project\CmakeProject\instant-ngp>cmake --help-policy CMP0127
    CMP0127
    -------
    
    .. versionadded:: 3.22
    
    ``cmake_dependent_option()`` supports full :ref:`Condition Syntax`.
    
    The ``<depends>`` parameter accepts a :ref:`semicolon-separated list <CMake
    Language Lists>` of conditions.  CMake 3.21 and lower evaluates each
    ``condition`` as ``if(${
           
           condition})``, which does not properly handle
    conditions with nested paren groups.  CMake 3.22 and above instead prefer
    to evaluate each ``condition`` as ``if(<condition>)``, where ``<condition>``
    is re-parsed as if literally written in a call to ``if()``.  This
    allows expressions like::
    
     "A AND (B OR C)"
    
    but requires expressions like::
    
     "FOO MATCHES (UPPER|lower)"
    
    to be re-written as::
    
     "FOO MATCHES \"(UPPER|lower)\""
    
    Policy ``CMP0127`` provides compatibility for projects that have not
    been updated to expect the new behavior.
    
    This policy was introduced in CMake version 3.22.  CMake version
    3.23.2 warns when the policy is not set and uses ``OLD`` behavior.
    Use the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
    explicitly.
    
    .. note::
      The ``OLD`` behavior of a policy is
      ``deprecated by definition``
      and may be removed in a future version of CMake.
    

抽象的すぎて初見ではわかりませんが、Googleプログラミングの場合はcmakeの出力と組み合わせてn回試して最終的にはこのブログを参考にして解決してください 要はエラー行の前に追加する必要があるということですが、いい奴、いい奴

cmake プロンプトによると、エラーが報告されている行でdependencies/pybind11/CMakeLists.txt:98 (cmake_dependent_option)、この CMakeLists.txt を見つけて、97 行目に次の 3 行のコードを追加します。

if(POLICY CMP0127)
cmake_policy(SET CMP0127 NEW)
endif()
cmake_dependent_option(PYBIND11_FINDPYTHON "Force new FindPython" OFF
                       "NOT CMAKE_VERSION VERSION_LESS 3.12" OFF)

cmakeを再起動します

D:\Project\CmakeProject\instant-ngp>cmake . -B build
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
-- Targeting GPU architectures: 86
-- Module support is disabled.
-- Version: 9.0.0
-- Build type:
-- CXX_STANDARD: 14
-- Required features: cxx_variadic_templates
-- Using Win32 for window creation
-- OptiX_INSTALL_DIR value: D:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0
-- pybind11 v2.7.1
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Project/CmakeProject/instant-ngp/build

Cmake は成功し、エラーは報告されませんが、4 行目でモジュールのサポートが無効になるわけではありません。

この質問は誰もしていないようですし、Githubに掲載されているサンプルコードにもこんな一文がありますが、無視しましょう

次は次の cmake コマンドです。これも開発者のコ​​マンド プロンプトで実行されます。

instant-ngp$ cmake --build build --config RelWithDebInfo -j

大量のエラー、多すぎる出力、いくつかのエラー レポートを表示する

D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility(1260): error :
 expected a "(" [D:\Project\CmakeProject\instant-ngp\build\optix_program.vcxproj]
            detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter
  =const char *, _Sentinel=const char *]"
  D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xlocale(1971): here
  
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility(1261): error :
 identifier "_Verify_range" is undefined [D:\Project\CmakeProject\instant-ngp\build\optix_program.vcxproj]
            detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter
  =const char *, _Sentinel=const char *]"
  D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xlocale(1971): here

D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility(1261): error :
 identifier "_Verify_range" is undefined [D:\Project\CmakeProject\instant-ngp\build\optix_program.vcxproj]
            detected during instantiation of "void std::_Adl_verify_range(const _Iter &, const _Sentinel &) [with _Iter
  =const char *, _Sentinel=const char *]"
  D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xlocale(1971): here


D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.1.t
argets(785,9): error MSB3721: 命令“"D:\Program Files (x86)\NVIDIA\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc.exe"
--use-local-env -ccbin "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hos
tX64\x64" -x cu   -I"D:\Program Files (x86)\NVIDIA\VulkanSDK\1.3.224.1\Include" -I"D:\Project\CmakeProject\instant-ngp\
dependencies\dlss\include" -I"D:\Project\CmakeProject\instant-ngp\dependencies\glfw\include" -I"D:\Project\CmakeProject
\instant-ngp\dependencies\imgui" -I"D:\Project\CmakeProject\instant-ngp\dependencies\gl3w" -I"D:\Project\CmakeProject\i
nstant-ngp\dependencies" -I"D:\Project\CmakeProject\instant-ngp\dependencies\eigen" -I"D:\Project\CmakeProject\instant-
ngp\dependencies\filesystem" -I"D:\Project\CmakeProject\instant-ngp\dependencies\nanovdb" -I"D:\Project\CmakeProject\in
stant-ngp\dependencies\tinylogger" -I"D:\Program Files (x86)\NVIDIA\NVIDIA Corporation\OptiX SDK 7.5.0\include" -I"D:\P
roject\CmakeProject\instant-ngp\include" -I"D:\Project\CmakeProject\instant-ngp\dependencies\tiny-cuda-nn\include" -I"D
:\Project\CmakeProject\instant-ngp\dependencies\tiny-cuda-nn\dependencies" -I"D:\Project\CmakeProject\instant-ngp\depen
dencies\tiny-cuda-nn\dependencies\cutlass\include" -I"D:\Project\CmakeProject\instant-ngp\dependencies\tiny-cuda-nn\dep
endencies\cutlass\tools\util\include" -I"D:\Project\CmakeProject\instant-ngp\dependencies\tiny-cuda-nn\dependencies\fmt
\include" -I"D:\Program Files (x86)\NVIDIA\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include"     --keep-dir x64\RelWithD
ebInfo -maxrregcount=0  --machine 64 -ptx -cudart shared --expt-relaxed-constexpr -std=c++14 -Xcompiler="/EHsc -Zi -Ob1
" -o optix_program.dir\RelWithDebInfo\raystab.ptx  -D_WINDOWS -DNDEBUG -DNGP_VULKAN -DGLFW_INCLUDE_VULKAN -DNGP_GUI -DN
GP_OPTIX -D"NGP_VERSION=\"1.0dev\"" -DTCNN_MIN_GPU_ARCH=0 -D"CMAKE_INTDIR=\"RelWithDebInfo\"" -D_MBCS -D"CMAKE_INTDIR=\
"RelWithDebInfo\"" "D:\Project\CmakeProject\instant-ngp\src\optix\raystab.cu"”已退出,返回代码为 1。 [D:\Project\CmakeProject\ins
tant-ngp\build\optix_program.vcxproj]
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xmemory(58): error : ex
pected a "(" [D:\Project\CmakeProject\instant-ngp\build\optix_program.vcxproj]

キーワード [D:\Project\CmakeProject\instant-ngp\build\optix_program.vcxproj] がおそらくそれに関連しています。

ようやく理由がわかりました。Optixとは関係がなく、CUDAのバージョンに問題があるため、次のステップはCUDA 11.6をインストールすることです。

インストール後、cmakeを再起動します

cmake . -B build
cmake --build build --config RelWithDebInfo -j 16

3 分間待ちます。エラーなしで完了します。出力が多すぎます。最後の数行のみをここに入力します。

    正在创建库 D:/Project/CmakeProject/instant-ngp/build/RelWithDebInfo/testbed.lib 和对象 D:/Project/CmakeProject/instant-ngp/
  build/RelWithDebInfo/testbed.exp
  testbed.vcxproj -> D:\Project\CmakeProject\instant-ngp\build\testbed.exe
  python_api.cu
    正在创建库 D:/Project/CmakeProject/instant-ngp/build/RelWithDebInfo/pyngp.lib 和对象 D:/Project/CmakeProject/instant-ngp/bu
  ild/RelWithDebInfo/pyngp.exp
  pyngp.vcxproj -> D:\Project\CmakeProject\instant-ngp\build\pyngp.cp39-win_amd64.pyd
  Building Custom Rule D:/Project/CmakeProject/instant-ngp/CMakeLists.txt

3.インスタントNGP

それから使い始めてください

Anaconda は仮想環境を作成します

conda create -n ngp python=3.9
conda activate ngp
pip install -r requirements.txt

サンプルデータ

キツネのデータを実行してみましたが、大丈夫な気がします。

instant-ngp$ ./build/testbed --scene data/nerf/fox

ここに画像の説明を挿入

カスタムデータ

  1. コルマップをインストールする

自分でプレイしたい場合は、これなしではいられない. ダウンロード後、インストールプロセスを必要とせずにすぐに使用できます. 通常の慣例に従って、インストールパスをカスタマイズできるソフトウェアは ディレクトリに移動されますD:\Program Files (x86)環境変数を追加する

N:	Path
V:	D:\Program Files (x86)\COLMAP\COLMAP-3.7-windows-cuda
  1. ポーズを計算する

    1. カスタムイメージセットを入れてくださいdata/<image_set_name>

    2. transform.json以下のコマンドから取得します。画像パスを挿入します<image/path>

    python scripts/colmap2nerf.py --colmap_matcher exhaustive --run_colmap --aabb_scale 16 --images <image/path>
    
    1. transform.jsonルートフォルダーに生成されるので、それをdata/<image_set_name>フォルダーにドラッグアンドドロップします
  2. サンプルデータフォックスに従ってデータ構造を再編成し、transform.jsonイメージパスを変更します。
    ここに画像の説明を挿入

ここに画像の説明を挿入
ルート ディレクトリをtransform.jsonその場所に移動した後、その中のイメージ パスを忘れずに変更し、次のようにサンプル データに従いますimages/img.jpg

  1. 走り始める

撮った写真で試してみる

python scripts/colmap2nerf.py --colmap_matcher exhaustive --run_colmap --aabb_scale 16 --images data/earphone

データを再編成し、transform.jsonを書き換えて実行します

instant-ngp$ ./build/testbed --scene data/nerf/earphone

ここに画像の説明を挿入

予防

  1. 携帯電話で撮影した写真は、水平方向または垂直方向で撮影する必要があります。そうしないと、ポーズを推定するときにエラーが報告されます。
  2. ある程度の重なりが必要ですが、小さなものであれば十数枚で十分です。
  3. ピクセルが高すぎる場合は、再処理する前に 1 倍などで縮小することを検討できます。コードは次のとおりです。
#include<iostream>
#include<icecream.hpp>
#include <vector>
#include <io.h>
#include <fstream>
#include <string>
#include <opencv2/opencv.hpp>
#include<opencv2/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>  
using namespace std;



/************************************************************************/
/*  获取文件夹下所有文件名
    输入:
        path    :   文件夹路径
        exd     :   所要获取的文件名后缀,如jpg、png等;如果希望获取所有
                    文件名, exd = ""
    输出:
        files   :   获取的文件名列表
/************************************************************************/
void getFiles(string path, string exd, vector<string>& files)
{
    //文件句柄
    long long   hFile = 0;
    //文件信息
    struct _finddata_t fileinfo;
    string pathName, exdName;

    if (0 != strcmp(exd.c_str(), ""))
    {
        exdName = "\\*." + exd;
    }
    else
    {
        exdName = "\\*";
    }

    if ((hFile = _findfirst(pathName.assign(path).append(exdName).c_str(), &fileinfo)) != -1)
    {
        do
        {
            //如果是文件夹中仍有文件夹,迭代之
            //如果不是,加入列表
            // 不推荐使用,硬要使用的话,需要修改else 里面的语句
            /*if((fileinfo.attrib &  _A_SUBDIR))
            {
                if(strcmp(fileinfo.name,".") != 0  &&  strcmp(fileinfo.name,"..") != 0)
                    getFiles( pathName.assign(path).append("\\").append(fileinfo.name), exd, files );
            }
            else */
            {
                if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0)
                    //files.push_back(pathName.assign(path).append("\\").append(fileinfo.name)); // 要得到绝对目录使用该语句
                    //如果使用
                    files.push_back(fileinfo.name); // 只要得到文件名字使用该语句
            }
        } while (_findnext(hFile, &fileinfo) == 0);
        _findclose(hFile);
    }
}




int main()
{
	string rootPath = "D:\\Project\\CmakeProject\\instant-ngp\\data\\nerf\\earphone_2";
	vector<string> imgLists;
    getFiles(rootPath, "jpg", imgLists);
	IC(imgLists);
    for (int i = 0; i < imgLists.size(); i++)
    {
        cv::Mat img = cv::imread(rootPath + "\\" + imgLists[i]);
        cv::Mat dst;
        cv::resize(img, dst, cv::Size(img.cols / 2, img.rows / 2), 0, 0, cv::INTER_AREA);
        cv::imwrite(rootPath + "\\rsz_" + imgLists[i], dst);
    }

	return 0;
}

疑問

  1. サンプル データを使用するか独自のデータを使用するかは関係ありません。カメラポーズ付近の写真に残像が残る
  2. GUIのチュートリアルがあればいいのですが、一部の対話型パラメータの具体的な意味がまだよくわかりません
  3. メッシュ効果が悪すぎて使用できません。エクスポートされた点群のサイズは 1 億点 (実際には数億点です) で、開くことができません。

おすすめ

転載: blog.csdn.net/m0_50910915/article/details/127414003