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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-04-06 18:47:45 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-04-06 18:47:45 +0400
commitf62d2669def640f2e448e8d677af0c04b5b53439 (patch)
tree308abc2e6e4f2f1e47ef52a9c4a603cad0b630f4 /source
parent2ed2226ee753cc6a7a19806d99772efa61af897f (diff)
Revert change made to bilinear sampler in libmv
This made preview working but that broke internals of tracking. Namely, BlurredImageAndDerivativesChannels is giving much more blurred image because it was assuming pixel center is an integer position. Guess other parts of libmv used to suffer because of this issue. Now pixel centering happens in blender side, and libmv assumes integer position is a pixel center.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/tracking.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index fe53f073ea6..9723e65e401 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -356,8 +356,8 @@ static void get_marker_coords_for_tracking(int frame_width, int frame_height,
/* Convert the corners into search space coordinates. */
for (i = 0; i < 4; i++) {
marker_unified_to_search_pixel(frame_width, frame_height, marker, marker->pattern_corners[i], pixel_coords);
- search_pixel_x[i] = pixel_coords[0];
- search_pixel_y[i] = pixel_coords[1];
+ search_pixel_x[i] = pixel_coords[0] - 0.5;
+ search_pixel_y[i] = pixel_coords[1] - 0.5;
}
/* Convert the center position (aka "pos"); this is the origin */
@@ -365,8 +365,8 @@ static void get_marker_coords_for_tracking(int frame_width, int frame_height,
unified_coords[1] = 0.0;
marker_unified_to_search_pixel(frame_width, frame_height, marker, unified_coords, pixel_coords);
- search_pixel_x[4] = pixel_coords[0];
- search_pixel_y[4] = pixel_coords[1];
+ search_pixel_x[4] = pixel_coords[0] - 0.5;
+ search_pixel_y[4] = pixel_coords[1] - 0.5;
}
/* Inverse of above. */
@@ -379,14 +379,14 @@ static void set_marker_coords_from_tracking(int frame_width, int frame_height, M
/* Convert the corners into search space coordinates. */
for (i = 0; i < 4; i++) {
- search_pixel[0] = search_pixel_x[i];
- search_pixel[1] = search_pixel_y[i];
+ search_pixel[0] = search_pixel_x[i] + 0.5;
+ search_pixel[1] = search_pixel_y[i] + 0.5;
search_pixel_to_marker_unified(frame_width, frame_height, marker, search_pixel, marker->pattern_corners[i]);
}
/* Convert the center position (aka "pos"); this is the origin */
- search_pixel[0] = search_pixel_x[4];
- search_pixel[1] = search_pixel_y[4];
+ search_pixel[0] = search_pixel_x[4] + 0.5;
+ search_pixel[1] = search_pixel_y[4] + 0.5;
search_pixel_to_marker_unified(frame_width, frame_height, marker, search_pixel, marker_unified);
/* If the tracker tracked nothing, then "marker_unified" would be zero.