Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-21 16:59:52 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-21 16:59:52 +0400
commitc8de268e1b636ec9c53d6934d04e8164d0c596c1 (patch)
treef47b9c6631c336a3a9b009c9b1310efdf0545d6d
parent88a2be1846d3cdca5c0a0f0dc68baad933a9f680 (diff)
Camera tracing: search area was always centered to marker's position when tracking
-rw-r--r--extern/libmv/libmv-capi.cpp2
-rw-r--r--source/blender/blenkernel/intern/tracking.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp
index 1835c53b53f..dbfdfdacafe 100644
--- a/extern/libmv/libmv-capi.cpp
+++ b/extern/libmv/libmv-capi.cpp
@@ -296,7 +296,7 @@ int libmv_regionTrackerTrack(libmv_RegionTracker *libmv_tracker, const float *im
double sx2 = *x2, sy2 = *y2;
int result = region_tracker->Track(old_patch, new_patch, x1, y1, x2, y2);
- if (!result) {
+ if (!result {
saveImage("old_patch", old_patch, x1, y1);
saveImage("new_patch", new_patch, sx2, sy2);
}
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 7461e057df5..373e1e4b9f4 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1100,13 +1100,13 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki
w= (max[0]-min[0])*ibuf->x;
h= (max[1]-min[1])*ibuf->y;
+ /* dimensions should be odd */
w= w|1;
h= h|1;
- x1= x-(int)(w/2.0f);
- y1= y-(int)(h/2.0f);
+ x1= x-(int)(w * (-min[0] / (max[0] - min[0])));
+ y1= y-(int)(h * (-min[1] / (max[1] - min[1])));
- /* dimensions should be odd */
tmpibuf= IMB_allocImBuf(w+margin*2, h+margin*2, 32, IB_rect);
IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1-margin, y1-margin, w+margin*2, h+margin*2);