Blender V5.0
tracking_solver.cc File Reference
#include <climits>
#include "MEM_guardedalloc.h"
#include "DNA_movieclip_types.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_string_utf8.h"
#include "BLT_translation.hh"
#include "BKE_fcurve.hh"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
#include "RNA_prototypes.hh"
#include "libmv-capi.h"
#include "tracking_private.h"

Go to the source code of this file.

Classes

struct  MovieReconstructContext
struct  ReconstructProgressData

Functions

static libmv_Trackslibmv_tracks_new (MovieClip *clip, ListBase *tracksbase, int width, int height)
static void reconstruct_retrieve_libmv_intrinsics (MovieReconstructContext *context, MovieTracking *tracking)
static bool reconstruct_retrieve_libmv_tracks (MovieReconstructContext *context, MovieTracking *tracking)
static int reconstruct_retrieve_libmv (MovieReconstructContext *context, MovieTracking *tracking)
static int reconstruct_refine_intrinsics_get_flags (MovieTracking *tracking, MovieTrackingObject *tracking_object)
static int reconstruct_count_tracks_on_both_keyframes (MovieTrackingObject *tracking_object)
bool BKE_tracking_reconstruction_check (MovieTracking *tracking, MovieTrackingObject *tracking_object, char *error_msg, int error_size)
MovieReconstructContextBKE_tracking_reconstruction_context_new (MovieClip *clip, MovieTrackingObject *tracking_object, int keyframe1, int keyframe2, int width, int height)
void BKE_tracking_reconstruction_report_error_message (MovieReconstructContext *context, const char *error_message)
const char * BKE_tracking_reconstruction_error_message_get (const MovieReconstructContext *context)
void BKE_tracking_reconstruction_context_free (MovieReconstructContext *context)
static void reconstruct_update_solve_cb (void *customdata, double progress, const char *message)
static void reconstructionOptionsFromContext (libmv_ReconstructionOptions *reconstruction_options, MovieReconstructContext *context)
void BKE_tracking_reconstruction_solve (MovieReconstructContext *context, bool *stop, bool *do_update, float *progress, char *stats_message, int message_size)
bool BKE_tracking_reconstruction_finish (MovieReconstructContext *context, MovieTracking *tracking)
static void tracking_scale_reconstruction (ListBase *tracksbase, MovieTrackingReconstruction *reconstruction, const float scale[3])
void BKE_tracking_reconstruction_scale (MovieTracking *tracking, float scale[3])

Detailed Description

This file contains blender-side implementation of camera solver.

Definition in file tracking_solver.cc.

Function Documentation

◆ BKE_tracking_reconstruction_check()

bool BKE_tracking_reconstruction_check ( struct MovieTracking * tracking,
struct MovieTrackingObject * tracking_object,
char * error_msg,
int error_size )

◆ BKE_tracking_reconstruction_context_free()

void BKE_tracking_reconstruction_context_free ( struct MovieReconstructContext * context)

Free memory used by a reconstruction process.

Definition at line 402 of file tracking_solver.cc.

References libmv_reconstructionDestroy(), libmv_tracksDestroy(), MEM_freeN(), and tracks_map_free().

Referenced by solve_camera_freejob().

◆ BKE_tracking_reconstruction_context_new()

MovieReconstructContext * BKE_tracking_reconstruction_context_new ( struct MovieClip * clip,
struct MovieTrackingObject * tracking_object,
int keyframe1,
int keyframe2,
int width,
int height )

◆ BKE_tracking_reconstruction_error_message_get()

const char * BKE_tracking_reconstruction_error_message_get ( const MovieReconstructContext * context)

Definition at line 397 of file tracking_solver.cc.

◆ BKE_tracking_reconstruction_finish()

◆ BKE_tracking_reconstruction_report_error_message()

void BKE_tracking_reconstruction_report_error_message ( MovieReconstructContext * context,
const char * error_message )

Definition at line 387 of file tracking_solver.cc.

References STRNCPY_UTF8.

Referenced by BKE_tracking_reconstruction_finish().

◆ BKE_tracking_reconstruction_scale()

void BKE_tracking_reconstruction_scale ( struct MovieTracking * tracking,
float scale[3] )

Apply scale on all reconstructed cameras and bundles, used by camera scale apply operator.

Definition at line 543 of file tracking_solver.cc.

References LISTBASE_FOREACH, MovieTracking::objects, and tracking_scale_reconstruction().

Referenced by blender::ed::object::apply_objects_internal().

◆ BKE_tracking_reconstruction_solve()

void BKE_tracking_reconstruction_solve ( struct MovieReconstructContext * context,
bool * stop,
bool * do_update,
float * progress,
char * stats_message,
int message_size )

Solve camera/object motion and reconstruct 3D markers position from a prepared reconstruction context.

stop is not actually used at this moment, so reconstruction job could not be stopped.

do_update, progress and stat_message are set by reconstruction callback in libmv side and passing to an interface.

Definition at line 441 of file tracking_solver.cc.

References ReconstructProgressData::do_update, error(), libmv_ReconstructionOptions::keyframe1, libmv_ReconstructionOptions::keyframe2, libmv_reprojectionError(), libmv_solveModal(), libmv_solveReconstruction(), ReconstructProgressData::message_size, ReconstructProgressData::progress, reconstruct_update_solve_cb(), reconstructionOptionsFromContext(), ReconstructProgressData::stats_message, ReconstructProgressData::stop, and TRACKING_MOTION_MODAL.

Referenced by solve_camera_startjob().

◆ libmv_tracks_new()

◆ reconstruct_count_tracks_on_both_keyframes()

◆ reconstruct_refine_intrinsics_get_flags()

◆ reconstruct_retrieve_libmv()

int reconstruct_retrieve_libmv ( MovieReconstructContext * context,
MovieTracking * tracking )
static

◆ reconstruct_retrieve_libmv_intrinsics()

void reconstruct_retrieve_libmv_intrinsics ( MovieReconstructContext * context,
MovieTracking * tracking )
static

◆ reconstruct_retrieve_libmv_tracks()

◆ reconstruct_update_solve_cb()

void reconstruct_update_solve_cb ( void * customdata,
double progress,
const char * message )
static

◆ reconstructionOptionsFromContext()

◆ tracking_scale_reconstruction()

void tracking_scale_reconstruction ( ListBase * tracksbase,
MovieTrackingReconstruction * reconstruction,
const float scale[3] )
static