Blender  V3.3
Classes | Typedefs | Functions
tracking_solver.c File Reference
#include <limits.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_movieclip_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_fcurve.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "libmv-capi.h"
#include "tracking_private.h"

Go to the source code of this file.

Classes

struct  MovieReconstructContext
 
struct  ReconstructProgressData
 

Typedefs

typedef struct MovieReconstructContext MovieReconstructContext
 
typedef struct ReconstructProgressData ReconstructProgressData
 

Functions

static struct 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 *object)
 
static int reconstruct_count_tracks_on_both_keyframes (MovieTracking *tracking, MovieTrackingObject *object)
 
bool BKE_tracking_reconstruction_check (MovieTracking *tracking, MovieTrackingObject *object, char *error_msg, int error_size)
 
MovieReconstructContextBKE_tracking_reconstruction_context_new (MovieClip *clip, MovieTrackingObject *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, short *stop, short *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.c.

Typedef Documentation

◆ MovieReconstructContext

◆ ReconstructProgressData

Function Documentation

◆ BKE_tracking_reconstruction_check()

bool BKE_tracking_reconstruction_check ( struct MovieTracking tracking,
struct MovieTrackingObject 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 428 of file tracking_solver.c.

References blender::compositor::context, libmv_reconstructionDestroy(), libmv_tracksDestroy(), MEM_freeN, NULL, 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 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 423 of file tracking_solver.c.

References blender::compositor::context.

◆ BKE_tracking_reconstruction_finish()

bool BKE_tracking_reconstruction_finish ( struct MovieReconstructContext context,
struct MovieTracking tracking 
)

◆ BKE_tracking_reconstruction_report_error_message()

void BKE_tracking_reconstruction_report_error_message ( MovieReconstructContext context,
const char *  error_message 
)

Definition at line 413 of file tracking_solver.c.

References BLI_strncpy(), and blender::compositor::context.

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 577 of file tracking_solver.c.

References BKE_tracking_object_get_reconstruction(), BKE_tracking_object_get_tracks(), LISTBASE_FOREACH, MovieTracking::objects, reconstruction, and tracking_scale_reconstruction().

Referenced by apply_objects_internal().

◆ BKE_tracking_reconstruction_solve()

void BKE_tracking_reconstruction_solve ( struct MovieReconstructContext context,
short *  stop,
short *  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 467 of file tracking_solver.c.

References blender::compositor::context, 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()

static struct libmv_Tracks* libmv_tracks_new ( MovieClip clip,
ListBase tracksbase,
int  width,
int  height 
)
static

◆ reconstruct_count_tracks_on_both_keyframes()

static int reconstruct_count_tracks_on_both_keyframes ( MovieTracking tracking,
MovieTrackingObject object 
)
static

◆ reconstruct_refine_intrinsics_get_flags()

static int reconstruct_refine_intrinsics_get_flags ( MovieTracking tracking,
MovieTrackingObject object 
)
static

◆ reconstruct_retrieve_libmv()

static int reconstruct_retrieve_libmv ( MovieReconstructContext context,
MovieTracking tracking 
)
static

◆ reconstruct_retrieve_libmv_intrinsics()

static void reconstruct_retrieve_libmv_intrinsics ( MovieReconstructContext context,
MovieTracking tracking 
)
static

◆ reconstruct_retrieve_libmv_tracks()

static bool reconstruct_retrieve_libmv_tracks ( MovieReconstructContext context,
MovieTracking tracking 
)
static

◆ reconstruct_update_solve_cb()

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

◆ reconstructionOptionsFromContext()

static void reconstructionOptionsFromContext ( libmv_ReconstructionOptions reconstruction_options,
MovieReconstructContext context 
)
static

◆ tracking_scale_reconstruction()

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