[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] tag/tag ransac.h
From: |
Ethan Eade |
Subject: |
[Toon-members] tag/tag ransac.h |
Date: |
Tue, 13 Jun 2006 02:00:21 +0000 |
CVSROOT: /cvsroot/toon
Module name: tag
Changes by: Ethan Eade <ethaneade> 06/06/13 02:00:21
Modified files:
tag : ransac.h
Log message:
Small fix to find_RANSAC_inliers.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/tag/tag/ransac.h?cvsroot=toon&r1=1.4&r2=1.5
Patches:
Index: ransac.h
===================================================================
RCS file: /cvsroot/toon/tag/tag/ransac.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ransac.h 13 Jun 2006 01:55:46 -0000 1.4
+++ ransac.h 13 Jun 2006 02:00:21 -0000 1.5
@@ -61,7 +61,7 @@
template <class Obs, class Trans, class Tol> size_t find_RANSAC_inliers(const
std::vector<Obs>& observations, int sample_size, const Tol& tolerance, size_t N,
Trans&
best, std::vector<bool>& inlier)
{
- std::vector<bool> thisInlier(observations.size(),best);
+ std::vector<bool> thisInlier(observations.size());
size_t bestScore = 0;
std::vector<size_t> sample_index(sample_size);
vector<Obs> sample(sample_size);
@@ -69,16 +69,16 @@
randomTuple(sample_index, observations.size());
for (int i=0;i<sample_size; i++)
sample[i] = observations[sample_index[i]];
- Trans thisT;
+ Trans thisT(best);
thisT.estimate(sample.begin(), sample.end());
size_t score = 0;
for (size_t i=0; i<observations.size(); i++) {
const Obs& o = observations[i];
if (thisT.isInlier(o, tolerance)) {
- inlier[i] = true;
+ thisInlier[i] = true;
score++;
} else
- inlier[i] = false;
+ thisInlier[i] = false;
}
if (score > bestScore) {
bestScore = score;