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>2014-02-20 17:41:05 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-04-17 15:28:41 +0400
commited2ddc9f706b956ea955ac86b3e7ec5e0b41d9cd (patch)
treeb8023b5604fef55f436c0d1be1a03e113f9ef39d /source/blender/editors/space_clip
parent39bfde674cfe4f6a9140b6d4c48a348de04d715a (diff)
Support multiple distortion models, including a new division model
This commit makes it so CameraIntrinsics is no longer hardcoded to use the traditional polynomial radial distortion model. Currently the distortion code has generic logic which is shared between different distortion models, but had no other models until now. This moves everything specific to the polynomial radial distortion to a subclass PolynomialDistortionCameraIntrinsics(), and adds a new division distortion model suitable for cameras such as the GoPro which have much stronger distortion due to their fisheye lens. This also cleans up the internal API of CameraIntrinsics to make it easier to understand and reduces old C-style code. New distortion model is available in the Lens panel of MCE. - Polynomial is the old well-known model - Division is the new one which s intended to deal better with huge distortion. Coefficients of this model works independent from each other and for division model one probably want to have positive values to have a barrel distortion.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_ops.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 3f0a376d791..b8fe9fe4a17 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1018,8 +1018,11 @@ static void do_movie_proxy(void *pjv, int *UNUSED(build_sizes), int UNUSED(build
if (build_undistort_count) {
int threads = BLI_system_thread_count();
+ int width, height;
- distortion = BKE_tracking_distortion_new();
+ BKE_movieclip_get_size(clip, NULL, &width, &height);
+
+ distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
BKE_tracking_distortion_set_threads(distortion, threads);
}
@@ -1185,8 +1188,11 @@ static void do_sequence_proxy(void *pjv, int *build_sizes, int build_count,
handle->build_undistort_count = build_undistort_count;
handle->build_undistort_sizes = build_undistort_sizes;
- if (build_undistort_count)
- handle->distortion = BKE_tracking_distortion_new();
+ if (build_undistort_count) {
+ int width, height;
+ BKE_movieclip_get_size(clip, NULL, &width, &height);
+ handle->distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
+ }
if (tot_thread > 1)
BLI_insert_thread(&threads, handle);