~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to extern/libmv/libmv/tracking/lmicklt_region_tracker.cc

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-04-28 12:11:12 UTC
  • mto: (14.1.6 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20120428121112-2zi0vp8b6vejda8i
Tags: upstream-2.63
ImportĀ upstreamĀ versionĀ 2.63

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  return true;
53
53
}
54
54
 
55
 
// Sample a region centered at x,y in image with size extending by half_width
56
 
// from x,y. Channels specifies the number of channels to sample from.
57
 
static void SamplePattern(const FloatImage &image,
58
 
                   double x, double y,
59
 
                   int half_width,
60
 
                   int channels,
61
 
                   FloatImage *sampled) {
62
 
  sampled->Resize(2 * half_width + 1, 2 * half_width + 1, channels);
63
 
  for (int r = -half_width; r <= half_width; ++r) {
64
 
    for (int c = -half_width; c <= half_width; ++c) {
65
 
      for (int i = 0; i < channels; ++i) {
66
 
        (*sampled)(r + half_width, c + half_width, i) =
67
 
            SampleLinear(image, y + r, x + c, i);
68
 
      }
69
 
    }
70
 
  }
71
 
}
72
 
 
73
55
// Estimate "reasonable" error by computing autocorrelation for a small shift.
74
56
static double EstimateReasonableError(const FloatImage &image,
75
57
                               double x, double y,