MVSNet depthfusion配置流程

2023-05-16

MVSNet depthfusion配置流程

原文内容

R/MVSNet itself only produces per-view depth maps. To generate the 3D point cloud, we need to apply depth map filter/fusion for post-processing. As our implementation of this part is depended on the Altizure internal library, currently we could not provide the corresponding code.
Fortunately, depth map filter/fusion is a general step in MVS reconstruction, and there are similar implementations in other open-source MVS algorithms. We provide the script depthfusion.py to utilize fusibile for post-processing (thank Silvano Galliani for the excellent code!).

To run the post-processing:

  • Check out the modified version fusibile git clone https://github.com/YoYo000/fusibile
  • Install fusibile by cmake . and make, which will generate the executable at FUSIBILE_EXE_PATH
  • Run post-processing (–prob_threshold 0.8 if using 3DCNNs): python depthfusion.py --dense_folder TEST_DATA_FOLDER --fusibile_exe_path FUSIBILE_EXE_PATH --prob_threshold 0.3
  • The final point cloud is stored in TEST_DATA_FOLDER/points_mvsnet/consistencyCheck-TIME/final3d_model.ply.

使用Origin Fusible代码融合出来的点云颜色是没有的,这里YaoYao通过修改了代码使得Gipuma融合出来的点云是由颜色的, 下面是YaoYao给出的代码: click here

CMakeList配置需求

cmake_minimum_required (VERSION 3.9)
project (fusibile)

# Enable C++11 globally
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Support IDEs: https://cliutils.gitlab.io/modern-cmake/chapters/features/ides.html
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "cmake-default-targets")

find_package(OpenCV REQUIRED )
find_package(CUDA 6.0 REQUIRED ) # For Cuda Managed Memory and c++11

if(NOT DEFINED CMAKE_CUDA_STANDARD)
    set(CMAKE_CUDA_STANDARD 11)
    set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(.)

# from https://en.wikipedia.org/wiki/CUDA#GPUs_supported
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75)
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_52,code=sm_52)

if(CMAKE_COMPILER_IS_GNUCXX)
    add_definitions(-std=c++11)
    add_definitions(-Wall)
    add_definitions(-Wextra)
    add_definitions(-pedantic)
    add_definitions(-Wno-unused-function)
    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -ffast-math -march=native") # extend release-profile with fast-math
    #add_definitions(-march=native)
endif()


# for YouCompleteMe
set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )

# For compilation ...
# Specify target & source files to compile it from
cuda_add_executable(
    fusibile
    cameraGeometryUtils.h
    vector_operations.h
    camera.h
    globalstate.h
    algorithmparameters.h
    cameraparameters.h
    linestate.h
    displayUtils.h
    mathUtils.h
    fileIoUtils.h
    fusibile.cu
    main.cpp
    )
# https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html
find_package(OpenMP)

# For linking ...
# Specify target & libraries to link it with
target_link_libraries(fusibile
	${OpenCV_LIBS}
	OpenMP::OpenMP_CXX
	)


include(FeatureSummary)
feature_summary(WHAT ALL)

针对CMakeList.txt文件修改

官方文件由于是14年的文件,那时候还不支持2080ti等算力的显卡。我通过cmake . make 编译得到的fusibile程序,运行报no kernel image is available for execution on the device的错误,因此为了兼容我的显卡以及多种其他算力不同cuda版本的显卡,我修改了CMAKELIST.txt文件。

将下面内容注释掉:

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_52,code=sm_52)

替换为了如下内容:

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75)

目前好像还不支持3090等30系显卡,但是20系显卡都支持了,后续的需要进行修改就好了.

具体配置

  • 将https://github.com/YoYo000/fusibile的代码clone下来
  • 前提是配置好下面所需要的配置:CMAKE、OPenCV和CUDA
  • 通过cmake.和make来安装fusible
    • 进入fusible文件夹
    • 输入cmake ., 得到如下数据
-- The following OPTIONAL packages have been found:

 * OpenMP

-- The following REQUIRED packages have been found:

 * OpenCV
 * Threads
 * CUDA (required version >= 6.0)

-- Configuring done
-- Generating done
-- Build files have been written to: /file/sync_files/MVSNet/fusible
  • 输入make, 编译完成之后文件夹会出现一个fusible文件没有后缀,表示成功了。
  • 如果需要的话,需要使用如下命令来清除缓存
rm -rf CMakeCache.txt

Linux安装CMAKE

  1. 通过如下命令查看Linux位数
getconf LONG_BIT
  1. 获取cmake源码包,先创了一个文件夹来存储cmake, 根据官方配置需求文件,得到我们需要一个CMAKE版本大于3.9
mkdir app

cd app

然后要去CMAKE官网去获取对应的CMAKE链接, 使用如下命令下载:

wget install https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2.tar.gz

这里我下载的是3.21版本的CMAKE.

  1. 解压源码
tar xzvf cmake-3.21.2.tar.gz
  1. 安装gcc(Ubuntu使用apt-get安装,Linux使用yum安装)
# Ubuntu
apt-get install gcc

# Linux
yum install gcc-c++
  1. 安装cmake,先进入解压后的cmake的目录
cd cmake-3.21.2

./bootstrap

如果编译出现如下信息:

 Could NOT find OpenSSL

Ubuntu系统可以执行如下命令安装相关依赖:

apt-get update
apt-get install libssl-dev

安装完成之后再重新编译就好了。

  1. 在当前目录执行如下命令安装make
make install
  1. 完成之后使用如下命令查看cmake版本
cmake --version

Linux安装OpenCV

  1. 按照之前的步骤安装完cmake
  2. 安装依赖环境
apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev

apt-get install libgtk2.0-dev

apt-get install pkg-config
  1. 去OpenCV官网下载源码,这里我是将源码下载下来,然后在上传到服务器上的,可以使用wget来进行源码的下载,命令如下:
wget install https://github.com/opencv/opencv/archive/4.5.3.zip
  1. 解压完文件
unzip -n opencv-4.5.3.zip
  1. 解压完文件之后,进入目录,创建build目录
cd opencv-4.5.3

mkdir build
  1. 使用如下命令清除CMakeCache缓存
rm -rf CMakeCache.txt

这个方法是进入到build文件夹之后,使用cmake出现如下错误时使用:

CMake Error: The source directory "/file/app/opencv-4.5.3/build" does not appear to contain CMakeLists.txt.
  1. 进入build文件夹,使用cmake命令
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

如果安装了Anaconda建议使用如下命令:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_SHARED_LIBS=OFF -D WITH_OPENMP=ON -D ENABLE_PRECOMPILED_HEADERS=OFF ..

切记不能在cmake配置下面的环境变量,否则会报错!!!
类似下面这种

  Some of these libraries may not be found correctly. Call Stack (most recent call first):   cmake/OpenCVModule.cmake:1273 (ocv_add_executable)   modules/highgui/CMakeLists.txt:272 (ocv_add_accuracy_tests)
  1. 执行结束之后,在使用make进行编译
make -j8
  1. 使用如下命令进行安装
make install
  1. 配置环境,使用vim打开/etc/ld.so.conf,在最后一行加上/usr/local/lib
vim /etc/ld.so.conf

include /usr/local/lib

然后运行如下命令生效:

ldconfig
  1. 修改bash.bashrc文件
vim /etc/bash.bashrc

在文件末尾添加上如下内容:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

然后在命令输入如下命令生效:

source /etc/bash.bashrc
  1. 检查是否生效
cd /usr/local/lib
ls

figure.1

问题

报错GL/gl.h: No such file or directory

使用如下命令安装:

sudo apt-get install mesa-common-dev
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

MVSNet depthfusion配置流程 的相关文章

随机推荐

  • HttpURLConnection执行getInputStream前应该先判断ResponseCode(响应码,通过getResponseCode获取)

    问题背景 xff1a 很多人在客户端做http请求的时候 xff0c 往往会执行完getOutputStream之后就立即执行getInputStream去获取服务端返回的数据 xff0c 这种方式大多数情况下也能正确的完成http交互 x
  • Mac Goland Debug无法调试的问题

    错误提示 GOROOT 61 usr local go gosetup GOPATH 61 Users xiong go gosetup usr local go bin go build o private var folders 7p
  • ios14.2越狱之后的一系列操作

    1 checkra1n越狱 2 afc2安装 源 xff1a https apt wxhbts com AFC2 iOS11 14 系统文件访问 然后安装个其他的什么插件重启storyboard或手机后生效 3 openssh cydia主
  • 【星伦商学院】中小企业经济复苏公益座谈会圆满结束

    中小企业经济复苏公益座谈会 为帮助中小微企业破解难题 渡过难关 xff0c 全面推进复工复产 xff0c 6月30日 xff0c 中小企业座谈会 xff08 以下简称会议 xff09 在中国 浙江诸暨市召开 力求创新举措破解制约中小微企业用
  • java Collections使用方法与详细分析

    Collections 此类仅由对集合进行操作或返回集合的静态方法组成 用例 import java util public class Test public static void main String args ArrayList
  • Kotlin View Binding,findViewById() 终结者

    AS 中如何配置 View Binding 仅需 2 步 xff0c 简单快速 xff1a 1 配置依赖 安卓扩展是 IntelliJ IDEA 与 Android Studio 的 Kotlin 插件的组成之一 xff0c 因此不需要再单
  • Android——支持图片加视频无限轮播的banner

    基于https github com youth5201314 banner 扩展 xff0c 图片 43 视频无限轮播banner Demo地址 https gitee com saqino pic video banner demo g
  • jpype报错OSError: [Errno 0] JVM DLL not found:

    python使用jpype运行java代码报错 OSError Errno 0 JVM DLL not found Library Java JavaVirtualMachines adoptopenjdk 8 jdk Contents H
  • 超详细 批处理文件脚本(bat) 教程(持续更新)

    目录 前言 xff08 1 xff09 使用echo输出字符串 xff08 2 xff09 使用echo拼接字符串 i xff09 没有变量 xff0c 直接拼接 ii xff09 有变量 xff0c 拼接变量 xff08 3 xff09
  • ChatGPT会如何影响我们的工作生活和人力资源需求

    ChatGPT xff0c 这几天体验了一下 xff0c 确实是非常震撼 一方面是因为它的回答确实相当好 xff0c 自带一点框架逻辑 xff0c 有上下文理解能力 xff0c 可以追问 xff0c 有情商 虽然很多时候都是一些正确的废话
  • 短视频文案风靡,如何做出好的短视频

    短视频近几年非常火爆 xff0c 大家都在转战短视频市场 xff0c 所以一时间如何写出好的短视频文案成为大家最关注的事情 xff0c 短视频文案作为众多文案中的一种 xff0c 既有共性也会有所区别 所以要做好短视频文案 xff0c 最关
  • 详解Ping程序

    前言 xff1a 今天在公司上班的时候 xff0c 出了一个很奇怪的错误 我在本机运行一个Java的项目 xff0c 外面的电脑可以访问我的程序 xff0c 而自己本机却访问不了 情急之下 xff0c 求助了公司里的一位大神 xff0c 大
  • 如何修改ftp服务器密码

    其实FTP服务就相当于共享文件 xff0c 你要进入FTP服务器首先要知道提供FTP这台电脑的IP或者域名 FTP服务器是可以设置访问的用户名和密码的 xff0c 当然也可以设置匿名访问 设置了匿名访问 xff0c 用户就不需要输用户名和密
  • 群晖Synology Drive同步规则中过滤指定文件夹

    学习Vue的过程中发现电脑上的Synology Drive同步文件时间变得超级长 xff0c 检查发现是项目文件夹里的 node modules 文件夹里文件非常多导致的 xff0c 每个项目都有上万个文件 xff0c 但是 Synolog
  • KKT条件介绍

    KKT条件介绍 KKT是非线性规划领域的重要成果 xff0c 它是判断某点是极值点的必要条件 对于凸规划 xff0c KKT条件就是充要条件了 xff0c 只要满足就是一定是极值点 xff0c 且一定得到是全局最优解 问题模型 等式约束 4
  • 尺度、尺度不变性、尺度空间、图像金字塔

    尺度 尺度不变性 尺度空间 图像金字塔 尺度 尺度不同有不同的表现形态 例如我们形容建筑物用 米 xff0c 观测分子 原子等用 纳米 更形象的例子比如 Google地图 xff0c 滑动鼠标轮可以改变观测地图的尺度 xff0c 看到的地图
  • MAC+VSCode+Latex 配置Latex编写环境

    title MAC 43 VSCode 43 Latex 配置Latex编写环境 categories VSCodeMACLatex tags VSCodeMACVSCode MAC 43 VSCode 43 Latex 配置Latex编写
  • LeetCode第168题—Excel表列名称—Python实现

    title LeetCode No 168 categories OJLeetCode tags ProgramingLeetCodeOJ LeetCode第168题 题目描述 给你一个整数 columnNumber xff0c 返回它在
  • # LeetCode第169题—多元数组

    title LeetCode No 169 categories OJLeetCode tags ProgramingLeetCodeOJ LeetCode第169题 题目描述 给定一个大小为 n 的数组 nums xff0c 返回其中的多
  • MVSNet depthfusion配置流程

    MVSNet depthfusion配置流程 原文内容 R MVSNet itself only produces per view depth maps To generate the 3D point cloud we need to