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/makesdna
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/makesdna')
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index a5079cb6c6f..c471cb26892 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -61,14 +61,21 @@ typedef struct MovieReconstructedCamera {
typedef struct MovieTrackingCamera {
void *intrinsics; /* intrinsics handle */
+ short distortion_model;
+ short pad;
+
float sensor_width; /* width of CCD sensor */
float pixel_aspect; /* pixel aspect ratio */
- float pad;
float focal; /* focal length */
short units; /* units of focal length user is working with */
short pad1;
float principal[2]; /* principal point */
- float k1, k2, k3; /* radial distortion */
+
+ /* Polynomial distortion */
+ float k1, k2, k3; /* polynomial radial distortion */
+
+ /* Division distortion model coefficients */
+ float division_k1, division_k2;
} MovieTrackingCamera;
typedef struct MovieTrackingMarker {
@@ -348,6 +355,12 @@ typedef struct MovieTracking {
MovieTrackingDopesheet dopesheet; /* dopesheet data */
} MovieTracking;
+/* MovieTrackingCamera->distortion_model */
+enum {
+ TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
+ TRACKING_DISTORTION_MODEL_DIVISION = 1
+};
+
/* MovieTrackingCamera->units */
enum {
CAMERA_UNITS_PX = 0,