Skip to content

Commit

Permalink
Cleanup of code after previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Nov 5, 2018
1 parent dfee088 commit e86a97d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
28 changes: 14 additions & 14 deletions src/base/cost_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class BundleAdjustmentConstantPoseCostFunction {
BundleAdjustmentConstantPoseCostFunction(const Eigen::Vector4d& qvec,
const Eigen::Vector3d& tvec,
const Eigen::Vector2d& point2D)
: qx_(qvec(0)),
qy_(qvec(1)),
qz_(qvec(2)),
qw_(qvec(3)),
: qw_(qvec(0)),
qx_(qvec(1)),
qy_(qvec(2)),
qz_(qvec(3)),
tx_(tvec(0)),
ty_(tvec(1)),
tz_(tvec(2)),
Expand All @@ -115,7 +115,7 @@ class BundleAdjustmentConstantPoseCostFunction {
template <typename T>
bool operator()(const T* const point3D, const T* const camera_params,
T* residuals) const {
const T qvec[4] = {T(qx_), T(qy_), T(qz_), T(qw_)};
const T qvec[4] = {T(qw_), T(qx_), T(qy_), T(qz_)};

// Rotate and translate.
T projection[3];
Expand All @@ -140,15 +140,15 @@ class BundleAdjustmentConstantPoseCostFunction {
}

private:
double qx_;
double qy_;
double qz_;
double qw_;
double tx_;
double ty_;
double tz_;
double observed_x_;
double observed_y_;
const double qw_;
const double qx_;
const double qy_;
const double qz_;
const double tx_;
const double ty_;
const double tz_;
const double observed_x_;
const double observed_y_;
};

// Rig bundle adjustment cost function for variable camera pose and calibration
Expand Down
15 changes: 2 additions & 13 deletions src/exe/colmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)

#ifndef NOMINMAX
# define NOMINMAX
#define NOMINMAX
#endif

#include <boost/property_tree/json_parser.hpp>
Expand Down Expand Up @@ -1657,22 +1657,11 @@ std::vector<Image> ReadVocabTreeRetrievalImageList(const std::string& path,
}
} else {
DatabaseTransaction database_transaction(database);
std::unordered_map<std::string, image_t> image_name_to_image_id;
image_name_to_image_id.reserve(database->NumImages());
for (const auto& image : database->ReadAllImages()) {
image_name_to_image_id.emplace(image.Name(), image.ImageId());
}

const auto image_names = ReadTextFileLines(path);
images.reserve(image_names.size());
for (const auto& image_name : image_names) {
if (image_name_to_image_id.count(image_name) == 0) {
std::cerr << "ERROR: Image " << image_name << " does not exist."
<< std::endl;
continue;
}
const auto image =
database->ReadImage(image_name_to_image_id.at(image_name));
const auto image = database->ReadImageWithName(image_name);
CHECK_NE(image.ImageId(), kInvalidImageId);
images.push_back(image);
}
Expand Down
4 changes: 2 additions & 2 deletions src/util/ply.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
#ifndef COLMAP_SRC_UTIL_PLY_H_
#define COLMAP_SRC_UTIL_PLY_H_

#include "types.h"

#include <string>
#include <vector>

#include "types.h"

namespace colmap {

struct PlyPoint {
Expand Down

0 comments on commit e86a97d

Please sign in to comment.