Git Product home page Git Product logo

theiasfm's People

Contributors

anstow avatar bjornpiltz avatar cbalint13 avatar cqd123123 avatar davesque avatar groundmelon avatar holynski avatar iago-suarez avatar kinddragon avatar klemmster avatar kvalev avatar meekohi avatar nosleduc avatar nrondaud avatar nuernber avatar oadoad avatar oleg-alexandrov avatar pmoulon avatar rajvishah avatar rsanchezsaez avatar seyoungpyo avatar stoyanovd avatar sweeneychris avatar tompaynter03 avatar tomrunia avatar urbste avatar vfragoso avatar zhixy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theiasfm's Issues

Error with export_reconstruction_to_pmvs

I got this error when trying to use pmvs:

No vis.dat although specified to initVisdata2:
/...../pmvs_working_dir/vis.dat

After changing the option "useVisData" from 1 to 0, pmvs ran successfully.

Tilde expansion in arguments

A very small bug, arguments can not cope with ~ (although $HOME is fine). Relative paths are fine, just tilde expansion seems to have been overlooked.

./extract_features --input_imgs=~/some.jpg --img_output_dir=~/results --descriptor=SIFT

Results in:

F0222 19:41:21.850764 15771 extract_features.cc:79] Check failed: theia::GetFilepathsFromWildcard(FLAGS_input_imgs, &img_filepaths) 
*** Check failure stack trace: ***
    @     0x7f8c450c1c6c  (unknown)
    @     0x7f8c450c1bb8  (unknown)
    @     0x7f8c450c15ba  (unknown)
    @     0x7f8c450c4551  (unknown)
    @           0x41449d  main
    @     0x7f8c440beec5  (unknown)
    @           0x41498f  (unknown)
    @              (nil)  (unknown)
[1]    15771 abort      ./extract_features --input_imgs=~/some.jpg 

Same is going on for img_output_dir.

Compilation issue on OSX El Capitan

I have the following error when I'm trying to compile the 0.5 version on OSX El Capitan

/usr/local/include/eigen3/Eigen/src/Core/Product.h:203:7: error: static_assert failed "THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS"
EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS);

It happens when I compile the file located at
theia/sfm/filter_view_pairs_from_orientation.cc
The error is at line 35

new global algorithm

Hi, is there any plan to add new start of art SfM algorithm, proposed by Ping Tan?

Global Structure-from-Motion by Similarity Averaging,
Zhaopeng Cui, Ping Tan,
International Conference on Computer Vision (ICCV), Santiago, Chile, Dec. 2015.

ThreadPool Failure

I just installed the Theia library and have tried to run some of the example applications provided and they all seem to fail with the following error:

./TheiaApplication/extract_features --input_imgs=./test_images --img_output_dir=./img_output --num_threads=-1 --descriptor=SIFT
F0424 20:23:58.192984  6497 threadpool.cc:82] Check failed: num_threads >= 1 (-1 vs. 1) The number of threads specified to the ThreadPool is insufficient.
*** Check failure stack trace: ***
    @     0x7fa777caff6d  google::LogMessage::Fail()
    @     0x7fa777cb1f23  google::LogMessage::SendToLog()
    @     0x7fa777cafae9  google::LogMessage::Flush()
    @     0x7fa777cb294e  google::LogMessageFatal::~LogMessageFatal()
    @           0x4692d0  theia::ThreadPool::ThreadPool()
    @           0x41dd7d  theia::FeatureExtractor::Extract<>()
    @           0x41379b  main
    @     0x7fa7761d5800  __libc_start_main
    @           0x414119  _start

I'm pretty new to working with linux so any support would be greatly appreciated.

Thx

Triangulation

I recently came across pretty simple point triangulation method that is fast but not that accurate,
i wonder how does it compare to the ones implemented in Theia:

/// R|t is relative transform between [ref]erence and [cur]rent
/// normalised features
bool triangulatePoint(const Eigen::Matrix3d& R,
                      const Eigen::Vector3d& t,
                      const Eigen::Vector3d& ref,
                      const Eigen::Vector3d& cur,
                      Eigen::Vector3d* result)
{

  Eigen::Matrix<double,3,2> A;
  Eigen::Matrix2d ATA, ATAInv;
  Eigen::Vector3d c;
  Eigen::Vector2d d;

  //  both vectors in frame 1
  const Eigen::Vector3d& v1 = ref;
  const Eigen::Vector3d& v2 = R.transpose() * cur;
  //  calculate depths along rays
  A << v1, -v2;
  c = -(R.transpose() * t);
  ATA = A.transpose() * A;

  bool invertible;
  ATA.computeInverseWithCheck(ATAInv, invertible);
  if (!invertible) {
    return false;
  } else {
    d = ATAInv * A.transpose() * c;
    if (d[0] > 0 && d[1] > 0) {
      //  average both points for solution
      *result = ((d[0]*v1 + d[1]*v2 + c)*0.5);
      return true;
    }
  }
  return false;
}

Triangulation enhancement

Did you read this article "Fury of the Swarm: Efficient and Very Accurate Triangulation for Multi-View
Scene Reconstruction" to improve triangulation ?

OpenGV enhancement

I've seen opengv is another good solution to fundamental minimal problem, such as PnP, Relative Pose problem for both central and non-central cameras. They use bearing vector instead of pixel which could represent more calibrated camera models, such as fisheye, panorama, stereo rig and etc.I think its another direction of enhancement~~

Personally, I'm working on a reconstruction project based on streetview panoramas, so camera model is relevent~

http://laurentkneip.github.io/opengv/

build_reconstruction stalls

Chris,

First, I would like to say that I have been very impressed by TheiaSfM, how the code is clean and implemented using good coding standards, and the care put into documentation. I am having trouble running it though. I made a directory with two images which I have used with other SFM solutions before. Very simple images with lots of features, with a resolution of 640 by 480. I first extracted features:

mkdir -p out_dir; extract_features --input_imgs=img_dir/*.jpg --img_output_dir=./out_dir --num_threads=4 --descriptor=SIFT

That worked. Then I did matching:

match_descriptors --input_imgs=img_dir/*.jpg --img_output_dir=./out_dir --num_threads=4 --descriptor=SIFT --matcher=brute_force --lowes_ratio=0.8

This is where the solver stalled, and even an hour later there is no progress. I attached to it with gdb. Here's where it appears stuck: void ExtractAndMatchFeatures<theia::L2, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(std::vectortheia::Image<float* ...

I though perhaps you may have some suggestions about what is going on. Thank you!

Handling repetitive structures in theia

Hi,

I was wondering if you can give me hints or pointers for increasing robustness against scenes with repetitive structures. The global sfm pipeline works pretty reliably most of the cases , but occasionally I come across data with repetitive structures , in those cases , the global sfm is producing incorrect results , even quite worse than incremental sfm results .

Regards

Avanindra

Theia fails occasionally if run repeatedly on the same dataset

Chris, I encountered the following problem. I have a dataset on which Theia succeeds 9 out of 10 tries, but every now and then it fails, giving a wildly incorrect reconstruction (and the incorrect reconstruction is quite different each time). At some point, I even got Theia to crash (with a larger dataset though, and this was not repeatable), so I would suspect that the problem is more of a software bug rather than non-uniqueness coming from multiple threads combined the randomness in RANSCAC or such.

The dataset in question is just 10 images, and they are very decent as far as I see it. There is sufficient perspective change between images, but they are still close enough for feature matching to work quite reliably. The camera has more rotation than translation motion between the frames for this set, but that is not a problem at all for the incremental BA algorithm I tried.

I ran Theia's match_descriptors function, and I get a lot of features and matches, so I think that is not the problem.

I also tried your latest code and the two sets of flags in the TheiaSFM/applications directory, and I did tweak the flags as well, nothing helps.

If you are interested and have the time to take a look at this, I can pass you the pictures.

Using Theia with two images only

I tried to use Theia with two images only, and it failed. It looks to me that there should be no fundamental issue why it should be so (unlike say OpenMVG whose basic unit is the triplet). I had to modify just three lines of code for Theia to work with two images, which amounted to just relaxing some checks (oleg-alexandrov@d7c8508). So I am just wondering if the current situation is intentional, or just a minor oversight.

global sfm is creating disconnected reconstructions into one

Hello,

I have been testing theia for past few days and many times I notice that the output reconstruction has disconnected set of multiple reconstructions , with their own scales. I want to separate these reconstructions , and ideally i think it should not happen. How can I fix this?....

Zero mean normalization different for each image in CascadeHasher

In CascadeHasher, when computing hash codes for an image, the descriptors are first modified by subtracting the mean descriptor of that image.

This is done for each image independently. Thus, the same descriptor in different images may end up having different hash codes, because the mean descriptor may be different on each image.

Should there be a global mean_descriptor so that all images use the same?

Improve number of geometrically verified features

After performing feature matching and 2-view geometry estimation, we run bundle adjustment on the inlier features. However, we currently do not re-evaluate the bundle-adjusted pose to determine if more inliers can be found. We need to do an analysis on this to make sure that the number of inliers reliably increases and that this procedure is stable.

What kind of data is good enough for Theia 3D reconstruction?

I created 46 pictures from different angles from a chair in my house. This is the corresponding gist: https://gist.github.com/mrquincle/1071001a5ab180eb56ba.

I only adjusted:

 --images=/home/anne/mypictures/3d/*.jpeg
--output_matches_file=output.matches

How many pictures do I need? Or am I doing something wrong? I have to admit the pictures are not taken in the best lighting conditions... Is there a (small) data set available that I can use to test?

Installation: Fail to find ImageMagick error

Hi,
I am to install Theia on my laptop( Mac OSX). However I'm getting the following error during compilation, even after installing ImageMagick(/opt/local/include) and all other dependencies. Please help me zero-down where I'm going wrong.
Thanks in advance.
screen shot 2016-01-15 at 04 18 11

Have a problem understanding smth

Hello,

I'm currently playing with different SLAM frameworks and experimenting with different initialization
steps when we don't know anything about world yet.
It seems to be a bit similar to incremental reconstruction that is implemented in Thiea so i wanted to
try similar approaches in my SLAM experiments. But i have troubles understanding some steps:

  1. first initial frame is Identity of course.
  2. we match all next frames to first and try to estimate relative pose.
  3. after we successfully estimate we triangulate initial map and continue extending it based on all new frames etc.

so i was trying to use Theia to estimate this initial map from 2 frames and relative pose. Theia is using 5pt Relative Pose estimator which returns multiple pose variants and we filter them after.
this includes computation of Essential matrix, decomposing it and filtering...
First question i got is why here:
https://github.com/sweeneychris/TheiaSfM/blob/master/src/theia/sfm/pose/essential_matrix_utils.cc#L82
we have to invert positions for candidate poses?

in my example i'm estimating Essential matrix from normalized correspondences where feature1 is in first identity frame and feature2 is in next frame. so i should get Essential from first to second frame. I thought that decomposing this Essential will give me [R|t] from first to second frame, but then when we filter this poses to find best one we modify them, what is the reason for that?

glog dependency not maintainable for Visual Studio

I'm using Windows. I'm stuck at the portion of the CMake build that looks for glog. glog does not look at all easy to get working on Windows. Its github repository looks like a mostly dead project with some occasional maintenance done on it. There is no CMake build, it is Autoconf based, which is problematic for the Visual Studio I'm using. There's a directory for Windows .sln files but they're 7 years old. I didn't even try to fire them up, I have no confidence in the headaches that will ensue. Comment files talk about "initial support" for Windows ala 2008. That work appears abandoned.

I'm wondering if this is an imported dependency from the Ceres Solver project. glog is not actually needed to build Ceres Solver. One can instead select a "mini glog" that Ceres itself rolls up and is maintained. Does Theia actually need any kind of glog, or is it just trying to make Ceres happy? If Theia does need glog-like functionality, can it do what Ceres does and use their "mini glog" ?

FindGflags.cmake does not detect gflags directory or namespace.

I'm using Windows 7, Visual Studio 2013 Community Edition, CMake 3.2.3. My gflags installation is in the standard place for a 64-bit Windows system, "C:/Program Files/gflags". FindGflags.cmake should be able to identify the directory without problem, as it is trivially easy to find, but it does not. The file contains a comment, "# TODO: Add standard Windows search locations for gflags." Although that may not be the source of the error, it seems reasonable to take it at face value.

Assuming one manually specifies the location of the gflags include directory and library file, gflags namespace detection is attempted. However on Windows it fails. I suspect that gflags has changed and the namespace testing is now inadequate.

The CMake modules appear to be derived from the Ceres Solver project, and their modules exhibit the same behavior. I have filed upstream bugs with them.

The "stock" gflags_declare.h defines the namespace is "google", so I have manually specified that in the CMake GUI to try to continue the build. I don't know if that's going to prove to be behaviorally correct though. Gflags has some weird implementation notes about using a hybrid of google and gflags namespace behavior. I really don't care to understand this presently; it looks like a "troubled" library.

Ceres Solver doesn't actually require gflags in order to be built. Is it possible for TheiaSfM to implement the same behavior, to not have this as a showstopper?

Compilation error: non-existing Eigen function Eigen::internal::tridiagonal_qr_step<>

When trying to build TheiaSfm (v0.5 tag; but the same issue appears on the most current commit 20c5433), I am experiencing a compiler error due to incorrect use of an internal Eigen function:

In file included from /theia/src/theia/sfm/global_pose_estimation/linear_position_estimator.cc:47:
In file included from /theia/libraries/spectra/include/SymEigsSolver.h:20:
/theia/libraries/spectra/include/LinAlg/TridiagEigen.h:93:13: error: no matching function for call to 'tridiagonal_qr_step'
            Eigen::internal::tridiagonal_qr_step<Eigen::ColMajor>(maind, subd, start, end, evecs.data(), n);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/theia/libraries/spectra/include/LinAlg/TridiagEigen.h:46:9: note: in instantiation of member function 'Spectra::TridiagEigen<double>::compute' requested here
        compute(mat);
        ^
/theia/libraries/spectra/include/SymEigsSolver.h:308:30: note: in instantiation of member function 'Spectra::TridiagEigen<double>::TridiagEigen' requested here
        TridiagEigen<Scalar> decomp(fac_H);
                             ^
/theia/libraries/spectra/include/SymEigsSolver.h:514:9: note: in instantiation of member function 'Spectra::SymEigsSolver<double, 0, theia::SparseSymShiftSolveLDLT>::retrieve_ritzpair' requested here
        retrieve_ritzpair();
        ^
/theia/src/theia/sfm/global_pose_estimation/linear_position_estimator.cc:257:8: note: in instantiation of member function 'Spectra::SymEigsSolver<double, 0, theia::SparseSymShiftSolveLDLT>::compute' requested here
  eigs.compute();
       ^
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:740:13: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'RealScalar'
static void tridiagonal_qr_step(RealScalar* diag, RealScalar* subdiag, Index start, Index end, Scalar* matrixQ, Index n)

A function from Eigen::internal should probably not be used in client code. I did not test which Eigen versions prior to 3.2.6 still perform a correct template instantiation, but the function template in question seems to have been changed a long time ago to take a scalar type as first template argument instead of a storage order (see Eigen commit 3bc00df9c229 from 2011?)

Platform is Mac OS X; all dependencies (Eigen, Ceres, etc.) have been installed via Homebrew to /usr/local.
Since Eigen is a multiplatform header-only library, I do not expect this issue to be platform specific.

Partial CMake output:

- The C compiler identification is AppleClang 7.0.0.7000176
- The CXX compiler identification is AppleClang 7.0.0.7000176
…
- Found Eigen: /usr/local/include/eigen3 (found suitable version "3.2.6", minimum required is "3.2.0") 
- Found Eigen version 3.2.6: /usr/local/include/eigen3

FivePointFocalLengthRadialDistortion

Hi

I'm testing the FivePointFocalLengthRadialDistortion function with 5 five coplanar points with the following function.
If I'm compiling theia in debug mode I've the following message:

Assertion failed: ((!(RowsAtCompileTime!=Dynamic) || (rows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (cols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (rows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (cols<=MaxColsAtCompileTime)) && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."), function resize, file /usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h, line 258.

If I using theia in release mode, the returned value of the function is true. But in the projection matrices contains NaN values.

Did I write something wrong in my code ?

static void TestTheiaFivePoints(){

    const double focal = 25.0;
const double depth = 1500.0;
const double z = .0;//0.5 * M_PI/180.0;
const double x = .0;//-1.5 * M_PI/180.0;
const double y = .0;//3.1 * M_PI/180.0;

// Create a ground truth pose.
Eigen::Matrix3d Rz, Ry, Rx;
Rz << cos(z), sin(z), 0,
        -sin(z), cos(z), 0,
        0, 0, 1;
Ry << cos(y), 0, -sin(y),
        0, 1, 0,
        sin(y), 0, cos(y);
Rx << 1, 0, 0,
        0, cos(x), sin(x),
        0, -sin(x), cos(x);
const Eigen::Matrix3d gt_rotation = Rz * Ry * Rx;
Eigen::Vector3d t(0.0, 0.0, 0.0);


std::vector<Eigen::Vector2d> pts2d(5);
std::vector<Eigen::Vector3d> pts3d(5);
pts3d[0] = Eigen::Vector3d(-100, -100.0, depth);
pts3d[1] = Eigen::Vector3d(100.0, -100.0, depth);
pts3d[2] = Eigen::Vector3d(100.0, 100.0, depth);
pts3d[3] = Eigen::Vector3d(-100.0, 100.0, depth);
pts3d[4] = Eigen::Vector3d(0.0, 0.0, depth);

for(int i = 0; i < 5; ++i){
    Eigen::Vector3d point = pts3d[i] ;
    Eigen::Vector3d pt = gt_rotation * point+ t;
    Eigen::Vector3d pt2 = pt * focal/pt(2);
    pts2d[i] = Eigen::Vector2d(pt2(0), pt2(1));
}

const int num_radial_distortion_params = 1;
std::vector<Eigen::Matrix<double, 3, 4>> projection_matrices;
std::vector<std::vector<double> > radial_distortions;


bool result = theia::FivePointFocalLengthRadialDistortion(pts2d, pts3d, num_radial_distortion_params, &projection_matrices, &radial_distortions);
std::cout << "Result of theia::FivePointFocalLengthRadialDistortion: "<<  result << std::endl;
for(size_t i = 0; i < projection_matrices.size(); ++i){
    std::cout << i << " " << projection_matrices[i](0, 0) << std::endl;
}

}

Segmentation fault during matching images

I'm probably doing something wrong I expect, but I get a segfault when running build_reconstruction

I1212 23:10:13.275478 23381 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 67.jpg
I1212 23:10:13.332242 23373 feature_extractor_and_matcher.cc:96] Successfully extracted 0 features from image /home/chris/Repositories/lights/out2/286.jpg
I1212 23:10:13.332535 23373 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 286.jpg
I1212 23:10:13.343547 23376 feature_extractor_and_matcher.cc:96] Successfully extracted 0 features from image /home/chris/Repositories/lights/out2/293.jpg
I1212 23:10:13.345017 23376 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 293.jpg
I1212 23:10:13.519985 23377 feature_extractor_and_matcher.cc:96] Successfully extracted 56 features from image /home/chris/Repositories/lights/out2/185.jpg
I1212 23:10:13.524101 23377 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 185.jpg
I1212 23:10:13.536026 23384 feature_extractor_and_matcher.cc:96] Successfully extracted 45 features from image /home/chris/Repositories/lights/out2/102.jpg
I1212 23:10:13.538269 23384 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 102.jpg
I1212 23:10:13.584291 23375 feature_extractor_and_matcher.cc:96] Successfully extracted 41 features from image /home/chris/Repositories/lights/out2/173.jpg
I1212 23:10:13.587066 23375 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 173.jpg
I1212 23:10:13.650713 23372 feature_extractor_and_matcher.cc:96] Successfully extracted 19 features from image /home/chris/Repositories/lights/out2/10.jpg
I1212 23:10:13.652554 23372 cascade_hashing_feature_matcher.cc:72] Created the hashed descriptors for image: 10.jpg
I1212 23:10:13.652746 23370 feature_extractor_and_matcher.cc:160] Matching images...
I1212 23:10:13.655616 24805 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 41.jpg
I1212 23:10:13.655791 24806 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 94.jpg
I1212 23:10:13.655884 24811 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 207.jpg
I1212 23:10:13.656082 24813 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 149.jpg
I1212 23:10:13.656085 24814 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 238.jpg
I1212 23:10:13.656185 24816 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 163.jpg
I1212 23:10:13.656360 24812 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 79.jpg
I1212 23:10:13.656471 24820 feature_matcher.h:406] Could not match a sufficient number of features between images 127.jpg and 99.jpg
Segmentation fault (core dumped)

Edit: I just obtained a backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee4cc700 (LWP 27651)]
0x0000000000606fcb in theia::CascadeHasher::MatchImages(theia::HashedImage const&, std::vector<Eigen::Matrix<float, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<float, -1, 1, 0, -1, 1> > > const&, theia::HashedImage const&, std::vector<Eigen::Matrix<float, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<float, -1, 1, 0, -1, 1> > > const&, double, std::vector<theia::IndexedFeatureMatch, std::allocator<theia::IndexedFeatureMatch> >*) const ()
(gdb) bt
#0  0x0000000000606fcb in theia::CascadeHasher::MatchImages(theia::HashedImage const&, std::vector<Eigen::Matrix<float, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<float, -1, 1, 0, -1, 1> > > const&, theia::HashedImage const&, std::vector<Eigen::Matrix<float, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<float, -1, 1, 0, -1, 1> > > const&, double, std::vector<theia::IndexedFeatureMatch, std::allocator<theia::IndexedFeatureMatch> >*) const ()
#1  0x00000000005b6482 in theia::CascadeHashingFeatureMatcher::MatchImagePair(theia::KeypointsAndDescriptors const&, theia::KeypointsAndDescriptors const&, std::vector<theia::FeatureCorrespondence, std::allocator<theia::FeatureCorrespondence> >*) ()
#2  0x0000000000515ddc in theia::FeatureMatcher<theia::L2>::MatchAndVerifyImagePairs(int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*) ()
#3  0x000000000050d1b9 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<std::reference_wrapper<std::_Bind<std::_Mem_fn<void (theia::FeatureMatcher<theia::L2>::*)(int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*)> (theia::FeatureMatcher<theia::L2>*, int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*)> > ()>, void> >::_M_invoke(std::_Any_data const&) ()
#4  0x00000000004a7579 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
#5  0x00007ffff79a836b in __pthread_once_slow (once_control=0xa74338, init_routine=0x4840d0 <__once_proxy@plt>) at pthread_once.c:114
#6  0x000000000050d933 in std::_Function_handler<void (), std::future<std::result_of<void (theia::FeatureMatcher<theia::L2>::*(theia::FeatureMatcher<theia::L2>*, int&, int const&, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*&))(int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*)>::type> theia::ThreadPool::Add<void (theia::FeatureMatcher<theia::L2>::*)(int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*), theia::FeatureMatcher<theia::L2>*, int&, int const&, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*&>(void (theia::FeatureMatcher<theia::L2>::*&&)(int, int, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*), theia::FeatureMatcher<theia::L2>*&&, int&, int const&, std::vector<theia::ImagePairMatch, std::allocator<theia::ImagePairMatch> >*&)::{lambda()#1}>::_M_invoke(std::_Any_data const&)
    ()
#7  0x00000000004bbe3b in std::thread::_Impl<std::_Bind_simple<theia::ThreadPool::ThreadPool(int)::{lambda()#1} ()> >::_M_run() ()
#8  0x00007ffff6227030 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007ffff79a16aa in start_thread (arg=0x7fffee4cc700) at pthread_create.c:333
#10 0x00007ffff598beed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Sanity check number of images found

If you forget the wildcard for --input_imgs you get the fairly confusing error message:

meekohi ~/Theia_Build/bin$ ./extract_features --input_imgs=arqhq/images/ --img_output_dir=arqhq/matches/ --num_threads=4 --descriptor=SIFT
F0526 15:51:50.579180 2017600256 threadpool.cc:82] Check failed: num_threads >= 1 (0 vs. 1) The number of threads specified to the ThreadPool is insufficient.
*** Check failure stack trace: ***
    @        0x10f1a5076  google::LogMessage::Fail()
    @        0x10f1a4757  google::LogMessage::SendToLog()
    @        0x10f1a4cc5  google::LogMessage::Flush()
    @        0x10f1a8015  google::LogMessageFatal::~LogMessageFatal()
    @        0x10f1a5363  google::LogMessageFatal::~LogMessageFatal()
    @        0x10edeba38  theia::ThreadPool::ThreadPool()
    @        0x10ed5a7b9  main
    @     0x7fff8bb945c9  start
    @                0x5  (unknown)
Abort trap: 6

Would be nice to sanity check some of the input parameters and give a more helpful error message.

Robust pairwise direction estimation

The current OptimizeRelativePositionWithKnownRotation uses a Huber loss to maintain robustness to outliers. Consider using the lifting technique of "Robust Bundle Adjustment Revisited" by Christopher Zach to design an L1 solver.

Make Feature a class

Right now, the Feature type is just a typedef of Eigen::Vector2d. Ideally, we would also save the color so that we may later colorize reconstructions.

Use ADMM Solver for Quadratic Programming

Update the least unsquared position estimator to utilize and ADMM solver for quadratic programming. This will help speed up the method considerably and the code should be simplified afterwards.

Error on opening image

When I try to open this image
https://copy.com/8lGcgDwqBQLgX2R3
I receive this error code:

[CImg] *** CImgIOException *** [instance(0,0,0,0,(nil),non-shared)] CImg<float>::load(): Failed to recognize format of file '/media/eugen/DATAPART1/SensorDaten/ReineBilder/RAG/sfm/all_left_images/1571720.jpg'.
terminate called after throwing an instance of 'cimg_library::CImgIOException'
  what():  [instance(0,0,0,0,(nil),non-shared)] CImg<float>::load(): Failed to recognize format of file '/media/eugen/DATAPART1/SensorDaten/ReineBilder/RAG/sfm/all_left_images/1571720.jpg'.
Aborted (core dumped)

The command I executed was:

./match_descriptors --input_imgs=$data/*.jpg --img_output_dir=$data/theia_matches --num_threads=14 --descriptor=SIFT --matcher=brute_force --lowes_ratio=0.8 -logtostderr -v 3

FindEigen.cmake does not detect eigen3 directory on Windows

It simply doesn't search obvious installed Windows paths for it. For instance, C:/Program Files/... on a 64-bit system. There's a note in FindEigen.cmake: "# TODO: Add standard Windows search locations for Eigen." I'm making note of it in the bug tracker, so that it is known that others are actually encountering this behavior when they try to build Theia on Windows. It's actually the very 1st impression of the Theia build, that this doesn't work.

Fortunately it is semi-easy to work around by specifying the directory. "Semi" because the directory that must be specified is actually "C:/Program Files/Eigen/include/eigen3", which is counterintuitive for an INCLUDE directory. Usually an INCLUDE would just be "C:/Program Files/Eigen/include", although unfortunately this library is using subdirectories for versioning.

File format for feature and matches files

Hi

I would like to test the build_reconstruction application provided in theia.
I have the image points, the matches and the camera parameters
How can I write them into the feature/matches/calibration files ?

[Help wanted] Create an FAQ section in the docs/website

SfM is a large and complex pipeline and Theia allow for many parameters to be easily set at runtime to alter the algorithm choice and performance. Tuning this parameters correctly can yield dramatic performance increases in efficiency and/or accuracy. The following common questions should be answered in an Frequently Asked Questions (FAQ) page in the docs/website:

  • Does Theia compile on Windows?
  • The reconstruction quality is poor, how do I improve it?
    • Affect of features, matching, and estimation settings should be given
    • Affect of changing the estimation algorithm (global vs incremental)
  • How do I implement a new pipeline?
  • Ok I have a reconstruction. Now what can I do with it?

To any users of Theia, please feel free to comment on this issue with questions you want answered in the docs

Add CameraIntrinsicsGroup to Views

For datasets where we know that multiple images may come from one camera, it is advisable to optimize the camera intrinsics explicitly as a single set of camera intrinsics parameters (rather than each image with its own intrinsics). To this effect, we can add a uint32_t CameraIntrinsicsGroupId to the View class and possibly an unordered_map<CameraIntrinsicsGroupId, unordered_set<ViewId> > to the Reconstruction class.

During BA, we can only optimize one set of camera intrinsics per group. This involves several steps:

  1. For each group, initialize the camera intrinsics so that they are the same (median values?)
  2. Choose a camera within the group that will be the representative camera intrinsics for the group (first available)
  3. Set all optimized views to be the updated camera intrinsics

Questions

  1. How does this work for partial BA during incremental SfM?
  2. Is there a better way to initialize intrinsics before BA?
  3. Is it sufficient to only consider camera intrinsics groups during BA? Are there other places it should be considered?

CMake OPTIMO_BUILD_TESTING unbuildable on Linux

I'm using a Linux Mint 17.2 installation. I've acquired numerous dependencies and everything says it'll build, except the option OPTIMO_BUILD_TESTING. Turning it on generates an error:

CMake Error at libraries/optimo/CMakeLists.txt:69 (ADD_SUBDIRECTORY):
add_subdirectory given source "libraries/gtest" which is not an existing
directory.

Looking at some of the CMakeLists.txt files, I suspect is has to do with conditional inclusion of the gtest directory, evaluation order, and some kind of lack of dependency in variable evaluation / definition. For instance TheiaSfM/libraries/CMakeLists.txt contains:

IF (${BUILD_TESTING})
ADD_SUBDIRECTORY(gtest)
ENDIF (${BUILD_TESTING})

Failed tests

A couple tests fail on 95adca5

The following tests FAILED:
     33 - filter_view_pairs_from_relative_translation_test (Failed)
     40 - four_point_focal_length_test (Failed)
Errors while running CTest

FindGFlags.cmake missing INCLUDE(CheckIncludeFileCXX)

CMake 3.2.3 fails with error, unknown command CHECK_INCLUDE_FILE_CXX. An INCLUDE statement is necessary to use commands in CMake modules, it's not automatic. FIx is trivial, put INCLUDE(CheckIncludeFileCXX) in FindGFlags.cmake.

Include akaze-eigen to Theia

Why not?
I really liked VisualSFM and Bundler (small sizes).
Just have not found a replacement for the SIFT
with a completely free license.

I compiled akaze-eigen on MinGW 32bit
I want to link it to Bundler + pmvs

Bundle adjustment segfault

Hi, I seem to have ran into a segfault during bundle adjustment every time I run build_reconstruction app.
See the backtrace at bottom, let me know if you need more info.

$ lldb /Users/XXXXX/TheiaSfM_debug/bin/build_reconstruction
(lldb) target create "/Users/XXXXX/TheiaSfM_debug/bin/build_reconstruction"
Current executable set to '/Users/XXXXX/TheiaSfM_debug/bin/build_reconstruction' (x86_64).
(lldb) settings set -- target.run-args  "--flagfile=build_reconstruction_flags.txt"
(lldb) r
Process 18924 launched: '/Users/XXXXX/TheiaSfM_debug/bin/build_reconstruction' (x86_64)
I0927 01:21:21.272766 27791360 feature_extractor_and_matcher.cc:215] Image input/00001.jpg did not contain an EXIF focal length.
I0927 01:21:22.494755 27791360 feature_extractor_and_matcher.cc:95] Successfully extracted 733 features from image input/00001.jpg
I0927 01:21:22.617712 27791360 feature_extractor_and_matcher.cc:215] Image input/00002.jpg did not contain an EXIF focal length.
I0927 01:21:23.849233 27791360 feature_extractor_and_matcher.cc:95] Successfully extracted 750 features from image input/00002.jpg
I0927 01:21:23.980813 27791360 feature_extractor_and_matcher.cc:215] Image input/00003.jpg did not contain an EXIF focal length.
I0927 01:21:25.203814 27791360 feature_extractor_and_matcher.cc:95] Successfully extracted 746 features from image input/00003.jpg
I0927 01:21:25.331620 27791360 feature_extractor_and_matcher.cc:215] Image input/00004.jpg did not contain an EXIF focal length.
I0927 01:21:26.569458 27791360 feature_extractor_and_matcher.cc:95] Successfully extracted 733 features from image input/00004.jpg
I0927 01:21:26.694496 27791360 feature_extractor_and_matcher.cc:215] Image input/00005.jpg did not contain an EXIF focal length.
I0927 01:21:27.893025 27791360 feature_extractor_and_matcher.cc:95] Successfully extracted 691 features from image input/00005.jpg
I0927 01:21:28.005946 2114392832 feature_extractor_and_matcher.cc:164] Matching images...
I0927 01:21:28.180091 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:21:28.180124 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:21:43.521611 27791360 feature_matcher.h:301] Images 0 and 1 were matched with 270 verified matches out of 276 putative matches.
I0927 01:21:43.569325 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:21:43.569350 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
W0927 01:21:44.030484 27791360 levenberg_marquardt_strategy.cc:113] Linear solver failure. Failed to compute a finite step.
W0927 01:21:44.033316 27791360 levenberg_marquardt_strategy.cc:113] Linear solver failure. Failed to compute a finite step.
I0927 01:21:44.033753 27791360 feature_matcher.h:301] Images 0 and 2 were matched with 281 verified matches out of 282 putative matches.
I0927 01:21:44.185824 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:21:44.185847 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:21:57.150576 27791360 feature_matcher.h:301] Images 0 and 3 were matched with 257 verified matches out of 257 putative matches.
I0927 01:21:57.189713 27791360 feature_matcher.h:301] Images 0 and 4 were matched with 211 verified matches out of 215 putative matches.
I0927 01:21:57.244614 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:21:57.244640 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:21:57.249637 27791360 feature_matcher.h:301] Images 1 and 2 were matched with 271 verified matches out of 271 putative matches.
I0927 01:21:57.297052 27791360 feature_matcher.h:301] Images 1 and 3 were matched with 257 verified matches out of 258 putative matches.
I0927 01:21:57.426190 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:21:57.426213 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:22:09.269661 27791360 feature_matcher.h:301] Images 1 and 4 were matched with 223 verified matches out of 224 putative matches.
I0927 01:22:09.413462 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:22:09.413488 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:22:22.022049 27791360 feature_matcher.h:301] Images 2 and 3 were matched with 258 verified matches out of 260 putative matches.
I0927 01:22:22.157681 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:22:22.157707 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:22:35.795744 27791360 feature_matcher.h:301] Images 2 and 4 were matched with 238 verified matches out of 241 putative matches.
I0927 01:22:35.942169 27791360 detect_structure.cc:107] Schur complement static structure <2,4,13>.
I0927 01:22:35.942194 27791360 schur_eliminator.cc:155] Template specializations not found for <2,4,13>
I0927 01:22:49.518909 27791360 feature_matcher.h:301] Images 3 and 4 were matched with 248 verified matches out of 249 putative matches.
I0927 01:22:49.519143 2114392832 feature_matcher.h:235] Matched 10 image pairs out of 10 possible image pairs.
I0927 01:22:49.519193 2114392832 reconstruction_builder.cc:227] 10 of 10 view pairs were matched and geometrically verified.
I0927 01:22:49.519214 2114392832 reconstruction_builder.cc:244] Writing matches to file: output/output.matches
I0927 01:22:49.534648 2114392832 track_builder.cc:123] 603 tracks were created. 8 features were dropped because they formed inconsistent tracks, and 0 features were dropped because they formed singleton tracks.
I0927 01:22:49.535193 2114392832 reconstruction_builder.cc:319] Attempting to reconstruct 5 images from 10 two view matches.
I0927 01:22:49.535218 2114392832 nonlinear_reconstruction_estimator.cc:174] Filtering the intial view graph.
I0927 01:22:49.535255 2114392832 nonlinear_reconstruction_estimator.cc:184] Calibrating any uncalibrated cameras.
I0927 01:22:49.535269 2114392832 nonlinear_reconstruction_estimator.cc:190] Estimating the global rotations of all cameras.
I0927 01:22:49.537837 2114392832 l1_solver.h:159] L1 solver did not converge after max_num_iterations (5). Exiting.
I0927 01:22:49.540048 2114392832 l1_solver.h:143] Converged in 10 iterations.
I0927 01:22:49.541961 2114392832 l1_solver.h:143] Converged in 8 iterations.
I0927 01:22:49.543562 2114392832 l1_solver.h:143] Converged in 8 iterations.
I0927 01:22:49.545073 2114392832 l1_solver.h:143] Converged in 8 iterations.
I0927 01:22:49.546067 2114392832 estimate_rotations_robust.cc:265] IRLS Converged in 6 iterations.
I0927 01:22:49.546083 2114392832 nonlinear_reconstruction_estimator.cc:197] Filtering any bad rotation estimations.
I0927 01:22:49.546216 2114392832 filter_view_pairs_from_orientation.cc:126] Removed 8 view pairs by rotation filtering.
I0927 01:22:49.546247 2114392832 nonlinear_reconstruction_estimator.cc:204] Optimizing the pairwise translation estimations.
I0927 01:22:49.546254 2114392832 nonlinear_reconstruction_estimator.cc:211] Filtering any bad relative translations.
I0927 01:22:49.547134 2114392832 filter_view_pairs_from_relative_translation.cc:294] Removed 0 view pairs by relative translation filtering.
I0927 01:22:49.547159 2114392832 nonlinear_reconstruction_estimator.cc:218] Estimating the positions of all cameras.
I0927 01:22:49.547292 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 33. Allocating 424
I0927 01:22:49.547431 2114392832 callbacks.cc:103] iter      cost      cost_change  |gradient|   |step|    tr_ratio  tr_radius  ls_iter  iter_time  total_time
   0  1.981672e+00    0.00e+00    2.98e-03   0.00e+00   0.00e+00  1.00e+04        0    1.13e-04    2.02e-04
I0927 01:22:49.547447 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.547587 2114392832 callbacks.cc:103]    1  1.310890e+00    6.71e-01    2.62e-03   5.88e+02   1.03e+00  3.00e+04        1    1.41e-04    3.61e-04
I0927 01:22:49.547597 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.547688 2114392832 callbacks.cc:103]    2  2.753119e-01    1.04e+00    7.15e-04   9.51e+02   1.58e+00  9.00e+04        1    8.89e-05    4.63e-04
I0927 01:22:49.547696 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.547786 2114392832 callbacks.cc:103]    3  1.467250e-02    2.61e-01    1.77e-04   6.69e+02   1.09e+00  2.70e+05        1    8.68e-05    5.61e-04
I0927 01:22:49.547796 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.547885 2114392832 callbacks.cc:103]    4  3.274250e-05    1.46e-02    4.25e-05   2.18e+02   1.00e+00  8.10e+05        1    8.70e-05    6.60e-04
I0927 01:22:49.547894 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.547981 2114392832 callbacks.cc:103]    5  1.292308e-09    3.27e-05    2.96e-07   6.17e+00   1.00e+00  2.43e+06        1    8.49e-05    7.56e-04
I0927 01:22:49.547989 2114392832 compressed_row_sparse_matrix.cc:82] # of rows: 6 # of columns: 6 max_num_nonzeros: 18. Allocating 244
I0927 01:22:49.548084 2114392832 trust_region_minimizer.cc:697] Terminating: Gradient tolerance reached. Gradient max norm: 2.069100e-11 <= 1.000000e-10
I0927 01:22:49.548108 2114392832 estimate_positions_nonlinear.cc:150] 
Solver Summary (v 1.10.0-lapack-suitesparse-cxsparse-no_openmp)

                                     Original                  Reduced
Parameter blocks                            3                        2
Parameters                                  9                        6
Residual blocks                             2                        2
Residual                                    6                        6

Minimizer                        TRUST_REGION

Sparse linear algebra library    SUITE_SPARSE
Trust region strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver          SPARSE_NORMAL_CHOLESKY   SPARSE_NORMAL_CHOLESKY
Threads                                     1                        1
Linear solver threads                       1                        1

Cost:
Initial                          1.981672e+00
Final                            6.145832e-18
Change                           1.981672e+00

Minimizer iterations                        6
Successful steps                            6
Unsuccessful steps                          0

Time (in seconds):
Preprocessor                           0.0001

  Residual evaluation                  0.0000
  Jacobian evaluation                  0.0005
  Linear solver                        0.0001
Minimizer                              0.0008

Postprocessor                          0.0000
Total                                  0.0009

Termination:                      CONVERGENCE (Gradient tolerance reached. Gradient max norm: 2.069100e-11 <= 1.000000e-10)
I0927 01:22:49.548171 2114392832 nonlinear_reconstruction_estimator.cc:359] 3 camera positions were estimated successfully.
I0927 01:22:49.548202 2114392832 nonlinear_reconstruction_estimator.cc:239] Triangulating all features.
I0927 01:22:49.563253 2114392832 estimate_track.cc:230] 0 tracks were estimated of 437 possible tracks.
I0927 01:22:49.563556 2114392832 nonlinear_reconstruction_estimator.cc:247] Performing bundle adjustment again.
Process 18924 stopped
* thread #1: tid = 0x2c207, 0x00000001000a419d build_reconstruction`std::__1::__tree_node_base<void*>* std::__1::__tree_next<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*) [inlined] bool std::__1::__tree_is_left_child<std::__1::__tree_node_base<void*>*>(__x=0x0000000101c00700) + 12 at __tree:68, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
    frame #0: 0x00000001000a419d build_reconstruction`std::__1::__tree_node_base<void*>* std::__1::__tree_next<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*) [inlined] bool std::__1::__tree_is_left_child<std::__1::__tree_node_base<void*>*>(__x=0x0000000101c00700) + 12 at __tree:68
   65   bool
   66   __tree_is_left_child(_NodePtr __x) _NOEXCEPT
   67   {
-> 68       return __x == __x->__parent_->__left_;
   69   }
   70   
   71   // Determintes if the subtree rooted at __x is a proper red black subtree.  If
(lldb) bt
* thread #1: tid = 0x2c207, 0x00000001000a419d build_reconstruction`std::__1::__tree_node_base<void*>* std::__1::__tree_next<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*) [inlined] bool std::__1::__tree_is_left_child<std::__1::__tree_node_base<void*>*>(__x=0x0000000101c00700) + 12 at __tree:68, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
  * frame #0: 0x00000001000a419d build_reconstruction`std::__1::__tree_node_base<void*>* std::__1::__tree_next<std::__1::__tree_node_base<void*>*>(std::__1::__tree_node_base<void*>*) [inlined] bool std::__1::__tree_is_left_child<std::__1::__tree_node_base<void*>*>(__x=0x0000000101c00700) + 12 at __tree:68
    frame #1: 0x00000001000a4191 build_reconstruction`std::__1::__tree_node_base<void*>* std::__1::__tree_next<std::__1::__tree_node_base<void*>*>(__x=0x0000000101c00700) + 97 at __tree:159
    frame #2: 0x00000001000a5820 build_reconstruction`void std::__1::__tree<double*, std::__1::less<double*>, std::__1::allocator<double*> >::__assign_multi<std::__1::__tree_const_iterator<double*, std::__1::__tree_node<double*, void*>*, long> >(std::__1::__tree_const_iterator<double*, std::__1::__tree_node<double*, void*>*, long>, std::__1::__tree_const_iterator<double*, std::__1::__tree_node<double*, void*>*, long>) [inlined] std::__1::__tree_const_iterator<double*, std::__1::__tree_node<double*, void*>*, long>::operator++(this=0x00007fff5fbfc840) + 18 at __tree:747
    frame #3: 0x00000001000a580e build_reconstruction`void std::__1::__tree<double*, std::__1::less<double*>, std::__1::allocator<double*> >::__assign_multi<std::__1::__tree_const_iterator<double*, std::__1::__tree_node<double*, void*>*, long> >(this=0x0000000101c01078, __first=__tree_const_iterator<double *, std::__1::__tree_node<double *, void *> *, long> at 0x00007fff5fbfc840, __last=__tree_const_iterator<double *, std::__1::__tree_node<double *, void *> *, long> at 0x00007fff5fbfc838) + 782 at __tree:1285
    frame #4: 0x00000001000a54e5 build_reconstruction`std::__1::__tree<double*, std::__1::less<double*>, std::__1::allocator<double*> >::operator=(this=0x0000000101c01078, __t=0x0000000101c00788) + 437 at __tree:1204
    frame #5: 0x00000001000a229d build_reconstruction`ceres::OrderedGroups<double*>::Reverse() [inlined] std::__1::set<double*, std::__1::less<double*>, std::__1::allocator<double*> >::operator=(this=0x0000000101c01078, __s=0x0000000101c00788) + 8 at set:480
    frame #6: 0x00000001000a2295 build_reconstruction`ceres::OrderedGroups<double*>::Reverse(this=0x0000000101c00740) + 869 at ordered_groups.h:127
    frame #7: 0x00000001000a0bcf build_reconstruction`theia::BundleAdjustPartialReconstruction(options=0x000000010ac284e8, view_ids=0x00007fff5fbfdda0, reconstruction=0x0000000101808ad0) + 5135 at bundle_adjustment.cc:205
    frame #8: 0x00000001000a166a build_reconstruction`theia::BundleAdjustReconstruction(options=0x000000010ac284e8, reconstruction=0x0000000101808ad0) + 74 at bundle_adjustment.cc:233
    frame #9: 0x000000010020926e build_reconstruction`theia::NonlinearReconstructionEstimator::BundleAdjustment(this=0x000000010ac283f0) + 206 at nonlinear_reconstruction_estimator.cc:381
    frame #10: 0x000000010020737e build_reconstruction`theia::NonlinearReconstructionEstimator::Estimate(this=0x000000010ac283f0, view_graph=0x0000000101808a70, reconstruction=0x0000000101808ad0) + 2206 at nonlinear_reconstruction_estimator.cc:249
    frame #11: 0x00000001003f1ebe build_reconstruction`theia::ReconstructionBuilder::BuildReconstruction(this=0x00007fff5fbfef10, reconstructions=0x00007fff5fbfeee8) + 1486 at reconstruction_builder.cc:327
    frame #12: 0x0000000100006cee build_reconstruction`main(argc=1, argv=0x00007fff5fbff418) + 1502 at build_reconstruction.cc:364
    frame #13: 0x00007fff9505e5c9 libdyld.dylib`start + 1

Compilation fails due to array index out of bounds

Trying to compile, I get this error (both on current master, and v0.5):

/home/hannes/Source/TheiaSfM/src/theia/image/keypoint_detector/sift_detector.cc: In member function     ‘virtual bool theia::SiftDetector::DetectKeypoints(const FloatImage&, std::vector<theia::Keypoint>*)’:
/home/hannes/Source/TheiaSfM/src/theia/image/keypoint_detector/sift_detector.cc:103:33: error: array subscript is above array bounds [-Werror=array-bounds]
     keypoint.set_orientation(angles[j]);
                             ^

This seems strange, because I can't see how the compiler could have any idea what num_angles will contain, since it is calculated by vl_sift_calc_keypoint_orientations().
Adding --Wno-array-bounds to the CXX_FLAGS made it compile but this seems like the wrong way to go.

I am using Fedora 23 (x64) with GCC 5.1.1

Allow any combination of intrinsics to optimize and bounds on values.

Often focal length is available from Exif, and principal point will be near, though not precisely at, the center of the image. It would be useful to be able to limit ranges for focal length and principal point deviation from priors, or use fixed focal length while still optimizing principal point and radial distortion. At least allowing all combinations seems like it would be straightforward using enum values for OptimizeIntrinsicsType that can be bitwise-or'd together.

Since Ceres allows for setting lower and upper bounds on problem parameters allowing these to be specified seems straightforward also. These might be specified as maximum deviation value, or perhaps a percentage of the IntrinsicsPrior value?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.