Skip to content

Commit

Permalink
cleaning up code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
snavely committed Dec 29, 2013
1 parent ab9f3c8 commit 9f36021
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
19 changes: 0 additions & 19 deletions src/BundlerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ void BundlerApp::ProcessOptions(int argc, char **argv)
{"key_dir", 1, 0, 301},//

{"analyze_matches", 0, 0, 'M'},//
{"match_global", 0, 0, '<'},//
{"ann_max_pts_visit", 1, 0, 302},//
{"global_nn_sigma", 1, 0, 304},//

{"output_dir", 1, 0, 'u'},
{"use_constraints", 0, 0, '=' },
Expand Down Expand Up @@ -465,8 +463,6 @@ void BundlerApp::ProcessOptions(int argc, char **argv)
m_track_file = strdup(optarg);
break;



case 340:
m_compute_covariance = true;
break;
Expand Down Expand Up @@ -507,8 +503,6 @@ void BundlerApp::ProcessOptions(int argc, char **argv)
m_add_image_file = strdup(optarg);
break;



case 'U':
m_use_focal_estimate = true;
break;
Expand Down Expand Up @@ -633,20 +627,11 @@ void BundlerApp::ProcessOptions(int argc, char **argv)
m_factor_essential = false;
break;

case '<':
m_match_global = true;
break;

case 302:
m_ann_max_pts_visit = atoi(optarg);
printf(" ann_max_pts_visit: %d\n", m_ann_max_pts_visit);
break;

case 304:
m_global_nn_sigma = atof(optarg);
printf(" global_nn_sigma: %0.3f\n", m_global_nn_sigma);
break;

case 'u':
m_output_directory = strdup(optarg);
break;
Expand Down Expand Up @@ -1060,10 +1045,6 @@ bool BundlerApp::OnInit()

static BundlerApp *bundler_app = NULL;

BundlerApp &wxGetApp() {
return *bundler_app;
}

int main(int argc, char **argv)
{
// mtrace();
Expand Down
10 changes: 0 additions & 10 deletions src/BundlerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,8 @@ class BundlerApp : public BaseApp
m_use_intrinsics = false;

m_matches_computed = false;
m_match_global = false;
m_ann_max_pts_visit = 400;
m_global_nn_sigma = 16.0;

// m_transforms = NULL;
// m_set_transforms = NULL;
// m_images_per_set = 0;

m_matches_loaded = false;
m_features_coalesced = false;

Expand Down Expand Up @@ -500,10 +494,6 @@ class BundlerApp : public BaseApp
int m_ann_max_pts_visit; /* Maximum points to visit during
* global matching */

bool m_match_global; /* Compute matches using global matcher */
double m_global_nn_sigma; /* Threshold from expected variance
* where features match */

bool m_optimize_for_fisheye; /* Optimize for fisheye-distorted
* points */

Expand Down
17 changes: 1 addition & 16 deletions src/BundlerGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ void BundlerApp::ComputeGeometricConstraints(bool overwrite,
ReadGeometricConstraints(filename);
return;
} else {
if (!m_match_global)
LoadMatches();
LoadMatches();

if (num_images < 40000)
WriteMatchTable(".prune");
Expand Down Expand Up @@ -272,19 +271,13 @@ void BundlerApp::ComputeTransforms(bool removeBadMatches, int new_image_start)

m_transforms.clear();

// for (int i = 0; i < num_images; i++) {
// for (int j = i+1; j < num_images; j++) {

for (unsigned int i = 0; i < num_images; i++) {
MatchAdjList::iterator iter;
for (iter = m_matches.Begin(i); iter != m_matches.End(i); iter++) {
// unsigned int i = iter->first;
// unsigned int j = iter->second;
unsigned int j = iter->m_index;

assert(ImagesMatch(i, j));

// MatchIndex idx = *iter;
MatchIndex idx = GetMatchIndex(i, j);
MatchIndex idx_rev = GetMatchIndex(j, i);

Expand Down Expand Up @@ -320,8 +313,6 @@ void BundlerApp::ComputeTransforms(bool removeBadMatches, int new_image_start)
MatchAdjList::iterator iter;

for (iter = m_matches.Begin(i); iter != m_matches.End(i); iter++) {
// unsigned int i = iter->first;
// unsigned int j = iter->second;
unsigned int j = iter->m_index; // first;

assert(ImagesMatch(i, j));
Expand Down Expand Up @@ -400,22 +391,16 @@ void BundlerApp::ComputeEpipolarGeometry(bool removeBadMatches,

m_transforms.clear();

// for (int i = 0; i < num_images; i++) {
// for (int j = MAX(i+1, new_image_start); j < num_images; j++) {

std::vector<MatchIndex> remove;

for (unsigned int i = 0; i < num_images; i++) {
MatchAdjList::iterator iter;

for (iter = m_matches.Begin(i); iter != m_matches.End(i); iter++) {
// unsigned int i = iter->first;
// unsigned int j = iter->second;
unsigned int j = iter->m_index; // first;

assert(ImagesMatch(i, j));

// MatchIndex idx = *iter;
MatchIndex idx = GetMatchIndex(i, j);
MatchIndex idx_rev = GetMatchIndex(j, i);

Expand Down

0 comments on commit 9f36021

Please sign in to comment.