来自Motion的结构(openCV):在此范围内未声明'reconstruct'

时间:2017-11-02 13:13:17

标签: c++ opencv ubuntu cmake ceres-solver

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

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

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

然后我安装了Ceres Solver:

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但是有什么帮助我。

1 个答案:

答案 0 :(得分:1)

添加

#define CERES_FOUND 1
代码前