From 5cc377022b810cb2ab291a0064e5749b976e185a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 18 Feb 2013 10:12:44 +0000 Subject: Correction to r54600 Calculate dependent area based on distortion model rather than using 15% of image resolution for this. Some assumptions here: - We're assuming real-life camera calibration is used here - Maximal undistortion delta would be achieved on frame boundary - Distortion fully goes inside frame This makes it possible to approximate margin for distortion by checking undistortion delta across frame boundary and use it for dependent area of interest. We do not use any formula-based equation here because we're likely support other distortion models and in that case it'll be stupid to try detecting formula here. --- source/blender/blenkernel/BKE_tracking.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel/BKE_tracking.h') diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index eb7004b1ced..9bdc96e187d 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -46,6 +46,7 @@ struct MovieDistortion; struct Camera; struct Object; struct Scene; +struct rcti; /* **** Common functions **** */ @@ -156,6 +157,8 @@ struct ImBuf *BKE_tracking_undistort_frame(struct MovieTracking *tracking, struc struct ImBuf *BKE_tracking_distort_frame(struct MovieTracking *tracking, struct ImBuf *ibuf, int calibration_width, int calibration_height, float overscan); +void BKE_tracking_max_undistortion_delta_across_bound(struct MovieTracking *tracking, struct rcti *rect, float delta[2]); + /* **** Image sampling **** */ struct ImBuf *BKE_tracking_sample_pattern(int frame_width, int frame_height, struct ImBuf *struct_ibuf, struct MovieTrackingTrack *track, -- cgit v1.2.3