Skip to content

Commit

Permalink
fixed a copy&paste bug in absorient. luckily it didn't change the res…
Browse files Browse the repository at this point in the history
…ults, only potentially the accuracy.
  • Loading branch information
Gerhard Reitmayr committed Jan 7, 2013
1 parent 75a3a94 commit 6b87649
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tag/absorient.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ std::pair<TooN::Matrix<D>, TooN::Vector<D> > computeAbsoluteOrientation( const s
}

// compute centroids
// Strictly speaking, it is not necessary to remove the centroids from both sets,
// one set is enough. However, we do it nevertheless to improve the conditioning
// of the rotation/scale estimation.
TooN::Vector<D> ma = TooN::Zeros(DIM), mb = TooN::Zeros(DIM);
for(unsigned i = 0; i < N; ++i){
ma += a[i];
Expand All @@ -148,7 +151,7 @@ std::pair<TooN::Matrix<D>, TooN::Vector<D> > computeAbsoluteOrientation( const s
std::vector<TooN::Vector<D> > ap(N), bp(N);
for( unsigned i = 0; i < N; ++i){
ap[i] = a[i] - ma;
bp[i] = b[i] - ma;
bp[i] = b[i] - mb;
}

// put resulting transformation together
Expand Down Expand Up @@ -200,6 +203,9 @@ std::tr1::tuple<TooN::Matrix<D>, TooN::Vector<D>, TooN::DefaultPrecision > compu
}

// compute centroids
// Strictly speaking, it is not necessary to remove the centroids from both sets,
// one set is enough. However, we do it nevertheless to improve the conditioning
// of the rotation/scale estimation.
TooN::Vector<D> ma = TooN::Zeros(DIM), mb = TooN::Zeros(DIM);
for(unsigned i = 0; i < N; ++i){
ma += a[i];
Expand All @@ -212,7 +218,7 @@ std::tr1::tuple<TooN::Matrix<D>, TooN::Vector<D>, TooN::DefaultPrecision > compu
std::vector<TooN::Vector<D> > ap(N), bp(N);
for( unsigned i = 0; i < N; ++i){
ap[i] = a[i] - ma;
bp[i] = b[i] - ma;
bp[i] = b[i] - mb;
}

// put resulting transformation together
Expand Down

0 comments on commit 6b87649

Please sign in to comment.