diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-20 17:41:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-17 15:28:41 +0400 |
commit | ed2ddc9f706b956ea955ac86b3e7ec5e0b41d9cd (patch) | |
tree | b8023b5604fef55f436c0d1be1a03e113f9ef39d /extern/libmv/libmv-capi_stub.cc | |
parent | 39bfde674cfe4f6a9140b6d4c48a348de04d715a (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 'extern/libmv/libmv-capi_stub.cc')
-rw-r--r-- | extern/libmv/libmv-capi_stub.cc | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/extern/libmv/libmv-capi_stub.cc b/extern/libmv/libmv-capi_stub.cc index 6e3b7336d86..720e56dbf60 100644 --- a/extern/libmv/libmv-capi_stub.cc +++ b/extern/libmv/libmv-capi_stub.cc @@ -199,11 +199,6 @@ struct libmv_CameraIntrinsics *libmv_reconstructionExtractIntrinsics( return NULL; } -struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNewEmpty(void) -{ - return NULL; -} - struct libmv_CameraIntrinsics *libmv_cameraIntrinsicsNew( const libmv_CameraIntrinsicsOptions * /*libmv_camera_intrinsics_options*/) { @@ -228,17 +223,12 @@ void libmv_cameraIntrinsicsSetThreads(struct libmv_CameraIntrinsics * /*libmv_in { } -void libmv_cameraIntrinsicsExtract(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, double * focal_length, - double * principal_x, double *principal_y, double *k1, double *k2, double *k3, - int *width, int *height) +void libmv_cameraIntrinsicsExtractOptions( + const libmv_CameraIntrinsics */*libmv_intrinsics*/, + libmv_CameraIntrinsicsOptions *camera_intrinsics_options); { - *focal_length = 1.0; - *principal_x = 0.0; - *principal_y = 0.0; - *k1 = 0.0; - *k2 = 0.0; - *width = 0.0; - *height = 0.0; + memset(camera_intrinsics_options, 0, sizeof(libmv_CameraIntrinsicsOptions)); + camera_intrinsics_options->focal_length = 1.0; } void libmv_cameraIntrinsicsUndistortByte(const struct libmv_CameraIntrinsics * /*libmv_intrinsics*/, |