|
Blender
V2.93
|
#include "atomic_ops.h"#include <stdlib.h>#include "MEM_guardedalloc.h"#include "DNA_movieclip_types.h"#include "DNA_object_types.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "PIL_time.h"#include "BKE_global.h"#include "BKE_movieclip.h"#include "BKE_tracking.h"#include "libmv-capi.h"#include "tracking_private.h"Go to the source code of this file.
Classes | |
| struct | AutoTrackClip |
| struct | AutoTrackTrack |
| struct | AutoTrackMarker |
| struct | AutoTrackTrackingResult |
| struct | AutoTrackContext |
| struct | AutoTrackTLS |
Typedefs | |
| typedef struct AutoTrackClip | AutoTrackClip |
| typedef struct AutoTrackTrack | AutoTrackTrack |
| typedef struct AutoTrackMarker | AutoTrackMarker |
| typedef struct AutoTrackTrackingResult | AutoTrackTrackingResult |
| typedef struct AutoTrackContext | AutoTrackContext |
Functions | |
Marker coordinate system conversion. | |
| static void | normalized_to_libmv_frame (const float normalized[2], const int frame_dimensions[2], float result[2]) |
| static void | normalized_relative_to_libmv_frame (const float normalized[2], const float origin[2], const int frame_dimensions[2], float result[2]) |
| static void | libmv_frame_to_normalized (const float frame_coord[2], const int frame_dimensions[2], float result[2]) |
| static void | libmv_frame_to_normalized_relative (const float frame_coord[2], const float origin[2], const int frame_dimensions[2], float result[2]) |
Conversion of markers between Blender's DNA and Libmv. | |
| static void | dna_marker_to_libmv_marker (MovieTrackingTrack *track, const MovieTrackingMarker *marker, int clip, int track_index, int frame_width, int frame_height, bool backwards, libmv_Marker *libmv_marker) |
| static void | libmv_marker_to_dna_marker (libmv_Marker *libmv_marker, int frame_width, int frame_height, MovieTrackingMarker *marker) |
General helpers. | |
TODO(sergey): Should be moved to tracking_util.c | |
| static bool | tracking_check_marker_margin (const libmv_Marker *libmv_marker, int margin, int frame_width, int frame_height) |
Autotrack context initialization. | |
| static bool | autotrack_is_marker_usable (const MovieTrackingMarker *marker) |
| static bool | autotrack_is_track_trackable (const AutoTrackContext *context, const AutoTrackTrack *autotrack_track) |
| static void | autotrack_context_init_clips (AutoTrackContext *context, MovieClip *clip, MovieClipUser *user) |
| static void | autotrack_context_init_tracks_for_clip (AutoTrackContext *context, int clip_index) |
| static void | autotrack_context_init_tracks (AutoTrackContext *context) |
| static void | autotrack_context_init_image_accessor (AutoTrackContext *context) |
| static size_t | autotrack_count_all_usable_markers (AutoTrackContext *context) |
| static int | autotrack_count_trackable_markers (AutoTrackContext *context) |
| static void | autotrack_context_init_autotrack (AutoTrackContext *context) |
| static void | autotrack_context_init_markers (AutoTrackContext *context) |
| AutoTrackContext * | BKE_autotrack_context_new (MovieClip *clip, MovieClipUser *user, const bool is_backwards) |
Context data synchronization. | |
Used to copy tracking result to Blender side, while the tracking is still happening in its thread. | |
| void | BKE_autotrack_context_sync (AutoTrackContext *context) |
| void | BKE_autotrack_context_sync_user (AutoTrackContext *context, MovieClipUser *user) |
Finalization. | |
| void | BKE_autotrack_context_finish (AutoTrackContext *context) |
| void | BKE_autotrack_context_free (AutoTrackContext *context) |
Threaded context step (tracking process). | |
| typedef struct AutoTrackTLS | AutoTrackTLS |
| static void | autotrack_context_step_cb (void *__restrict userdata, const int marker_index, const TaskParallelTLS *__restrict tls) |
| static void | autotrack_context_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk) |
| bool | BKE_autotrack_context_step (AutoTrackContext *context) |
| typedef struct AutoTrackClip AutoTrackClip |
| typedef struct AutoTrackContext AutoTrackContext |
| typedef struct AutoTrackMarker AutoTrackMarker |
| typedef struct AutoTrackTLS AutoTrackTLS |
| typedef struct AutoTrackTrack AutoTrackTrack |
| typedef struct AutoTrackTrackingResult AutoTrackTrackingResult |
|
static |
Definition at line 466 of file tracking_auto.c.
References autotrack_count_all_usable_markers(), autotrack_is_marker_usable(), AutoTrackTrack::clip_index, context, dna_marker_to_libmv_marker(), AutoTrackClip::height, libmv_autoTrackNew(), libmv_autoTrackSetMarkers(), MovieTrackingTrack::markers, MovieTrackingTrack::markersnr, MEM_freeN, MEM_malloc_arrayN, AutoTrackTrack::track, and AutoTrackClip::width.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 347 of file tracking_auto.c.
References BKE_movieclip_get_size(), and context.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 407 of file tracking_auto.c.
References BLI_assert, context, MAX_ACCESSOR_CLIP, MEM_freeN, MEM_malloc_arrayN, tracking_image_accessor_new(), and tracks.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 509 of file tracking_auto.c.
References autotrack_count_trackable_markers(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_marker_get(), AutoTrackClip::clip, AutoTrackTrack::clip_index, context, dna_marker_to_libmv_marker(), AutoTrackClip::height, AutoTrackTrack::is_trackable, AutoTrackMarker::libmv_marker, MEM_calloc_arrayN, and AutoTrackClip::width.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 397 of file tracking_auto.c.
References autotrack_context_init_tracks_for_clip(), BLI_assert, and context.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 364 of file tracking_auto.c.
References autotrack_is_track_trackable(), BKE_tracking_get_active_tracks(), BLI_assert, BLI_listbase_count(), AutoTrackClip::clip, AutoTrackTrack::clip_index, context, AutoTrackTrack::is_trackable, LISTBASE_FOREACH, MEM_reallocN, NULL, AutoTrackTrack::track, AutoTrackTrack::track_region_options, MovieClip::tracking, and tracking_configure_tracker().
Referenced by autotrack_context_init_tracks().
|
static |
Definition at line 646 of file tracking_auto.c.
References BLI_listbase_is_empty(), BLI_movelisttolist(), and AutoTrackTLS::results.
Referenced by BKE_autotrack_context_step().
|
static |
Definition at line 582 of file tracking_auto.c.
References BLI_addtail(), BLI_assert, context, libmv_Marker::frame, if(), libmv_autoTrackGetMarker(), libmv_autoTrackMarker(), AutoTrackTrackingResult::libmv_marker, AutoTrackTrackingResult::libmv_result, MEM_mallocN, libmv_Marker::reference_frame, AutoTrackTLS::results, AutoTrackTrackingResult::success, TRACK_MATCH_KEYFRAME, TRACK_MATCH_PREVIOS_FRAME, and tracking_check_marker_margin().
Referenced by BKE_autotrack_context_step().
|
static |
Definition at line 433 of file tracking_auto.c.
References autotrack_is_marker_usable(), context, MovieTrackingTrack::markers, and MovieTrackingTrack::markersnr.
Referenced by autotrack_context_init_autotrack().
|
static |
Definition at line 449 of file tracking_auto.c.
References context, and AutoTrackTrack::is_trackable.
Referenced by autotrack_context_init_markers().
|
static |
Definition at line 323 of file tracking_auto.c.
References MovieTrackingMarker::flag, and MARKER_DISABLED.
Referenced by autotrack_context_init_autotrack(), autotrack_count_all_usable_markers(), and autotrack_is_track_trackable().
|
static |
Definition at line 331 of file tracking_auto.c.
References autotrack_is_marker_usable(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_marker_get(), AutoTrackClip::clip, AutoTrackTrack::clip_index, context, MovieTrackingTrack::flag, AutoTrackTrack::track, TRACK_HIDDEN, TRACK_LOCKED, and TRACK_SELECTED.
Referenced by autotrack_context_init_tracks_for_clip().
| void BKE_autotrack_context_finish | ( | AutoTrackContext * | context | ) |
Definition at line 790 of file tracking_auto.c.
References BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_get_active_plane_tracks(), BKE_tracking_plane_track_has_point_track(), BKE_tracking_track_plane_from_existing_motion(), AutoTrackClip::clip, context, AutoTrackTrack::is_trackable, LISTBASE_FOREACH, PLANE_TRACK_AUTOKEY, AutoTrackTrack::track, and MovieClip::tracking.
Referenced by track_markers_endjob().
| void BKE_autotrack_context_free | ( | AutoTrackContext * | context | ) |
Definition at line 818 of file tracking_auto.c.
References BLI_freelistN(), BLI_spin_end(), context, libmv_autoTrackDestroy(), MEM_freeN, MEM_SAFE_FREE, NULL, and tracking_image_accessor_destroy().
Referenced by track_markers_freejob().
| AutoTrackContext* BKE_autotrack_context_new | ( | MovieClip * | clip, |
| MovieClipUser * | user, | ||
| const bool | is_backwards | ||
| ) |
Definition at line 549 of file tracking_auto.c.
References autotrack_context_init_autotrack(), autotrack_context_init_clips(), autotrack_context_init_image_accessor(), autotrack_context_init_markers(), autotrack_context_init_tracks(), BLI_spin_init(), context, MovieClipUser::framenr, and MEM_callocN.
Referenced by track_markers_initjob().
| bool BKE_autotrack_context_step | ( | AutoTrackContext * | context | ) |
Definition at line 660 of file tracking_auto.c.
References autotrack_context_reduce(), autotrack_context_step_cb(), BLI_listbase_clear(), BLI_movelisttolist(), BLI_parallel_range_settings_defaults(), BLI_spin_lock(), BLI_spin_unlock(), BLI_task_parallel_range(), context, TaskParallelSettings::func_reduce, libmv_autoTrackAddMarker(), LISTBASE_FOREACH, AutoTrackTLS::results, TaskParallelSettings::use_threading, TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by track_markers_startjob().
| void BKE_autotrack_context_sync | ( | AutoTrackContext * | context | ) |
Definition at line 713 of file tracking_auto.c.
References BKE_movieclip_remap_clip_to_scene_frame(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_dopesheet_tag_update(), BKE_tracking_marker_get_exact(), BKE_tracking_marker_insert(), BLI_assert, BLI_listbase_clear(), BLI_spin_lock(), BLI_spin_unlock(), libmv_Marker::clip, AutoTrackClip::clip, context, MovieTrackingMarker::flag, MovieTrackingMarker::framenr, AutoTrackClip::height, libmv_marker_to_dna_marker(), LISTBASE_FOREACH_MUTABLE, MARKER_DISABLED, max_ii(), MEM_freeN, min_ii(), NULL, libmv_Marker::track, AutoTrackTrack::track, tracking_marker_insert_disabled(), and AutoTrackClip::width.
Referenced by track_markers_endjob(), and track_markers_updatejob().
| void BKE_autotrack_context_sync_user | ( | AutoTrackContext * | context, |
| MovieClipUser * | user | ||
| ) |
Definition at line 779 of file tracking_auto.c.
References context, and MovieClipUser::framenr.
Referenced by clip_main_region_draw().
|
static |
Definition at line 188 of file tracking_auto.c.
References libmv_Marker::center, libmv_Marker::clip, libmv_Marker::disabled_channels, MovieTrackingMarker::flag, MovieTrackingTrack::flag, libmv_Marker::frame, MovieTrackingMarker::framenr, LIBMV_MARKER_CHANNEL_B, LIBMV_MARKER_CHANNEL_G, LIBMV_MARKER_CHANNEL_R, LIBMV_MARKER_MODEL_TYPE_POINT, LIBMV_MARKER_SOURCE_MANUAL, LIBMV_MARKER_SOURCE_TRACKED, LIBMV_MARKER_STATUS_UNKNOWN, MARKER_TRACKED, libmv_Marker::model_id, libmv_Marker::model_type, normalized_relative_to_libmv_frame(), normalized_to_libmv_frame(), libmv_Marker::patch, MovieTrackingMarker::pattern_corners, MovieTrackingTrack::pattern_match, MovieTrackingMarker::pos, libmv_Marker::reference_clip, libmv_Marker::reference_frame, MovieTrackingMarker::search_max, MovieTrackingMarker::search_min, libmv_Marker::search_region_max, libmv_Marker::search_region_min, libmv_Marker::source, libmv_Marker::status, libmv_Marker::track, TRACK_DISABLE_BLUE, TRACK_DISABLE_GREEN, TRACK_DISABLE_RED, TRACK_MATCH_KEYFRAME, tracking_get_keyframed_marker(), and libmv_Marker::weight.
Referenced by autotrack_context_init_autotrack(), and autotrack_context_init_markers().
|
static |
Definition at line 165 of file tracking_auto.c.
References result.
Referenced by libmv_marker_to_dna_marker().
|
static |
Definition at line 173 of file tracking_auto.c.
References result.
Referenced by libmv_marker_to_dna_marker().
|
static |
Definition at line 247 of file tracking_auto.c.
References libmv_Marker::center, MovieTrackingMarker::flag, libmv_Marker::frame, MovieTrackingMarker::framenr, libmv_frame_to_normalized(), libmv_frame_to_normalized_relative(), LIBMV_MARKER_SOURCE_TRACKED, MARKER_TRACKED, libmv_Marker::patch, MovieTrackingMarker::pattern_corners, MovieTrackingMarker::pos, MovieTrackingMarker::search_max, MovieTrackingMarker::search_min, libmv_Marker::search_region_max, libmv_Marker::search_region_min, and libmv_Marker::source.
Referenced by BKE_autotrack_context_sync().
|
static |
Definition at line 156 of file tracking_auto.c.
References normalized(), and result.
Referenced by dna_marker_to_libmv_marker().
|
static |
Definition at line 148 of file tracking_auto.c.
References normalized(), and result.
Referenced by dna_marker_to_libmv_marker().
|
static |
Definition at line 288 of file tracking_auto.c.
References libmv_Marker::center, INIT_MINMAX2, max_ff(), minmax_v2v2_v2(), and libmv_Marker::patch.
Referenced by autotrack_context_step_cb().