Commit 5e4d9b0b authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1172 from LaurentBerger:sfmstring

parents 941a33ae 03f0b94f
......@@ -108,7 +108,7 @@ reconstruct(InputArrayOfArrays points2d, OutputArray Rs, OutputArray Ts, InputOu
*/
CV_EXPORTS
void
reconstruct(const std::vector<std::string> images, OutputArray Ps, OutputArray points3d,
reconstruct(const std::vector<String> images, OutputArray Ps, OutputArray points3d,
InputOutputArray K, bool is_projective = false);
/** @brief Reconstruct 3d points from 2d images while performing autocalibration.
......@@ -128,7 +128,7 @@ reconstruct(const std::vector<std::string> images, OutputArray Ps, OutputArray p
*/
CV_EXPORTS
void
reconstruct(const std::vector<std::string> images, OutputArray Rs, OutputArray Ts,
reconstruct(const std::vector<String> images, OutputArray Rs, OutputArray Ts,
InputOutputArray K, OutputArray points3d, bool is_projective = false);
#endif /* CV_DOXYGEN || CERES_FOUND */
......
......@@ -166,8 +166,8 @@ public:
virtual void run(InputArrayOfArrays points2d, InputOutputArray K, OutputArray Rs,
OutputArray Ts, OutputArray points3d) = 0;
virtual void run(const std::vector<std::string> &images) = 0;
virtual void run(const std::vector<std::string> &images, InputOutputArray K, OutputArray Rs,
virtual void run(const std::vector<String> &images) = 0;
virtual void run(const std::vector<String> &images, InputOutputArray K, OutputArray Rs,
OutputArray Ts, OutputArray points3d) = 0;
CV_WRAP virtual double getError() const = 0;
......@@ -219,7 +219,7 @@ public:
- The images must be ordered as they were an image sequence. Additionally, each frame should be as close as posible to the previous and posterior.
- For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images.
*/
virtual void run(const std::vector<std::string> &images) = 0;
virtual void run(const std::vector<String> &images) = 0;
/** @brief Calls the pipeline in order to perform Eclidean reconstruction.
@param images a vector of string with the images paths.
......@@ -232,7 +232,7 @@ public:
- The images must be ordered as they were an image sequence. Additionally, each frame should be as close as posible to the previous and posterior.
- For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images.
*/
virtual void run(const std::vector<std::string> &images, InputOutputArray K, OutputArray Rs,
virtual void run(const std::vector<String> &images, InputOutputArray K, OutputArray Rs,
OutputArray Ts, OutputArray points3d) = 0;
/** @brief Returns the computed reprojection error.
......
......@@ -5,7 +5,6 @@
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
using namespace cv;
......@@ -29,7 +28,7 @@ static void help() {
}
int getdir(const string _filename, vector<string> &files)
int getdir(const string _filename, vector<String> &files)
{
ifstream myfile(_filename.c_str());
if (!myfile.is_open()) {
......@@ -57,7 +56,7 @@ int main(int argc, char* argv[])
// Parse the image paths
vector<string> images_paths;
vector<String> images_paths;
getdir( argv[1], images_paths );
......
......@@ -4,7 +4,6 @@
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
using namespace cv;
......@@ -52,7 +51,7 @@ static void help() {
*/
void
parser_2D_tracks(const string &_filename, std::vector<Mat> &points2d )
parser_2D_tracks(const String &_filename, std::vector<Mat> &points2d )
{
ifstream myfile(_filename.c_str());
......@@ -213,7 +212,7 @@ int main(int argc, char** argv)
viz::WCube cube_widget(Point3f(0.1,0.1,0.0), Point3f(0.0,0.0,-0.1), true, viz::Color::blue());
cube_widget.setRenderingProperty(viz::LINE_WIDTH, 2.0);
window_est.showWidget("Cube"+string(buffer), cube_widget, point_pose);
window_est.showWidget("Cube"+String(buffer), cube_widget, point_pose);
}
Affine3d cam_pose = path_est[idx];
......
......@@ -188,7 +188,7 @@ namespace sfm
void
reconstruct(const std::vector<std::string> images, OutputArray Ps, OutputArray points3d,
reconstruct(const std::vector<cv::String> images, OutputArray Ps, OutputArray points3d,
InputOutputArray K, bool is_projective)
{
const int nviews = static_cast<int>(images.size());
......@@ -232,7 +232,7 @@ namespace sfm
void
reconstruct(const std::vector<std::string> images, OutputArray Rs, OutputArray Ts,
reconstruct(const std::vector<cv::String> images, OutputArray Rs, OutputArray Ts,
InputOutputArray K, OutputArray points3d, bool is_projective)
{
const int nviews = static_cast<int>(images.size());
......
......@@ -116,19 +116,21 @@ parser_2D_tracks( const libmv::Matches &matches, libmv::Tracks &tracks )
*/
libmv_Reconstruction *libmv_solveReconstructionImpl(
const std::vector<std::string> &images,
const std::vector<String> &images,
const libmv_CameraIntrinsicsOptions* libmv_camera_intrinsics_options,
libmv_ReconstructionOptions* libmv_reconstruction_options)
{
Ptr<Feature2D> edetector = ORB::create(10000);
Ptr<Feature2D> edescriber = xfeatures2d::DAISY::create();
//Ptr<Feature2D> edescriber = xfeatures2d::LATCH::create(64, true, 4);
std::vector<std::string> sImages;
for (int i=0;i<images.size();i++)
sImages.push_back(images[i].c_str());
cout << "Initialize nViewMatcher ... ";
libmv::correspondence::nRobustViewMatching nViewMatcher(edetector, edescriber);
cout << "OK" << endl << "Performing Cross Matching ... ";
nViewMatcher.computeCrossMatch(images); cout << "OK" << endl;
nViewMatcher.computeCrossMatch(sImages); cout << "OK" << endl;
// Building tracks
libmv::Tracks tracks;
......@@ -196,7 +198,7 @@ public:
/* Run the pipeline given a set of images
*/
virtual void run(const std::vector <std::string> &images)
virtual void run(const std::vector <String> &images)
{
// Set libmv logs level
libmv_initLogging("");
......@@ -217,7 +219,7 @@ public:
}
virtual void run(const std::vector <string> &images, InputOutputArray K, OutputArray Rs,
virtual void run(const std::vector <String> &images, InputOutputArray K, OutputArray Rs,
OutputArray Ts, OutputArray points3d)
{
// Run the pipeline
......
......@@ -7,11 +7,10 @@ Dependencies
The Structure from Motion module depends on some open source libraries.
- [Eigen](http://eigen.tuxfamily.org) 3.2.2 or later. \b Required
- [GLog](http://code.google.com/p/google-glog) 0.3.1 or later. \b Required
- [GFlags](http://code.google.com/p/gflags). \b Required
- [GLog](https://github.com/google/glog) 0.3.1 or later. \b Required
- [GFlags]( https://github.com/gflags). \b Required
- [Ceres Solver](http://ceres-solver.org). Needed by the reconstruction API in order to solve part of the Bundle Adjustment plus the points Intersect. If Ceres Solver is not installed on your system, the reconstruction funcionality will be disabled. \b Recommended
@note The module is only available for Linux/GNU systems.
Installation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment