diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-07 13:21:50 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-07 13:21:50 +0400 |
commit | 433033c2bf4b72e389d103e00a375d344588ac8e (patch) | |
tree | cd64b6d1b332e68a7158fe520c8e2939ddf41779 /source | |
parent | 2b49d0533817df05e829b3adc802a30b2234e49d (diff) |
Camera tracking: some bug fixes
- Fixed bug with not putting disabled markers properly when doing backwards tracking
- Fixed margin size calculating from pattern size which used to be double-sized
and prevented to track things on the image edges.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/tracking.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 66c0c0265a1..043fabcd510 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -1158,7 +1158,7 @@ int BKE_tracking_next(MovieTrackingContext *context) if(marker && (marker->flag&MARKER_DISABLED)==0) { #ifdef WITH_LIBMV int width, height, origin[2], tracked= 0, need_readjust= 0; - float pos[2], margin[2]; + float pos[2], margin[2], dim[2]; double x1, y1, x2, y2; ImBuf *ibuf= NULL; MovieTrackingMarker marker_new, *marker_keyed; @@ -1174,7 +1174,8 @@ int BKE_tracking_next(MovieTrackingContext *context) else nextfra= curfra+1; /* margin from frame boundaries */ - sub_v2_v2v2(margin, track->pat_max, track->pat_min); + sub_v2_v2v2(dim, track->pat_max, track->pat_min); + margin[0]= margin[1]= MAX2(dim[0], dim[1]) / 2.0f; margin[0]= MAX2(margin[0], (float)track->margin / ibuf_new->x); margin[1]= MAX2(margin[1], (float)track->margin / ibuf_new->y); @@ -1287,7 +1288,7 @@ int BKE_tracking_next(MovieTrackingContext *context) { /* check if there's no keyframe/tracked markers before tracking marker. if so -- create disabled marker before currently tracking "segment" */ - put_disabled_marker(track, marker, 1, 0); + put_disabled_marker(track, marker, !context->backwards, 0); } } @@ -1311,7 +1312,7 @@ int BKE_tracking_next(MovieTrackingContext *context) /* make currently tracked segment be finished with disabled marker */ #pragma omp critical { - put_disabled_marker(track, &marker_new, 0, 0); + put_disabled_marker(track, &marker_new, context->backwards, 0); } } else { marker_new= *marker; |