gpt4 book ai didi

c++ - 运动结构 (openCV) : ‘reconstruct’ was not declared in this scope

转载 作者:太空宇宙 更新时间:2023-11-03 22:46:09 25 4
gpt4 key购买 nike

我是 opencv 库的初学者。我已经在 Ubuntu 17.04 上安装了它,安装过程中的一切都很完美,一点错误都没有。我已经安装了 Opencv-master,构建了它,然后我下载了 opencv_contrib-master,一切都很完美..

我正在尝试使用 SFM(运动结构)构建 scene_reconstruction。我已经安装了所有依赖项:

sudo apt-get install libeigen3-dev libgflags-dev libgoogle-glog-dev

然后我安装了 Ceres 求解器:

git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
mkdir build && cd build
cmake ..
make -j4
make test
sudo make install

一切正常,完全没有错误。我尝试按照此处 (Scene Reconstruction) 的官方文档编写 example_sfm_scene_reconstruction.cpp,将其命名为 Reconstruct.cpp

我编写了 CMakeLists.txt 文件:

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

project( Reconstruct )

include_directories( /usr/local/include/eigen3 )

find_package( OpenCV REQUIRED )
find_package( Eigen3 REQUIRED )
add_executable( Reconstruct Reconstruct.cpp )
target_link_libraries( Reconstruct ${OpenCV_LIBS})

我已经创建了构建目录并使用 mkdir build && cd build 打开它。然后 cmake ..:

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /usr/local (found version "3.3.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/simocolna/Scrivania/SFM/build

但是当我尝试执行 make 时出现此错误:

error: ‘reconstruct’ was not declared in this scope
econstruct(images_paths, Rs_est, ts_est, K,
points3d_estimated,is_projective);

我试着关注这个论坛issue 476但任何事情都对我有帮助。

最佳答案

添加

#define CERES_FOUND 1

在你的代码之前

关于c++ - 运动结构 (openCV) : ‘reconstruct’ was not declared in this scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47076263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com