Tracking: Fix (un)distortion happen in single thread
Need to communicate available number of threads to the camera intrinsics implementation, otherwise default value of 1 is used. Must have been single-threaded for a very long time.
This commit is contained in:
parent
2903fb6929
commit
7e93d4eea3
|
@ -80,6 +80,8 @@ void libmv_cameraIntrinsicsUpdate(
|
|||
* are not freed.
|
||||
*/
|
||||
|
||||
camera_intrinsics->SetThreads(libmv_camera_intrinsics_options->num_threads);
|
||||
|
||||
if (camera_intrinsics->focal_length() != focal_length) {
|
||||
camera_intrinsics->SetFocalLength(focal_length, focal_length);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ enum {
|
|||
|
||||
typedef struct libmv_CameraIntrinsicsOptions {
|
||||
// Common settings of all distortion models.
|
||||
int num_threads;
|
||||
int distortion_model;
|
||||
int image_width, image_height;
|
||||
double focal_length;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "BLI_math.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_string_utils.h"
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
@ -442,6 +443,8 @@ void tracking_cameraIntrinscisOptionsFromTracking(
|
|||
MovieTrackingCamera *camera = &tracking->camera;
|
||||
float aspy = 1.0f / tracking->camera.pixel_aspect;
|
||||
|
||||
camera_intrinsics_options->num_threads = BLI_system_thread_count();
|
||||
|
||||
camera_intrinsics_options->focal_length = camera->focal;
|
||||
|
||||
camera_intrinsics_options->principal_point_x = camera->principal[0];
|
||||
|
|
Loading…
Reference in New Issue